Language proposal : blocking asynchronicity

The issue in brief
Currently, the only way to get data from another actor is to use behaviors in a request/response pattern. I think there are cases where it is detrimental.
Real life example
Let's take an actor which holds a list of worker servers. The list is updated depending on the workers availability. That list is then regularly retrieved by the client connections. The relevant part of the code looks like this:
class val Worker

interface iso GetWorkersCallback
  fun apply(workers: SetIs[Worker] val)

actor WorkerList
  var _workers: SetIs[Worker] val = recover val SetIs[Worker] end

  be add_worker(new_worker: Worker) =>
    let new_list = recover val SetIs[Worker] end
    for worker in _workers.values() do
      new_list.set(worker)
    end
    new_list.set(new_worker)
    _workers = new_list

  // Here is the problematic method
  be workers(cb: GetWorkersCallback) =>
    cb(_workers)

And the part using it:
actor ClientConnection
  let _workers: WorkerList

  be client_wants_worker_list() =>
    _workers.workers(
      recover (lambda(c: ClientConnection, w: SetIs[Worker] val) =>
        c.get_workers_cb(w) end)~apply(this) end)

  be get_workers_cb(workers: SetIs[Worker] val) =>
    // Send the thing

This thing is actually much more complicated, as it can serve other requests from the client.
I couldn't think of another way to do it without duplicating data all over the place.
So, what's wrong?
I think there are several issues here:

It breaks local reasoning. If a message is processed between the request for data and its retrieval, care must be taken so that the object isn't in an invalid state.
If you have more than one thing to fetch, the code becomes more and more complicated, and the useful part gets diluted. Also, the data must be carried through all the calls.
The syntax to build the callback is terrible. Partial application didn't help.

Proposal
Add a new method category for actors. It would send a message, but with several differences with a behavior:

The caller blocks until the method is completely executed.
It can have a return value.

Taking back my example, the syntax could be:
actor WorkerList
  // The new method category
  asyn workers(): SetIs[Worker] val =>
    _workers

actor ClientConnection
  let _workers: WorkerList

  be client_wants_worker_list() =>
    let worker_list = _workers.workers() // Blocks here
    // Send the thing

This is pretty unpolished at the moment and I don't know how it would interact with things like exceptions, C-API and the other 80% of the language I haven't covered here, and it can probably block itself, so thoughts are welcome.
What do you think about this, both from the language point of view and the implementation point of view?

@Praetonus
I would expect any kind of actual blocking of an actor is out of the question from a design standpoint.  If you read about the theory behind systems under the "actor pattern" umbrella, you'll note that they are pretty much always non-blocking by nature, and this is how they get many of their desirable properties.
I think the closest we could get to something that looks like your example would be to use compiler trickery to split the block of calling code at the point of the "blocking" call, compiling it internally to two separate behaviour methods with a "stack continuation state" object of some kind that gets passed to the second method later.  See Clojure's await (from what I can tell C# has an await keyword that also works this way, though I haven't read about that one in detail).  This could work in some cases, however, as far as I can tell, this imposes some restrictions on the calling code.  Particularly, any stack state from the pre-call part of the code block that needs to be accessed in the post-call would have to be sendable (iso, val, tag).  Also, there would probably be restrictions on what sort of control flow would be involved (for example, maybe you can't call from within a loop?).  There may be other restrictions or caveats that I'm not thinking of right now.

The big issue here is deadlocking. This is a major problem with "traditional" concurrency techniques and avoiding it is the biggest motivator for using actors in the first place. Adding blocking calls between actors puts deadlocks back, so I'm afraid it's never going to happen.
For your example, I'd say the problem is that your WorkerList is effectively trying to return the list to other actors, whereas it should be encapsulating it. Depending on exactly what you're trying to do, instead of handing out the list, WorkerList should have a behaviour to assign a worker to the requesting actor, and tell that actor with a callback behaviour. If you need to pick workers with particular properties a filter or score function could be provided as a lambda. If the other actors need to iterate through the whole list then WorkerList could provide a behaviour to do that, taking a lambda for the operation to perform on each worker.

@jemc
Do you have some literature for the curious reader?
For the implementation, I was thinking about pony_schedule and pony_unschedule. However, I don't know exactly how the runtime works, so I may be completely wrong here.
@andymcn
I think the deadlocking issue can be solved. If I didn't miss anything, the problem is when a blocking method tries to call another blocking method itself. The most basic way to solve it would be to forbid any method calls from a blocking method (maybe except behaviors? I'm not sure about this).
However, this is probably overkill. What we could do is, during compilation, flag any method that can be called from a blocking method as "unsafe", recursively. Then, if an unsafe method is calling a blocking method, raise a compiler error.
For my example, I actually need to send the full list of workers over the network to the client, which will then choose a worker itself. Yes, this is terrible, but the design isn't mine.

The problem with trying to determine which code can call blocking methods at compile time is interfaces (including interfaces, traits and type parameters). As soon as you have any form of interface we don't know at compile time which code will be run. To get round that you'd have to include a "this method is (un)safe to run in a blocking call" as part of all method signatures, like we do with "this method may raise an error". Without that blocking methods could do very little and certainly couldn't access a List.
I really do think this is not a good approach and reworking program designs to better use actors is the favourable approach.

@Praetonus
Sorry, I don't have a chance to look up reading references on actors for you right now, but there's lots of actor systems material out there and hopefully someone else has some references on hand.  However, please take a look at how Clojure's await works - understanding how await works and why it needs to work that way should start to lead you to the core of the problem, and I think it is the most reasonable conclusion of the feature that you're asking for, but has some caveats and limitations as I explained above.  I'm not sure where the best place to read about await is, but if I recall correctly, this talk from Rich Hickey has some explanation of it: www.infoq.com/presentations/clojure-core-async
For whatever it's worth, the syntax for the lambda in your example can be considerably reduced using the capture syntax sugar I lobbied for in this ticket: #273
I haven't compiled this, but it should be right (or close):
actor ClientConnection
  let _workers: WorkerList

  be client_wants_worker_list() =>
    _workers.workers(lambda iso(w: SetIs[Worker] val)(c = this) =>
        c.get_workers_cb(w)
    end)

  be get_workers_cb(workers: SetIs[Worker] val) =>
    // Send the thing

I was asking about coroutines on the mailing list which is another approach to the problem of needing to block in a non-blocking language, with the same restrictions making it hard in Pony (i.e. problems due to the capability safety guarantees being incompatible with temporarily saving the stack contents).
The options I'm aware of are: coroutines (not happening it seems), callbacks (with a closure), promises, or a state machine. Also, running some kind of higher-layer interpreter (e.g. Lua on C) or compiling specially marked functions (like C# async/await) to simulate an independent stack on top of the language, like a simulation of coroutines. Since C# converts async/await into a state machine, and a Pony actor is like a state machine, then perhaps a Pony async function (if it were to exist) could generate a set of behaviours (each corresponding to an await point) and store local variables as actor variables instead.
Also see this:
http://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/
Then note that Pony is 'red' all through, and fully embraces redness and aims to make it as pain-free as possible. For blocking-style 'blue' coding, then Go is almost 100% the opposite extreme (but without the safety guarantees of capabilities).
So I wonder whether asking for async/await or other sequential/blocking styles of programming is missing the point in an actor language.  Or maybe these approaches have their place? I'm not sure yet.

@andymcn Yes, it seems that the disadvantages outweight the benefits.
@jemc Thank you, I'll look into it.
@uazu This is interesting, I'll look at the answers on the mailing list.
I think the issue can be closed.

In a comment on this issue, @andymcn mentions that avoiding deadlocks is possibly the biggest motivator of using actors in the first place.
To me it's more related to the memory model – actors delineate which isolate an object belongs to – and that actors run sequentially. I don't think being able to wait on a promise undercuts the value of being actor-based:
let result = await some_promise
let results = await Promise.all([promise1, promise2])

The await statement blocks the actor – perhaps indefinitely – but if this actor is for example an HTTP request handler, then what's the problem? – (assuming that the compiler is smart enough to split up the code block such that the executing thread is free to take up other work – and by split up I mean that a mechanism has to be devised that keeps the actor "blocked" and thus doesn't impact the safety guarantees – basically an "unsafe" lambda).
Of course the program should be implemented such that the promise is always fulfilled or denied within some time threshold, e.g. using a network timeout option.

@malthe The issue here isn't just blocking (like an HTTP request handler), it's mutual blocking aka deadlocking. Actor A starts waiting on a promise meant to be fulfilled by actor B while B is already waiting on a promise meant to be fulfilled by A. This kind of thing is hard to debug and it basically put the most of the traditional thread & mutex problems back on the table.
It's possible to implement "blocking" paradigms with the pony_continuation function in the runtime (the Encore language which uses the Pony runtime does that) but it's unlikely to land in the actual Pony language.

It's a tool that can be problematic in the wrong situation. That doesn't mean it's a bad tool.

¯_(ツ)_/¯. I'm not in favor of this and I seriously doubt I ever will be.


fix: missing options property in schema and ID's should be strings

An explanation for this in detail: https://github.com/webpack-contrib/multi-loader/issues/10#issuecomment-379463986

This looks like a decent PR to get into the project @evilebottnawi @michael-ciniawsky
It's small and resolves some issues using extract-text-plugin to generate multiple theme files with combine-loader and multi-loader

@Photonios @sokra Is there any plan to merge this PR ??

The commits need either be reworded or this PR needs to be splitted into 2 separate PR's please, since we generate the CHANGELOG based on the commit history
fix(schema/plugin): add missing `id` option
fix(index): id's should be strings (`options.id`)

@michael-ciniawsky Thanks!!

@Photonios Hey are planning to do the changes or shall I take it up ?? Let me know thanks!!

@gokulkrishh Would you be able to progress this issue if @Photonios doesn't? This would be a great fix to have available for me.

DEPRECATED
Please use: https://github.com/webpack-contrib/mini-css-extract-plugin


overrrideInactivity adjusted time to get int instead of string

