Decode Error when extracting protobuf message (macOS)

Just playing around with the package, I find that beyond a certain number of data or parameters, I seem to run into a Decode Error.
Taking the sample model...

schools_code = """
data {
  int<lower=0> J;         // number of schools
  real y[J];              // estimated treatment effects
  real<lower=0> sigma[J]; // standard error of effect estimates
}
parameters {
  real mu;                // population treatment effect
  real<lower=0> tau;      // standard deviation in treatment effects
  vector[J] eta;          // unscaled deviation from mu by school
}
transformed parameters {
  vector[J] theta = mu + tau * eta;        // school treatment effects
}
model {
  target += normal_lpdf(eta | 0, 1);       // prior log-density
  target += normal_lpdf(y | theta, sigma); // log-likelihood
}
"""

This succeeds:
schools_data = {"J": 8,
                "y": [28,  8, -3,  7, -1,  1, 18, 12],
                "sigma": [15, 10, 16, 11,  9, 11, 10, 18]}

posterior = stan.build(schools_code, data=schools_data)
fit = posterior.sample(num_chains=4, num_samples=1000)

This succeeds:
schools_data = {"J": 8*10,
                "y": [28,  8, -3,  7, -1,  1, 18, 12]*10,
                "sigma": [15, 10, 16, 11,  9, 11, 10, 18]*10}

posterior = stan.build(schools_code, data=schools_data)
fit = posterior.sample(num_chains=4, num_samples=1000)

But this fails:
schools_data = {"J": 8*11,
                "y": [28,  8, -3,  7, -1,  1, 18, 12]*11,
                "sigma": [15, 10, 16, 11,  9, 11, 10, 18]*11}

posterior = stan.build(schools_code, data=schools_data)
fit = posterior.sample(num_chains=4, num_samples=1000)

Stack trace:
DecodeError                               Traceback (most recent call last)
<ipython-input-3-815b881aecc2> in <module>
      1 posterior = stan.build(schools_code, data=schools_data)
----> 2 fit = posterior.sample(num_chains=1, num_samples=1000)

~/.pyenv/versions/3.8.5/envs/stan/lib/python3.8/site-packages/stan/model.py in sample(self, **kwargs)
    239
    240         try:
--> 241             return asyncio.run(go())
    242         except KeyboardInterrupt:
    243             pass

~/.pyenv/versions/3.8.5/lib/python3.8/asyncio/runners.py in run(main, debug)
     41         events.set_event_loop(loop)
     42         loop.set_debug(debug)
---> 43         return loop.run_until_complete(main)
     44     finally:
     45         try:

~/.pyenv/versions/3.8.5/lib/python3.8/asyncio/base_events.py in run_until_complete(self, future)
    614             raise RuntimeError('Event loop stopped before Future completed.')
    615
--> 616         return future.result()
    617
    618     def stop(self):

~/.pyenv/versions/3.8.5/envs/stan/lib/python3.8/site-packages/stan/model.py in go()
    188                         if resp.status != 200:
    189                             raise RuntimeError((await resp.json())["message"])
--> 190                         stan_outputs.append(tuple(extract_protobuf_messages(await resp.read())))
    191
    192                 def is_nonempty_logger_message(msg):

~/.pyenv/versions/3.8.5/envs/stan/lib/python3.8/site-packages/stan/model.py in extract_protobuf_messages(fit_bytes)
    131                 msg = callbacks_writer_pb2.WriterMessage()
    132                 next_pos, pos = varint_decoder(fit_bytes, pos)
--> 133                 msg.ParseFromString(fit_bytes[pos : pos + next_pos])
    134                 yield msg
    135                 pos += next_pos

DecodeError: Error parsing message

Running on MacOS 10.15.6 with 32GB, Python 3.8.5, stan 3.0.0b4, httpstan 2.3.0

Thank you for the detailed report. I'll see if I can reproduce this on macOS.

Should we decode the msg before it goes to ParseFromString?
msg.ParseFromString(fit_bytes[pos : pos + next_pos].decode("utf-8"))

This may take some time to fix/pin down. No developer working on PyStan has easy access to a macOS machine.

FWIW, I get the same error on an AWS instance running Amazon Linux 4.14.133-88.105.amzn1.x86_64

AWS might have a different explanation. gcc 9 is required to use the wheels. Amazon Linux 4.14 uses an earlier version, right?
pystan works fine with earlier versions of gcc, but one needs to build httpstan from source, see https://httpstan.readthedocs.io/en/latest/installation.html

I got access to a mac. I'm able to reproduce this. I'll dig deeper this weekend.
We should certainly add this as a test case (to httpstan).

There is
[libprotobuf ERROR google/protobuf/wire_format_lite.cc:577] String field 'stan.WriterMessage.Feature.name' contains invalid UTF-8 data when parsing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes.

Should we have bytes here
https://github.com/stan-dev/httpstan/blob/main/protos/callbacks_writer.proto

Ok, I think the msg is somehow cut of (or there is part of the next message). lp__ is twice there etc --> eta.12 is the last duplicate.

So, it appears that part of the fit bytes is somehow malformed (some responses are not full).
This happens both in macOS and Linux (randomly).

@ahartikainen I'm not confident there is sufficient evidence to conclude that the linux problem (if one exists) is the same as the problem on macOS. It may be. This issue is going to be about the non-randomly-occuring macOS bug.
Added a test case in httpstan to make sure we catch this in the future, https://github.com/stan-dev/httpstan/pull/490

It might be different
https://github.com/ahartikainen/run_custom_code
Here is one run where it fails with Ubuntu https://github.com/ahartikainen/run_custom_code/runs/1334128557?check_suite_focus=true

Worked on this a bit today. Clearly something has gone wrong with the protobuf encoding.
When I have the time, I'll try doing what the error message suggests, switching from "string" to "bytes" in our protobuf definition file, https://github.com/stan-dev/httpstan/blob/main/protos/callbacks_writer.proto
Looking at the protobuf docs, it seems like we are, in fact, doing the wrong thing. A C++ std::string is not a protobuf string.

@lwoloszy What version of Xcode are you using?

11.7

Thanks.
I'll admit I do not understand what is happening. I'm really surprised that different byte sequences are being written to disk on macOS vs Linux. Protobuf is supposed to provide cross-platform serialization.
My only thought is that something is going wrong with the length-prefix encoding which is not a standard feature of protobuf (although it is in the official Java version).
My proposed "solution" to this is to move away from protobuf and use JSON instead. This switch had been planned for some time.

Fixed in 3.0.0b5.
@lwoloszy Thanks again for the report. Sorry it took 22 days to fix. The problem turned out to be a coding error I made in Python. The reason this occurred on macos and not linux is that macos has a much smaller receive and send buffer for unix domain sockets. (httpstan uses unix domain sockets to send messages from C++ to Python.)


Bowtie memory parameter update

Apologies, I didn't get this committed before you merged the PR. The units parameter was omitted previously.

All's good. Thanks for the update.


Use logo in documentation

Before

After

Alternatively

Honestly not in love with the look, seems like it'd need a tweak to the size.

Think I should shrink it a little as in the later comment?

I slightly prefer the larger version but I'm fine with either.

Note we use the lightning bolt logo in Ruff (which looks pretty nice).


feat(gomall): update ch07

What type of PR is this?

What this PR does / why we need it (en: English/zh: Chinese):

en: update ch07
zh: 更新gomall 第七节代码
Which issue(s) this PR fixes:

cc @baiyutang