no more errors!

grrrr

inactivity uses a modal, which i dont think supports int only input?

inactivity uses a modal, which i dont think supports int only input?

Use ms then so we don't need to deal with people not reading and entering 1d and not 1

(wat dat)

(wat dat)

[https://github.com/Wristspasm/Wristspasm-Discord-Bot/blob/master/src/discord/commands/giveawayCreate.js#L65](We have used it before) just check that to see how to use it. Tldr converts 5m to 300000 (5m in milliseconds)

Updated in this commit so it wont error


Feature: detect chain reorgs

How is this going?

I'm not sure how to efficiently detect chain reorganizations with the polling block tracker :thinking: We could periodically ask for the uncle count I suppose.

I'm not sure how to efficiently detect chain reorganizations with the polling block tracker :thinking: We could periodically ask for the uncle count I suppose.

😀


Add Drawable.Empty static helper for empty construction

For patterns such as:
protected virtual Drawable CreateXYZ() => new Container();

which can now be written as:
protected virtual Drawable CreateXYZ() => Drawable.Empty;

Where: returning null feels wrong in hierarchical construction, and returning a Container feels arbitrary.
Note: Empty Drawable instances aren't shared.

I disagree with this being a property if it’s not a shared value.  I would expect consecutively reading from a property would give the same value/object every time.  I think Drawable.Empty() is clearer.

Yeah I'm not sure... If we wanted to follow o!f conventions, neither Empty nor Empty() are appropriate, and it should be named CreateEmpty().

CreateXXX have historically been protected virtual though, not public static.

The original intention of CreateXXX() was just to let the user know an allocation was occurring, but maybe that should be the initial assumption for methods in the first place. Will name it Empty() for now.


Can Implementation for STM32 Board

We added an implementation for CAN for both CAN 1 and CAN 3 (CAN 3 was determined to be used in the latest iteration of the board instead of CAN2 for the motor CAN).
Added a test file called Test_CarCANBoard to test CAN 1
Modified motorcontroller.c and carcan.c to account for the changes in the BSP_CAN
NOTE: This version of BSP_CAN.h doesn't work for the simulator, we might need to work on this if necessary  (failing build in github because of this)

@NathanielDelgado Is this still current?

@babusid Yes, it is still current.

@Cam0Cow is there a reason this has been left unmerged for this long?

It couldn't be fully tested with the old revision of the board. Only once it's confirmed to work on the new board would I feel comfortable merging it.

@NathanielDelgado @ErickCortez98 Take a look at this version of the CAN Driver. I believe that we do in fact need TX/RX event handling because as per my understanding there is a hardware queue for both sending and receiving that needs to be handled. This may not have to be added directly into this branch and can be merged on top of it, but let me know your thoughts.

I tested this today and some additional changes were required. I would appreciate it if someone could take a look at the changes, which now appear to be working.

The BSP Layer developed on this branch has been merged into the RTOS_SendCarCAN branch and has been validated (mostly) with the RTOS driver and the sendcarcan task. That Branch is being merged in PR #141. I'm going to close this for now, but let's not delete this branch just yet.


Add shavemantissa f2py code

Description

This PR adds shavemantissa python and f2py code. This apparently existed in an old CVS version of MAPL_cfio and @patricia-nasa has need of it.
I think the way this is set up, f2py is not a requirement, but rather "if you have it, it builds" but we need to be careful not to break our external friends.
Related Issue

Motivation and Context

How Has This Been Tested?

Types of changes

[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] Trivial change (affects only documentation or cleanup)

Checklist:

[ ] I have tested this change with a run of GEOSgcm (if non-trivial)
[ ] I have added one of the required labels (0 diff, 0 diff trivial, 0 diff structural, non 0-diff)
[x] I have updated the CHANGELOG.md accordingly following the style of Keep a Changelog

Well, didn't break the CI, but then the CI explicitly does not do f2py. I need to try it on a machine where it might not work...

Welp, I've done some tests and all seems good. When I try build on discover without GEOSpyD loaded, a CMake warning is thrown saying f2py doesn't work:
-- Performing Test DETECT_F2PY2_SUFFIX
-- Performing Test DETECT_F2PY2_SUFFIX: FAILURE
CMake Warning at ESMA_cmake/python/f2py2/try_f2py2_compile.cmake:36 (message):
  Test f2py2 compile using /usr/bin/f2py-2.7 failed.  F2PY2 modules will not
  be built.  This usually indicates an incomplete Python/numpy installation.
Call Stack (most recent call first):
  ESMA_cmake/python/f2py2/FindF2PY2.cmake:79 (try_f2py2_compile)
  MAPL_cfio/CMakeLists.txt:60 (find_package)

and then no f2py is done. If you do have GEOSpyD loaded, our tests pass and you get install/lib/Python/MAPL_cfio_r4 where the .so and .py scripts are.
I think this is safe.


Is there a way of 'cutting' a network?

I wonder if there is a way of 'cutting' the network. What I want to achieve is fine-tuning of the whole inception v3 network and then implement transfer learning by replacing the last 2 inception modules with new layers. I did the whole fine-tuning using this code https://github.com/tensorflow/models/tree/master/inception on my own dataset taking the last checkpoint that I need but now I don't know how I can implement the transfer learning by taking the output of 8th inception module and train the new layers. Is there a standard tensorflow-way of doing this operation?

You can keep the layers in the graph. Just add a new connection and sess.run(x).

If I add a new connection, I will have new variables and I think I will have problem with the checkpoint restoration.

I have worked at this code https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/image_retraining/retrain.py
too and the transfer learning here is easy to understand, but if I decide to implement it in this way I need to create a protocol buffer file for my 'fine-tuning' graph. But I hope there is an easier way.

Unless there is a bug you suspect, please re-ask this issue on StackOverflow. That forum is a better place to ask "how do I do something." Thanks!


Support for multiple name types

This PR adds the posibility to specify irreps through various conventions:

Weight names (status quo + storage): SUNIrrep(I1, I2, ..., I_{N-1}, 0) or SUNIrrep{N}(I1, I2, ..., I_{N-1}, 0)
Dynkin labels: SUNIrrep([a1, a2, ..., a_{n-1}]) or SUNIrrep{N}([a1, a2, ..., a_{n-1}])
Dimensional names: SUNIrrep{N}(name::AbstractString)

Additionally, the user can select their preferred output format for print and show through a preference-based system:
julia> using SUNRepresentations
julia> for mode in ["weight", "dynkin", "dimension"]
           SUNRepresentations.display_mode(mode)
           @show SUNIrrep(2,2,2,0)
       end
SUNIrrep(2, 2, 2, 0) = Irrep[SU₄]((2, 2, 2, 0))
SUNIrrep(2, 2, 2, 0) = Irrep[SU₄]([0, 0, 2])
SUNIrrep(2, 2, 2, 0) = Irrep[SU₄]("10")

As an added benefit, this also exports dynkin_label and congruence, which allow access to some convenient properties of irreps.
For convenience, a package extension is also added for Latexify.jl, to obtain the latex-compatible form:
julia> using Latexify
julia> latexify(SUNIrrep{4}("10⁺"))
L"$\overline{\textbf{10}}$"

Finally, the package now reexports SU{N} from TensorKit, as well as defines and exports the unicode aliases SU₃, SU₄ and SU₅. There are also the short-hands SU3Irrep, SU4Irrep and SU5Irrep.

It might be useful to add a reference here to whatever material you used for implementing this, so that it is easier to maintain in we look back at this in a few years from now.


Update project creation success screen and next steps modal

What does this PR do and why?
Update project creation success screen and next steps modal. Clarify language and add CTA to join the Discord.
Would love some help testing this one, /create dev mode proved too intensive for my machine. Will test in preview.
Update: tested this and it's working well.
https://user-images.githubusercontent.com/96905094/213941472-3ac241de-5fc4-42cb-b6fb-511160e1245c.mp4
Acceptance checklist

[x] I have evaluated the Approval Guidelines for this PR.
[x] I have tested this PR in all supported browsers.
[x] I have tested this PR in dark mode and light mode (if applicable).

@filipvvv i'm lovin it. WDYT about stacking the buttons vertically instead?

@aeolianeth implemented your suggestions, switched to vertical buttons, and cleaned up styling/imports.


Prepare version 0.2.1 for release

This would be the first release we install in production.
Would appreciate a second pair of 👀 on the whole codebase before doing so 🙏

@robertomiranda 🙇♂


修复漏洞CVE-2022-29526,CVE-2021-44716,CVE-2022-1996

Close PR as need updated makefile and github action flow file for PR


remove anchor from outside of div

jsx doesn't link anchor tags outside of div

pushing now to get fix out in production, fyi @xdamman


Change Celery message broker from AMQP to another

AMQP support has been removed in Celery 5.x so to facilitate updating Celery from 4.x we need to change AIPscan to use another message broker (Redis should work).

I was mistaken that this was needed.


Generic way to set a name to a runtype

https://github.com/pelotom/runtypes/issues/39#issuecomment-384384570

const Foo = Union(
  // ...
).named('Foo');

We may need an API like this in order to get better error messages.

Agreed! is there no way to name a RunType?

Constraint runtype has such a feature (though it's not a recommended way, in favor of the API proposed in this issue).
const YourRuntype = Unknown.withConstraint(x => true, { name: "YourRuntype" })
// Then you can see `YourRuntype.name === "YourRuntype"` is `true`.


Migrate forum.stackstorm.com to GitHub Discussions

We decided to migrate forum.stackstorm.com to GitHub Discussions at https://github.com/StackStorm/st2/discussions
@armab already set the forum to read-only, archived it and added a banner on top of the page to inform users. Thank you!
ToDos and things to discuss:

[x]  Organize categories & labels
[ ]  Manage and moderate questions & discussions

[ ]  Everyone from the TSC is welcome to moderate discussions. Do we need moderators to be contacted by the community members if something needs to be escalated?

[ ]  convert forum.stackstorm.com to GitHub static pages so we won't loose SEO/traffic/URLs
[ ] Migrate integrations

[ ] Slack integration to notify about new Questions / Discussions (https://stackstorm-community.slack.com/archives/C066APT88/p1630043814000600 )
[ ] Daily discussions agregator  to post a summary of new questions once a day ( https://stackstorm-community.slack.com/archives/CSBELJ78A/p1631028662011000 )

[ ] Blog post to announce the migration

[ ] write the post
[ ] publish it on https://stackstorm.com/blog/

Extra info:

https://gist.github.com/mikecrittenden/fe02c59fed1aeebd0a9697cf7e9f5c0c seems to be super helpful to convert forum.stackstorm.com to GH static pages
Source code of the "Daily forum posts integration" can be found here:  https://github.com/StackStorm/stackstorm-st2community/tree/master

Those categories and tags/labels were migrated that seem to be useful right now. List of categories and labels may grow in the future but we decided to start with a short and clear one and extend it if needed.

I'm currently testing the process and downloading the forum with wget and will  try to create GitHub pages on a private repo first. I'll have limited internet access until friday evening, so I'm not sure how far I'll get but I'll keep you posted.

Let's use https://github.com/StackStorm/forum.stackstorm.com as a repository.
Feel free to push to master to experiment with it.
Static HTML version for this repo is available at https://stackstorm.github.io/forum.stackstorm.com/

Switched CNAME to GH static pages now.
forum.stackstorm.com is now officially based on static HTML archive and Discourse subscription is canceled.


A Multitude of Issues While Testing

Hi.
I have created a private testing chat group to test this before adding it to our public group and found the following problems.
FIRST SCENARIO: Group owner (A)  promotes Shieldy as admin. Another member (B) joins the chat and acts as the tester. A is able to apparently configure the bot and everything seem to go well. Yet when the B tests the bot by leaving the chat and rejoining it:

B (re) join the chat and it's presented with the right captcha. B solves the captcha, messages are deleted as supposed but welcoming message is not shown. The configuration, though, shows that it's set correctly.
Following previous point, buttons with links are also not shown. Again, configuration shows they are set up correctly.

SECOND SCENARIO: Following previous scenario, A & B switch. B becomes owner of the group and A the testing member.
The configuration is left untouched.

Again, the captcha is presented but no following welcoming message neither linked buttons.
To aggravate, now neither B nor A are able to interact with the bot in any way. All attempts (ie. /help or /viewconfig etc.) are deleted.

I have tried to make the group chat public but got the same results.
If necessary for testing, I can provide invitation link for the group.
Thank YOU.

Hi there!

You should always config Shieldy in the groups, not in private messages. I.e. the id in /viewConfig should be negative.
Shieldy experiences issues at the moment, follow https://t.me/borodutch_support for updates.

Cheers!

Hi @backmeupplz ,
Thank YOU for your prompt reply. Much appreciated.
Sorry I was not clear. I said "private testing" not "Private messages" or chat.
I did indeed worked with Shieldy in a group, private group. Groups in Telegram can be "Private" or "Public". I tested it on both. The groups were created purposely by me for the testing.
I hope makes is more clear now.
I will also follow your updates.

@G-i-o can you share a /viewConfig example with me here, please?

@backmeupplz
I'd be happy to but, as mentioned above, currently any interaction with the bot gets deleted with no results given.
So, if I type /viewConfig or any other command, the post gets deleted and nothing shows up.`

@G-i-o can you give me a link to the group then? Better to send it to me on Telegram — t.me/borodutch

@backmeupplz
Sure. Done. Thank YOU.


Dockerfile for Oracle SSO

Any suggestions on how to deploy Oracle Single Sign-On via docker? Any plans to provide dockerfile or image for it?

No plans. What would be the use case? Why would you put SSO inside a container?

Same reason as other apps, reduce the use of VMs, better consolidation, etc.

But for production use or dev/test only?

Dev/test for sure.

Test/dev.
cheers, Adeesh
On Oct 20, 2016 12:25 PM, "Bruno Borges"<EMAIL_ADDRESS>wrote:

But for production use or dev/test only?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/oracle/docker-images/issues/191#issuecomment-255203323,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACjpyvREpUj0OV5ZNEOCwSrd1-aUmdtOks5q18AQgaJpZM4Kbbup
.

@afulay Does SSO refer to Oracle eSSO (Enterprise Single Sign On) or Oracle Access Manager ? Or something else ?

eSSO.

Closing this issue as a whole bunch of new Oracle Dockerfiles are in development. Hopefully it'll be part of that.


Fix log rebuilding crashing when there's no messages

Fixes the editor crashing on any action that rebuilds the log display (filtering, searching, theme change etc) while there's no messages in it.
Example: Clearing the log manually with the button and then clicking on one of the filter buttons would cause a crash.

Thanks!


feat: improve py-evm performance

What was wrong?
How was it fixed?
grab bag of optimizations. profiling (using pypy as the runtime) showed that hotspots included

functools.__call__ (presumably from functools.partial and functools.wraps)
apply_computation
expand_memory
stack operations

to that end, I applied the following optimizations

write more inlineable wrappers for DUP/SWAP/PUSH instructions
write more inlineable ceil_XX implementations, replace with branchless implementation
optimize the Stack data structure. instead of using List[type, value], simply use List[value] (as the type is tagged in the python runtime anyways)
optimize apply_computation event loop

remove usage of CodeStream iterator, inline pc logic
remove __enter__ and __exit__, replace with inlined try/finally

a minor peephole optimization in expand_memory, not sure if it helped much.

some of these optimizations are simple rewrites (e.g. ceil32 rewrite and stack data structure), but others (e.g. inlining CodeStream.__iter__) may break some abstractions.
execution time came down 25% in local timings, will try to make some reproductions
$ pypy3 --version
Python 3.8.13 (7.3.9+dfsg-1, Apr 01 2022, 21:41:47)
[PyPy 7.3.9 with GCC 11.2.0]

final thoughts -- according to profiling, this is most of the low hanging fruit. better performance would probably need to come from some deeper redesigns, including how opcodes are constructed / get looked up and analyzed (analysis of opcodes for runtime hotspots could be very fruitful, for instance)
Todo:

[ ] Clean up commit history
[ ] reproduce timings
[ ] record profiling results

[ ] Add entry to the release notes

Cute Animal Picture

paging @kclowes and @fselmo for initial feedback on the approach. i was thinking eventually, we will probably want to split this into two PRs - those which are relatively simple and those which may break abstractions / downstream

Hey @charles-cooper, thanks for the submission! 👍. I haven't had time to poke around too much in here yet but I see some failing core tests. Did you have any issues there? On a quick scan, looks like there's a method instance being returned in some cases where an integer result is expected. If you're expecting some tests to fail let us know too but otherwise it would be nice to address those first. I can try to take a peek here soon. Thanks again!

profiling (using pypy as the runtime)

Also, it will be important to profile using the standard cpython, because it's possible that an optimization in pypy creates a slowdown in cpython.

i reverted the changes to the Computation.apply_message routines (which involved breaking some abstractions) and just left the other improvements which didn't involve architectural changes.

@charles-cooper, do you have examples of the benchmarking you used anywhere? I'm not seeing anything significant on the test suite but I'm also not sure that running pytest would be the best measure. It would be nice to have whatever you used to benchmark as a reference here.
With some quick testing on my side I'm not seeing much, negative or positive, on the cpython side of things... so if it indeed does optimize for pypy then these might still be some good changes to bring in.

@fselmo here's a benchmark using titanoboa (I used v0.1.6, because v0.1.7 and master require python>=3.10 and pypy has not yet release support for python 3.10:
(pypy3.9) ~/titanoboa $ python --version
Python 3.9.16 (7.3.11+dfsg-1~ppa1~ubuntu22.04, Dec 30 2022, 13:49:46)
[PyPy 7.3.11 with GCC 11.3.0]
(pypy3.9) ~/titanoboa $ python time_optimizations.py
overall took 1.0565147399902344s
average op time: 36.388879933534284us
(pypy3.9) ~/titanoboa $ PYTHONPATH=~/src-references/py-evm/ python time_optimizations.py # optimizations branch
overall took 0.9218192100524902s
average op time: 31.749645589739277us

# time_optimizations.py
#!/usr/bin/env python

import boa
import time

test_code = """
@external
def foo() -> uint256:
    x: uint256 = 0
    for i in range(1_000):
        x += i
    return x
"""
c = boa.loads(test_code)

t0 = time.time()
NUM_RUNS = 100
for i in range(NUM_RUNS):
    c.foo()
t1 = time.time()
print(f"overall took {t1 - t0}s")

opcode_trace = c._computation.code._trace
avg_op_time = (t1 - t0) / len(opcode_trace)
avg_op_time_us = avg_op_time * 1e6
print(f"average op time: {avg_op_time_us}us")

after removing the changes to the apply_computation() event loop and applying some changes induced by mypy requirements (ex. _FastOpcode needing to implement OpcodeAPI, which caused a 1-3% perf hit).
i can also benchmark with python3.11 where i think there will be some gains too, but there is a dependency conflict here (titanoboa==0.1.6 depends on eth-abi==3.0.1 which itself does not work with python3.11) so i may have to construct a different benchmark.

with python3.11 looks like the gain is smaller, around 2%, but stable across several runs, here's the output of one run
(python3.11) ~/titanoboa $ python time_optimizations2.py
overall took 4.019573926925659s
(python3.11) ~/titanoboa $ PYTHONPATH=~/src-references/py-evm/ python time_optimizations2.py
overall took 3.9480371475219727s

# time_optimizations2.py
import time
from eth.chains.mainnet import MainnetChain
import eth.tools.builder.chain as chain
from eth.db.atomic import AtomicDB
import eth.constants as constants
from eth.vm.transaction_context import BaseTransactionContext
from eth.vm.message import Message

GENESIS_PARAMS = {"difficulty": constants.GENESIS_DIFFICULTY, "gas_limit": int(1e8)}

_Chain = chain.build(MainnetChain, chain.latest_mainnet_at(1)).from_genesis(AtomicDB(), GENESIS_PARAMS)

vm = _Chain.get_vm()

tx_ctx = BaseTransactionContext(origin=constants.ZERO_ADDRESS, gas_price = 0)

msg = Message(
    sender=constants.ZERO_ADDRESS,
    to = constants.ZERO_ADDRESS,
    gas=int(1e7),
    value=0,
#@external
#def foo() -> uint256:
#    x: uint256 = 0
#    for i in range(1_000):
#        x += i
#    return x
    code=b'`\x036\x11a\x00\x0cWa\x00ZV[_5`\xe0\x1c4a\x00^Wc\xc2\x98Ux\x81\x18a\x00XW_`@R_a\x03\xe8\x90[\x80``R`@Q``Q\x80\x82\x01\x82\x81\x10a\x00^W\x90P\x90P`@R`\x01\x01\x81\x81\x18a\x00+WPP``@\xf3[P[__\xfd[_\x80\xfd\xa1evyper\x83\x00\x03\t\x00\x0b',
    data=b'\xc2\x98Ux'  # method_id("foo()")
)

t0 = time.time()
NUM_RUNS = 100
for i in range(NUM_RUNS):
    vm.state.computation_class.apply_message(vm.state, msg, tx_ctx)
t1 = time.time()
print(f"overall took {t1 - t0}s")

https://github.com/ethereum/py-evm/pull/2076/commits/a5f6af9010bcb15d06c44e0efbee13ee2d617bc9 fixed a hotspot in memory.write, where it was looping and writing one byte of memory at a time - the commit uses native slicing notation to batch the write. running the above benchmarks shows an additional 5% improvement(!)


Integration loosing my callback methods after some time

The problem
After few days my  Home  Assistant suddenly "looses" callbacks that were exposed by net-daemon intergration.
I am exposing 4 methods  such as:
[HomeAssistantServiceCall]
public async Task OpenDoor1(dynamic data)
{...}
they are working happilly dozen of times for few days and then they simply disappear.
When trying to call  them from my scripts I get:
Service not found for call_service at pos 1: Unable to find service netdaemon.mutuumairlockapp_opendoor1
When going to:
Developer tools > Services
I stiill see:
NetDaemon - Entity_Create
NetDaemon - Entity_Remove
NetDaemon - Entity_update
NetDaemon - register_service
NetDaemon - reload_apps
but my callbacks  are gone.
Restarting NetDaemon docker container solves problem, till next time it occurs.
System health

System Health

version
core-2021.5.0

installation_type
Home Assistant Container

dev
false

hassio
false

docker
true

virtualenv
false

python_version
3.8.9

os_name
Linux

os_version
4.19.118

arch
aarch64

timezone
Europe/Madrid

Home Assistant Cloud

logged_in
false

can_reach_cert_server
ok

can_reach_cloud_auth
ok

can_reach_cloud
ok

Lovelace

dashboards
1

resources
0

views
1

mode
yaml

Traceback/Error logs
Additional information

Do you think this happening when you are installing a new version of HA or restarting HA or does it "just stops working"?

Thank you for following up on this, sorry for delay, missed this message.
This happens when HA is restarted, without restarting NetDaemon container.
As soon as I restart also NetDaemon, it reconnects to HA and then my netdaemon service is back.
Is there some bidirectional pinging mechanism in place that makes sure both parties sees each other?
Cheers!

Now this error happens more frequent, as netdaemon is installed on one machine and Home Assistant on another one. For one reason or another they are getting out of sync much more frequently now

Can you point to your code for the app. If you do not want it public, ping me privately. Thanks.


Natives loading issue (with JNA?) on Win10 + Java 11

We've had two user reports now with the same error on Windows 10 running the game via Java 11 resulting in the attached log entry. One user can be a fluke, two not so much. Difficulty might be in how to test any attempted fixes since we've only encountered two systems that trigger it, today's instance was with Discord user oil_boi
Only idea I've got for something to try would be to straighten up our usage of JNA via #4146 but that's a stab in the dark. If we do figure something out there we might want to retest this, or in the absence of an available tester able to provoke the issue close this after we've done something in the area with the hope that this might have been resolved - can always re-open if it triggers again later.
On a semi-related note there is https://github.com/MovingBlocks/Terasology/wiki/Troubleshooting-Developer#ldso-dl-lookup-failures where some Java 11s on Ubuntu at least can fail to load LWJGL. Highly unlikely to be related as that issue seems to be a legit problem unrelated to us, see here or there - but it does make me wonder if other JDK variants would encounter this issue or if it is again very specific to a given JDK. Hard to test though. The Java 11 we ship with the launcher has hit this failure.
PathManager being initialized. Initial code location is C:\Users\jorda\Desktop\TerasologyLauncher-windows64-4.1.1\games\DistroOmega\1099\libs\engine-3.3.0-SNAPSHOT.jar
Switched it to expected working dir: C:\Users\jorda\Desktop\TerasologyLauncher-windows64-4.1.1\games\DistroOmega\1099
installPath was null, running from IDE or headless server? Setting to: C:\Users\jorda\Desktop\TerasologyLauncher-windows64-4.1.1\games\DistroOmega\1099
Found the natives dir: C:\Users\jorda\Desktop\TerasologyLauncher-windows64-4.1.1\games\DistroOmega\1099\natives
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\jorda\AppData\Local\Temp\jna-101312778\jna3303093479537907948.dll: Can't find dependent libraries
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.load0(Unknown Source)
        at java.lang.System.load(Unknown Source)
        at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:851)
        at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:826)
        at com.sun.jna.Native.<clinit>(Native.java:140)
        at com.sun.jna.Pointer.<clinit>(Pointer.java:41)
        at com.sun.jna.Structure.<clinit>(Structure.java:2078)
        at com.sun.jna.platform.win32.KnownFolders.<clinit>(KnownFolders.java:20)
        at org.terasology.engine.paths.PathManager.useDefaultHomePath(PathManager.java:177)
        at org.terasology.engine.Terasology.handleLaunchArguments(Terasology.java:400)
        at org.terasology.engine.Terasology.main(Terasology.java:133)

The above execution was via java -jar whereas running via launcher failed quietly with something like this:
14:51:48.605 [main] INFO  o.terasology.engine.TerasologyEngine - Initializing Terasology...
14:51:48.629 [main] INFO  o.terasology.engine.TerasologyEngine - [buildNumber=2315, buildId=2315, buildTag=jenkins-Terasology-2315, buildUrl=http://jenkins.terasology.org/job/Terasology/2315/, gitBranch=develop, gitCommit=112d30ed521ae27f9d6e249c7e8be04990739e9d, dateTime=2020-09-07T04:33:26Z, displayVersion=alpha, engineVersion=3.3.0-SNAPSHOT]
14:51:48.629 [main] INFO  o.terasology.engine.TerasologyEngine - Home path: C:\Users\jorda\Saved Games\Terasology
14:51:48.630 [main] INFO  o.terasology.engine.TerasologyEngine - Install path: C:\Users\jorda\Desktop\TerasologyLauncher-windows64-4.1.1\games\DistroOmega\1099
14:51:48.630 [main] INFO  o.terasology.engine.TerasologyEngine - Java: 11.0.7 in C:\Users\jorda\Desktop\TerasologyLauncher-windows64-4.1.1\jre
14:51:48.630 [main] INFO  o.terasology.engine.TerasologyEngine - Java VM: OpenJDK 64-Bit Server VM, version: 11.0.7+10-LTS
14:51:48.630 [main] INFO  o.terasology.engine.TerasologyEngine - OS: Windows 10, arch: amd64, version: 10.0
14:51:48.630 [main] INFO  o.terasology.engine.TerasologyEngine - Max. Memory: 3572 MiB
14:51:48.631 [main] INFO  o.terasology.engine.TerasologyEngine - Processors: 4

Hello!
I'm having the same problem here . Just tell me if I can help in any way. I am a complete newbie here, but if I can help I will be happy.
Today I've been trying to find more information. Launching terasology without the launcher leads to this:
C:\Users\avall\Documents\terasology\TerasologyLauncher-windows64-4.1.1\games\DistroOmegaRelease\37>java -Xms128m -Xmx2048m -jar libs/Terasology.jar
PathManager being initialized. Initial code location is C:\Users\avall\Documents\terasology\TerasologyLauncher-windows64-4.1.1\games\DistroOmegaRelease\37\libs\engine-4.0.0-SNAPSHOT.jar
Switched it to expected working dir: C:\Users\avall\Documents\terasology\TerasologyLauncher-windows64-4.1.1\games\DistroOmegaRelease\37
installPath was null, running from IDE or headless server? Setting to: C:\Users\avall\Documents\terasology\TerasologyLauncher-windows64-4.1.1\games\DistroOmegaRelease\37
Found the natives dir: C:\Users\avall\Documents\terasology\TerasologyLauncher-windows64-4.1.1\games\DistroOmegaRelease\37\natives
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\avall\AppData\Local\Temp\jna-93193548\jna13568336661813337304.dll: Can't find dependent libraries
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(Unknown Source)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.base/java.lang.Runtime.load0(Unknown Source)
at java.base/java.lang.System.load(Unknown Source)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:851)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:826)
at com.sun.jna.Native.(Native.java:140)
at com.sun.jna.Pointer.(Pointer.java:41)
at com.sun.jna.Structure.(Structure.java:2078)
at com.sun.jna.platform.win32.KnownFolders.(KnownFolders.java:20)
at org.terasology.engine.paths.PathManager.useDefaultHomePath(PathManager.java:177)
at org.terasology.engine.Terasology.handleLaunchArguments(Terasology.java:400)
at org.terasology.engine.Terasology.main(Terasology.java:133)

Hello!
I'm having the same problem here . Just tell me if I can help in any way. I am a complete newbie here, but if I can help I will be happy.
Today I've been trying to find more information. Launching terasology without the launcher leads to this:
C:\Users\avall\Documents\terasology\TerasologyLauncher-windows64-4.1.1\games\DistroOmegaRelease\37>java -Xms128m -Xmx2048m -jar libs/Terasology.jar
PathManager being initialized. Initial code location is C:\Users\avall\Documents\terasology\TerasologyLauncher-windows64-4.1.1\games\DistroOmegaRelease\37\libs\engine-4.0.0-SNAPSHOT.jar
Switched it to expected working dir: C:\Users\avall\Documents\terasology\TerasologyLauncher-windows64-4.1.1\games\DistroOmegaRelease\37
installPath was null, running from IDE or headless server? Setting to: C:\Users\avall\Documents\terasology\TerasologyLauncher-windows64-4.1.1\games\DistroOmegaRelease\37
Found the natives dir: C:\Users\avall\Documents\terasology\TerasologyLauncher-windows64-4.1.1\games\DistroOmegaRelease\37\natives
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\avall\AppData\Local\Temp\jna-93193548\jna13568336661813337304.dll: Can't find dependent libraries
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
        at java.base/java.lang.ClassLoader$NativeLibrary.load(Unknown Source)
        at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(Unknown Source)
        at java.base/java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.base/java.lang.Runtime.load0(Unknown Source)
        at java.base/java.lang.System.load(Unknown Source)
        at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:851)
        at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:826)
        at com.sun.jna.Native.<clinit>(Native.java:140)
        at com.sun.jna.Pointer.<clinit>(Pointer.java:41)
        at com.sun.jna.Structure.<clinit>(Structure.java:2078)
        at com.sun.jna.platform.win32.KnownFolders.<clinit>(KnownFolders.java:20)
        at org.terasology.engine.paths.PathManager.useDefaultHomePath(PathManager.java:177)
        at org.terasology.engine.Terasology.handleLaunchArguments(Terasology.java:400)
        at org.terasology.engine.Terasology.main(Terasology.java:133)

Open this dll with Dependencies walker.
There you can watch dll's dependencies. Present and missing (warn icon)
Which dependency is missing (i saw one old issue, jna wanted msvc100.dll, maybe we have several problem)

tried installing Oracle Java JRE
java -version java version "1.8.0_261" Java(TM) SE Runtime Environment (build 1.8.0_261-b12) Java HotSpot(TM) Client VM (build 25.261-b12, mixed mode)
Now it launches.

Open this dll with Dependencies walker.
There you can watch dll's dependencies. Present and missing (warn icon)
Which dependency is missing (i saw one old issue, jna wanted msvc100.dll, maybe we have several problem)

I cant find the DLL since the C:\Users\avall\AppData\Local\Temp\jna-93193548 folder is empty :-(

installed dependecies walker . found the DLL file in the temp directory.
depend.exe generates tones of errors
attached is a DWI file if it can help
jna1090700796970070159.zip

Yeah seems needs msvcr100.dll.
Check plz bin directory of Oracle JVM.
Is Oracle JVM have msvcr100.dll?

yes it does

@avallesalas thx for help!
@Cervator jna uses msvc100 (microsoft visual C runtime (one of many)).
There lib shipped with oracle jre 8.
AdoptJDK and Liberica JDK have msvc120+
Another windows users haven't this problem because they have installed in system already. (Like lib for old game from installer)
Then... We must upgrade or downgrade jna(4.1.0 works)
Or say to windows users install msvc100

@DarkWeird  yes!
I downloaded and installed the redistributables from http://www.microsoft.com/en-us/download/details.aspx?id=14632 and now it works great! :-D
Other download links (for 32 bits) can be found here: https://answers.microsoft.com/en-us/windows/forum/windows_other-performance/msvcp100dll-missing/9a687c31-0619-4ee9-b511-020985e29b5f

We've merged a supposed fix - it doesn't seem to break anything, but it is hard to say if it fixes the problem on unmodified systems - like @avallesalas I would ask you to test but you've already installed the redistributable that we now in theory shouldn't need, so I'm not sure how to do more testing or just hope that this did the trick ... 😅


Update to 3.1.1

Hi! This is the friendly automated conda-forge-linting service.
I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.


Unify Messages when action comment is triggered.

when 2 rules are a match, we will post twice, we should group the messages in a single message.

This should be solved now.


allow get PID from JNI layer

Problem
if you want to define your custom PID and only define it at CHIPProjectConfig.h file, then you could not compile the tv-app successfully
Change overview
allow to achieve custom PID  from JNI channel ,not through CHIPProjectConfig.h
Testing

building tv-app
building chip-tool
tv-app commissioned successfully by chip-tool

@nicelyjust I assume you want to be able to read the PID from config for Android instead of using the define from header file, right? Please note that the file you modified is default implementation for all platforms, including the ones that do not support read from configs, so doing config read is not a good idea. Indeed due to bug I made, the Android platform is not able to do config reads for now, but I it should be fixed in this PR: https://github.com/project-chip/connectedhomeip/pull/20208. Please take a look and check if my change would be enough to address your requirements.

@nicelyjust I assume you want to be able to read the PID from config for Android instead of using the define from header file, right? Please note that the file you modified is default implementation for all platforms, including the ones that do not support read from configs, so doing config read is not a good idea. Indeed due to bug I made, the Android platform is not able to do config reads for now, but I it should be fixed in this PR: #20208. Please take a look and check if my change would be enough to address your requirements.

@kkasperczyk-no yes,that I want ,I will close this


A problem about affix identifying weapons

I use the reforge table to add affix to the weapon. But a lightsaber was identified as a shield
The details are in this issue, and someone has given the code problem
https://github.com/coolsimulations/SurvivalPlus-Lightsabers/issues/14

This is just an unfortunate side effect of how autodetection worke.  If you want them to be picked up as swords, use the config to override the type.

This is just an unfortunate side effect of how autodetection worke. If you want them to be picked up as swords, use the config to override the type.

I see. The problem is solved
I also have a question whether the rarity of affixes of items can be specified in the loot table
I noticed that the rarity is set in the loot table of the chest
However, the item will be obtained randomly and the item ID cannot be specified. Whether the item ID can be determined by modifying the loot table
I mean a function to determine the rarity


Images in content folder are not displayed

Hi,
In our project we want to display notebooks exported from Jupyter on PicoCMS. The structure of the export is always the same:
notebook.md
notebook_files/graph.png

The image markdowncode inside the .md files looks like this:
![Png](notebook_files/graph.png).
But that's not how the graphics are displayed.
It would be possible to change all paths before uploading them, but always time-consuming. And we would like to keep the structure.
Why is pico doing this and how can we change it?

https://github.com/picocms/Pico/issues/530#issuecomment-586689852
It's for security reasons, but no one keeps you from changing it:

make sure .htaccess doesn't keep you from accessing the content folder
content|content-sample

    # Deny access to internal dirs and files by passing the URL to Pico
    RewriteRule ^(config|content|content-sample|lib|vendor)(/|$) index.php [L]

Then you have to write a plugin (http://picocms.org/development/#plugins) to expand the path in your markdown file.

Something like this:
    /**
     * Triggered after Pico has prepared the raw file contents for parsing
     *
     * @see DummyPlugin::onContentParsing()
     * @see Pico::parseFileContent()
     * @see DummyPlugin::onContentParsed()
     *
     * @param string &$markdown Markdown contents of the requested page
     *
     * @return void
     */
    public function onContentPrepared(&$markdown)
    {
    	// search for image tags and expand the full path to your images in the content folder
    }

That should give you an idea.

I went a different way.
Jupyter saves the Notebook as Markdown (with nbconvert) and then embed the images as Base64 Url in the file with this js-extension: https://github.com/freeman-lab/embed-images
my last cell in every notebook looks like this:
os.system('jupyter nbconvert --to markdown ' + ipyparams.notebook_name + ' --output Markdown_Files/' + ipyparams.notebook_name[:-6] + '.md')
os.system('embed-images Markdown_Files/' + ipyparams.notebook_name[:-6] + '.md > Markdown_Files/' + ipyparams.notebook_name[:-6] + '_emb.md')

to get the name of the notebook, this is necessary: https://pypi.org/project/ipyparams/
known issues:
if you (re)start the kernen and run the whole notebook for the first time, no file will be saved.
solution:
just run the last cell again


response.format for .pdf is changed from "pdf" to "all" after installing mail plugin

$ sdk use grails 3.0.8
$ grails create-app pdf308
$ cd pdf308
$ grails create-controller Foo
$ echo "\${response.format}" > grails-app/views/foo/index.gsp
$ grails run-app

open http://localhost:8080/foo/index.pdf
Output is: pdf
Add mail plugin to build.gradle:
compile "org.grails.plugins:mail:2.0.0.RC2"

run-app and reload page. Output is now: all
This seems to be the case with Grails 3.0.8 and later. With Grails 3.0.7 and earlier, output is pdf both before and after installing plugin.
Both 2.0.0.RC1  and 2.0.0.RC2 is affected.
Unfortunately, this is causing issues in wkhtmltopdf plugin, see rlovtangen/grails-wkhtmltopdf#15

+1 same problem here with latest grails 3.0.11

I can not reproduce this issue on 3.0.14 and the upcoming 2.0.0 release

Tested OK in both Grails 3.0.8 and 3.0.14 with mail plugin 2.0.0.RC4
Version 2.0.0.RC2 fails in both Grails 3.0.8 and 3.0.14 so it seems to have been resolved by a change between RC2 and RC4.


[EventHubs] exception/kwargs testing

related to: #26229
Adding tests + fixing bugs found for scenarios listed in above issue.

API change check
API changes are not detected in this pull request.


A0-249 + A0-250: Let node recover after crash

Together with @Yithis, we improved the PR. Currently, After starting a node (possibly after a crash), we periodically broadcast  the requests for the highest units created so far by us. We stop broadcasting messages, once at least 2*N/3+1 responses are collected and the specified amount of time has passed (config.delay_config.unit_broadcast_delay(0)).
Each request consists of:

requester index,
a u64 salt (defined as the hash of the timestamp of creation of Member),

and each response consists of

requester index,
responder index,
the highest unit created by the requester which is known by the responder (or None if they don't know any such unit),
salt of the request,
responder's signature of the concatenation of the above fields.

I would bump the minor version to 0.6.0, the patch version bumps automatically.


[SPARK-33630][SQL] Support SHOW TABLES command as table valued function

What changes were proposed in this pull request?
Support SHOW TABLES command as a table valued function.
So user can be easy to reach metadata system information use SQL and analysis directory.
Why are the changes needed?
user can be easy to reach metadata system information use SQL and analysis directory.
Does this PR introduce any user-facing change?
Yea, user can get table list by call table valued function show_table()
       sql("CREATE DATABASE d1")
        sql("CREATE TABLE t1(a INT) USING PARQUET")
        sql("CREATE TABLE d1.t1(a INT) USING PARQUET")
        sql("CREATE TABLE d1.t2(a INT) USING PARQUET")

        sql("SELECT * from show_tables()")
        sql("SELECT * from show_tables('default')")
        sql("SELECT * from show_tables('d1')")
        sql("SELECT * from show_tables('d1', 't1*')")

How was this patch tested?
Added UT

This PR now pending by https://github.com/apache/spark/pull/31245

This PR now pending by https://github.com/apache/spark/pull/31245

Test build #134258 has started for PR 31257 at commit 1d1121c.

Test build #134258 has started for PR 31257 at commit 1d1121c.

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38844/

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38844/

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38844/

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38844/

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/38844/

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/38844/

Test build #134258 has finished for PR 31257 at commit 1d1121c.

This patch fails Spark unit tests.
This patch merges cleanly.
This patch adds no public classes.

Test build #134258 has finished for PR 31257 at commit 1d1121c.

This patch fails Spark unit tests.
This patch merges cleanly.
This patch adds no public classes.

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/134258/

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/134258/

retest this please

Test build #135552 has started for PR 31257 at commit 1d1121c.

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40133/

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40133/

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/40133/

Test build #135552 has finished for PR 31257 at commit 1d1121c.

This patch fails Spark unit tests.
This patch merges cleanly.
This patch adds no public classes.

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/135552/

Is this related to https://github.com/apache/spark/pull/31548 ?

Is this related to #31548 ?

Yea, hmmm since this is pending by https://issues.apache.org/jira/browse/SPARK-34157, so I left it until that pr merge.
Anyway it's a useful method.  Seems we use different way to do this. I think it’s good if you use either method.

Test build #135554 has started for PR 31257 at commit 1c11abb.

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40135/

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40135/

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/40135/

Test build #135554 has finished for PR 31257 at commit 1c11abb.

This patch fails Spark unit tests.
This patch merges cleanly.
This patch adds no public classes.

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/135554/

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41424/

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41424/

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41424/

Test build #137562 has started for PR 31257 at commit 1c11abb.

Test build #137562 has finished for PR 31257 at commit 1c11abb.

This patch fails Spark unit tests.
This patch does not merge cleanly.
This patch adds no public classes.

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/137562/

Test build #138940 has started for PR 31257 at commit 1c11abb.

Test build #138940 has finished for PR 31257 at commit 1c11abb.

This patch fails Spark unit tests.
This patch does not merge cleanly.
This patch adds no public classes.

Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/138940/


Ensure 'Cancel' button closes the dialog

Fix #25
Test URLs:

Before: https://main--aem-assets-boilerplate--hlxsites.hlx.page/aem-asset-selector
After: https://i-25--aem-assets-boilerplate--hlxsites.hlx.page/aem-asset-selector

should we add package-lock to the .gitignore list?

There seems to be a lot of debate around this, but AFAIK the current best practice is to commit the file: https://stackoverflow.com/questions/44206782/do-i-commit-the-package-lock-json-file-created-by-npm-5


tfcockpit: define schema for node capacity provisioning

Depends on : https://github.com/threefoldtech/zosv2/issues/77

fixed by cd1185bbd890b69a3ecedb5bd08e07161aac8e6a


fix: release notifications pill

Before

After

Note: After includes fixes in other PRs

i'm getting some weird rendering on main now @afonsojramos 🫠


[ACM-10271] Added warning logs for deprecated spec field usage

Description
Added a warning log to indicate that a deprecated field is being used with the MCH CR spec.
Related Issue
https://issues.redhat.com/browse/ACM-10271
Changes Made
Added additional logging to check if deprecated fields are being used within MCH.
Screenshots (if applicable)
Add screenshots or GIFs that demonstrate the changes visually, if relevant.
Checklist

[ ] I have tested the changes locally and they are functioning as expected.
[ ] I have updated the documentation (if necessary) to reflect the changes.
[ ] I have added/updated relevant unit tests (if applicable).
[ ] I have ensured that my code follows the project's coding standards.
[ ] I have checked for any potential security issues and addressed them.
[ ] I have added necessary comments to the code, especially in complex or unclear sections.
[ ] I have rebased my branch on top of the latest main/master branch.

Additional Notes
Add any additional notes, context, or information that might be helpful for reviewers.
Reviewers
Tag the appropriate reviewers who should review this pull request. To add reviewers, please add the following line: /cc @reviewer1 @reviewer2
/cc @cameronmwall
Definition of Done

[ ] Code is reviewed.
[ ] Code is tested.
[ ] Documentation is updated.
[ ] All checks and tests pass.
[ ] Approved by at least one reviewer.
[ ] Merged into the main/master branch.

/lgtm


Appstudio update test-component-pac-cjvg

Pipelines as Code configuration proposal

Pipelines as Code CI/test-component-pac-cjvg-on-pull-request has successfully validated your commit.

StatusDurationName

✅ Succeeded
10 seconds
init

✅ Succeeded
20 seconds
clone-repository

✅ Succeeded
31 seconds
build-container

✅ Succeeded
16 seconds
deprecated-base-image-check

✅ Succeeded
13 seconds
inspect-image

✅ Succeeded
9 seconds
clair-scan

✅ Succeeded
35 seconds
clamav-scan

✅ Succeeded
7 seconds
sbom-json-check

✅ Succeeded
10 seconds
label-check

✅ Succeeded
10 seconds
optional-label-check

✅ Succeeded
6 seconds
show-summary

Pipelines as Code CI/test-component-pac-cjvg-on-pull-request has successfully validated your commit.

StatusDurationName

✅ Succeeded
6 seconds
init

✅ Succeeded
17 seconds
clone-repository

✅ Succeeded
32 seconds
build-container

✅ Succeeded
21 seconds
inspect-image

✅ Succeeded
24 seconds
deprecated-base-image-check

✅ Succeeded
34 seconds
clamav-scan

✅ Succeeded
23 seconds
clair-scan

✅ Succeeded
20 seconds
sbom-json-check

✅ Succeeded
10 seconds
label-check

✅ Succeeded
8 seconds
optional-label-check

✅ Succeeded
9 seconds
show-summary


Content with "" as part of header leads to break?

Hey,
a bit of a strange error/thing I've found here. More below.
Affected Version
$ composer info --direct

innoweb/silverstripe-social-metadata 5.1.2  Adds social metadata like OpenGraph, Twitter and JSON-LD to all pages.
jonom/silverstripe-betternavigator   4.1.1  Front-end utility menu for SilverStripe websites featuring administration and development tools
phpunit/phpunit                      5.7.27 The PHP Unit Testing framework.
silverstripe/blog                    3.5.1  A fresh take on blogging in Silverstripe set out to tackle the issue of a cluttered Site Tree.
silverstripe/googlesitemaps          2.1.6  SilverStripe support for the Google Sitemaps XML, enabling Google and other search engines to see all urls on...
silverstripe/recipe-cms              4.6.1  SilverStripe recipe for fully featured page and asset content editing
silverstripe/recipe-plugin           1.3.0  Helper plugin to install SilverStripe recipes
symbiote/silverstripe-queuedjobs     4.6.0  A framework for defining and running background jobs in a queued manner

$ composer info | grep "silverstripe/"

silverstripe/admin                             1.6.1   SilverStripe admin interface
silverstripe/asset-admin                       1.6.1   Asset management for the SilverStripe CMS
silverstripe/assets                            1.6.1   SilverStripe Assets component
silverstripe/blog                              3.5.1   A fresh take on blogging in Silverstripe set out to tackle the issue of a cluttered Site Tree.
silverstripe/campaign-admin                    1.6.0   SilverStripe campaign admin interface
silverstripe/cms                               4.6.0   The SilverStripe Content Management System
silverstripe/config                            1.0.18  SilverStripe configuration based on YAML and class statics
silverstripe/errorpage                         1.6.0   ErrorPage component for SilverStripe CMS
silverstripe/framework                         4.6.2   The SilverStripe framework
silverstripe/googlesitemaps                    2.1.6   SilverStripe support for the Google Sitemaps XML, enabling Google and other search engines to se...
silverstripe/graphql                           3.3.0   GraphQL server for SilverStripe models and other data
silverstripe/lumberjack                        2.0.2   A module to make managing pages in a GridField easy without losing any of the functionality that...
silverstripe/mimevalidator                     2.0.0   Checks uploaded file content roughly matches a known MIME type for the file extension.
silverstripe/recipe-cms                        4.6.1   SilverStripe recipe for fully featured page and asset content editing
silverstripe/recipe-core                       4.6.1   SilverStripe framework-only core recipe
silverstripe/recipe-plugin                     1.3.0   Helper plugin to install SilverStripe recipes
silverstripe/reports                           4.6.0   Reports module for SilverStripe CMS
silverstripe/siteconfig                        4.6.0   Site wide settings administration.
silverstripe/tagfield                          2.4.3   Tag field for SilverStripe
silverstripe/vendor-plugin                     1.4.1   Allows vendor modules to expose directories to the webroot
silverstripe/versioned                         1.6.2   SilverStripe Versioned component
silverstripe/versioned-admin                   1.6.0   SilverStripe versioned admin interface

Description
I'm not entirely sure, but I assume this is a framework issue. Google alerted me about broken structured data on one particular page:

The website is using framework v4.6.2., CMS v4.6.0 and silverstripe-social-metadata v5.1.2 (latest) by @xini. It generates a JSON with meta information in the head tag (http://json-ld.org) to help with SEO.
On one page (which contains a code snippet with </head> in the content) the JSON breaks. Surprisingly it breaks right in the middle of the JSON - at the position of the closing head-tag. Maybe there is some trigger caused by the </head>? I'm a bit unsure about the reason.
Steps to Reproduce
Please see the JSON in the head-tag. The attribute articleBody on https://bringyourownideas.com/blog/passwordless-login-with-laravel/ shows the issue.
Cheers!

Thanks for tagging me @spekulatius.
For the 'articleBody' I am using ->Plain() (https://github.com/silverstripe/silverstripe-framework/blob/4/src/ORM/FieldType/DBHTMLText.php#L219) on the Content DB Object (https://github.com/xini/silverstripe-social-metadata/blob/master/src/Extensions/BlogPostExtension.php#L95), which should really give back a plain text version of the content, right?
The question is what a plain text version of a code example looks like? Not sure how I would solve this. But I think it should be solved in DBHTMLText->Plain()?
I am happy to implement a (temporary) workaround into my module if you happen to find one? ;)
Cheers

Hey @xini,
thanks for replying! I assume it's caused by the closing head tag. Otherwise the JSON wouldn't break I guess.
I'll download the live db and see what the Plain-output looks like later. Maybe this leads to a better understanding.
Cheers,
Peter

Hey @spekulatius
I think it's just a matter of correctly encoding the value. I'll set up a test site and have a look.
Cheers

Yeah, that might be the issue. I might have trusted the WYSIWYG editor to much with this

There's code that inserts JavaScript tags before the /head that is very simple - it's just a regex, for performance. This can be either disabled or I think replaced with a smarter one - check the Requirements API docs I think?
In 99% of cases it works so we allow for a config change in the 1%, which you found. ;-)

Hey @sminnee
yeah, exactly this was the issue. I've played around and added a negative lookahead to the regex. With this it works for me. The linked PR would resolve this. I would appreciate if someone could test this to ensure it doesn't break anything I'm unaware off.
Thanks for your help Sam!
Cheers,
Peter

Cool, the main thing about improving a regex is confirming that we have a decent test suite for it.

On your site in question is there a setWriteJavascriptToBody(false) in PHP or WriteJavascriptToBody: false in YAML set on the Requirements_Backend in one of the modules? If so, that's the root cause of the issue here and you may want to investigate why. The insert-at-end-of-head code has some bugs, but it also leads to lower front-end performance.

Hey @sminnee,
I haven't found any YAML or PHP setting the parameter. While looking further I've noticed it's actually CSS files:
<link rel="stylesheet" type="text/css" href="/resources/vendor/silverstripe/blog/client/dist/styles/main.css?m=1591928642" />
<link rel="stylesheet" type="text/css" href="/resources/vendor/jonom/silverstripe-betternavigator/css/betternavigator.css?m=1523054468" />
</head>

The config only applies to JS files afaik.
I guess that's the reason why this isn't working and brings us back to square one, doesn't it?
Cheers,
Peter

Hm. You're right. https://github.com/silverstripe/silverstripe-framework/blob/4/src/View/Requirements_Backend.php#L963 is the culprit.

Yeah, it is @xini. But getting all cases covered safely is a bit annoying - my PR is covering only one part of it.

Oh right yes CSS file refs can't be moved to the body!
Fixing the escaping of the social module, if possible, or moving to a DOMDocument parser (optionally) seem like the ways forward

Fixing the escaping of the social module, if possible, or moving to a DOMDocument parser (optionally) seem like the ways forward

Yeah, sounds like these are the only ways to fix it. My personal preference would be a DOM parser as it would fix the issue once and for all - but it's also more work :D

I have fixed the social module and removed articleBody from the blog post json+ld to remove this duplication of content. articleBody is not required according to the Google guidelines: https://developers.google.com/search/docs/data-types/article.

Cheers @xini! Good to see we found a solution!
I guess this very edge case is barely worth investing more time into it. Closing it for now.


Is Supergroup.restriction_reason global or specific for user?

Is Supergroup.restriction_reason global or specific for user/something else?
restriction_reason is empty means empty string and cannot be null (= missing value)?

restriction_reason is for the current user.
Strings are never omitted. Only object fields can be null/missing in received from TDLib objects.


ScenarioManager.write_data_to_excel not working on CPDaaS

Throws error, because it is incorrectly using ibm_watson_studio_lib, which is not (yet) supported on CPDaaS.
Needs to use method add_data_file_using_project_lib, which is using the project that is passed into the ScenarioManager constructor.

Patch - add the following in a notebook cell:
def add_file_as_data_asset(self, file_path: str, asset_name:str = None):
    """Register an existing file as a data asset in CPD.

    :param file_path: full path of the file
    :param asset_name: name of asset. If None, will get the name from the file
    :return:
    """
    if asset_name is None:
        asset_name = os.path.basename(file_path)

    if self.platform in [Platform.CPD40]:
        self.add_data_file_using_ws_lib_s(file_path)
    elif self.platform in [Platform.CPD25, Platform.CPDaaS]:
        self.add_data_file_using_project_lib(file_path, asset_name)
    else:  # i.e Local: do not register as data asset
        pass
ScenarioManager.add_file_as_data_asset = add_file_as_data_asset

TODO: test in CPDv4.0 before we release in next version

Basic write Excel test in CPD4.0 passed


Can we add a slide after init

Hi again @sachinchoolur
Like Slick JS, can we add slide after slider loaded?
And on Gallery mode, thumbnails are scrollable?

I found for add slide on https://github.com/sachinchoolur/lightslider/issues/146
For scrollable thumbnails, do you have an idea?


Getting reports from users that remote_boombox command is returning 403

As the title says. Our client sends the remote_boombox command without using the protocol since remote_boombox is not yet supported, however lately some users are reporting that they are now receiving 403s only on this command which indicates that use of the protocol is now required for remote_boombox.
Will the protos and Vehicle-Command now support remote_boombox (or in the near future)?

Update, can confirm that remote_boombox looks to be longer supported as an unsigned command as all attempts now return 403

Duplicate of #109


Need a tool to show database space usage

Is your feature request related to a problem? Please describe.
In order to understand database space growth, need a tool to query and display usage distribution. How much space is used across the resources, search parameters, indexes etc.
Describe the solution you'd like
An extension to the fhir-persistence-schema CLI tool.
Describe alternatives you've considered
Manually query the database each time the information is required, but this is not desirable in a production environment. Also, the queries to collect this data will be very different for PostgreSQL and Db2, so it would be useful to hide this complexity in a tool.
Acceptance Criteria

GIVEN a PostgreSQL with the FHIR schema deployed
WHEN the schema-tool is run using the --show-db-size option
THEN a summary report is written to stdout.

GIVEN a PostgreSQL with the FHIR schema
WHEN the schema-tool is run using the --show-db-size option
AND the --show-db-size-detail option is included
THEN both summary and detailed reports are written to stdout

GIVEN a Db2 with the FHIR schema deployed
WHEN the schema-tool is run using the --show-db-size option
AND a schema name is provided
AND a tenant name is provided
THEN a summary report is written to stdout.

GIVEN a Db2 with the FHIR schema
WHEN the schema-tool is run using the --show-db-size option
AND a schema name is provided
AND a tenant name is provided
AND the --show-db-size-detail option is included
THEN both summary and detailed reports are written to stdout

Additional context
Possibly also include machine-readable output so that the tool can be used to provide metrics to a performance management solution. (*) now supported using the --show-db-size-detail option.

Confirmed expected behavior with both postgres and db2:
java -jar ./fhir-persistence-schema-4.11.0-SNAPSHOT-cli.jar --prop-file C:\KMBspace\aFHIR\docker\postgresql.properties --schema-name fhirdata --db-type postgresql --show-db-size
java -jar ./fhir-persistence-schema-4.11.0-SNAPSHOT-cli.jar --prop-file C:\KMBspace\aFHIR\docker\postgresql.properties --schema-name fhirdata --db-type postgresql --show-db-size --show-db-size-detail
java -jar ./fhir-persistence-schema-4.11.0-SNAPSHOT-cli.jar --prop-file C:\KMBspace\aFHIR\docker\db2.properties --tenant-name default --schema-name FHIRDATA --db-type db2 --show-db-size
java -jar ./fhir-persistence-schema-4.11.0-SNAPSHOT-cli.jar --prop-file C:\KMBspace\aFHIR\docker\db2.properties --tenant-name default --schema-name FHIRDATA --db-type db2 --show-db-size --show-db-size-detail


Create LICENSE

My company is strict about licencing (even for dev deps) and require an explicit licence file for vendored projects rather than simply naming the licence. I believe this is due to the possibility that the licence will change over time and without the file it's not clear what terms were agreed to. Anyway it would be much appreciated if you added the MIT license file.
Thanks.

@sokra, @geelen, @Kovensky, @Cauldrath, @pieter, any chance of getting this merged to master and the npm package published?


NO-ISSUE: add rccrdpccl to approvers

Description

How was this code tested?

Assignees

/cc @
/cc @
Links

Checklist

[ ] Title and description added to both, commit and PR
[ ] Relevant issues have been associated
[ ] Reviewers have been listed
[ ] This change does not require a documentation update (docstring, docs, README, etc)
[ ] Does this change include unit tests (note that code changes require unit tests)

/lgtm


remove k8s 1.21 as it went end of support in Feb 2023

Fixes #
Description
How was this change tested?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
9 unchanged lines in 2 files lost coverage.
Overall coverage remained the same at 81.291%

Files with Coverage Reduction
New Missed Lines
%

pkg/scheduling/requirements.go
2
98.5%

pkg/controllers/node/controller.go
7
70.59%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
6900

Relevant Lines:
8488

💛  - Coveralls


[Plugin Request] http://www.ustvnow.com plugin request

ustvnow provides access to 8 (free account) or 27 (paid account) ustv programs. There is allready an xbmc plugin [1] that can create strm-files; would be nice if someone could "pluginify" this for livestreamer!
[1] http://deanvaughan.org/wordpress/2014/06/
[2] http://deanvaughan.org/wordpress/wp-content/uploads/2014/06/ustvnow.zip

Cleanup


Database creation 5.0.0-alpha

I am attempting to use a pattern in my program of using a single class per database for a data access layer. The basic pattern of the classes is illustrated with the following:
    internal class FirmDB : IDisposable
    {
        private readonly LiteDatabase Database;
        private readonly LiteCollection<Firm> Firms;
        private readonly bool ReadOnly;
        private bool disposedValue = false;

        #region Public Interface

        public FirmDB(bool readOnly = false)
        {
            ConnectionString connStr = new ConnectionString
            {
                Filename = Constants.FirmSpec,
                Password = Constants.FirmPW,
                ReadOnly = readOnly
            };
            Database = new LiteDatabase(connStr);
            Firms = Database.GetCollection<Firm>();
            if (!Database.CollectionExists(nameof(Firm))) Firms.EnsureIndex(f => f.Id);
            ReadOnly = readOnly;
        }

        public BsonValue Create(string firmName, PersonName repName, IAddress address)
        {
            if (ReadOnly) return null;
            if (Firms.Count() > 0) Delete(Firms.FindAll().FirstOrDefault());
            return Firms.Insert(new Firm
            {
                BusinessName = firmName,
                FirmRep = repName,
                Address = address
            });
        }

        public Firm Read()
        {
            return Firms.FindAll()?.FirstOrDefault();
        }

        public bool Update(Firm f)
        {
            if (ReadOnly) return false;
            return Firms.Update(f);
        }

        public bool Delete(Firm f)
        {
            if (ReadOnly) return false;
            return Firms.Delete(f.Id);
        }

        #endregion Public Interface

        #region IDisposable Support

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    Database.Dispose();
                }

                disposedValue = true;
            }
        }

        // This code added to correctly implement the disposable pattern.
        public void Dispose()
        {
            Dispose(true);
        }

        #endregion IDisposable Support
    }

When I need to access the database, it is via a using statement like so:
            using (FirmDB db = new FirmDB())
            {
                // do stuff
            }

My issue is occurring when the physical file does not exist on the disk. The instantiation procedure is a bit unclear to me. I had thought that calling GetCollection<T> would be enough to cause the file to appear. According to the documentation that I can find, that does not appear to be the case. One must also call EnsureIndex as well.
This works well for the first database I create (a different class, UsersDB, though of the same form). On attempting to instantiate the first instance of ProgramOptionsDB I am met with an error:
System.IO.FileNotFoundException
  HResult=0x80070002
  Message=Could not find file 'C:\ProgramData\AccountingApp\AccountingApp\<IP_ADDRESS>\ProgramOptions.db'.
  Source=mscorlib
  StackTrace:
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at LiteDB.Engine.FileStreamFactory.GetStream(Boolean canWrite, Boolean sequencial)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at LiteDB.Engine.DiskService..ctor(EngineSettings settings)
   at LiteDB.Engine.LiteEngine..ctor(EngineSettings settings)
   at LiteDB.ConnectionString.CreateEngine()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at LiteDB.LiteCollection`1.Query()
   at LiteDB.LiteDatabase.GetCollectionNames()
   at LiteDB.LiteDatabase.CollectionExists(String name)
   at AccountingApp.Databases.ProgramOptionsDB..ctor(Boolean readOnly) in C:\Users\michael\source\repos\AccountingClasses\AcctClasses\AccountingApp\Databases\ProgramOptionsDB.cs:line 27
   at AccountingApp.Controls.CtlFirm..ctor() in C:\Users\michael\source\repos\AccountingClasses\AcctClasses\AccountingApp\Controls\CtlFirm.cs:line 26
   at AccountingApp.FrmMain.TvNavigate_BeforeSelect(Object sender, TreeViewCancelEventArgs e) in C:\Users\michael\source\repos\AccountingClasses\AcctClasses\AccountingApp\FrmMain.cs:line 58
   at System.Windows.Forms.TreeView.OnBeforeSelect(TreeViewCancelEventArgs e)
   at System.Windows.Forms.TreeView.TvnSelecting(NMTREEVIEW* nmtv)
   at System.Windows.Forms.TreeView.WmNotify(Message& m)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
   at System.Windows.Forms.Control.WmNotify(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at System.Windows.Forms.TreeView.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at AccountingApp.Program.Main() in C:\Users\michael\source\repos\AccountingClasses\AcctClasses\AccountingApp\Program.cs:line 16

As succinctly as possible, here is what I am observing while debugging:
When I arrive at the if (!Database.CollectionExists(nameof(UsersDB))) line when creating the UsersDB (the one that succeeds), the physical file on disk does not exist yet. After stepping through that statement and before executing the EnsureIndex following it, I see one file, Users.db of size zero bytes. On executing the EnsureIndex I see two files, the original Users.db and another, Users-log.db, both of size zero bytes. This state continues until I finally exit the using statement that originally called the constructor and I now have a single file, Users.db of size 40k. Opening the database in LiteDB Studio shows that it does appear to contain the information I stored there.
At a later point in my process, I have entered a separate using statement for my ProgramOptionsDB class. I hit the if (!Database.CollectionExists(nameof(ProgramOptionsDB))) line, and if I try to step past it, the file is not created and I receive the error above.

Ah, okay, found the issue. I am still a bit puzzled about the best way to overcome this, however.
I was calling my constructor like this:
            using (ProgramOptionsDB db = new ProgramOptionsDB(true))
            {
                TbDataDir.Text = db.GetDataDir(RuntimeGlobals.CurrentUserGuid);
            }

As I am only reading a value out of the database, this seemed perfectly okay. However, if the physical file on disk does not exist yet, LiteDB fails when creating the file, due to the readonly setting.
For the time being, I have modified my constructors to the following form, which appears to work.
        internal ProgramOptionsDB(bool readOnly = false)
        {
            ConnectionString connStr = new ConnectionString
            {
                Filename = Constants.ProgramOptionsSpec,
                Password = Constants.ProgramOptionsPW,
                ReadOnly = (File.Exists(Constants.ProgramOptionsSpec)) ? readOnly : false
            };
            Database = new LiteDatabase(connStr);
            Options = Database.GetCollection<ProgramOptions>();
            ReadOnly = readOnly;
        }

For the sake of discussion, the reason I am using a ConnectionString instead of a LiteEngine and EngineSettings is I want to be able to have the option of setting the Mode option in the future. With EngineSettings I do not see a way to access this property. Is there some way to set the Mode using EngineSettings?


Your organisation - remove guidance

https://trello.com/c/G6MX07EP/1238-your-organisation-remove-guidance

 Your organisation - remove guidance


ReferenceError: CanvasRenderer is not defined

Hi, I'm trying to implement the pdf.addHtml in an angular app, but i keep getting
ReferenceError: CanvasRenderer is not defined
I have tried adding the min.js and the debug.js version also manually adding the canvas2html lib, but nothing seems to work. Any hint ?

Personally I cannot use the latest version. Even their examples will not work and generates errors so I have no idea what it was released to Bower. Try going back to an earlier version.

i fixed this by including the min version and the plugins, though i had to use an old version of canvas2html the on that comes with this repository is not working with me, the one that's on the example page (an old version) worked with the current lib.

I'm using the download from the website. The latest versions released to Bower seems like a major oversight. Is this project abandoned?

Which version is pulling through on bower?
The latest is flagged as a pre-release
https://github.com/MrRio/jsPDF/releases
On Wed, 26 Aug 2015 at 16:26 Charles Forman<EMAIL_ADDRESS>wrote:

I'm using the download from the website. The latest versions released to
Bower seems like a major oversight. Is this project abandoned?
—
Reply to this email directly or view it on GitHub
http://t.sidekickopen18.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XYg1px68TN3MP7VjfmKZgF7q48d93YjZf19pFfl03?t=https%3A%2F%2Fgithub.com%2FMrRio%2FjsPDF%2Fissues%2F564%23issuecomment-135062492&si=6421163020386304&pi=6f23a2a3-335a-478e-b2c0-0876608a65d8
.

Version through bower is: 1.1.135 - maybe remove it from the list as its a prerelease?

same issue with v1.2.61

Is there any progress on this? I am experiencing the same problem on an angular2 project. My code is quite simple:
var pdf = new jsPDF('p', 'pt', 'a4');
pdf.addHTML($('#render_me').get(0), function () {
pdf.save('Test.pdf');
});

Hi there,
There's now a html2pdf example which much better supports generating documents from HTML.
Get the latest master and try:
npm install
npm start

Then visit localhost:8000/examples/html2pdf/showcase.html
Hope this works well for you :)
Many thanks,
James


Bring over chart deployment advancement from 0.3.0-SNAPSHOT to 0.2

Description:
Cherry pick deployment enhancement from 0.3.0-SNAPSHOT to 0.2
Brings over changes from

#249
#254

Related issue(s):
Fixes #
Notes for reviewer:

Checklist

[ ] Documented (Code comments, README, etc.)
[ ] Tested (unit, integration, etc.)

Codecov Report

Merging #264 (3b222de) into release/0.2 (2294a03) will not change coverage.
The diff coverage is n/a.

:exclamation: Current head 3b222de differs from pull request most recent head 4c1eedf. Consider uploading reports for the commit 4c1eedf to get more accurate results

@@             Coverage Diff              @@
##           release/0.2     #264   +/-   ##
============================================
  Coverage        58.35%   58.35%
============================================
  Files                9        9
  Lines              742      742
  Branches           111      111
============================================
  Hits               433      433
  Misses             283      283
  Partials            26       26

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2294a03...4c1eedf. Read the comment docs.