libevent2.d:97: undefined reference to `event_set_mem_functions' on gentoo linux

This is what I get when I run:
dub init smashfuse vibe.d
cd smashfuse
dub build
Compiling using dmd...
Linking...
../../../.dub/packages/vibe-d-0.7.23/libvibe-d.a(libevent2_32da_5d7.o): In function _D4vibe4core7drivers9libevent215Libevent2Driver6__ctorMFNbC4vibe4core6driver10DriverCoreZC4vibe4core7drivers9libevent215Libevent2Driver': /home/taylor/projects/smashfuse/smashfuse/../../../.dub/packages/vibe-d-0.7.23/source/vibe/core/drivers/libevent2.d:97: undefined reference to event_set_mem_functions'
collect2: error: ld returned 1 exit status
--- errorlevel 1
FAIL .dub/build/application-debug-linux.posix-x86_64-dmd_2066-418F4DD6CDD1AE0EFCC533D25B9B948A/ smashfuse executable
Error executing command build: dmd failed with exit code 1.
I have dev-libs/libevent-2.1.5 installed, both 64-bit and 32-bit. I also downgraded to libevent-2.0.22, although the problem persists. After downgrading I ran ldconfig and deleted the ~/.dub directory.
I am using dmd-2_066, with that useflag set on dev-utils/dub, and eselect set.
Here is the output of dub build -v
https://gist.github.com/gronka/5b9a6d8b0ca09dcc70ff

I'm wondering if the EVENT_SET_MEM_FUNCTIONS flag is disabled by default - it doesn't appear to be disabled in the ebuild https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/libevent/libevent-2.1.5.ebuild?view=markup

vibe.d runs with libevent linked from the readme. Thanks for that.

looks like you have to build libevent with the debug useflag enabled

Just ran into it using Calculate Linux, a Gentoo-based distro. Enabling debug useflas with # USE="debug" emerge libevent works like a charm.
@s-ludwig please consider adding a small note on this issue to the Vibe.d build instructions.


The access to the pretrained privacy attribute detection models

Hi @DAVEISHAN, thanks for open-sourcing your great work!
Could you provide your pre-trained privacy attribute detection models, which are used for measuring the privacy leakage on the given images?

did you get the weights or train the model yourself yet by any chance?

For weights, pl check out our follow-up work: TeD-SPAD, which improves anonymization for longer videos and performs similarly on UCF101.


main: use local paths instead of github API

for iterating the workflow files.
By default it will look in .github/workflows/*.y(a)ml for files.

Not my code, but I'm using this fork because I have some workflows in different folders that I would also like to keep up to date, but the fork is lacking the latest updates.

Thanks, we have a repo with template workflows that are copied to other repos, so it would be awesome to keep those up-to-date as well. 😃

closing in favor of https://github.com/saadmk11/github-actions-version-updater/pull/34


Moving electron-redux to V2 as the new default version

Since I believe the main part of development for v2 is done, and similar support of features is available - it might be the time to move the library to v2 as the new default version.
Docs still need some work, but this can happen without postponing the release

Any news?


Make form replay more robust

Makes form replay robust to addition and deletion of questions, by changing 3 things:

Instead of matching widgets to actions using the FormIndex, use the actual path of the question (e.g. /data/name). This value works better as a unique identifier for a question/answer pairing because while app builders can change the question ID of a question, they do so much less often than they insert or delete questions. (And in the event that they have changed a question ID, all this will do is prevent the question from being repopulated; it won't break anything).

Don't assume that questions have to be replayed in the exact order that the set of FormEntryActions is in. Instead, as you move through each question index in the form, just search the list of actions for an action with a matching reference.

If there is no action entry for the current index, don't throw an error, and instead just proceed (this allows for insertion of new questions).

Good ideas! I assume that this works well with repeats by comparing the multiplicity in the repeat tree reference's string rep, like "/data/patient[2]/name"

@phillipm Yep, although that all conveniently happens under the hood, since the path returned by FormIndex.getReference() is already of that format.

@phillipm This is good to review. I tested it fairly thoroughly, including adding and removing questions before and after the stopping point, adding questions into question lists, and a bunch of messing around with repeats, all of which worked well. Would be great if you can see if you can come up with any failure modes I haven't thought of though.

ah ok have to fix the tests though

Nice, thanks for the j2me fix and quick merge!


Github Action to prevent large files

Part of #1403
Checklist

[x] I have read and agree to Contributor Guide and the Code of Conduct
[ ] I've included a screenshot or gif (if applicable)

does not check for accidental LFS files, just rooting for other stuff in CI breaking then ;)

Any particular reason for doing this as bash instead of python?

Should have done python given that I spent soo much time figuring it out. Story is that I first had it in its own job and didn't want to install python. Then moved it into the util job which already has it but didn't convert it


[ BUG ] TypeScript not working

Describe the bug
My TypeScript won't work anyway.
To Reproduce
Copying the components as per the documentation, I make sure all the copied paths are okay
Expected behavior
Type inference should work properly
Screenshots

Platform (please complete the following information):

OS: MacOS
IDE: WebStorm
Nodejs: v20
TypeScript: 5.4.3

Additional context
Here is my tsconfig
{
  "extends": "expo/tsconfig.base",
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "jsx": "preserve",
    "lib": [
      "dom",
      "esnext"
    ],
    "moduleResolution": "node",
    "noEmit": true,
    "skipLibCheck": true,
    "resolveJsonModule": true,
    "target": "esnext",
    "allowJs": true,
    "forceConsistentCasingInFileNames": true,
    "esModuleInterop": true,
    "module": "esnext",
    "isolatedModules": true,
    "strict": true,
    "baseUrl": "./src",
    "types": [
      "nativewind/types"
    ],
    "paths": {
      "@/*": [
        "./*"
      ]
    }
  },
  "include": [
    "app.d.ts",
    "**/*.ts",
    "**/*.tsx"
  ],
}

Seems related to: https://github.com/redwoodjs/redwood/issues/5104
When I add the following lines to tsconfig.json, the type works correctly.
"compilerOptions": {
    "paths": {
      "react": [
        "./node_modules/@types/react"
      ]
    }
}

I had this issue when updating my packages with npx expo install --fix. I had to delete my node_modules and install them again to fix it.


Provide a description for the code scanning

Why:
Closes #11901.
What's being changed:
Provide a description for the code scanning permissions.
Check off the following:

[x] I have reviewed my changes in staging (look for "Automatically generated comment" and click Modified to view your latest changes).
[x] For content changes, I have completed the self-review checklist.

@lucalves
Thanks so much for opening a PR! I'll get this triaged for review :zap:


When using "fromFields", address will be add an 0x beforehand.

Below will return 400 because when I use "fromFields" it will load an extra 0x for any address regardless it had 0x already or not.
import { NextApiRequest, NextApiResponse } from "next";
import { SuiClient } from "@mysten/sui/client";
import {
  CoinAddedEvent,
  CoinAddedEventFields,
  VaultCreatedEvent,
  VaultCreatedEventFields,
} from "@/giftdrop-contracts/giftdrop_vault/giftdrop_vault/vault/structs";

export default async function handler(
  req: NextApiRequest,
  res: NextApiResponse
) {
  if (req.method !== "POST") {
    return res.status(405).json({ error: "Method not allowed" });
  }

  try {
    const { txDigest } = req.body;

    if (!txDigest) {
      return res.status(400).json({ error: "Transaction digest is required" });
    }

    const suiClient = new SuiClient({
      url:
        process.env.NEXT_PUBLIC_SUI_RPC_URL ||
        "https://fullnode.mainnet.sui.io:443",
    });

    const txData = await suiClient.waitForTransaction({
      digest: txDigest,
      options: {
        showEvents: true,
      },
    });
    console.log({ txData });
    const events = txData.events;
    const vaultCreatedEvent = events?.find((e) =>
      e.type.endsWith("VaultCreatedEvent")
    );
    if (!vaultCreatedEvent || !vaultCreatedEvent.parsedJson) {
      return res.status(400).json({ error: "Vault created event not found" });
    }
    const vaultCreatedEventFields = VaultCreatedEvent.fromFields(
      vaultCreatedEvent.parsedJson as Record<string, any>
    );
    if (
      vaultCreatedEventFields.manager !==
      process.env.NEXT_PUBLIC_MANAGER_ADDRESS
    ) {
// vaultCreatedEventFields.manager will be 0x0x4fb6bb32eb3f5e495430e00233d3f21354088eee6e2b2e0c25c11815f90eea53
// and it should be 0x4fb6bb32eb3f5e495430e00233d3f21354088eee6e2b2e0c25c11815f90eea53
      return res.status(400).json({ error: "Vault manager is incorrect" });
    }

This could indeed be a bug. What is the type of the vaultCreatedEventFields.manager field (in Move)? Also in general you should be decoding from bcs instead of json because it's more stable

Curious how can we decode a event from BCS from suiClient.waitForTransaction?

Does it not return bcs?

Does it not return bcs?

No
export interface SuiTransactionBlockResponseOptions {
    /** Whether to show balance_changes. Default to be False */
    showBalanceChanges?: boolean;
    /** Whether to show transaction effects. Default to be False */
    showEffects?: boolean;
    /** Whether to show transaction events. Default to be False */
    showEvents?: boolean;
    /** Whether to show transaction input data. Default to be False */
    showInput?: boolean;
    /** Whether to show object_changes. Default to be False */
    showObjectChanges?: boolean;
    /** Whether to show raw transaction effects. Default to be False */
    showRawEffects?: boolean;
    /** Whether to show bcs-encoded transaction input data */
    showRawInput?: boolean;
}

Will be great to add an function that parse from event from transaction block.

The returned event type contains a bcs string:
You can decode like this:
VaultCreatedEvent.r.fromBcs(fromBase56(vaultCreatedEvent.bcs)))

You can decode like this:
VaultCreatedEvent.r.fromBcs(fromBase58(vaultCreatedEvent.bcs)))

Oh yes! Got it! It works

Yet when I try event with type, it will showArgument of type 'string' is not assignable to parameter of type 'PhantomReified<string>'.ts(2345).
        const vaultCoinAddedEvent = CoinAddedEvent.fromBcs(
          coinType,
          fromBase58(vaultCoinAddedEvent_.bcs)
        );

    public struct CoinAddedEvent<phantom T> has copy, drop {
        vault_id: ID,
        coin_value: u64,
    }


NavigationExperimental - conflicts withanother route when double clicks

NavigationExperimental on UIExplorer.
 You could avoid this by creating an isNavigating flag to prevent this kind of thing

@nvcken What version of React Native are you using? NavigationAnimatedView is replaced with NavigationTransitioner, and as of v0.28-rc, NavigationTransitioner no longer depends on route keys.
🍺

Sorry, I dont remember exactly, seem it's 0.26 version

Hello, I face the same problem, but with RN 0.28.0

You can add a check in your reducer so that same route isn't pushed again.

Yes, here is my reducer case when pushing a route:
case C.PUSH_ROUTE: {
	// trying to push the route where we already are, no need to change a thing
	if (state.routes[state.index].key === (action.route && action.route.key)) return state;
	// ensure no duplicate keys
	const index = state.routes.findIndex((route) => {
		return action.route.key === route.key && action.route.title === route.title;
	});
	if (index > -1) state.routes.splice(index, 1);
	return NavigationStateUtils.push(state, action.route);
}

you may use NavigationStateUtils.has(state, route.key) to check duplicated key.

By the way @xseignard, I notice your reducer mutates the routes with the splice statement. This mutation is considered a bad practice because anyone else who looks at the original array of routes will see the mutated version and won't be able to make good comparisons

@hedgerwang you're right, I updated my comment

Hi there! This issue is being closed because it has been inactive for a while.
But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/navigationexperimental-conflicts-withanother-route-when-double-clicks
Product Pains has been very useful in highlighting the top bugs and feature requests:
https://productpains.com/product/react-native?tab=top
Also, if this issue is a bug, please consider sending a pull request with a fix.


Does not work on iPhone device ios 12.4.1

No error thrown but lagging on this device

Do you mean exactly 12.4.1?
I am not able to find this version on Xcode 11.   Can you try to find it out？

This was fixed when the Flutter version updated.


Couldn't import useLiveQuery from dexie-react-hooks

I'm using<EMAIL_ADDRESS>for my react project with bun + vite (newest version).
after installing the package, all I have is dist folder with no js file, just type definition:

so because there's no js file, I couldn't use useLiveQuery, please help

I checked the package on npmjs 'code' tab: https://www.npmjs.com/package/dexie-react-hooks?activeTab=code
Seems it has the required files on version 1.1.7.
Check if you just need to delete node_modules and retry npm install. If that doesn't help, try npm cache clean --force and redo npm install.

thank you, after clearing cache from bun, I finally successfully installed the package now, @dfahlander


hoverctl doesn't connect to a custom host or a custom port

If I want to get for example status of a hoverfly running on either a custom port or a custom host I execute:
hoverctl status --admin-port 12345 --host <IP_ADDRESS>
but I get
Could not connect to Hoverfly at localhost:8888

Hi @MatousJobanek, hoverctl already supports multiple hoverfly instances, please check this out: http://hoverfly.readthedocs.io/en/latest/pages/tutorials/advanced/remotehoverfly/remotehoverfly.html
You just need to create a target and set it as default first:
hoverctl targets create --host <IP_ADDRESS> --admin-port 12345 --set-default
Any hoverctl commands will point to that target.

Ok, I missed that doc - I followed the hoverctl help when I was trying to get the status:
$ ./hoverctl status --help
If Hoverfly is running, this command will show an overview
of the instance of Hoverfly. This includes reporting the
mode and middleware set.

Usage:
  hoverctl status [flags]

Global Flags:
      --admin-port int   A port number for the Hoverfly API/GUI. Overrides the default Hoverfly admin port (8888)
  -f, --force            Bypass any confirmation when using hoverctl
      --host string      A host on which a Hoverfly instance is running. Overrides the default Hoverfly host (localhost)
      --proxy-port int   A port number for the Hoverfly proxy. Overrides the default Hoverfly proxy port (8500)
      --set-default      Sets the current target as the default target for hoverctl
  -t, --target string    A name for an instance of Hoverfly you are trying to communicate with. Overrides the default target (default)
  -v, --verbose          Verbose logging from hoverctl

so I thought that it should be possible to just call:
hoverctl status --admin-port 12345 --host <IP_ADDRESS>
to override the default hoverfly settings - exactly as it is written in there.

Aww, that's misleading... I don't think --admin-port,  --proxy-port, --host are global flags. But --target is. So limiting the scope fo those three flags will prevent any misuse.

To be precise, these flags are global to hoverctl start, hoverctl targets and hoverctl login, but not for any other commands.


Add ponydocs to the list of awesome CMSes

[x] verified that the CMS I'm adding is still maintained.
[x] read CONTRIBUTING.md.
[x] did not generate README.md.

Now pondering the proper plural of CMS. Ponydocs is a documentation-specific CMS that is, frankly, awesome for churning out documentation with different products, versions, child products, different manuals, and a generic "latest" for all your generic version needs. Supported and in heavy use by Splunk, it proves that a CMS can be a wiki but the content doesn't have to look like a wiki.

Now pondering the proper plural of CMS

I know! Pluralizing an acronym is a pain. I skewed towards "CMSes" in the scripts that support this repo.
@smoreface, is Ponydocs a standalone CMS? It seems to be a plugin for MediaWiki. Also, we're experimenting with a minimum star count of 50 (arbitrary, but using it as a metric of some sort of success or ability to control a botnet) for open source repositories to be added to Awesome CMS. PonyDocs is only 8 away, so it should be there soon.

Ooh, good point @mutewinter. It is a plugin for MediaWiki, and thus not standalone. I think of it as its own thing, but it is not. Feel free to decline my PR in favor of accumulating a list of standalone CMSes powerful enough to control a botnet.

@smoreface thanks for the explanation. I'll close this. However, I could definitely see an awesome-mediawiki list being very useful. Perhaps one already exists. If it does, that'd be a great place for Ponydocs.
Thanks for proposing this, even though we didn't merge it.


dotnet publish won't work with this package

I have a problem using this package with dotnet publish. I got the error C:\Program Files\dotnet" exited with code 1. That's it. When I remove the package everything is working fine.

Hello.
Do you have a specific error? Also can you provide whole command which you are using to publish?
I just tried it in my Demo project using:
dotnet publish Demo\Demo.csproj

and... it works.
My .Net Version: 5.0.104

No I only got the error I already mentioned. I'm using .NET 5.0.302.
The command I use is:
dotnet publish myProject.csproj

Seems to be a problem with dotnet. It works in version 5.0.104 but in 5.0.302 (using dotnet publish -v d) it returns:
 Could not find file 'C:\Users\Morasiu\.nuget\packages\blazortimeline\1.3.1\staticwebassets\.gitkeep'.
            at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
            at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
            at System.IO.File.OpenRead(String path)
            at Microsoft.NET.Sdk.BlazorWebAssembly.Tools.BrotliCompressCommand.<ExecuteCoreAsync>b__16_0(Int32 i)
            at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
         --- End of stack trace from previous location ---
            at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
            at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
            at System.Threading.Tasks.TaskReplicator.Replica.Execute()

I guess I should report this bug.

Reported: https://github.com/dotnet/sdk/issues/19453

Fixed in version 1.3.2


Add callback to client.open function which triggers on sendRequest completion

Simple callback  to start

It'd be great to also have a callback when the request is finished with the status code and other data.


Hitting ctrl+c while on a different user area crashes CP/M-65

I accidently hit ctrl+c while on user area 1 on the nano6502, and this crashed CP/M-65 with the error message "Couldn't open CCP". I could recreate the same thing on a BBC Micro (with b-em) to verify that it is not  platform specific.
I haven't investigated further, but I assume it tries to load CCP from the current user area and fails.

Thanks for the bug report. That's extremely likely. User areas are cursed; I'll take a look.


Error:32 Broken pipe

Installed ESFormatter for Sublime Text3 when try to use it using Ctrl +Alt+ F. I get Broken Pipe.

I have the same problem.
What's should I do?
+1

Version 1.6.3 is broken, see #51
Can you please upgrade to 1.6.4 and try again? Btw keep in mind that it doesn't format JSON, only valid JS.

It worked! Thanks piuccio!


{Enhancement} Optimize Dockerfiles for AWS Lambda Image

Combined RUN commands to reduce image layers and size.
Added cleanup for yum cache to minimize image footprint.
Used --no-cache-dir option with pip install to avoid caching unnecessary files.
Grouped COPY commands to streamline the build process.
Changed 'as' to 'AS' in the multi-stage build instruction to match Dockerfile casing conventions, this resolves the casing warning from the Dockerfile linter in VS Code editor.

Hey @kubed-arch  I had to force update repo (delete infracost key), now could you please fix conflict and will be happy to approve it

Hey @kubed-arch I had to force update repo (delete infracost key), now could you please fix conflict and will be happy to approve it

Hey @vedmichv 😊,
I've resolved the conflicts as requested 👍.


Clarify error handling design

The relationship GHResult / GHResponse could be more useful, e.g.
GHResponse[A](result: Either[GHException, A], statusCode: Int, headers: Map[String, String])

That way we don't lose status code and headers on the unhappy path.
Also, error handling should be front and center on the getting started.

As a new user, going through the documentation I kept seeing examples that simply matched on left and right, and printed that. It was never clear to me whether "right" was a complete success, or simply a lack of exceptional conditions such as connect failures. Or, put another way, were 400 and 404 rights or lefts? Did I need to handle a 30x?
I started out thinking if I got a right, then I was getting an authorized response to the API call I made, but looking at how status code was present only on right, I started to question that assumption.
So, from my perspective, that's what I wish was made clear.

By the way, somewhat related but not totally, right now GHResponse is an alias for Either. However, it doesn't have the type classes from cats that Either does. For example, I can't replace the Either in the following code with GHResponse:
  private def autoPaginate[F[_]: Sync, T]
      (call: Pagination => F[Either[GHException, GHResult[List[T]]]]): EitherT[F, GHException, List[T]] = {
    for {
      firstPage <- EitherT(call(Pagination(1, 100)))
      pages = getPages(firstPage).map(Pagination(_, 100))
      restPages <- EitherT(pages.traverse(call(_)).map(_.sequence))
    } yield firstPage.result ++ restPages.flatMap(_.result)
  }

Whatever path you take, it would be useful to have those available.

we've removed type aliases in https://github.com/47degrees/github4s/blob/master/github4s/src/main/scala/github4s/GithubResponses.scala

this is done closing


fix: remove url-loader && exclude output folder from svg loaders

Relate PR.

Thanks

Can you please upload a new version on NPM?

Changes released on v0.3.0

@farnabaz , Thanks a lot!


Detected I/O inside the event loop

hey, first of thanks for your component
I found this in my registry, I guess you'll know what it means:
Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for samsungtv_tizen doing I/O at custom_components/samsungtv_tizen/upnp.py, line 28: response = requests.post("http://{host}:9197/upnp/control/{protocole}1".format(host=self.host, protocole=protocole), data=body, headers=headers, timeout=0.1)

What version of HA are you using? Have you installed the latest version of this integration?

0.111.4 and yes, the integration the latest version. I guess you suggest to uninstall and reinstall the integration again?

no, i wasn't going to suggest that 😄

oh ok, it shows up when I use the cast url service

I've read, some time ago, that HA made a change and requested all integration to respond in short times, forcing them to use async calls so that I/O is not done in the same thread as the requester. I've tried to find that note but I could not find it. Hope not to be wrong and to be inherent.

it show up even when I call the homeassistant.turn_on service. TV won't turn on and it yields this error

i think i fixed this with v1.5.0, reopen the issue if you still see that warning

thanks a lot!I will


Add python-client implementation & example for dataset uploading using Uppy

The old dataset upload code in the python client should be thrown out or overwritten. Only a few collaborators had access to the shared upload buckets, and AFAIK they've all finished what they wanted to do, so we shouldn't keep the old code around after the new code is available.


server npm install bcrypt failed

3671 verbose stack Error<EMAIL_ADDRESS>install: `node-pre-gyp install --fallback-to-build`
3671 verbose stack spawn ENOENT
3671 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:17:16)
3671 verbose stack     at emitTwo (events.js:87:13)
3671 verbose stack     at ChildProcess.emit (events.js:172:7)
3671 verbose stack     at maybeClose (internal/child_process.js:821:16)
3671 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
3672 verbose pkgid<EMAIL_ADDRESS>3673 verbose cwd /opt/fabu.love/server
3674 error Linux 4.4.0-127-generic
3675 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
3676 error node v4.2.6
3677 error npm  v3.5.2
3678 error file sh
3679 error code ELIFECYCLE
3680 error errno ENOENT
3681 error syscall spawn
3682 error<EMAIL_ADDRESS>install: `node-pre-gyp install --fallback-to-build`
3682 error spawn ENOENT
3683 error Failed at the<EMAIL_ADDRESS>install script 'node-pre-gyp install --fallback-to-build'.
3683 error Make sure you have the latest version of node.js and npm installed.
3683 error If you do, this is most likely a problem with the bcrypt package,
3683 error not with npm itself.
3683 error Tell the author that this fails on your system:
3683 error     node-pre-gyp install --fallback-to-build
3683 error You can get information on how to open an issue for this project with:
3683 error     npm bugs bcrypt
3683 error Or if that isn't available, you can get their info via:
3683 error     npm owner ls bcrypt
3683 error There is likely additional logging output above.
3684 verbose exit [ 1, true ]

原来是我的 npm 版本太老了。


Fix KubeObjectDetails drawer not working for Cluster scoped resources

Fix not displaying spinner while object is not defined

Fix not displaying loading error if object is not defined

Signed-off-by: Sebastian Malton<EMAIL_ADDRESS>fixes https://github.com/lensapp/lens/issues/5917
fixes https://github.com/lensapp/lens/issues/5903
fixes https://github.com/lensapp/lens/issues/5936

@jim-docker The fix is in Kube object store.
The rest of the changes are there is make the component not empty when it fails. They were what I did to figure out what the error was. I would consider them big fixes and not just refactorings.

@jim-docker The fix is in Kube object store.
The rest of the changes are there is make the component not empty when it fails. They were what I did to figure out what the error was. I would consider them big fixes and not just refactorings.

Ok, but wasn't there already code to make sure the component was not empty (isLoading, loadingError)?

Ok, but wasn't there already code to make sure the component was not empty (isLoading, loadingError)?

Yes but they were only being called if this.object was already defined which is why in practice the drawer was blank.

Ok, but wasn't there already code to make sure the component was not empty (isLoading, loadingError)?

Yes but they were only being called if this.object was already defined which is why in practice the drawer was blank.

So that was the bug fix


binaries for node 12.18.4

https://nodejs.org/en/blog/vulnerability/september-2020-security-releases/
I am currently creating a patch

It seems like the patch for 12.18.3 can also be used for 12.8.4.

Nice!

Seems the build is working: https://github.com/robertsLando/pkg-binaries/releases/tag/node12
:tada:

Cool! It would be nice to also have some kind of smoke test CI script that packages and executes the binary, just to makes sure it actually works.

Humm that's a really nice idea! I will take a look at it later, if you want to submit a pr in the meanwhile feel free to do it :)

I did just push https://github.com/n1ru4l/pkg-fetch/commit/2a86c241189f52d4e9cdab36daf5d94c2fde210d

What is your opinion on somehow integrating the pkg-fetch fork inside this repository? That way we have one source and don't have to update two repositories.

What is your opinion on somehow integrating the pkg-fetch fork inside this repository? That way we have one source and don't have to update two repositories.

@n1ru4l I'm +1 for this! We could use submodules or git-subrepo

I'm thinking that as we are using out own fork, we could also make it automatically look for binaries also on this repo and automatically download them :)

yes, let's create a new issue for this! :)


Trouble parsing the json from the annotations csv file - needing to know subject id ahead of time to access json string

This might be me doing something wrong, but when I try to parse the subject json I'm having some trouble.
The subject data looks like this: {"499639":{"APFid":"APF00002yr.jpg","retired":false}}
If I read this in using python json package, to access the APFid which is the column that I had in the manifest.csv file, I have to know the subject id number to get access
tmp=json.loads(row['subject_data'])
print tmp['499640']['APFid']
I can't find a way to access learn the subject id ahead of time.
For annotations it outputs as such so [{"task":"T0","value":[],"task_label":"Mark the boulders you see in the image"}]
so when I parse that with json I can get any value out
            tmp=json.loads(row['annotations'])
            print tmp[0]['value']

This might be me doing this wrong since I use json infrequently, but I thought I'd bring it up and see if there was simple answer or if there was an issue with the json format from the subject data.   I couldn't find one online on stack overflow that seemed to match my issue.
If there is an issue, since there is now the subject csv really all is needed is the subject id number maybe that could be a work around

@mschwamb your subject data for the each classification should currently only contain 1 entry (1 subject) as we don't currently provide multi subject classification. So you can safely parse each subject json entry and extract the keys (subject ids) and metadata (or just leave them in the resulting dictionary) and use it as an effecient lookup table.
So 2 things:

You have the subject export you can pre-load to know the set of subjects you're looking up
You can just iterate over the resulting json loads dictionary key, http://stackoverflow.com/questions/3545331/how-can-i-get-dictionary-key-as-variable-directly-in-python-not-by-searching-fr

Perhaps something like..
mp = json.loads(row['subject_data'])

#access the first subject
subject_ids = mp.keys()
first_subject_id = subject_ids[0]
print "key: %s , value: %s" % (first_subject_id, mp[first_subject_id])

# OR enumerate all keys
for key in mp.keys():
   print "key: %s , value: %s" % (key, mp[key])

Gotcha. Thanks. This worked. I was trying to use iterkeys() and thought json made it it into a straight dictionary from loads. Thanks for this and sorry for bothering. I'm good now.


Is it possible to join multiple networks with a single client?

I need to manage a number of different projects, that are unrelated to each other.
In ZeroTier, you can run a single instance of the ZeroTier client, and join multiple networks.
For example, on my laptop:

I'm curious - what is the proper way of doing this with Nebula?
As in, is it possible to spin up a single instance of the nebula binary, and have it join multiple networks, each with their own certificate/key and subnets?

Hi @victorhooi, I'm pretty new to Nebula but yes, this is possible. You essentially segment your network by using a different CA for each network segment.
In your client, you combine again by trusting both CAs:
pki:
  ca: |
    -----BEGIN NEBULA CERTIFICATE-----
    abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+/abcdefgh
    ijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+/abcdefghijklmnop
    qrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+/abcdefghijklmnopqrstuvwx
    yz=
    -----END NEBULA CERTIFICATE-----
    -----BEGIN NEBULA CERTIFICATE-----
    abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+/abcdefgh
    ijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+/abcdefghijklmnop
    qrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+/abcdefghijklmnopqrstuvwx
    yzABCDEFGHIJKLMNOPQRSTUVWXYZ123==
    -----END NEBULA CERTIFICATE-----

Now your client trusts nodes on both segments. But how do you make both segments trust your client? We do this by letting both CAs sign our client. Generate a single public/private client pair for your client that we will sign with both CA keys:
nebula-cert keygen --out-key client.key -out-pub client.pub

Now we sign the public key with both CAs:
nebula-cert sign -ca-crt ca1.crt -in-pub client.pub -name client -ip <IP_ADDRESS>/24 -out-crt client1.crt
nebula-cert sign -ca-crt ca2.crt -in-pub client.pub -name client -ip <IP_ADDRESS>/24 -out-crt client1.crt

And finally you combine the two certificates in a single certificate (like we did for the pki: ci: in the yaml earlier):
cat client1.crt client2.crt > client.crt

And your done! Your config looks something like:
pki:
  ca: |
    -----BEGIN NEBULA CERTIFICATE-----
    abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+/abcdefgh
    ijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+/abcdefghijklmnop
    qrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+/abcdefghijklmnopqrstuvwx
    yz=
    -----END NEBULA CERTIFICATE-----
    -----BEGIN NEBULA CERTIFICATE-----
    abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+/abcdefgh
    ijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+/abcdefghijklmnop
    qrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+/abcdefghijklmnopqrstuvwx
    yzABCDEFGHIJKLMNOPQRSTUVWXYZ123==
    -----END NEBULA CERTIFICATE-----
  cert: /location/to/client.crt # You can also inline this of course
  key: /location/to/client.key # You can also inline this of course

@toonsevrin Thanks for looking into this - just saw your update about the cert field, and that it won't work =(.
Does anybody else know a way to join multiple Nebula networks at once?
(Does running multiple instances of the nebula binary work, or will that break something?)

Does anybody else know a way to join multiple Nebula networks at once?

Based on suggestion in another issue, I've been running two instances at the same time, just make sure to set them to use different tunnels.

(Does running multiple instances of the nebula binary work, or will that break something?)

This is the recommended way of connecting to two Nebula networks. I'm leaving this issue open however as it would be a prerequisite of #306 if we ever desire to implement it.

Could be a good documentation point: "How to join multiple networks on desktop: create multiple nebula services running on different ports && you can enable/disable as needed; Mobile supports multiple networks but only one at a time"


Get the results in parallel using Streaming

What is unsafeInterleaveIO even supposed to do in the code? From what I could determine by just reading the code, it should not make any difference if you just remove it. In updateResults you delay the IO action with unsafeInterleaveIO and then immediately force it with a case expression:
https://github.com/balsoft/lambda-launcher/blob/b35c41e10b5758eeddc3d6992b2bf53d11bbea03/src/LambdaLauncher/Main.hs#L117-L123
If you want to delay the partial computations of each element in the list, you would have to call unsafeInterleaveIO repeatedly each time you generate an element. See for example the source code for readFile which recursively calls lazyRead, which starts with an unsafeInterleaveIO, for each chunk of data it will return.
So, for now I suggest either simply removing it or changing it so it actually does something.

@anka-213 I removed unsafeInterelaveIO for now.

So what do you want it to do? Run each plugin in parallel? Delay getting results from a plugin until it is needed? If it is the first, streaming/pipes/conduits is not sufficient, you will need to run it in separate threads.
I suggest using async which has some nice primitives for concurrency and waiting for multiple results, especially mapConcurrently. Otherwise, it is fairly easy to implement yourself using forkIO and for example MVars.

The problem is I'm not aware of any out-of-the-box solution that would be  [IO a] -> IO [a] where it returns the list "sorted" on the time that the IO finished (so evalutating the list element-by-element the way I'm doing this right now will result in search results appearing one-by-one as they arrive.

If you still want the type-signature [IO a] -> IO [a], you would indeed need to use unsafeInterleaveIO together with some method for racing the threads, for example a queue. Otherwise you could either return a Stream or something similar or simply store the queue together with the value.
I think the easiest solution for the racing would be to spawn all the threads in parallel (and if needed limit the amount of parallelism with a semaphore) and then when a thread is done, have it add the result to a concurrent queue (e.g. TQueue). Then you can consume the queue and use them in any pace you want. You'll also need some kind of counter to know when all threads are done. Also, don't forget to fully evaluate the value before putting it into the queue.
Does this seem sensible to you? If so, I might try implementing something like this if I get bored.

This seems absolutely sensible and it was indeed what I intended to do with unsafeInterleaveIO call. I just didn't think it through because the main part of this was written in a couple of hours as an experiment with gi-gtk-declarative.
If you wish to implement that, please do!

I looked at the code and I think it looks good. I left a minor comment in the commit.
I haven't tried running it, but if you want to test that the parallelism works you can add an artificial delay (with threadDelay) in several of the plugins and check that it doesn't take longer to complete than the slowest plugin.

Parallelism seems to work, I was just worried if there's some terrible leak or something. I'll rewrite it with mapM_, thanks.

Nope, nothing terrible. It should be perfectly fine now. :) (And even without the mapM_ it would have been perfectly fine, just very very marginally less efficient)

A bit late, but I recently discovered that the library streamly does exactly what we want here. It has a really nice interface, similar to Streaming. For example, this program performs a number of actions asynchronously and forwards the results as soon as they arrive:
import Streamly
import qualified Streamly.Prelude as S
import Control.Concurrent (threadDelay)

main = S.drain $ do
  x <- asyncly $ do
     n <- S.fromList [5,4..1]
     S.yieldM $ threadDelay (n * 1000000)
     pure n
  S.yieldM $ print x

There is a tutorial here: https://hackage.haskell.org/package/streamly-0.7.2/docs/Streamly-Tutorial.html


Update snappy to 1.1.3 and use new download URL

A simple "make" without specifying GIT_REPO_URL no longer worked, because the snappy project has moved from googlecode to GitHub. This PR fixes the build and also updates some of the native libraries to use snappy 1.1.3. Tests ran clean on x86-64, ppc, ppc64, and s390x.

Looks good. Could you merge the recent change of develop branch to resolve the conflicts?

Sorry for the delay; the code is ready to merge now.

Merged. Thanks


[WIP] Bring ember-microstates up to date with Microstates.js library

It's been more than 2 years since Charles' last commit to this repository. Since then, most of the work was done in cowboyd/microstates.js and now microstates/microstates.js repository.
A lot has happened in Microstates world since ember-microstates was last worked on. This PR aims to bring the Ember integration with Microstates with the latest version of Microstates. There are some significant breaking changes to maintain consistency with the main Microstates library.
In spirit, the Ember add-on remains primarily a way to make templates more expressive and eliminate the need for writing actions to perform common state transitions. In the current version of ember-microstates this is only possible with types that were provided by ember-microstates namely String, Boolean, Number, List, Object,  Select and MultiSelect. It was not possible to create custom types because types in ember-microstates are not composable.
The new version of Microstates allows to compose Microstate types into complex data structures. Microstates will provide the transitions that you can perform on Microstates instances created from the Microstates types. ember-microstates will ensure that the result of these transitions will be reflected in the template. You can learn about types and type composition in the Microstates README.
To make it possible to consume custom Microstates types, we are introducing use-type helper and useType computed property macro. Both of these mechanisms for creating Microstates instances have the same argument signature, they take a Type as a first argument and value as the second argument.
(use-type Type value) helper
use-type exists to make it easy to create Microstates in the template. You can use it without providing any arguments, in which case the created Microstate will be treated as a Microstates<Any>. The created Microstate will have set transition that you can invoke but it will not have any type specific transitions.
{{#let (use-type) as |value|}}
  {{value.state}}
  <button {{action value.set "Hello World"}}>Show Hello World</button>
{{/let}}

To create a Microstate of a specific Type, you can pass the Type argument. Type is a class or a function that can work as a constructor. There are several ways to make types available within the context of your template.
Make the Type available as a property on the context
This is probably the most direct way but it requires that you jump into JavaScript to do this. For example, if you have a component that uses use-type helper in the template, then you can do something like this:
import Component from '@ember/component';

class Person {
  name = String;
  age = Number;
}

const initialValue = { name: 'John Doe' };

export default Component.extend({
  PersonType: Person,
  initialValue,
  layout: hbs`
  {{#let (use-type PersonType initialValue) as |person|}}
    {{person.name.state}} is {{person.age.state}}
  {{/let}}
  `
});

Note: usually, you should not create classes with references to complex objects because they will be shared across component instances. This requirement doesn't matter with Microstates since it's immutable and that value will never be mutated.

Use (import) helper from ember-import
We created ember-import package that provides (import helper to make it easier to create Microstates from templates without touching JavaScript. It has a few limitations but it will allow you to import Type that are exported by your JavaScript modules.
For example, we could create a module called person.js that will export Person type. You would use it like this,
// types/person.js
export default class Person {
  name = String;
  age = Number;
}

To use it in your template, you would do the following,
{{#let (use-type (import 'my-app/types/person')) as |person|}}
    {{person.name.state}} is {{person.age.state}}
{{/let}}

You can learn more about (import) helper in the ember-import README.
useType computed macro
What you can do in the template, you can also do in JavaScript. ember-microstates now provides useType macro that takes Type and value. When a transition is invoked by the microstate on the computed property, it'll automatically update the microstate.
import Component from '@ember/component';
import { useType } from 'ember-microtates';

class Person {
  name = String;
  age = Number;
}

const initialValue = { name: 'John Doe' };

export default Component.extend({
  person: useType(Person, initialValue),
  layout: hbs`{{person.name.state}} is {{person.age.state}}`
});

This is the API that you would probably want to use if you're going to use microstates with Ember Concurrency. You should keep in mind, that for all intends and purposes, Microstates transitions will have similiar behaviour to computed properties. They are syncronous, so you can perform the transition and read the next state on the next line.
import Component from '@ember/component';
import { task } from 'ember-concurrency';
import fetch from 'ember-network';

class Person {
  name = String;
  age = Number;
}

export default Component.extend({
  person: useType(Person),

  fetchPerson: task(function *() {
    let response = yield fetch('/person/123');
    let data = yield response.json();

    this.get('person').set(data);
    // microstate is updated
  }),

  layout: hbs`
  {{#if fetchPerson.isSuccessful}}
    {{person.name.state}} is {{person.age.state}}
  {{/if}}
  `
});

Primitive Type Helpers
Make it easy to create Microstates from built in JavaScript types without importing types into the template context. ember-microstates includes of these helpers: (Number), (String), (Boolean), (Array) and (Object).

Note: In JavaScript, Number, String, Boolean, Array and Object classes are all constructors that can be used to instantiate Microstates of that type. These are not available in the context of Glimmer templates. ember-microstates provides helpers with these names but they are Ember Helpers which are different than the classes that are available in JavaScript.

(Number value)
Creates a Microtates of Number type.
{{#let (Number 42) as |number|}}
  {{number.state}}
  <button {{action number.increment}}>Increment</button>
{{/let}}

(Boolean value)
Creates a Microstate of Boolean type.
{{#let (Boolean true) as |bool|}}
  {{bool.state}}
  <button {{action bool.toggle}}>Increment</button>
{{/let}}

(String value)
Creates a Microstate of String type.
{{#let (String 'Hello World') as |str|}}
  {{str.state}}
  <button {{action str.concat '!!!'}}>Exclaim!!!</button>
{{/let}}

(Array value)
Creates a Microstate of Array type.
{{#let (Array (array 1 2 3)) as |list|}}
  {{#each list as |item|}}
    <button {{action list.remove item}}>Remove: {{item.state}}</button>
  {{/each}}
{{/lef}}

Note: (array) helper has to be imported from ember-composable-helpers or provided on the context.

(Object value)
Creates a Microstate of Object type.
{{#let (Object (hash a='A' b='B')) as |object|}}

  {{#each object as |entry|}}

      {{entry.key}}: {{entry.value}}
      <button {{action object.delete entry.key}}>x</button>

  {{/each}}

{{/lef}}

Exported Types
ember-microstates re-exports types from microstates package. This is necessary because we're exporting modules from the CJS build instead of the ES build that ember-auto-import uses by default. The CJS build does not transpile the classes which avoids the need for adding IE11 as a target in development.
The types can be imported using ember-import.

ember-microstates/types/number
ember-microstates/types/boolean
ember-microstates/types/string
ember-microstates/types/object
ember-microstates/types/array

TODO

[ ] Wait for https://github.com/microstates/microstates.js/pull/276 to be released
[ ] Add integration tests for all helpers
[ ] Move to @microstates/ember

@alexlafroscia @knownasilya what do you guys think?

Looks good to me!

I like the idea too, but am curious about this import helper -- I feel like it would be a little more "natural" to have something like a type helper that goes through the resolver to look up the module.
With the same types/Person file, it might look something like this:
{{#let (use-type (type 'person')) as |person|}}
    {{person.name.state}} is {{person.age.state}}
{{/let}}

I think that the type helper could look something like this:
import Helper from '@ember/component/helper';
import { getOwner } from '@ember/application';

export default Helper.extend({
  compute([name]) {
    return getOwner(this).lookup(`type:${name}`);
  }
});

This is a little more "terse" in that you don't need the my-app/types in the import name

I'm sure ember-import will come in handy in other scenarios, like types that are shared on npm and not built as ember addons.

I definitely don't mean to disparage the idea of ember-import as a whole -- I just think that a more "tailored" helper for this use-case that's specific to looking up a type would be a nicer API, and as a bonus avoid using the global require function which, while not exactly "private" API, might be better to avoid.

Bam! @taras is on a roll!

I pushed latest version of ember-microstates to this branch and updated the README.
cc @sivakumar-kailasam

@alexlafroscia it's a great idea to eliminate the useState and useType CPMs. It got me thinking that the API surface might be bigger than necessary in general.
The API surface will be

helpers:

(use microstate) - wraps Microstate in a store
(create Type value) - creates a microstate from type value
(from value) - creates microstate from value
(value-of microstate) - gets value from microstate

computed property macros

use(microstate)

When using primitive types in templates, the developer can do this.
{{#let (use (from 42)) as |number|}}
  <button {{action number.increment}}>Increment ({{number.state}})</button>
{{/let}}

When the developer needs to create a microstate, they can just do
{{#let (use (create (type "person") (hash name="Taras"))) as |number|}}
  <button {{action number.increment}}>Increment ({{number.state}})</button>
{{/let}}

In JavaScript, the developer can do this,
import Component from '@ember/component';
import { computed } from '@ember/object';
import { valueOf, use, create, from } from 'ember-microstates';

export default Component.extend({
  // if the type is not necessary: `from([10, 20, 30])`
  numbers: use(create([Number], [10, 20, 30])),

  value: computed('numbers', function() {
    return valueOf(this.get('numbers'));
  }),

  layout: hbs`
  {{#each numbers as |number|}}

<button {{action numbers.delete number}}>{{number.state}}</button>

  {{/each}}
  `
})

If Ember wasn't so "opinionated" the only API that would be necessary would be use helper and macro, but because templates can't use JavaScript functions we have to define create, from and value-of helpers. In JavaScript, they can just use functions exports from microstates.
This will be a huge simplification and a much better alignment.
Thoughts?

I like that direction as well, feels very composable 👍

Will the use helper conflict with the use helper coming out in the new Module Unification API?

@brandynbennett yes it will. Thank you for bringing it to my attention.

Ok, since we can't use use helper, what about just using state.

helpers

(state valueOrMicrostate) - takes a value, which it converts to a microstate with Microstates.from, or a microstate and wraps it in a Store

(create Type value) - creates a Microstate from a type
(type name) - retrieves the type
macros
state - takes a value, which it converts to a microstate with Microstates.from, or a microstate and wraps it in a Store

{{#let (state 42) as |number|}}
  <button {{action number.increment}}>Increment ({{number.state}})</button>
{{/let}}

{{#let (state (type "person") initial) as |number|}}
  <button {{action number.increment}}>Increment ({{number.state}})</button>
{{/let}}

import Component from '@ember/component';
import { computed } from '@ember/object';
import { valueOf, state, create } from 'ember-microstates';

export default Component.extend({
  // if the type is not necessary: `from([10, 20, 30])`
  numbers: state(create([Number], [10, 20, 30])),

  value: computed('numbers', function() {
    return valueOf(this.get('numbers'));
  }),

  layout: hbs`
  {{#each numbers as |number|}}

<button {{action numbers.remove number}}>{{number.state}}</button>

  {{/each}}
  `
})

Will you be keeping the value-of helper? I think that one would still be useful for getting objects/arrays

Will you be keeping the value-of helper? I think that one would still be useful for getting objects/arrays

Yes, I just added it to the description. I'm going to finalize this now.

I just pushed TodoMVC example. Here is what entire TODOMVC app looks like in Ember - without writing JavaScript. It's using TodoMVC type from @microstates/todomvc.
   {{#let (state (type "todomvc") initialTodomvc) as |todomvc|}}

          <form class="header" {{action todomvc.insertNewTodo on="submit"}}>

todos

            <input
              class="new-todo"
              placeholder="What needs to be done?"
              value={{todomvc.newTodo.state}}
              onchange={{action todomvc.newTodo.set value="target.value"}}
              autofocus
            />
          </form>

            <input class="toggle-all" type="checkbox" checked={{todomvc.isAllComplete}} />

              Mark all as complete

              {{#each todomvc.filtered as |todo|}}

                  {{#if todo.editing.state}}
                    <input
                      class="edit"
                      value={{todo.text.state}}
                      onchange={{action todo.text.set value="target.value"}}
                      onblur={{action todo.save}}
                    />
                  {{else}}

                      <input
                        class="toggle"
                        type="checkbox"
                        checked={{todo.completed.state}}
                        onclick={{action todo.completed.toggle}}
                      />

                        {{todo.text.state}}

                      <button class="destroy" {{action todomvc.todos.remove todo}} />

                  {{/if}}

              {{/each}}

                {{todomvc.active.length}}

              {{if (eq todomvc.active.length 1) 'item' 'items'}} left

              {{#each todomvc.filters as |filter|}}

                  <button
                    class={{if filter.selected "selected"}}
                    {{action filter.select}}
                  >
                    {{filter.label}}
                  </button>

              {{/each}}

            {{#if todomvc.hasCompleted}}
              <button class="clear-completed" {{action todomvc.clearCompleted}}>
                Clear completed
              </button>
            {{/if}}

      {{/let}}

Note: I discovered and fixed a bug in Microstates. This latest PR requires fixed version of Microstates. You can see the PR here.

This PR seems to be getting quite heavy 😸 maybe time to merge and open smaller PRs to fix subsequent issues?

It's getting meaty AF. I'm waiting for https://github.com/microstates/microstates.js/pull/284#issuecomment-441796876 to be merged so I can merge this PR with working demos. Right now, the demos work only with yarn link. I suspect today or tomorrow we'll have it merged.
Then you can feast your eyes on the new demo app :)

Ok, this is ready to go. Here is the updated demo site https://5bfcbca19a063f20024980b5--ember-microstates.netlify.com


Feature: Swap out Discord to Community and keep consistencies

Suggested solution
In the spirit of transparency and following the update on our docs, let's put things where people can see them!

Change Discord into Community with link https://github.com/orgs/open-sauced/discussions/1 in the compliance.yml
Remove an exclamation mark after the heart icon and a space from "Open Sauced".

- Congrats on making your first Pull Request and thanks for taking the time to improve Open Sauced! ❤! 🎉🍕
- Say hello by joining the conversation in our [Discord](https://discord.gg/U2peSNf23P)
+ Congrats on making your first Pull Request and thanks for taking the time to improve OpenSauced! ❤🎉🍕
+ Say hello by joining the conversation in our [Community](https://github.com/orgs/open-sauced/discussions/1 )

Lines of code:
https://github.com/open-sauced/hot/blob/645fafd4f07289681ad8265c1e71f9d93df2bf25/.github/workflows/compliance.yml#L67-L68

.take


Multiple account support

It would be great to be able to be logged in to multiple accounts at once, and easily switch between them

it could use tabs to switch between them!


Update Composer dependencies (2022-01-27-00-03)

Visual regression test passed!
View the visual regression test report


Upgrade to coola 0.0.12

Codecov Report
Patch coverage: 100.00% and no project coverage change.

Comparison is base (cbb04b1) 100.00% compared to head (cced2d8) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #55   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files           12        12
  Lines          465       469    +4
  Branches        62        62
=========================================
+ Hits           465       469    +4

Impacted Files
Coverage Δ

src/aroma/utils/vocab.py
100.00% <100.00%> (ø)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


Add \r and \n to DEFAULT_STRIP_REGEX

I worked with text vectorization and I thought that \r and \n needed to be cropped off.

@googlebot I signed it!

Can you explain more of what's going wrong for you here?
Whitespace should be removed during the token splitting step, which comes after the standardization step where this regex is applied. You can also always pass custom callables for standardize or split if you want custom behavior. But as a default, I do not think we the standardization step to strip whitespace.

Can you explain more of what's going wrong for you here?
Whitespace should be removed during the token splitting step, which comes after the standardization step where this regex is applied. You can also always pass custom callables for standardize or split if you want custom behavior. But as a default, I do not think we the standardization step to strip whitespace.

A lot of the data that I had had \n and \r, and I think that it is probably a common occurrence in text data, which is why I thought it should be part of the default punctuation removal part. I kind of think it is redundant to have a callable that basically does the exact same thing as the default program with just these two characters, right?

A minimal code example might help us get to the bottom of this!
To be clear \n and \r should already be stripped, along with spaces, tabs, and other whitespace, just during the "splitting" step, not the "standardization" step. You won't see them in a regex in this file, as we call into a standard tf utility for whitespace splitting. Removing whitespace in the standardization step would be unwanted, as it could actually end up fusing separate tokens across whitespace.
Here's an example of how things work today.
text_vectorization = TextVectorization(
    output_mode="int",
)
text_vectorization.adapt(["foo\r\nbar\nbaz   foo"])
text_vectorization.get_vocabulary()
> ['', '[UNK]', 'foo', 'baz', 'bar']
text_vectorization(["foo\r\nbar\nbaz   foo"])
> <tf.Tensor: shape=(1, 4), dtype=int64, numpy=array([[2, 4, 3, 2]])>

I believe with your change we could end up getting a vocabulary of "foobarbaz foo", which is not what we want in this case.

Oh! ok, I see.

A minimal code example might help us get to the bottom of this!
To be clear \n and \r should already be stripped, along with spaces, tabs, and other whitespace, just during the "splitting" step, not the "standardization" step. You won't see them in a regex in this file, as we call into a standard tf utility for whitespace splitting. Removing whitespace in the standardization step would be unwanted, as it could actually end up fusing separate tokens across whitespace.
Here's an example of how things work today.
text_vectorization = TextVectorization()
text_vectorization.adapt(["foo\r\nbar\nbaz   foo"])
text_vectorization.get_vocabulary()
> ['', '[UNK]', 'foo', 'baz', 'bar']
text_vectorization(["foo\r\nbar\nbaz   foo"])
> <tf.Tensor: shape=(1, 4), dtype=int64, numpy=array([[2, 4, 3, 2]])>

I believe with your change we could end up getting a vocabulary of "foobarbaz foo", which is not what we want in this case.

Ok, I see. That makes sense to split it then. I think I incorrectly assumed that it wouldn't happen just by looking at the regex. That all seems good, then!


Ability to manually name layers

First of all, thank you for writing this library! It has been quite useful to me so far.
It would be useful if you could manually name the layers of a SymbolicModel, perhaps via the interception of a specific keyword argument in the module call wrapper. For example (mockup):
>>> import torch.nn as nn
>>> from pytorch_symbolic import Input, SymbolicModel
>>>
>>> x = Input((1,1))
>>> y = nn.Conv2d(1,1,1)(x, name="MyCustomName")
>>> model = SymbolicModel(x, y)
>>>
>>> model.summary()
>>> print(model.state_dict().keys())

_________________________________________________
     Layer      Output shape   Params   Parent
=================================================
1    Input_1      (None, 1, 1)   0
2*   MyCustomName (None, 1, 1)   2        1
=================================================
Total params: 2
Trainable params: 2
Non-trainable params: 0
_________________________________________________
odict_keys(['MyCustomName.weight', 'MyCustomName.bias'])

This would particularly help to improve clarity when using nested SymbolicModels.

Will do.

This has been added in the latest 1.0.6 version.
Your code (modified):
import torch.nn as nn

from pytorch_symbolic import Input, SymbolicModel

x = Input((1, 1))
y = nn.Conv2d(1, 1, 1)(x, custom_name="MyCustomName")
z = nn.Conv2d(1, 1, 1)(x, custom_name="MyCustomName")
model = SymbolicModel(x, y + z)

model.summary()
print(model.state_dict().keys())

Produces:
_______________________________________________________
     Layer            Output shape   Params   Parent
=======================================================
1    Input_1          (None, 1, 1)   0
2    MyCustomName_1   (None, 1, 1)   2        1
3    MyCustomName_2   (None, 1, 1)   2        1
4*   AddOpLayer_1     (None, 1, 1)   0        2,3
=======================================================
Total params: 4
Trainable params: 4
Non-trainable params: 0
_______________________________________________________
odict_keys(['MyCustomName_1.weight', 'MyCustomName_1.bias', 'MyCustomName_2.weight', 'MyCustomName_2.bias'])

This new kwarg custom_name should work for all three ways of adding a layer to the model:

outputs = inputs(layer, custom_name="YOUR_CUSTOM_NAME")
outputs = layer(inputs, custom_name="YOUR_CUSTOM_NAME")
outputs = add_to_graph(layer, inputs, custom_name="YOUR_CUSTOM_NAME")

Thanks for opening the issue. I am closing it, but let me know if there's anything else.

Apologies for the late response. Works perfectly!
For the purposes of re-using trained weights in a slightly different architecture, it would have been nice to have a way of suppressing the automatic indexing ("_1", "_2") as well (with perhaps an exception on a duplicate name), but this is a very minor point.

Even better!
I think suppressing the indexing for the first occurrence is already a pretty good compromise.


Edits for the new color scheme

Refer to the staged site (http://istio-staging.surge.sh/):

When you scroll the home page, the old banner image becomes visible

The downward pointing arrow should be blue to match the overall color scheme

When you hover over the button, it switches to teal (should we change it to a different shade of blue?)

Also I find the text of the buttons a bit hard to read: the text is very thin.


Link preview is not working for google photos shared album's URL

I am try to preview google photo album's shared url using SwiftLinkPreview. But in the result, I am not getting expected results whereas if I shared same URL to WhatsApp or Skype, I can show link preview for same URL.
Request URL: https://photos.app.goo.gl/D2pM5KCoFEhStCYu9
Thanks

I have the same issue.


Loading component

Mix updated some dependencies while i was running mix setup , thats why mix lock changed.

Pull Request Test Coverage Report for Build de8cd9d08ad1e9971b5cc30a20b6603bf010685b-PR-31
Details

0 of 25 (0.0%)  changed or added relevant lines in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage decreased (-2.9%) to 64.249%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

lib/daisy_ui_components/loading.ex
0
25
0.0%

Totals

Change from base Build 4953c4e152480f90e7eb15699e6908353da1d9cc:
-2.9%

Covered Lines:
372

Relevant Lines:
579

💛  - Coveralls

Pull Request Test Coverage Report for Build de8cd9d08ad1e9971b5cc30a20b6603bf010685b-PR-31
Details

0 of 25 (0.0%)  changed or added relevant lines in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage decreased (-2.9%) to 64.249%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

lib/daisy_ui_components/loading.ex
0
25
0.0%

Totals

Change from base Build 4953c4e152480f90e7eb15699e6908353da1d9cc:
-2.9%

Covered Lines:
372

Relevant Lines:
579

💛  - Coveralls


Automatical download of Faceit and ESEA demos.

Is there a way to implement this?
It would also be fantastic to follow the "ELO" progress on faceit, and even display the ELO for the individual player

Should be pretty simple to get FaceIT ELO thx to their API (seems not totally public), here is a request example : https://api.faceit.com/api/nicknames/BuRner
Return a simple JSON to parse. API key not needed, at least for one request.
More infos here : https://www.reddit.com/r/GlobalOffensive/comments/53mwsd/check_your_faceit_elo_faceitstatscom/

will this ever be implemented

Well, its open since 2016....

A new major version has been released, closing the issue 🧹


CLI setup failing on windows 10

I'm submitting a ...
[ x ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ x ] question about how to use this project

Summary

Either I'm setting this up wrong, or there's a bug with the setup. Running through the CLI constantly fails to properly install for me on windows 10. I have tried in command prompt, powershell, and Bash (WSL) and each time I get the same error. I have also tried using "Run as admin" and still fails.

Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

Errors:

Main error is a renaming operation;
15921 silly saveTree | `--<EMAIL_ADDRESS>15921 silly saveTree `--<EMAIL_ADDRESS>15922 verbose stack Error: EPERM: operation not permitted, rename 'X:\dev\.misc\test-ts\node_modules\.staging\nyc-f51733ed\node_modules\snapdragon' -> 'X:\dev\.misc\test-ts\node_modules\.staging\snapdragon-5e10080e'
15923 verbose cwd X:\dev\.misc\test-ts
15924 verbose Windows_NT 10.0.17134
15925 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xander\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
15926 verbose node v10.7.0
15927 verbose npm  v6.1.0
15928 error path X:\dev\.misc\test-ts\node_modules\.staging\nyc-f51733ed\node_modules\snapdragon
15929 error code EPERM
15930 error errno -4048
15931 error syscall rename
15932 error Error: EPERM: operation not permitted, rename 'X:\dev\.misc\test-ts\node_modules\.staging\nyc-f51733ed\node_modules\snapdragon' -> 'X:\dev\.misc\test-ts\node_modules\.staging\snapdragon-5e10080e'
15932 error  { [Error: EPERM: operation not permitted, rename 'X:\dev\.misc\test-ts\node_modules\.staging\nyc-f51733ed\node_modules\snapdragon' -> 'X:\dev\.misc\test-ts\node_modules\.staging\snapdragon-5e10080e']
15932 error   cause:
15932 error    { Error: EPERM: operation not permitted, rename 'X:\dev\.misc\test-ts\node_modules\.staging\nyc-f51733ed\node_modules\snapdragon' -> 'X:\dev\.misc\test-ts\node_modules\.staging\snapdragon-5e10080e'
15932 error      errno: -4048,
15932 error      code: 'EPERM',
15932 error      syscall: 'rename',
15932 error      path:
15932 error       'X:\\dev\\.misc\\test-ts\\node_modules\\.staging\\nyc-f51733ed\\node_modules\\snapdragon',
15932 error      dest:
15932 error       'X:\\dev\\.misc\\test-ts\\node_modules\\.staging\\snapdragon-5e10080e' },
15932 error   stack:
15932 error    'Error: EPERM: operation not permitted, rename \'X:\\dev\\.misc\\test-ts\\node_modules\\.staging\\nyc-f51733ed\\node_modules\\snapdragon\' -> \'X:\\dev\\.misc\\test-ts\\node_modules\\.staging\\snapdragon-5e10080e\'',
15932 error   errno: -4048,
15932 error   code: 'EPERM',
15932 error   syscall: 'rename',
15932 error   path:
15932 error    'X:\\dev\\.misc\\test-ts\\node_modules\\.staging\\nyc-f51733ed\\node_modules\\snapdragon',
15932 error   dest:
15932 error    'X:\\dev\\.misc\\test-ts\\node_modules\\.staging\\snapdragon-5e10080e',
15932 error   parent: 'test-ts' }
15933 error The operation was rejected by your operating system.
15933 error It's possible that the file was already in use (by a text editor or antivirus),
15933 error or that you lack permissions to access it.
15933 error
15933 error If you believe this might be a permissions issue, please double-check the
15933 error permissions of the file and its containing directories, or try running
15933 error the command again as root/Administrator (though this is not recommended).
15934 verbose exit [ -4048, true ]

Don't develop on exFAT formatted drives. Lots of stuff doesn't work properly apparently.
This issue is likely unrelated to this project.


Row of stuck pixels with scaling of 1.33333

Already reported ? *

[X] I have searched the existing open and closed issues.

Regression?
No
System Info and Version
 System/Version info
Hyprland 0.45.2 built from branch  at commit 12f9a0d0b93f691d4d9923716557154d74777b0a  ([gha] Nix: update inputs).
Date: Tue Nov 19 21:47:18 2024
Tag: v0.45.2, commits: 5451
built against aquamarine 0.4.2

flags set:
debug

System Information:
System name: Linux
Node name: nebula
Release: 6.12.1-gentoo-dist
Version: #1 SMP PREEMPT_DYNAMIC Thu Dec  5 14:20:50 -00 2024

GPU information:
2f:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 31 [Radeon RX 7900 XT/7900 XTX/7900M] [1002:744c] (rev c8) (prog-if 00 [VGA controller])

os-release: NAME=Gentoo
ID=gentoo
PRETTY_NAME="Gentoo Linux"
ANSI_COLOR="1;32"
HOME_URL="https://www.gentoo.org/"
SUPPORT_URL="https://www.gentoo.org/support/"
BUG_REPORT_URL="https://bugs.gentoo.org/"
VERSION_ID="2.17"

plugins:

======Config-Start======

Config File: /home/roger/.config/hypr/hyprland.conf: Read Succeeded
# This is an example Hyprland config file.
# Syntax is the same as in Hypr, but settings might differ.
#
# Refer to the wiki for more information.
source=~/.config/hypr/monitors.conf
source=~/.config/hypr/binds-common.conf
source=~/.config/hypr/binds-normal.conf

submap=gaming
source=~/.config/hypr/binds-common.conf
submap=reset

source=~/.config/hypr/input.conf

general {
    gaps_in=5
    gaps_out=10
    border_size=2
    col.active_border=0xFFAB47BC
    col.inactive_border=0xFF585858
}

decoration {
    rounding=10
    no_blur_on_oversized=0
    active_opacity=0.9
    inactive_opacity=0.7
    fullscreen_opacity=1

    shadow {
        enabled = 1
        range=15
        render_power=2
        color=0xE6AB47BC
        # color_inactive=0xFF585858
        color_inactive=0xE6212121
    }

    blur {
        # Your blur "amount" is blur_size * blur_passes, but high blur_size (over around 5-ish) will produce artifacts.
        # if you want heavy blur, you need to up the blur_passes.
        # the more passes, the more you can up the blur_size without noticing artifacts.
        size=2 # minimum 1
        passes=3 # minimum 1, more passes = more resource intensive.
        # Would be nice but due to mysterious circumstances hyprland keeps showing
        # the default wallpaper instead of mine on transparent windows :(
        new_optimizations=1
    }
}

xwayland {
	force_zero_scaling = true
}
bezier=test,0.2,1,0.6,1

animations {
    enabled=1
    animation=windows,1,7,default,slide
    animation=border,1,10,default
    animation=fade,1,10,default
    animation=workspaces,1,8,default
    animation=specialWorkspace,1,5,default,slidevert
}

dwindle {
    pseudotile=1 # enable pseudotiling on dwindle
    force_split=2 # always split to right/bottom
    split_width_multiplier=1.3
    preserve_split=0
}

misc {
    disable_hyprland_logo=1
    enable_swallow=false
    swallow_regex=org.wezfurlong.wezterm
    #animate_manual_resizes=1
}

binds {
    movefocus_cycles_fullscreen=0
}

source=~/.config/hypr/windowrule.conf

# env=QT_QPA_PLATFORM,wayland
env=ELECTRON_OZONE_PLATFORM_HINT,wayland
env=MOZ_ENABLE_WAYLAND,1
env=XCURSOR_SIZE,20
#env=XCURSOR_THEME,Notwaita-Black
# env=XCURSOR_THEME,Adwaita
exec-once=hyprctl setcursor Bibata-Modern-Amber 20

source=~/.config/hypr/autostart.conf

workspace=special:qalc,gapsout:100
workspace=special:spotify,gapsout:100

Config File: /home/roger/.config/hypr/monitors.conf: Read Succeeded
monitor=DP-1,3440x1440@120,auto,1.33333
monitor=DP-2,2560x1440@120,auto-left,1.33333

workspace=1,monitor:DP-1,default:true
workspace=2,monitor:DP-1
workspace=3,monitor:DP-1
workspace=4,monitor:DP-1
workspace=5,monitor:DP-1
workspace=6,monitor:DP-1
workspace=7,monitor:DP-1
workspace=8,monitor:DP-1
workspace=9,monitor:DP-1
workspace=10,monitor:DP-1

workspace=11,monitor:DP-2,default:true
workspace=12,monitor:DP-2
workspace=13,monitor:DP-2
workspace=14,monitor:DP-2
workspace=15,monitor:DP-2
workspace=16,monitor:DP-2
workspace=17,monitor:DP-2
workspace=18,monitor:DP-2
workspace=19,monitor:DP-2
workspace=20,monitor:DP-2

bind=SUPER,1,workspace,1
bind=SUPER,2,workspace,2
bind=SUPER,3,workspace,3
bind=SUPER,4,workspace,4
bind=SUPER,5,workspace,5
bind=SUPER,6,workspace,6
bind=SUPER,7,workspace,7
bind=SUPER,8,workspace,8
bind=SUPER,9,workspace,9
bind=SUPER,0,workspace,10

bind=SUPERSHIFT,1,movetoworkspacesilent,1
bind=SUPERSHIFT,2,movetoworkspacesilent,2
bind=SUPERSHIFT,3,movetoworkspacesilent,3
bind=SUPERSHIFT,4,movetoworkspacesilent,4
bind=SUPERSHIFT,5,movetoworkspacesilent,5
bind=SUPERSHIFT,6,movetoworkspacesilent,6
bind=SUPERSHIFT,7,movetoworkspacesilent,7
bind=SUPERSHIFT,8,movetoworkspacesilent,8
bind=SUPERSHIFT,9,movetoworkspacesilent,9
bind=SUPERSHIFT,0,movetoworkspacesilent,10

bind=SUPERCTRL,1,workspace,11
bind=SUPERCTRL,2,workspace,12
bind=SUPERCTRL,3,workspace,13
bind=SUPERCTRL,4,workspace,14
bind=SUPERCTRL,5,workspace,15
bind=SUPERCTRL,6,workspace,16
bind=SUPERCTRL,7,workspace,17
bind=SUPERCTRL,8,workspace,18
bind=SUPERCTRL,9,workspace,19
bind=SUPERCTRL,0,workspace,20

bind=SUPERCTRLSHIFT,1,movetoworkspacesilent,11
bind=SUPERCTRLSHIFT,2,movetoworkspacesilent,12
bind=SUPERCTRLSHIFT,3,movetoworkspacesilent,13
bind=SUPERCTRLSHIFT,4,movetoworkspacesilent,14
bind=SUPERCTRLSHIFT,5,movetoworkspacesilent,15
bind=SUPERCTRLSHIFT,6,movetoworkspacesilent,16
bind=SUPERCTRLSHIFT,7,movetoworkspacesilent,17
bind=SUPERCTRLSHIFT,8,movetoworkspacesilent,18
bind=SUPERCTRLSHIFT,9,movetoworkspacesilent,19
bind=SUPERCTRLSHIFT,0,movetoworkspacesilent,20

Config File: /home/roger/.config/hypr/binds-common.conf: Read Succeeded
bind=SUPER,F5,exec,playerctl -p spotify previous
bind=SUPER,F6,exec,playerctl -p spotify play-pause
bind=SUPER,F7,exec,playerctl -p spotify next
bind=,XF86AudioPrev,exec,playerctl -p spotify previous
bind=,XF86AudioPlay,exec,playerctl -p spotify play-pause
bind=,XF86AudioNext,exec,playerctl -p spotify next

bind=SUPER,w,exec,wp fallback
bind=SUPER,F9,exec,wp previous
bind=SUPER,F10,exec,wp-toggle
bind=SUPER,F11,exec,wp next

#bind=SUPER,XF86AudioMute,pass,discord

bind=,Print,exec,grim -g "$(slurp -o)" - | wl-copy
bind=SHIFT,Print,exec,grim -g "$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | "\(.x),\(.y) \(.width)x\(.height)"')" - | wl-copy
bind=SUPER,Print,exec,grim -g "$(hyprctl activewindow -j | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')" - | wl-copy

bind=SUPER,XF86AudioMute,togglespecialworkspace,spotify
bind=ALT,XF86AudioMute,togglespecialworkspace,spotify

bind=ALT,F9,pass,com.obsproject.Studio
bind=ALT,F10,pass,com.obsproject.Studio
bind=SUPER,F10,pass,com.obsproject.Studio

# bind=SUPER,G,exec,gamemode toggle

bind=SUPER,x,exec,wtype -P XF86Cut
bind=SUPER,c,exec,wtype -P XF86Copy
bind=SUPER,v,exec,wtype -P XF86Paste

bind=,XF86MonBrightnessDown,exec,brightnessctl -e set 2%-
bind=,XF86MonBrightnessUp,exec,brightnessctl -e set +2%
bind=,XF86AudioRaiseVolume,exec,wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bind=,XF86AudioLowerVolume,exec,wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bind=,XF86AudioMute,exec,wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bind=,XF86AudioMicMute,exec,wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle

Config File: /home/roger/.config/hypr/binds-normal.conf: Read Succeeded
bindm=SUPER,mouse:272,movewindow
bindm=SUPER,mouse:273,resizewindow

#bind=,XF86Calculator,exec,hypa-unique-window "wezterm start --class qalc -- qalc" "qalc"
bind=,XF86Calculator,togglespecialworkspace,qalc

bind=SUPER,P,exec,togglesinks

bind=SUPER,R,exec,kitty --class lf -- lf
bind=SUPER,T,exec,kitty --class top -- btop
# bind=SUPER,P,exec,kitty --class pulsemixer -- pulsemixer
bind=SUPER,D,exec,sh -c "$(tofi-drun --terminal foot --drun-launch false)"
bind=SUPER,RETURN,exec,kitty
bind=SUPER,S,exec,power-menu

bind=SUPER,Q,killactive,
bind=SUPERSHIFT,E,exit,
bind=SUPER,V,togglefloating,
bind=SUPER,F,fullscreen,1
bind=SUPERSHIFT,F,fullscreen,0
bind=SUPERSHIFT,P,pseudo,

bind=SUPER,h,movefocus,l
bind=SUPER,l,movefocus,r
bind=SUPER,k,movefocus,u
bind=SUPER,j,movefocus,d

bind=SUPERSHIFT,H,movewindow,l
bind=SUPERSHIFT,L,movewindow,r
bind=SUPERSHIFT,K,movewindow,u
bind=SUPERSHIFT,J,movewindow,d

# bind=SUPERSHIFT,l,movecurrentworkspacetomonitor,r
# bind=SUPERSHIFT,h,movecurrentworkspacetomonitor,l

Config File: /home/roger/.config/hypr/binds-common.conf: Read Succeeded
bind=SUPER,F5,exec,playerctl -p spotify previous
bind=SUPER,F6,exec,playerctl -p spotify play-pause
bind=SUPER,F7,exec,playerctl -p spotify next
bind=,XF86AudioPrev,exec,playerctl -p spotify previous
bind=,XF86AudioPlay,exec,playerctl -p spotify play-pause
bind=,XF86AudioNext,exec,playerctl -p spotify next

bind=SUPER,w,exec,wp fallback
bind=SUPER,F9,exec,wp previous
bind=SUPER,F10,exec,wp-toggle
bind=SUPER,F11,exec,wp next

#bind=SUPER,XF86AudioMute,pass,discord

bind=,Print,exec,grim -g "$(slurp -o)" - | wl-copy
bind=SHIFT,Print,exec,grim -g "$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | "\(.x),\(.y) \(.width)x\(.height)"')" - | wl-copy
bind=SUPER,Print,exec,grim -g "$(hyprctl activewindow -j | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')" - | wl-copy

bind=SUPER,XF86AudioMute,togglespecialworkspace,spotify
bind=ALT,XF86AudioMute,togglespecialworkspace,spotify

bind=ALT,F9,pass,com.obsproject.Studio
bind=ALT,F10,pass,com.obsproject.Studio
bind=SUPER,F10,pass,com.obsproject.Studio

# bind=SUPER,G,exec,gamemode toggle

bind=SUPER,x,exec,wtype -P XF86Cut
bind=SUPER,c,exec,wtype -P XF86Copy
bind=SUPER,v,exec,wtype -P XF86Paste

bind=,XF86MonBrightnessDown,exec,brightnessctl -e set 2%-
bind=,XF86MonBrightnessUp,exec,brightnessctl -e set +2%
bind=,XF86AudioRaiseVolume,exec,wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bind=,XF86AudioLowerVolume,exec,wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bind=,XF86AudioMute,exec,wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bind=,XF86AudioMicMute,exec,wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle

Config File: /home/roger/.config/hypr/input.conf: Read Succeeded
input {
    kb_layout=eu
    kb_variant=
    kb_model=
    kb_options=
    kb_rules=

    numlock_by_default=1
    follow_mouse=1
}

Config File: /home/roger/.config/hypr/windowrule.conf: Read Succeeded
# example window rules
# for windows named/classed as abc and xyz
#windowrule=move 69 420,abc
#windowrule=size 420 69,abc
#windowrule=tile,xyz
#windowrule=float,abc
#windowrule=pseudo,abc
#windowrule=monitor 0,xyz

#windowrule=tile,Spotify
#windowrule=workspace 10 silent,Spotify
windowrule=workspace special:spotify silent,Spotify

windowrule=workspace 2 silent,(.*)steam(.*)
windowrule=workspace 2 silent,(.*)Steam(.*)
windowrule=float,title:Steam Guard - Computer Authorization Required

windowrule=workspace special:qalc silent,qalc

windowrule=workspace 11 silent,discord
windowrule=workspace 11 silent,WebCord
windowrule=workspace 11 silent,vesktop

windowrule=opaque,^(steam_app_)(.*)
windowrule=opaque,(.*)(\.exe)$
windowrule=opaque,gamescope

windowrule=workspace 3,^(steam_app_)(.*)
windowrule=workspace 3,^(.*)(\.exe)$
windowrule=workspace 3,gamescope

windowrule=renderunfocused,^(steam_app_)(.*)
windowrule=renderunfocused,^(.*)(\.exe)$
windowrule=renderunfocused,gamescope

windowrule=opacity 1.0 override 0.8 override,emacs

windowrule=workspace 20 silent,com.obsproject.Studio

windowrule=float,xdg-desktop-portal-gtk
#windowrule=monitor 0,firefox
#windowrule=workspace 1,firefox

Config File: /home/roger/.config/hypr/autostart.conf: Read Succeeded
#exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_DATA_DIRS QT_QPA_PLATFORMTHEME
#exec-once=systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_DATA_DIRS HYPRLAND_INSTANCE_SIGNATURE QT_QPA_PLATFORMTHEME
exec-once=dbus-update-activation-environment --systemd XDG_DATA_DIRS QT_QPA_PLATFORMTHEME
exec-once=systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_DATA_DIRS HYPRLAND_INSTANCE_SIGNATURE QT_QPA_PLATFORMTHEME
exec-once=systemctl --user start hyprland-session.target
exec-once=import-gsettings
#exec-once=/usr/lib/polkit-kde-authentication-agent-1

exec-once=vesktop-bin
exec-once=firefox
exec-once=steam -forcedesktopscaling 1.3
exec-once=flatpak run com.spotify.Client
# exec-once=sleep 5 && QT_QPA_PLATFORMTHEME=qt6ct obs --startreplaybuffer
exec-once=sleep 5 && QT_QPA_PLATFORMTHEME=qt6ct obs
exec-once=openrgb --noautoconnect -m Direct -c FF0000

# Should be done in wireplumber/pipewire but it broken
exec-once=sleep 5 && pw-link alsa_input.usb-Focusrite_Scarlett_2i2_USB-00.pro-input-0:capture_AUX0 capture.Focusrite_Mic:playback_FL
exec-once=sleep 5 && pw-link alsa_input.usb-Focusrite_Scarlett_2i2_USB-00.pro-input-0:capture_AUX0 capture.Focusrite_Mic:playback_FR

exec-once=waybar
exec-once=foot -a qalc -- qalc

======Config-End========

Description
I have a row of stuck pixels on my bottom and right side of my monitor (3440x1440 and 2560x1440 and scaling of 1.33333). The pixels will take on the color of my border/shadows and keep it until I display something else in the region. Toggling fullscreen for example makes the color go away, but as soon as I tile the window again the shadow touches the region and the pixels keep the shadow color.
Maybe related but waybar is one pixel short from covering the entire length.
Selected not a regression but I only started using scaling now so it could be one.
How to reproduce
Take a window and drag it over the screen edge. The border color will overwrite the until something else gets displayed.
Crash reports, logs, images, videos

can you check an older version just to make sure?

Found out you need to have hyprpaper running for the bug to appear. Went back to v0.38.0 and couldn't reproduce it at first. Next commit was f2dc48d92f340efe6d4264b92d38378c18a3e1ea (shortly after v0.41.2) and found the bug but couldn't reproduce it reliably, so v0.38 could have it as well and I just didn't see it.
This time just dragging a window over the area didn't work, but moving windows around would sometimes cause the bug to appear around the resize animations.

Tried hyprpaper git without hyprgraphics commits and --no-fractional and still had the bug.
I also saw it on my laptop's 1920x1080 and 1.2 scaling display yesterday, but couldn't reproduce it as easily as on my desktop.

After some more testing it turned out to be a regression after all. Commit 6967a31450441fc5605c05db6f65505dace4b263 introduces the behavior. Interestingly, before that commit I also don't get the one pixel gap in waybar.
I also believe my previous comment about seeing it on my laptop is wrong. I probably just forgot I was streaming from my PC and saw the issue there.

Happens for me at 1.566 scaling, but not at 1.25 scaling on nixos 24.11.

On a larger display (4k, 1.33 scaling) it takes up a much more substance part of the screen (using a window gap of 8 for reference):

I have found out that the issue only appears the first time the monitor is set up. Changing the scaling to 1 and back to 1.33333 fixes it.


Renamed bridgerelayer project to relay

This allows for clearer terminology:

Each chain has a bridge module
Cross-chain messages are relayed between bridge modules using the relay.

Obsolete in favour of #106


Select tag value

Is there any way to set the value of a select tag from the tag its self rather than setting selected on the child option tags?
I would like to be able to write:
el("select#kittens", {selected: "two"},
   [el("option", {value: "one"}, "one"),
    el("option", {value: "two"}, "two"),
    el("option", {value: "three"}, "three")])

Rather than:
el("select#kittens",
   [el("option", {value: "one"}, "one"),
    el("option", {value: "two", selected: true}, "two"),
    el("option", {value: "three"}, "three")])

If this is not possible currently is it a feature that you would consider adding to the domvm?

@logaan you could write a hook to do that https://jsfiddle.net/iamjohnlong/y89L60o5/ or write a custom select "component"

@logaan the DOM is a cruel mistress and doesnt always provide the most logical way to do stuff.
as @iamjohnlong suggests, the way to do this is with vnode-level will/didInsert lifecycle hooks attached through the attrs object: https://jsfiddle.net/tn41ka9L/
you can also use the view-level will/didMount hooks if you choose to componentize this sort of thing: https://jsfiddle.net/vvdsx5d1/

closing, but feel free to discuss further if needed

Mithril will has a special case to handle this [1] - I think it is worth the developer convenience to support this in domvm. Thoughts @leeoniya ?
[1] https://github.com/MithrilJS/mithril.js/blob/ae27c0ff183da5c36c9bf0052567d9c2b8ae464c/render/render.js#L123

I think it looks useful; I've always thought that the absence of a "value" attribute on select, flagging instead the option is counter-intuitive and an obvious blunder. Of course it will probably make me add value="..." to <select ...> when working with normal HTML, but, oh well.

i was hoping this would suffice, and it mostly does, except for initial mount 😠: https://jsfiddle.net/740b3ja3/
i agree with @lawrence-dol that it'd be most logical with value. however, it would be a feature that'd be difficult to discover because HTML Doesn't Work Like That ™.
given that <option>s cannot contain complex elements or even attributes other than value/selected, i'm tempted not to add anything and just have people use a helper function. it's not all that scary and doesnt impose a penalty across the whole lib:
el("select#kittens", opts([
  el("option", {value: "one"}, "one"),
  el("option", {value: "two"}, "two"),
  el("option", {value: "three"}, "three")
], "two"))

autofocus is another one that could use special handling...and to mimic html would only need to work on initial root mount and not any view mount afterwards, though the latter may be more useful.

it would be a feature that'd be difficult to discover because HTML Doesn't Work Like That ™.

Eh, I doubt most people are coming to domvm from vanilla HTML/JS/DOM. Most people are likely coming to domvm after trying React or Mithril. Given that both of these frameworks support this convenience, this is more the expectation of a commonly used element that leads someone to believe something is broken with domvm rather than it being an obscure "difficult to discover" feature.

Eh, I doubt most people are coming to domvm from vanilla HTML/JS/DOM.

most likely come from jQuery since there are many more of them than the rest combined. this is part of the reason that the lib focuses on distributing a pre-built single file, staying small, tooling-free and as easy to get started with as jQuery.
i expect domvm's more sophisticated audience to be able to discern JSX-isms (className="..."), React-isms (synthetic camelcase events) and Mithril-isms (withAttr, etc.) from vanilla HTML/JS/DOM. i'm not particularly keen on imitating features from those by adding non-standard special cases unless the value is sufficiently high and does not introduce a perf overhead or add a bunch of extra internal machinery.
to implement this in domvm, i'd need to add handling in at least the hot preProcBody() and either mutate the attrs object of the parent to ensure it doesnt actually set a selected or value attrs on the select or add a bypass check to all the hot attrs loops. if the API was something closer to the more-explicit ivi, eg h.select().attrs().children(), then it would be easier to do without affecting perf lib-wide.
the value-added here isn't worth it IMO vs having a very simple helper.


Improve CMake configuration

Improves UX when trying to build this application.

Tell CMake to require C++11 and not just enable it if available
Use custom target to manage resource compilation
Properly include Blackmagic SDK stuff, and show an error message in case it can't be found

Introduces -DBLACKMAGIC_SDK_DIR=... option to allow users to specify the directory during the configuration step

TODO: search for library dependencies using CMake facilities, and show error message if one or more of them are missing.
By the way, it's really bad style to build in-source (e.g., cmake .). Better tell people to perform out-of-source builds (mkdir build && cd build && cmake .. -DBLACKMAGIC_SDK_DIR=... && make -j$(nproc)).

Updated the PR with the new instructions, and also resolved the TODO mentioned above. Can be merged now.


Replace "0ffice" with "Office"

@nenonix @JohanFreelancer9 Copy editing is needed for this PR. Thanks.

@LanaChin Changes look correct. Could you please review and merge? Thanks!