Refactor Sockets API

See #4277 (issue-comment) for the initial idea.
There are quite a few errors in the API design related to sockets:
TCPServer inherits from TCPSocket which is conceptually true, but TCPSocket is a Socket which inherits from IO - yet a server cannot be used as an IO. The same is true for UNIXServer.
UDPSocket also inherits from Socket and IO, yet cannot be used as an IO either since UDP communication does not work as a stream.
IPSocket as parent of UDPSocket and TCPSocket defines accessors local_address and remote_address, yet TCPServer does not have single remote address. Neither does a UDPSocket in listening mode.
While it's not such a big issue, I would also suggest to put all these types in the Socket namespace. These socket types are the only non-basic types in the global name space. And large parts of the API are already in the Socket namespace. TCPSocket -> Socket::TCP, TCPServer -> Socket::Server::TCP (or Socket::TCPServer) etc. I will use namespaced types from now on but that should not influence the logical considerations.
TCP and UDP sockets should be an IO because they are essentially streaming interfaces. The basic Socket however should not be an IO because Socket::UDP cannot be used as an IO. This would call for an intermediary class Socket::IO as parent for Socket::TCP and Socket::UDP which inherits from IO.

Socket

Socket::UDP
Socket::IO < IO

Socket::TCP
Socket::UNIX

I'm not entirely sure about Socket as a base type. It needs to be a module because IO is a class, but I don't know if it has any useful functionality common to streaming and non-streaming sockets. It's main purpose is to give access to lower level socket functions.
I'm also not sure we need IPSocket at all, it adds very little.
The server sockets can't inherit from Socket::TCP and Socket::UNIX so they're don't need to be related. It could be considered having a module which can be included by both, but I don't think there is much commonality, at least not for the public API.

Socket::Server

Socket::Server::TCP
Socket::Server::UNIX

May be related: https://github.com/crystal-lang/crystal/issues/4317#issuecomment-295789662

@bew yeah, this assumes UNIX sockets are only used as streams.

Additionally, I would suggest that all sockets and servers can be created using appropriate Socket::IPAddress or Socket::UNIXAddress as constructor parameters.
Maybe these could also be renamed to Socket::Address::IP and Socket::Address::UNIX to clean up the namespace and follow the same naming as for sockets and servers.
Socket and Socket::Server could have as static method .new which receives a Socket::Address and creates the specific type based on the address type. A nice addition would be a parser for Socket::Address which receives a string and creates the appropriate type based on whether it contains a host + port or a unix path.
This would make it very easy to use a simple string as a config setting for users to transparently choose either a UNIX or TCP connection type (see also #2735 (issue-comment)).

I can hear the conceptual requirement that TCPServer and UNIXServer shouldn't eventually inherit from IO, and it's maybe possible to achieve. I'll welcome a solution that doesn't merely wrap a TCPSocket and delegates some selected methods, but let's stay focused on this single problem.
Honestly, introducing many namespaces only introduces complicity for it's own sake and doesn't solve anything. For example Socket::Server::TCP spells hideously when compared to TCPServer —the OpenSSL namespaces are a perfect example of how hideous and user unfriendly it can lead to (you can't remember proper names without looking at documentation).
Last but not least, the TCPServer or UNIXSocket classes are simple abstractions for very common usages (e.g. start a TCP server, connect to an UNIX socket, send/receive a message over UDP). Uncommon usages must use Socket directly. For example UNIX DGRAM sockets are so uncommon we only have one single reported use case (wpa_supplicant): we musn't bother about it (use Socket).

Listing problems is fine, but detailing what's accessible to each level (general / TCP / UDP and UNIX sockets and servers) would be even better, especially since the underlying system implementation just mixes everything —so Socket should be capable to intermix everything, even being an IO, because of advanced usages, such as Bluetooth or RAW sockets.
That would really help to map what should be accessible, what shouldn't, and so on, and decide whether such a refactor makes sense, or if it would inexorably leads to a horrible implementation.

Right now working on Bluetooth socket , its a hacky ride because of current implementation.
I would love to somehow remove the AF settings from an enum

The only solution to avoid convoluted APIs is to separate the low-level API currently provided by Socket from the more specific implementations. The low-level API needs to be able to provide access to everything you can possibly do. But TCPSocket needs no methods for sending and receiving datagrams for example.
Implementationwise, this could be achieved by wrapping the low-level API in the higher-level classes, though that would not be particularly great. Another approach could be non-public modules that provide the required functionality. But I guess that's gonna cause some issues, just thinking about API docs. Alternatively, we could have a very basic, internal API similar to the APIs in the Crystal::System namespace which is used by both the low-level and high-level types.
I'll try to sketch the basics of each type, leaving out any detailed configuration settings to get a more clear overview:
(we could probably have a module Socket::TCPSettings and include it in Socket::TCP and Socket::Server::TCP to apply tcp settings for both server and client sockets)
abstract class Socket::IO < IO::Syscall
  getter file_descriptor : Int32

  def self.open(*args, **kwargs, &block : self ->) # individual implementations in subclasses
end

class Socket::TCP < Socket::IO
  getter local_address : Socket::Address::IP
  getter remote_address : Socket::Address::IP

  def self.new(address : IPAddress, local_address : IPAddress = nil)
  def self.new(host : String, port : Int32)
end

class Socket::UNIX < Socket::IO
  getter remote_address : Socket::Address::UNIX?

  def self.pair : {self, self}
end

class Socket::UDP
  property? broadcast : Bool
  getter remote_address : Socket::Address:IP?
  getter local_address : Socket::Address:IP?

  def self.new
  def self.new(address : IPAddress)

  def file_descriptor : Int32

  def connect(address : IPAddress)
  def connect(host : String, port : Int32)
  def connected?
  def disconnect

  def bind(address : Socket::Address::IP)
  def bound? : Bool
  def close

  def send(message, address : Socket::Address::IP? = nil)
  def receive(message : Bytes), {Int32, Socket::Address::IP}
end

And the servers:
abstract class Socket::Server
  getter local_address : Socket::Address

  def accept(&block : Socket::IO ->)
  def accept?(&block : Socket::IO ->)
  def accept? : Socket::IO?

  def close
end

class Socket::Server::TCP < Socket::Server
  getter file_descriptor : Int32
  getter local_address : Socket::Address:IP

  def self.new(address : Socket::Address::IP, backlog = nil, reuse_port = false)
  def self.new(host : String, port : Int32, backlog = nil, reuse_port = false)
  def self.new(port : Int32, backlog = nil, reuse_port = false)
end

class Socket::Server::UNIX < Socket::Server
  getter file_descriptor : Int32
  getter local_address : Socket::Address:UNIX

  def self.new(address : Socket::Address::UNIX, backlog = nil)
  def self.new(path : String, backlog= nil)

  def close(delete = true)
end
```


Composite Keys

When at scale, Spanner docs often suggest using composite keys for the primary key, for example using a ShardId combined with the other columns, something like PRIMARY KEY (ShardId, Id)
Is there already a proper way to do this using this driver? And to handle things like many-to-many relationships with composite primary keys etc?
I see there is an existing library for composite keys in Eloquent in general, https://github.com/thiagoprz/eloquent-composite-key - is that compatible with this driver perhaps?

Is there already a proper way to do this using this driver?

No, you will have to add the constraints manually.

I see there is an existing library for composite keys in Eloquent in general, https://github.com/thiagoprz/eloquent-composite-key - is that compatible with this driver perhaps?

You can try, but I don't think that trait covers complex cases like relations.

But when using the library https://github.com/thiagoprz/eloquent-composite-key, it identifies string or array as primary key

That is not aligned with how laravel does things and may result in errors where string is expected to return from$model->getKey() so it may make upgrading to newer versions hard and painful.

For complex relationships we use https://github.com/tylernathanreed/laravel-composite-relations.

This overrides a lot of the logic from the base framework and that's quite risky when upgrading the underlying framework.


TypeError: undefined is not a function (evaluating '$('p#callback')')

TypeError: undefined is not a function (evaluating '$('p#callback')')
Js:

Can you see what's the problem??

Your calling jQuery without loading it.
Please ask support questions on StackOverflow this forum is for reporting bugs.


Add RotatingFileHandler

https://docs.python.org/3/library/logging.handlers.html#rotatingfilehandler

Codecov Report

Merging #31 (e03e00f) into main (121199d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #31   +/-   ##
=======================================
  Coverage   78.82%   78.82%
=======================================
  Files           8        8
  Lines        1091     1091
=======================================
  Hits          860      860
  Misses        231      231

Continue to review full report at Codecov.

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

Thanks for the PR!


Hash commands API

The only missing command is HSCAN which I intentionally decided not to implement because I'm still not sure about what's the best design. Maybe it'd be better at the Stream level.

Codecov Report

Merging #2 into master will not change coverage.
The diff coverage is 0%.

@@         Coverage Diff          @@
##           master    #2   +/-   ##
====================================
  Coverage       0%    0%
====================================
  Files          18    19    +1
  Lines         272   333   +61
  Branches        1     1
====================================
- Misses        272   333   +61

Impacted Files
Coverage Δ

...m/github/gvolpe/fs2redis/Fs2RedisStringsDemo.scala
0% <ø> (ø)

.../github/gvolpe/fs2redis/interpreter/Fs2Redis.scala
0% <0%> (ø)
:arrow_up:

.../com/github/gvolpe/fs2redis/Fs2RedisHashDemo.scala
0% <0%> (ø)

Continue to review full report at Codecov.

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


Please include SKU availability timelines per region

We can avoid customer churn if we publish per-region timelines for v2 SKUs' availability.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: bf4e86ea-4194-da83-ac43-56a7316b9367
Version Independent ID: f7659a05-0441-e060-40cb-e2ddfc6cad8b
Content: What's new in Azure Application Gateway
Content Source: articles/application-gateway/whats-new.md
Service: application-gateway
GitHub Login: @vhorne
Microsoft Alias: victorh

@aconkle Thanks for the feedback. We are actively investigating and will get back to you soon.

@aconkle I have assigned the issue to the content author to evaluate and update as appropriate.

Regional availability is documented here: https://docs.microsoft.com/en-us/azure/application-gateway/application-gateway-autoscaling-zone-redundant#supported-regions
We avoid making future statements and promises due to legal implications.
#please-close


Disentangle docsrs and features

Remaining cleanup from https://github.com/gtk-rs/gtk-rs-core/pull/1078

Now that the gir changes have landed, it would be great to also update & regenerate the sys crate.

Are you asking me to do it and add it to the PR? I see that you approved it already, so I am not sure

Are you asking me to do it and add it to the PR? I see that you approved it already, so I am not sure

Yes, please
Just make sure the update submodule commit is separate from the regeneration, as that would simplify backporting

Actually, I will do that along with more changes


does not work in nodejs with a worker with dependencies

I'm trying to use a worker comes from a separated file, the code seems like
import { readFileSync, writeFileSync } from 'fs';
import { join } from 'path';

import parseSDF from './parseSDF';

export default function processFile(filename) {
  let sdfText = readFileSync(filename, 'utf8');
  let results = parseSDF(sdfText);

  let hoses = [];
  for (let result of results) {
   hoses.push(result);
  }

  writeFileSync(filename.replace('.sdf', '.json'), JSON.stringify(hoses));
}

the code where I use ework seems like
import { Ework } from 'ework';
import workerFunction from 'worker_path';

async function fun() {
  let files = readdirSync(join(__dirname, '../output')).filter((file) =>
    file.match(/sdf$/),
  );
  const workers = new Ework(processFile);
  const result = await workers.execute(join(__dirname, '../output', files[0]));
}

fun();

but when I try to execute a worker it throw an error that 'readFileSync' is not defined.
am I doing something wrong?

We do not maintain this project anymore.
I recommend to use piscina if you want this kind of functionality in Node.js: https://github.com/piscinajs/piscina


[looker] Refactor script

Make the script more readable, mostly by:

using the Product classes,
a little bit of renaming and documentation.

No version change as expected, merging.


some limit_dims to limit global merging

only supports merging dims in a way that does not surpass limit, no splitting yet

no process replay diff for the things we run in CI, i think we only hit it in unet3d. @francislata fyi let me know if you still have issue after this


[Bug report] Multi Camera Record is not working in Unity

Required Info

Camera Model
D415

Firmware Version
<IP_ADDRESS>

Operating System & Version
Win10

Platform
PC

SDK Version
2.31.0

Language
Unity / C#

Segment
ect.

Issue Description
I updated RealSense SDK 2.0 from 2.24.0 to 2.31.0. Unfortunately I can't record bag with 3 RealSense Cameras.
Just one RsDevice run, others not run...
Should I downgrade RealSense SDK 2.0?

<Test Scene Images, I added serial number in live mode>
ExternalException: rs2_pipeline_wait_for_frames(pipe:000001C90CA61680)
Rethrow as Exception: Frame didn't arrived within 5000
Intel.RealSense.ErrorMarshaler.MarshalNativeToManaged (System.IntPtr pNativeData) (at <cc4cf66ca4ac447089d4777657d39da9>:0)
Intel.RealSense.Pipeline.WaitForFrames (System.UInt32 timeout_ms) (at <cc4cf66ca4ac447089d4777657d39da9>:0)
RsDevice.WaitForFrames () (at Assets/RealSenseSDK2.0/Scripts/RsDevice.cs:159)
System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.Threading.ThreadHelper.ThreadStart () (at <567df3e0919241ba98db88bec4c6696f>:0)
UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs)
Intel.RealSense.NativeMethods:rs2_pipeline_wait_for_frames(IntPtr, UInt32, Object&)
Intel.RealSense.Pipeline:WaitForFrames(UInt32)
RsDevice:WaitForFrames() (at Assets/RealSenseSDK2.0/Scripts/RsDevice.cs:159)
System.Threading.ThreadHelper:ThreadStart()

ExternalException: rs2_pipeline_wait_for_frames(pipe:000001C9688DD0C0)
Rethrow as Exception: Frame didn't arrived within 5000
Intel.RealSense.ErrorMarshaler.MarshalNativeToManaged (System.IntPtr pNativeData) (at <cc4cf66ca4ac447089d4777657d39da9>:0)
Intel.RealSense.Pipeline.WaitForFrames (System.UInt32 timeout_ms) (at <cc4cf66ca4ac447089d4777657d39da9>:0)
RsDevice.WaitForFrames () (at Assets/RealSenseSDK2.0/Scripts/RsDevice.cs:159)
System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.Threading.ThreadHelper.ThreadStart () (at <567df3e0919241ba98db88bec4c6696f>:0)
UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs)
Intel.RealSense.NativeMethods:rs2_pipeline_wait_for_frames(IntPtr, UInt32, Object&)
Intel.RealSense.Pipeline:WaitForFrames(UInt32)
RsDevice:WaitForFrames() (at Assets/RealSenseSDK2.0/Scripts/RsDevice.cs:159)
System.Threading.ThreadHelper:ThreadStart()

Please Modify RsConfiguration.cs in Unity Package!
This issue was found when I use RealSense SDK 2.0 ver 2.24.0...
            case Mode.Record:
                cfg.EnableDevice(RequestedSerialNumber);   // Add this!
                foreach (var p in Profiles)
                    cfg.EnableStream(p.Stream, p.StreamIndex, p.Width, p.Height, p.Format, p.Framerate);
                if (!String.IsNullOrEmpty(RecordPath))
                    cfg.EnableRecordToFile(RecordPath);
                break;

Hi,
Will you be needing further help with this? If we don’t hear from you in 7 days, this issue will be closed.
Thanks

I don't need help with this. I just want that someone fix this codes and commit.. Thanks.


PUB-1210 Remove Duplicate Results on Case Search Page

JIRA link
https://tools.hmcts.net/jira/browse/PUB-1210
Change description
When user tries to add subscription and search by the case name, if a same case exists in multiple artefacts, more than one results shown on the page. It should be show only one result.
Does this PR introduce a breaking change? (check one with "x")
[ ] Yes
[x] No

@junaidiqbalmoj  i think youve misunderstood this ticket. this is not a FE ticket, this is related to the subscriber flow, please see https://tools.hmcts.net/jira/browse/PUB-1210


Bug fixed: domainRegistry interface invocation

Hi @Heriam Do you want to merge your updates to master branch ?

Hi @jboulmal  I fixed the problem yesterday. It turns out that they changed the interface of domain registry, so we have to accordingly modify our code when we invoke the domain registry.

If you want to test you can fisrt update your domain registry and see if your msg node reports the same error like yesterday. And then update your msg node code with my update to see if my update fix the error. Thank you!

Then we need to update also develop branch, could also send pull request for that. currently I don't have time for testing.


Only show relative folder

Would be great if jshint only showed the path to the file from the gulpfile, like ./public/js/file.js instead of whole path /Users/Username/path/to/file/deep/on/disks/folders/file.js. Maybe it already does, but I couldn't see it in the options.

I can't reproduce this issue:
My file tree:
subfolder/
-- test.js

nicol@DESKTOP-EDGLMME MINGW64 ~/Documents/jshint (master)
$ bin/jshint subfolder/
subfolder\test.js: line 1, col 1, Unnecessary semicolon.

1 error

(I get subfolder\test.js)

I think this may likely depend on the reporter they're using, rather than jshint itself

I'm using jshint as part of gulp, and its the default reporter. I'll post
the gulp js file if that helps.
søn. 16. aug. 2015, 21.57 skrev ⭐caitp⭐<EMAIL_ADDRESS>
I think this may likely depend on the reporter they're using, rather than
jshint itself
—
Reply to this email directly or view it on GitHub
https://github.com/jshint/jshint/issues/2618#issuecomment-131615274.

I'm using jshint as part of gulp, and its the default reporter

that may not be the jshint reporter - https://github.com/spalger/gulp-jshint/blob/master/src/reporters/fail.js
You should raise this with gulp-jshint or let us know how to reproduce using jshint.


Unable to use the shell in Explorer with Safari

What kind of request is this (question/bug/enhancement/feature request): bug
Steps to reproduce (least amount of steps as possible):

Open the Cluster Explorer
Click on the shell button

Result:
The shell window opens but the connection will not established. In the bottom I see disconnected und nothing happens. The Developers console shows no network related errors.
With Chrome the shell opens and I have a connection to the cluster.
Environment information:
Rancher version (rancher/rancher/rancher/serverimage tag or shown bottom left in the UI): 2.5.3
Installation option (single install/HA): HA

What version of Safari?
Is the SSL cert trusted or did you have to add an exception?
Do "change events" work in the same browser?  (If you as/delete some resource while the list is up in another window, does it appear/disappear)
Does the Cluster Manager shell work in the same browser?
Safari has a long history of websockets being broken when combined with self-signed/requiring exception certs.  If that's the case there's not really anything we can do about.  But the Manager UI shows a big red warning for this when the change event connection fails; Explorer doesn't currently do anything to warn you.

What version of Safari?
Is the SSL cert trusted or did you have to add an exception?
Do "change events" work in the same browser?  (If you as/delete some resource while the list is up in another window, does it appear/disappear)
Does the Cluster Manager shell work in the same browser?
Safari has a long history of websockets being broken when combined with self-signed/requiring exception certs.  If that's the case there's not really anything we can do about.  But the Manager UI shows a big red warning for this when the change event connection fails; Explorer doesn't currently do anything to warn you.


Scenario extents representation

I understood that we would display the scenario extents as the boundary of the scenario and not a bounding box. @tieganh can you confirm if this is still the preferred approach?
The scenario extents are available in the API at: https://geo-api.riskprofiler.ca/collections/opendrr_shakemap_scenario_extents_v1.4.0/items?lang=en_US

thanks for providing those extents @jvanulde - i've added them now, looks great:

Thanks @phil-evans!


Singleton ApolloClient instance approach, potential issues?

Could this approach present any issues? In a previous project we had kind of the same set up with Next's page router, where we shared the same Apollo instance throughout the application without any issues.
Currently we are using NextJS 14 with the app router
'use client'

import { NormalizedCacheObject } from '@apollo/client'
import {
  ApolloClient,
  ApolloNextAppProvider,
  InMemoryCache
} from '@apollo/experimental-nextjs-app-support'
import { PropsWithChildren, ReactElement } from 'react'

import authLink from '~/service_providers/graphql/configuration/auth_link'
import splitLink from '~/service_providers/graphql/configuration/link'

const link = authLink.concat(splitLink)
const client = new ApolloClient<NormalizedCacheObject>({
  cache: new InMemoryCache(),
  link
})

export function makeClient (): ApolloClient<NormalizedCacheObject> {
  return client
}

export function ApolloWrapper ({ children }: PropsWithChildren): ReactElement {
  return (
    <ApolloNextAppProvider makeClient={makeClient}>
      {children}
    </ApolloNextAppProvider>
  )
}

My use case is that I need to use the same ApolloClient instance outside the context of React, more specifically, I have an FirebaseAuthenticationProvider class that has to validate the user against our graphql backend on log in, kind of a "handshake" that "this user indeed exists and is valid":
...
    try {
      if (!isNil(idToken) && isNil(userId)) {
        const { data } = await makeClient().query({
          query: currentUser
        })
        userId = data?.currentUser?.id
      }
    } catch (error: any) {
      return err(new UnexpectedError('Could not retrieve the id associated with the user\'s token'))
    }

    return ok(userId)

This class is retrieved through a function that will only instantiate the class IF there was a change in authentication state (e.g a user logged in), this ensures that the class will not "operate" on methods without a user, if the class is available, it means there is a user.
let authenticationProvider: AuthenticationProvider | null = null

export function setAuthenticationProvider (provider: AuthenticationProvider): void {
  authenticationProvider = provider
}

export async function getAuthenticationProvider (): AsyncResult<AuthenticationProvider, MissingDependencyError> {
  if (authenticationProvider === null) {
    await initializeFirebase()
    await tokenInitializedPromise
    setAuthenticationProvider(new FirebaseAuthenticationProvider())
  }

  return ok(authenticationProvider)
}

And is used on my authentication link like so:
const authLink = setContext(async (_, { headers }) => {
  const authProvider = await getAuthenticationProvider()

  let token

  if (authProvider.isOk()) {
    const tokenResult = await authProvider.value.getToken()
    if (tokenResult.isOk()) {
      token = tokenResult.value
    }
  }

  return {
    headers: {
      ...headers,
      authorization: !isNil(token) ? `Bearer ${token}` : ''
    },
    credentials: 'include'
  }
})

export default authLink

the method authProvider.getToken() does not have a backend request, that's why I'm able to call getToken without falling into a circular dependency of needing Apollo already set up in the auth provider for backend requests and the auth provider being needed for setting up Apollo.
The reason for needing the same instance throughout my application is so that once the authentication provider fetched a user from the backend, it can cache it and not hit the server every time I need to retrieve some user information again due to makeClient returning a different instance with a new cache.
Note: I imperatively clear the cache on user log out with .clearStore()
I assume this won't have problems with SSR either since the InMemoryCache from the experimental package acts a "enqueuer" of cache writes during SSR, and once we are in the client context, the cache is restored by executing those writes, unless I understood the RFC incorrectly: https://github.com/apollographql/apollo-client-nextjs/blob/pr/RFC-2/RFC.md#library-design-regarding-ssr
Also looking at the source code the ApolloNextAppProvider reuses the same client instance as a singleton too.
So far I haven't noticed any problems besides not being able to call makeClient() in server components like a layout, Next throws a webpack error:
app/profile/layout.tsx (8:25) @ makeClient
 ⨯ TypeError: (0 , _main_app_components_ApolloWrapper_ApolloWrapper__WEBPACK_IMPORTED_MODULE_2__.makeClient) is not a function
    at ProfileLayout (./app/profile/layout.tsx:16:109)
    at stringify (<anonymous>)
    at AsyncLocalStorage.run (node:async_hooks:338:14)
digest: "1887363878"

But just wanted confirmation if my assumption is correct and if there could be any other potential issues with this pattern (and potentially a hint towards fixing the webpack error :grimacing:)
Thanks!

Hey @ViktorShev 👋
We don't recommend you share the same instance between requests otherwise you risk leaking user data. If you're authenticating once outside of a request, only a single user could login to your app at a time (or at least one user per running server instance). Even if you managed to solve that issue, using a single instance of the client means that you would be merging multiple user's data into the same InMemoryCache instance and that could leak user data between users.
That makeClient prop exists for this reason. This package will create a new client per-request to prevent this issue. The client is the same instance however during the duration of the request. If you kick off multiple queries in the same request for example, you'll be using the same client/cache instance for each of those queries.
If you're trying to avoid making that authentication call to the remote service on every request, I'd recommend caching and storing that value outside Apollo Client with something like Redis or your own key/value store that can distinguish between users.

@jerelmiller Hey! thanks for the quick response.
I don't seem to be experiencing any of the issues you mention, I am still able to log in into my application with different users and interact with it in parallel, checking the cache of each browser instance they also don't seem to be leaking into each other:

Maybe I missed some details in my initial issue, would you like me to provide some more clarity on anything?

Ah I missed the idToken part of your initial description and went straight to the singleton instance of the authorization mechanism. So are probably fine here as long as your clients send those tokens to distinguish them. Ignore the part of my last message about only allowing a single user to login.
As for your screenshot, you're not going to see issues on records that have different cache IDs, like the user records themselves. Where you start to get issues with data leaking is when you're querying for records that have user-specific data attached to a shared entity.
As an example, let's say you have a schema like this:
type Query {
  post(id: ID!): Post
}

type Post {
  id: ID!
  canEdit: Boolean!
  contents: String!
}

where canEdit is dependent on whether or not the logged-in user authored the Post.
And let's say that when users visit a particular post, it issues the following query:
query($postId: ID!) {
  post(id: $postId) {
    id
    canEdit
    contents
  }
}

Now let's say the author of post 1 is the first to visit that post. It will be cached as such:
{
  ROOT_QUERY: {
    "post({\"id\":1})": { __ref: "Post:1" }
  },
  "Post:1": {
    id: 1,
    canEdit: true,
    contents: "Lorem ipsum",
  }
}

Now lets say another user logs in and visits the same post, which issues the same query. Because we can fulfill the data from the cache, this means that we return the cached data for that post. Oops, now we've just given that user the ability to edit that post.
Its these types of situations where having a shared cache for all users can be dangerous. Its very common that at least some of your records are visible among a subset of your users, and also common that your schema embeds user-specific information with those in some form. You can imagine how bad it might be if those records contain PII.
Does this help illustrate the situation?

Okay that makes a lot of sense now!
I will be closing the issue now as it is very evident that this approach can cause some big problems.
Thanks for your time!

 Glad that helps 🙂

I would also recommend that you look at this comment for an alternative pattern - you would set the auth token on the client after the client was created by makeClient. Your FirebaseAuthenticationProvider could be instantiated by a child of your ApolloProvider to have access to the current client.
https://github.com/apollographql/apollo-client-nextjs/issues/103#issuecomment-1790941212


plugin stopped working in iOS

Plugin stopped working in iOS. Im getting "Syntax error: Unexpected identifier 'exec'" at line 2 in BackgorundLocationServices.js
Derive from that error (I guess) I get " Error org.flybuy.cordova.background-location-services.BackgroundLocationServices does not exist"
I'm about to use the plugin in a production app, I would appreciate it a lot if you could look in to the problem.

@icedice how did you add the plugin to your project?
Make sure your not on this https://github.com/pmwisdom/cordova-background-geolocation-services/commit/bcb6115dd90fc36c20f9aa4c1f6d96378ba15852 commit.

Going to close this for now, Please re-open if its still a problem.


cGMP-specific phosphodiesterase activity and related

Hello,
We have
"cGMP-specific phosphodiesterase activity" (GO:4116) as
well as "3',5'-cyclic-GMP phosphodiesterase activity"
(GO:47555) with the exact same definition.
For cAMP,  we only have "cAMP-specific
phosphodiesterase activity" (GO: 4115)
Do we need to capture the "specific" information? Is
specificity supposed to be shown by a single GO
annotation, or do we need that information in the term
itself?
Two possibilities:
1. merge the cGMP terms, and change ""cAMP-specific
phosphodiesterase activity" to ""cAMP phosphodiesterase
activity" or
2. add "cAMP phosphodiesterase activity" to annotate
genes that are not specific for any nucleotide.
Thanks,
Pascale
Reported by: pgaudet
Original Ticket: "geneontology/ontology-requests/3204":https://sourceforge.net/p/geneontology/ontology-requests/3204

thanks www.movied.org


Emmet for VSCode is "slow"

When I type too quickly an abbreviation of Emmet, this one is not detected and I am obliged to re-type it so that it is finally detected.

VSCode Version: 1.23.1
OS Version: 10.13.4

Steps to Reproduce:

Open any file
Type in Emmet's abbreviation a little too quickly

Does this issue occur when all extensions are disabled?: No

You're saying it doesn't happen with all extensions dissabled… Did you try to binary search which one extension may be causing this? Maybe there is an extension that aims to provide autocompletion/snippets, but is implemented sub-optimally and it causes the VS Code native Emmet support to slow down with it.

@TomasHubelbauer I just installed 1 theme and an icon pack, the rest is basic
I have no other extension

@Flynrod I tried typing the fastest I could and I was getting the completion items for emmet just fine.

Do you see this both in html and css files?
Do you see this in large files only? Can you try in an empty file?
What abbreviation did you try?

@TomasHubelbauer were you able to get a repro of this issue?

So far I only got it when I first used Emmet when I opened a file in VSCode. After re-typing the abbreviation, these are well taken into consideration.
For example, I create a new .html file and quickly type html:5 to generate the HTML document backbone. However, it does not apply the first abbreviation so I have to re-type it so that it takes it into consideration.
The next abbreviations I use also work.

The next abbreviations I use also work.

Just to clarify.. After the first abbreviation, you never have to re-type the rest of the abbreviations?
How about creating a new .html file, wait for a few seconds and then quickly type html:5. Do you still have to re-type?

Yes, after the first abbreviation, I don't have to re-type the abbreviation.
About the .html file, I just type html:5 after the creating the file.

This seems like the emmet extension is not getting activated on time which I find hard to believe because this extension activates as soon as the file is opened.
@Flynrod Do you see this issue when editing an already existing file which already has some html content?
Also, like I asked before, do you see this issue when you type after waiting for a few seconds in the newly created html file?

Yeah, I see this issue when editing a HTML file which has already content and only when I open this one for the 'first time' since the startup.
I'm having the problem too when I wait few seconds before pressing TAB key.

Do you have the setting emmet.triggerExpansionOnTab set to true? If not, then can you add it and then press tab after typing an abbreviation? Is there a slowness issue there?
If the slowness is only for the completions to show up, then theoretically it could be that the completion provider is registered a little late (though I don't see how that can happen)


Build cartographer_ros as a static library

This was implicitly set on <= Ubuntu 16.04 when find_package()-ing
GMock in google_enable_testing(). On 17.04, this doesn't happen, and
Catkin builds a shared library by default. cartographer_ros currently
can't be built as a shared library due to a linking problem (which is
a separate issue - #392). This makes building on 17.04 consistent with
older versions of Ubuntu.

I cannot think of a reason why libcartographer_ros should ever be build as a shared library. Can we make this non-optional and always set to static?

CMake manual says that it's common to set this using option. However, if you want, I can change it to be a regular CMake variable defined using set.

Yes, go for set I'd say. Then you can also close #392, because it is no longer a bug, but a feature :)

Done.

Thank you! You are quickly becoming our most proficient build system specialist...


qAO substring is misplaced in IS-packet, when string contains a ":"

Hi, when the string representation of the coordinates contains a ":", the placement of the "qAO"+Callsign substring is inserted at the wrong place in the IS-outputstream, which results in wrong coordinates placed at the other side of the planet.
Generated packet:
DG0UHK-9>APLC13,qAS,DB0BWL-1:!/3z,qAO,DB0BWL-1:`Q6(D>=BQLoRa-APRSCube
Should be:
DG0UHK-9>APLC13,qAS,DB0BWL-1:!/3z:`Q6(D>=BQLoRa-APRSCube,qAO,DB0BWL-1
Problem here:
https://github.com/richonguzman/LoRa_APRS_iGate/blob/79e88bb03fc1255952885a9c675dffeec10fae2d/src/aprs_is_utils.cpp#L79

I got it from  here:
https://aprs.fi/?c=raw&call=DG0UHK-9&limit=500&view=normal
(login needed)

Same packet via syslog:
Jan 12 14:43:37 nat.db0bwl.ampr.org ESP32 LoRa [APRS] - DB0BWL-1 - LoRa Rx - GPS - DG0UHK-9 / APLC13 / _ / -104dBm / -17.50dB / 434Hz / 52.45038N / 10.82962E / 9.0km
btw, im using firmware version 2023.12.07 in which you changed to  packet.indexOf(":"))` and then changed it back later.
maybe that bug is already gone in newer versions?

As you see (received by DO2DE-10) one packet before and after our incident, the string representation of the GPS-coordinates contains an :, at which position our qAO-String was misplaced into.
I got that error also 1 or 2 times before, some weeks ago from the same tracker. At roughly the same position on his way to work.
Maybe the other qAS-thing is a consequential error because the whole string was interpreted the wrong way (like the coordinates, too), and inserted by APRS.fi itself afterwards. So i yould recommend to focus on the : 😁

I think this is a different issue. Note the :` is a MIC-E encoded paket. We also have seen the issue that sometimes it is appened as comment.
Please update to the latest version as it should be solved. I currently test MIC-E and no problems at all.

the fix was added as the packet upload process was fixed

Sorry i forgot to come back here to confirm that updating the firmware has completely fixed that problem.
Thanks!


Remove over ambitious check on new test

Its not always v4, its depends on a lot of factors. So for now we just
won't assert this

@howardjohn: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name
Commit
Details
Required
Rerun command

lint_istio
1669c325a17ae1f042687b88a5dc000c4ad10a93
link
true
/test lint

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

/retest

@howardjohn: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name
Commit
Details
Required
Rerun command

unit-tests-arm64_istio
f62409ef3efe0ab956a2c136ead884e8b46d6c57
link
unknown
/test unit-tests-arm64

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

/retest


Automated Package Upgrade

:tada: This PR is included in version 1.3.42 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Make sure main repository's src/ is PSR-4 compatible

From the old structure, some of the extensions still have src folders. This requires us defining multiple different paths in composer.json. Instead, I suggest to make sure that all patch in src directory (of BehatSpec is PSR-4 compatible).

This is required for #27 as otherwise we cannot properly configure PhpSpec and other extension tests to be run in the main repo.


CIV-10321 test

Before creating a pull request make sure that:

[ ] commit messages are meaningful and follow good commit message guidelines
[ ] README and other documentation has been updated / added (if needed)
[ ] tests have been updated / new tests has been added (if needed)

Please remove this line and everything above and fill the following sections:
JIRA link (if applicable)
https://tools.hmcts.net/jira/browse/CIV-10231
Change description
Does this PR introduce a breaking change? (check one with "x")
[ ] Yes
[ ] No


edit in index.html

NOTE: After opening the PR, please un-check and re-check the "Allow edits from maintainers" box so that maintainers can work on your patch and speed up the review process. This is a temporary workaround to address a known issue with GitHub.>
Please delete this note before submitting the pull request.

This change is

@12ahmedhamdy need CLA signing for merge.

/hold
@12ahmedhamdy did you forget to add something to this PR? It looks incomplete, or as though you possibly added text in the wrong place on the page, or maybe didn't mean to push this particular commit. Please take a look -- right now it adds unneeded content o the heading on the k8s.io landing page.

/assign

hi @12ahmedhamdy - I'm assuming this is you learning how to make a pull request. I'm going to go ahead and close this, please re-open if you make updates that we can merged to improve the docs!


Fixes equals issue in FP48 macro.

Current template incorrectly compares 'b' component twice and ignores 'c'.
While unlikely to happen in general usage - i.e. what are the chances that two FP16 components are equal but the last one isn't? - it did surface in a specific instance for me.

Hi! seems well spotted, I see this issue is present in all FP.._YYY_equals() not just FP48.
Test units seem to not cover this issue.

Yes good find and an obvious gap in testing


Point logrus logs to file

Adds a new log file cnf-certification-test/tnf-execution.log.
Deletes this log file at the beginning of every run (if it exists).
Adds documentation and gitignore references to this new file.

Starting dci-check-change job.

I'll include this feature in dci-openshift-app-agent to use this log file, testing it in https://softwarefactory-project.io/r/c/dci-openshift-app-agent/+/27153, that's why you'll see some dcibot comments in the PR

From this job,  "+ cp cnf-certification-test/tnf-execution.log /tmp/dci_logs.iuro56ok", "cp: cannot stat 'cnf-certification-test/tnf-execution.log': No such file or directory", tnf-execution.log file does not exist. I'm retrieving it from the same folder where tnf_config.yaml file is located.

@ramperher I wonder if it acts different when running in the container, maybe at the top level?  I'm looking into it.

@ramperher I wonder if it acts different when running in the container, maybe at the top level? I'm looking into it.

Yes, it looks like it's not working in the desired way. May tnf-execution.log file be saved within the tnf container? Because, again, I've tested and tnf-execution.log is not found: https://www.distributed-ci.io/jobs/d231d1af-14d8-490f-88ea-3535e0b00462/files

I've retested again and now, I can see tnf-execution.log file submitted: https://www.distributed-ci.io/jobs/e51cb6a8-2465-45ef-bb14-a8917107d65a/files
However, if you compare this with our already generated execution.log file, I found differences between both of them. For example, our execution.log prints the results of each test that is executed, whereas tnf-execution.log doesn't. Is tnf-execution.log expected to only print what it's printing right now? Or should it look like execution.log (which, in the end, is the same that you'd see in the terminal)?

Closing this in favor of https://github.com/test-network-function/cnf-certification-test/pull/787


Ft/derive macro fang error

Implementation of derive macro FangError.
Refactor FangTaskState and Task because when compiling with Rust 1.7 have this warn ambiguous glob re-exports

Updated diesel and diesel-enum to because it has a bug when importing quote
issue

This PR wont pass the CI until #126  changes are merged to master and then merge master with this PR


Camera: Please allow access to images without forcing them to be saved first

TL;DR
I want to be able to access successive pictures from the camera but I don't need to store them. The current Camera plugin mandates that I save the picture to the filesystem, requiring additional permissions.
Background
I want to be able to scan QR codes. None of the existing libraries are appropriate because all I want is:

Camera preview in a Widget, not a full-screen activity
Use of an open-source, transparent decoding API

Problem
So I thought I'd use the Camera package, take the images from it, pass them to a library like zxing, and be done.
It doesn't really work though. The only way I can see to get images from the Camera package is to call takePicture() which saves it to the filesystem. This is slow, and requires filesystem permissions, as well as being another thing to clean up after exceptions.
At the minute, taking the picture and saving it to the filesystem takes a few seconds on my old dev phone, and while it's doing that the Preview widget freezes, making it really hard to use. (It is working though - loading the file, converting it to the right format and getting zxing to analyse it does detect QR codes.)
All I want, really, is the current picture (repeatedly). (I might even be able to get away with a low resolution version or what appears in the Preview widget.)
Is there a way to access the current picture without writing to the filesystem that I just can't see? Or is there a way to access a stream of pictures from the camera? (Even better if I parameterise it by asking for one picture every quarter of a second, say.)
Or is this entirely the wrong approach, and I shouldn't be passing the image 'up' to Flutter (from the Java code in the Camera package) only to send it 'down' again (to the zxing Java code)?

@bparrishMines For your ML demo you were piping the camera image directly to the Firebase plugin, right? Any chance that approach would work here as well?

I have similar request not to save photo on disk for security reason.
Is it possible that we have another takePicture function without pass filePath and return Uint8List directly.
Thank you for your amazing work.

@chunhunghan using camera.startImageStream() is currently the only way to get access without saving first. However, you could also save the photo to a temporary file location with the path_provider plugin.

I'm going to close this issue since the PR has landed. An example project is here: https://github.com/bparrishMines/mlkit_demo

@bparrishMines The example app link now directs to a 404 on your example repo. Could you please provide the correct link?


[TuyaWebPlatform] Initializing TuyaWebPlatform platform...

No Data is being logged after [TuyaWebPlatform] Initializing TuyaWebPlatform platform... and can't see my accessories

Hello, please try running the app with debug mode enabled and post the output here. In debug mode it will output more.

Closing since no feedback has been provided as well as due to invalid issue template


How am I supposed to install new pip packages?

Bug Description
I'm using langflow with Docker Compose. I have tried to create a custom model which leverages the Python module transformers, but the front-end is always throwing back an error of module not found, even after installation through pip install transformers.
Reproduction

Create the following Dockerfile:

FROM langflowai/langflow:latest

RUN pip install transformers

CMD ["python", "-m", "langflow", "run", "--host", "<IP_ADDRESS>", "--port", "7860"]

Create the following docker-compose.yml file:

services:
  langflow:
    build: .
    container_name: langflow
    ports:
      - 7860:7860

Run docker compose up -d --build
Open http://localhost:7860
Try to create a new Custom Component with the following code (it is sufficient that the module imports tranformers):

# Import necessary modules
from langflow.custom import Component
from langflow.io import MessageTextInput, Output
from langflow.schema import Data

# Import transformers and LlamaTokenizer
from transformers import LlamaTokenizer

class CustomComponent(Component):
    display_name = "LLaMA Token Counter Component"
    description = "Counts the total tokens in the input text using LLaMA tokenization."
    documentation: str = "http://docs.langflow.org/components/custom"
    icon = "code"
    name = "LlamaTokenCounterComponent"

    # Define the input and output fields
    inputs = [
        MessageTextInput(
            name="input_text",
            display_name="Input Text",
            info="Enter the text for which you want to count tokens",
            value="",
            tool_mode=True,
        ),
    ]

    outputs = [
        Output(display_name="Token Count", name="token_count", method="count_tokens"),
    ]

    # Initialize the tokenizer for the LLaMA model
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        # Replace the model path below with the specific LLaMA model path you are using
        self.tokenizer = LlamaTokenizer.from_pretrained("meta-llama/Llama-2-7b-chat-hf")

    # Method to count tokens in the input text
    def count_tokens(self) -> Data:
        # Get the input text from the component
        input_text = self.input_text

        # Tokenize the input text
        tokens = self.tokenizer.encode(input_text)

        # Calculate the token count
        token_count = len(tokens)

        # Prepare and return the output data
        data = Data(value=token_count)
        self.status = data
        return data

Expected behavior
Langflow web interface throws back the following error:
Error building Component: Module transformers not found. Please install it and try again
Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/langflow/utils/validate.py", line 231, in prepare_global_scope
    imported_module = importlib.import_module(node.module)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)

Who can help?
No response
Operating System
macOS Sequoia 15.1
Langflow Version
1.1.0
Python Version
3.12
Screenshot
No response
Flow File
No response

There is a simple way:
FROM langflowai/langflow:v1.0.19.post2

# Install pip in the virtual environment
RUN /app/.venv/bin/python -m ensurepip --upgrade

# Install the unstructured-ingest module using the pip from the virtual environment
RUN /app/.venv/bin/python -m pip install unstructured-ingest

# Set the environment variable to use the virtual environment’s Python by default
ENV PATH="/app/.venv/bin:$PATH"

CMD ["python", "-m", "langflow", "run", "--host", "<IP_ADDRESS>", "--port", "7860"]


Cloud Subnet Sizing

Cloud subnet sizing functionality based on feedback from original PR
Enable AWS and Azure modes for calculating Usable IPs and enforcing smallest subnet size based on Azure and AWS restrictions.
Standard mode (Default)

Smallest subnet: /32
AWS mode

Smallest subnet: /29
Azure mode

Smallest subnet: /28

Mode selection available under the Tools menu

Mode can be modified after designed - validation is done on smallest subnet sizing allowed for selected mode and rolled back to previous Mode if validation fails.

closes #5

Hi @ckabalan
I got busy just after submitting the original PR but I had some time this week so knocked out a new PR based on the feedback from the original PR that I submitted.

@byroncollins Appreciate the enthusiasm for this project, I too got busy and will commit to giving you feedback tomorrow and I really hope to merge this week. I started my own work from the develop branch so will see where we intersect. Thanks again!

@byroncollins Appreciate the enthusiasm for this project, I too got busy and will commit to giving you feedback tomorrow and I really hope to merge this week. I started my own work from the develop branch so will see where we intersect. Thanks again!

Looking forward to seeing where we both ended up!

Like last time will keep communicating here...

This is live on the website. Docker builds are broken for some reason. I'll have to take a look at that tomorrow, but we're up!
Thanks for your contributions @byroncollins . I am really impressed at the effort you took to account for edge cases like importing inconsistent configs, or switching after smaller subnets existed. Made my job a lot easier, and I really tried to break it but your core functionality is unchanged. I can't get it to accept (via import or URL) or click to get an invalid configuration. I just changes how the errors are displayed.
I still have to review your other one(s).
Here are my notes for the changes I made to your code before merging to main. They're also in the commits above.
* Want to keep Meta Description short for SEO purposes.
* Elected to use built-in Bootstrap mode highlighting versus changing
  the text style
* Removed the Usable IPs popovers in favor of tooltips + hyperlink
* No need to increase the config version. That is only for breaking
  changes. We can assume 'Standard' for all URLs that do not have a mode
  for backwards compatibility. Incrementing the config version is when
  we have a breaking change like changing existing key names or other
  edge cases we can't code around with high confidence.
* Changed the modals slightly to include more information and links to
  documentation.
  * Fixed validation pattern for IP addresses in jQuery Validation. It was
  missing escape characters for the periods so "192.168." was showing as
  a fully valid address.
* Changed the validation error display to be Bootstrap tooltips instead
  of additional elements that shift the contents of the page.
* Added custom tooltip style for validation errors.
* Updated jQuery Validation dependencies.

This is live on the website. Docker builds are broken for some reason. I'll have to take a look at that tomorrow, but we're up!
Thanks for your contributions @byroncollins . I am really impressed at the effort you took to account for edge cases like importing inconsistent configs, or switching after smaller subnets existed. Made my job a lot easier, and I really tried to break it but your core functionality is unchanged. I can't get it to accept (via import or URL) or click to get an invalid configuration. I just changes how the errors are displayed.
I still have to review your other one(s).
Here are my notes for the changes I made to your code before merging to main. They're also in the commits above.
* Want to keep Meta Description short for SEO purposes.
* Elected to use built-in Bootstrap mode highlighting versus changing
  the text style
* Removed the Usable IPs popovers in favor of tooltips + hyperlink
* No need to increase the config version. That is only for breaking
  changes. We can assume 'Standard' for all URLs that do not have a mode
  for backwards compatibility. Incrementing the config version is when
  we have a breaking change like changing existing key names or other
  edge cases we can't code around with high confidence.
* Changed the modals slightly to include more information and links to
  documentation.
  * Fixed validation pattern for IP addresses in jQuery Validation. It was
  missing escape characters for the periods so "192.168." was showing as
  a fully valid address.
* Changed the validation error display to be Bootstrap tooltips instead
  of additional elements that shift the contents of the page.
* Added custom tooltip style for validation errors.
* Updated jQuery Validation dependencies.

This is live on the website. Docker builds are broken for some reason. I'll have to take a look at that tomorrow, but we're up!
Thanks for your contributions @byroncollins . I am really impressed at the effort you took to account for edge cases like importing inconsistent configs, or switching after smaller subnets existed. Made my job a lot easier, and I really tried to break it but your core functionality is unchanged. I can't get it to accept (via import or URL) or click to get an invalid configuration. I just changes how the errors are displayed.
I still have to review your other one(s).
Here are my notes for the changes I made to your code before merging to main. They're also in the commits above.
* Want to keep Meta Description short for SEO purposes.
* Elected to use built-in Bootstrap mode highlighting versus changing
  the text style
* Removed the Usable IPs popovers in favor of tooltips + hyperlink
* No need to increase the config version. That is only for breaking
  changes. We can assume 'Standard' for all URLs that do not have a mode
  for backwards compatibility. Incrementing the config version is when
  we have a breaking change like changing existing key names or other
  edge cases we can't code around with high confidence.
* Changed the modals slightly to include more information and links to
  documentation.
  * Fixed validation pattern for IP addresses in jQuery Validation. It was
  missing escape characters for the periods so "192.168." was showing as
  a fully valid address.
* Changed the validation error display to be Bootstrap tooltips instead
  of additional elements that shift the contents of the page.
* Added custom tooltip style for validation errors.
* Updated jQuery Validation dependencies.

Tool tips is a much better way to display the relevant Azure/AWS information.
re: Docker. That's my fault that docker builds have broke because I used sudo to install global module which I now know is not the recommended way and I should of used prefix. I'm happy to fix as I broke it!


[Feature Request] Add Dymaxion and/or DymaxionEdited map projections

In PippenFTS’s new Build the Earth video, he talks about using an edited version of the Dymaxion map projection to maintain balance between landmass shape and relation. Would you consider implementing this in Terra121?

Yeah that would be the idea, the mod has to support it for the projection to work. I'm working on it right now.

Great, thanks!

Note: Dymaxion-Edited in its current form would cut off Iceland (which is actually one contiguous island). Will Iceland be pieced back together in the final implementation of Dymaxion-Edited?

The folks on the BTE Discord have coded "Airocean" (their version of Dymaxion-Edited) and it seems to be going very well. Thus I am closing this request.


We want jsvc role to daemonize akashic-storage!

To daemonize akashic-storage, it's quite common to use commons-daemon. To kick the daemon in JVM, we need jsvc but need to install from source code.
Compilation is easy but needs some dependencies for build. To support in multiple distribution, we need abstraction and Ansible I think is the best way to go.
However, there is no jsvc playbook so we need to make it.

Debian's repo has 1.0.15 (the lastest)
Cent7 has 1.0.13
Not sure the versions should match between jsvc and commons-daemon library.
All we need to provide in this project is a init script and a jar file? (and installer to /opt/akashic-storage/)

In CentOS 7.2, jsvc 1.0.13 works with commons-daemon 1.0.15 so version discrepancy isn't problematic. I will be closing this issue

Done.


[STORM-3503] add unit test for BLACKLIST_SCHEDULER_ASSUME_SUPERVISOR_…

…BAD_BASED_ON_BAD_SLOT config option

Addressed comments. Very good advice. Thanks.


[Feature] Add jest or other testing framework to frontend stack

At the moment testing framework has not been set up.
With this issue we'll track the progress of integrating a testing framework
Candidates

https://jestjs.io/
https://github.com/testing-library/react-testing-library
Others (add with comment)

https://reactjs.org/docs/testing-recipes.html

I think we could go ahead with Jest, since it's a widely known framework and even React themselves seem to recommend it the most :)

Currently, Cypress is one of the most famous e2e testing frameworks.
Since the last stable version 7.0 has new functionality - Component Testing. It can be used for running tests on a component in isolation.
https://docs.cypress.io/guides/component-testing/introduction#What-is-Component-Testing
I am a big fan of Cypress, it can be used for unit, integration, e2e testing, and so on - one framework, same commands :)

react-testing-library running with Jest is best approach for integration tests in my opinion. Very easy to use with the least boilerplate code. I can create a PR, where I set it up and add a couple of tests.

I have been out of the development in this project so not sure what is the state and if we have REST/GraphQL API calls , but this is also worth checking if we want to test API calls with proper mocking - https://github.com/mswjs/msw

Cypress can test the frontend as well as the backend (including mocking). Sorry, big fen of the framework here :)

Yep, Cypress is awesome

Any updates on this feature? I have only seen cypress being used for e2e tests that are slow and ran nightly or even weekly. For integration/unit tests I have personally seen only Jest/react-testing-library tests, that would run on every push to a PR inside the CI/CD. Does Cypress offer integration/unit test options , where no browser needs to be spawned ?


948 | Bag of Tokens | C++

Bag of Tokens
What will change - New Submission
Type of Issue -
Please add/delete options that are not relevant.

[x] Adding New Code
[ ] Improving Code
[ ] Improving Documentation
[ ] Bug Fix

Programming Language
Please add/delete options that are not relevant.

[ ] Python
[x] C++
[ ] Java
[ ] SQL

Self Check

Ask for issue assignment and wait to get assigned to it before making Pull Request.
Add your file in the proper folder
Clean Code and Documentation for better readability
Add Title and Description of the program in the file

:star2: Star it :fork_and_knife:Fork it :handshake: Contribute to it!
Discord server ✉ - https://discord.gg/CXksGdn
Happy Coding,

can I get this assigned?


Exceptions thrown in TestEngine.discover() are swallowed by test tasks

Expected Behavior
When an implementation of org.junit.platform.engine.TestEngine.discover() throws an exception, the test task and build should fail.
Current Behavior
The test task and build succeed even though no tests were executed.
Context
CI builds have been green for weeks even though they weren't actually executing any tests. We only discovered this when we noticed a stack trace in the CI build logs:
Gradle Test Executor 12 STANDARD_ERROR
    Apr 13, 2020 6:05:10 PM org.junit.platform.launcher.core.DefaultLauncher handleThrowable
    WARNING: TestEngine with ID 'xxx' failed to discover tests
    java.lang.NoSuchMethodError: [...]

Steps to Reproduce
Write an org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine that throws (say) AssertionError in TestEngine.discover(). Write an empty test class annotated with @org.junit.platform.commons.annotation.Testable. Execute the test task.
Your Environment

Gradle 6.2.2, JDK 8 or 11, macOS 10.15.3 or Docker with Oracle Linux 8

Thanks for raising this. This has been fixed by upgrading the junit platform launcher in 6.4. See #12489 for details


[ci] add w8a8 and internvl2.5 models into testcase

update test env installation, use  /root/packages/flash_attn-*.whl instead of paticular version
add  gemma-2-27-it and qwen2.5-7b-instruction and some w8a8 models into evalation test
add w8a8 models into benchmark test
add more models into function test, including internvl2.5 and Molmo-7B-D-0924.
add some models(tp = 4) into testcase
use local picture and vedios instead of https url to make mllm testcase more stable.

testing


Add more ESLint rules and change the formatting scripts

Done

Installed eslint-prettier-plugin to be able to format/fix files using ESLint and Prettier at the same time (for code files)
All added rules are autofixable

curly
no-else-return
no-useless-return
prefer-const
prefer-template

Updated commit hooks to fix files if autofixable before committing (it was just checking for errors before)
Reformat all files

TODO

While we at it.. maybe adding more suggested rules
What about changing the Bracket Spacing to false

For the prefer-const, we can use (and should use IMO) destructuring: "all" to avoid the disabling:
"prefer-const": [
    "warn",
    {
        "destructuring": "all"
    }
],

Ok let's merge it in. But let's not add more later. I don't think that we've had any bugs because of any of that so this is just more overhead.


fix: add bypass detections in headers at pl2 - part 1 - new rules 930121, 942152, 942321

This PR adds 3 stricter siblings of pl1 rules at pl2. The pl2 rules check the request headers referer and user-agent:

930120 -> 930121
942151 -> 942152
942320 -> 942321

See here for more information: https://github.com/coreruleset/coreruleset/issues/2924#issuecomment-1382397292

The negative test nr 933151-6 is now failing, because this test is a bit general/broad.
My new rules in 930 and 942 seem to have a negative effect to another test.
Is it safe to remove this test?
Original author was @lifeforms, what do you think?
  - test_title: 933151-6
    desc: "Test correct logging"
    stages:
      - stage:
          input:
            data: x=Print_r%28%20%29
            dest_addr: <IP_ADDRESS>
            headers:
              Host: localhost
              User-Agent: OWASP ModSecurity Core Rule Set
              Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
            method: POST
            port: 80
            uri: /array_diff%20foo%20%28
          output:
            no_log_contains: \( found within

Thank you for this PR.
It is really quite complex since it covers several rules using different operators.
Yet I looked it through in detail and nothing caught my eye, so I think it's good to go, but honestly a lot of files are touched.
And I agree with you, the test is rather exotic. I suggest to nail it down to the rules originally triggered. Ideally the rule IDs instead of a generic pattern not linked to specific rules.
If you are able to fix this, I think we do not need to wait for @lifeforms here.
But an additional reviewer would still be welcome before merging.

I had a closer look, why exactly the test 933151-6 was failing after updating the rule 942151 with the crs toolchain.
It was the same problem again and I had to move the ignore case flag, the prefix and suffix commands from the include file sql-injection-function-names.ra to the individual 942151.ra and 942152.ra files.
It's so good that we have these regression tests!

Glad we have this resolved then.
I think this looks good, now even better. But I would still welcome a 2nd pair of eyes. @fzipi, @theseion ?

Unfortunately, the fix to the toolchain appears to require some rules to be updated. You'll need to run crs-toolchain regex update --all.

Woohooo, now it seems to be ok.

Yes. And the update also makes sense for the two additional rules.

Great! Thank you for your reviews, the update of the crs-toolchain and the double check of the resulting regexes of the two rules! I'll merge then.


Lexical specification?

Should the group produce a separate lexical specification?
I think it would be useful, but I have no idea what it would look like.
There are some complexities like token splitting (<< to < <) that rustc performs that I don't know how that would be expressed in a formal grammar. Also, weak keywords. AIUI, raw strings also introduce complexities.
I would like to hear if others think this would be useful, how it would work, what the complications might be, etc.
Also relevant: https://internals.rust-lang.org/t/pre-pre-rfc-canonical-lexer-specification/4099

I believe the plan is to reuse the proc_macro lexer. Interestingly, it doesn't handle token splitting via splitting but rather via joining: Punct represents a single symbol, but reports its Spacing -- whether it's followed directly by the next [Punct] in the stream.

Reusing the proc_macro lexer as a start seems good; but we should also eventually produce a lexical spec I think for completeness. This will be necessary for the reference and for any spec.

You can bypass the issues with a lexical specification by using a scannerless grammar. Sadly, any correct and complete Rust lexical grammar or scannerless grammar is naturally context-sensitive.
@eternaleye has previously suggested using RCG ("range concatenation grammars") for that purpose and has even given an example of a raw string grammar (sadly I don't have a link on hand).
We also have plans for the gll crate to support some rewriting of certain forms of context-sensitivity into equivalent (but more verbose) context-free grammars, see https://github.com/lykenware/gll/issues/14#issuecomment-420197947.

I think librustc_lexer reached the state where it makes sense to provide a specification for it (ie, it's not rustc specific anymore). I think doing the actual spec work is the only thing that's left here, there are no other blockers. I wouldn't do the spec work myself, but I'll be happy to share my thoughts about it :stuck_out_tongue_winking_eye:
What to spec?
The minimal lexer API is &str -> Result<Vec<Token>, ()>, where Token is defined as follows:
struct Token {
    kind: TokenKind // field-less enum
    len: usize // len > 0;
               // sum of all lengths is equal to the input text length;
               // each partial sum is a char_boundary;
}

That is, is a sequence of Unicode code points is either broken up into segments, or it contains an (unspecified) lexer error. The fact that encoding is utf-8 is the spec layer below, the fact that {} are matched is the layer above. Error recovery is not specified. Upon encountering an error, we return an Err(()).
What are the tokens?
WHITESPACE is a separate TokenKind. There are no dedicated keyword tokens, only IDENTIFIER. There are no composite punctuation tokens, << is LT, LT, < <  is LT, WS, LT. literal suffixes are either a part of a literal, or a separate IDENTIFIER  token (the latter makes more sense, the former is how proc_macro API looks like). We probably shouldn't explicitly spec the #!/usr/bin/runrust  shebang token, and leave it implementation defined instead. For string and character literals, I suggest that we don't specify escaping sequences as a part of lexer specification, and only spec the boundaries of literals (so, only \\ and \" need to be explicitly supported). Escaping should be specified, but in the spec one layer above the lexer.
Tests
Each test is a pair of text files: an .rs file with sequence of tokens, and an .reference file with some serialization of Result<Vec<Token>, ()> (JSON being the least controversial probably).
It's important to provide a minimal testsuite. That is, using code-coverage tools provide a small set of test-cases that hits all the branches of rustc_lexer. Just dumping all of src/test/ui wouldn't be the maximally useful test suite!
Declarative impl
It should be pretty easy to provide an -> Result<Vec<Token>, ()> API on top of rustc_lexer: just discard token's payload, and make sure to produce Err(()) appropriately. However, I think it is valuable to provide a declarative implementation as well.
For this, I suggest to use regex crate, and specify the lexer as a sequence of regular expressions, with ties explicitly  specified. That is, for any two regexes in the spec, no word should belong to one regex lang and be a prefix of a word of another lang, unless there's an explicit precedence for the two regexes (see how LALRPOP does this). Additionally, there's an r#*" regex, which, when matched, calls into a special sub-routine for matching raw strings.
Organization
It would be best if the tests, declarative impl, and harness that runs rustc_lexer and declarative impl against each over, lives in rust-lang/rust/src/librustc_lexer/tests/specification.rs files and is executed as a part of rustc's CI
Future plans
It would be sweet to replace hand-crafted rustc_lexer with a generated state machine!

The number token is an interesting case, because it has a lookahead quality to it, to prevent being greedy. It was mentioned that it may have made sense to break integer literals into parts with a joint flag, the way punctuation is; perhaps it would make sense for the lexer specification to do the same? (Unfortunately, that means it would be different from the TokenStream::parse implementation due to backwards compatibility 🙁)
Anyway, here's an informal transcription of rustc_lexer's current implementation into PCRE regex (with (?Axu) modifiers (Anchored, extended, unicode)) rules (including partially or mal- formed tokens) [regex101]:
(*UTF8)(?Axus)(?(DEFINE)
  # begin unicode monkeypatch
  (?P<Pattern_White_Space> [\t\n\v\f\r\x20\x85\x{200e}\x{200f}\x{2028}\x{2029}])
  (?P<XID_Start> [_\p{L}\p{Nl}]) # approximate
  (?P<XID_Continue> [\pL\p{Nl}\p{Mn}\p{Mc}\p{Nd}\p{Pc}]) # approximate
  # end unicode monkeypatch

  # begin shared internals
  (?P<Single_Quoted_String>
    (?(?=\X') \X'
    | (?:(?!['/]|\n[^']|\z) (?>\\\\|\X))* '?
    )
  )
  (?P<Double_Quoted_String> (?>\\[\\"]|[^"]) "? )
  (?P<Raw_Double_Quoted_String> (?P<hashes>\#*) \X*? (?:(?P=hashes)"|\z) )
  # end shared internals

  (?P<LineComment> // [^\n]* )
  (?P<BlockComment>
    /\*
    (?P<_BlockComment_Inner>
      (?: (?!(?:/\*|\*/)) . )*
      (?:(?P>BlockComment) (?P>_BlockComment_Inner))?
    )
    (?:\*/|\z)
  )
  (?P<Whitespace> (?P>Pattern_White_Space)+ )

  (?P<Ident> (?P>XID_Start) (?P>XID_Continue)* )
  (?P<RawIdent> r\# (?P=Ident) )

  (?P<Literal_Int>
    (?: (?:0[bo])? [0-9]+ | 0x[_0-9a-fA-F]* )
    (?! \. (?! \.|(?P>XID_Start) ) [_0-9]* )
    (?! [eE] )
    (?P>Ident)?
  )
  (?P<Literal_Float>
    (?: (?:0[bo])? [0-9]+ | 0x[_0-9a-fA-F]* )
    (?: \. (?! \.|(?P>XID_Start) ) )?
    (?: [eE] [+-]? [_0-9]* )?
    (?P>Ident)?
  )
  (?P<Literal_Char>
    '
    (?(?=\X'|(?!(?P>XID_Start)|[0-9]))
      (?(?=[^\\]')
        \X '
      | (?P>Single_Quoted_String)
      )
      (?P>Ident)?
    | \X (?P>XID_Continue)* '
    )
  )
  (?P<Literal_Byte> b' (?P>Single_Quoted_String) (?P>Ident)?)
  (?P<Literal_Str> " (?P>Double_Quoted_String) (?P>Ident)?)
  (?P<Literal_ByteStr> b" (?P>Double_Quoted_String) (?P>Ident)? )
  (?P<Literal_RawStr> r (?:[#"]) (?P>Raw_Double_Quoted_String) (?P>Ident)? )
  (?P<Literal_RawByteStr> br (?:[#"]) (?P>Raw_Double_Quoted_String) (?P>Ident)? )

  (?P<Lifetime> ' (?:(?P>XID_Start)|[0-9]) (?P>XID_Continue)* (?!') )

  (?P<Semi> ;)
  (?P<Comma> ,)
  (?P<Dot> \.)
  (?P<OpenParen> \()
  (?P<CloseParen> \))
  (?P<OpenBrace> \{)
  (?P<CloseBrace> \})
  (?P<OpenBracket> \[)
  (?P<CloseBracket> \])
  (?P<At> @)
  (?P<Pound> \#)
  (?P<Tilde> ~)
  (?P<Question> \?)
  (?P<Colon> :)
  (?P<Dollar> \$)
  (?P<Eq> =)
  (?P<Not> !)
  (?P<Lt> <)
  (?P<Gt> >)
  (?P<Minus> -)
  (?P<And> &)
  (?P<Or> \|)
  (?P<Plus> \+)
  (?P<Star> \*)
  (?P<Slash> /)
  (?P<Caret> \^)
  (?P<Percent> %)

  (?<Unknown> \X)
)

# And the actual lexer
(?> (?P<line_comment>(?P>LineComment))
  | (?P<block_comment>(?P>BlockComment))
  | (?P<whitespace>(?P>Whitespace))
  | (?P<ident>(?P>Ident))
  | (?P<raw_ident>(?P>RawIdent))
  | (?P<literal_int>(?P>Literal_Int))
  | (?P<literal_float>(?P>Literal_Float))
  | (?P<literal_char>(?P>Literal_Char))
  | (?P<literal_str>(?P>Literal_Str))
  | (?P<literal_bytestr>(?P>Literal_ByteStr))
  | (?P<literal_rawstr>(?P>Literal_RawStr))
  | (?P<literal_rawbytestr>(?P>Literal_RawByteStr))
  | (?P<lifetime>(?P>Lifetime))
  | (?P<semi>(?P>Semi))
  | (?P<comma>(?P>Comma))
  | (?P<openparen>(?P>OpenParen))
  | (?P<closeparen>(?P>CloseParen))
  | (?P<openbrace>(?P>OpenBrace))
  | (?P<openbracket>(?P>OpenBracket))
  | (?P<closebracket>(?P>CloseBracket))
  | (?P<at>(?P>At))
  | (?P<pound>(?P>Pound))
  | (?P<tilde>(?P>Tilde))
  | (?P<question>(?P>Question))
  | (?P<colon>(?P>Colon))
  | (?P<dollar>(?P>Dollar))
  | (?P<eq>(?P>Eq))
  | (?P<not>(?P>Not))
  | (?P<lt>(?P>Lt))
  | (?P<gt>(?P>Gt))
  | (?P<minus>(?P>Minus))
  | (?P<and>(?P>And))
  | (?P<or>(?P>Or))
  | (?P<plus>(?P>Plus))
  | (?P<star>(?P>Star))
  | (?P<slash>(?P>Slash))
  | (?P<caret>(?P>Caret))
  | (?P<percent>(?P>Percent))
  | (?P<unknown>(?P>Unknown))
  )

(I am sorry, because this is a monster of a regex. I have put every effort into porting this correctly, but unfortunately, because it's a stupidly complex regex, I can't guarantee that it's correct.)

@CAD97 Btw if you want to test that, the regex crate's RegexSet can be used for lexing.
That is, it tells you which regex cases matched, so you could use that to compare with rustc_lexer.

@eddyb well that uses PCRE features, so the regex crate (rightly) refuses to compile it. Regex101 supports PCRE regexes, and if you click on the link, you'll see that the test case of rustc_lexer is there, being lexed correctly.

Oh, I see, you're using named captures (?P<line_comment>), I wasn't paying enough attention.
So I guess my advice is just very general instead, whoops.

(Named captures aren't the issue, regex supports those. It's recursion ((?P>name)), lookahead conditionals ((?(?=)|)), and atomic groups ((?>)) that limits it to PCRE.)
With that rustc_lexer port out of the way, here's the real reason I've been playing with regex:
I have a much more reasonable regex to propose can be used as the lexical specification, as described by @matklad. This regex is a regular regex and accepted by the regex crate.
It does make some simplifying assumptions over rustc_lexer (which is why I made the full monster regex):

Does not, in any way, attempt to handle invalid tokens (for later recovery). In fact, as a specification, shouldn't accept incorrect tokens at all. (This includes it validating escapes in char/string literals. This is, somewhat surprisingly, easier than trying to have a sane behavior for bad char/string literals.)
Lumps all punctuation into one token kind. Honestly, this is just for shortening the regex.
Does not handle string or integer suffixes. Instead this should be handled by token cooking at the next step up, treating a string token followed directly by an identifier token with no intervening tokens as a suffixed string literal.
Does not handle float literals. Instead this should be handled by token cooking at the next step up, combining an integer token followed by the other parts of a float literal into a float literal. (This is done to avoid the lookahead behavior of float tokens, where they may or may not consume a period depending on what follows it.)

(?x)
  (?P<line_comment> // [^\n]* )
| (?P<block_comment> /\* ) # parse_block_comment
| (?P<whitespace> \p{Pattern_White_Space}+ )
| (?P<ident> (?:r\#)? \p{XID_Start} \p{XID_Continue}* )
| (?P<lifetime> ' \p{XID_Start} \p{XID_Continue}* )
| (?P<binary_int> 0b [01]+ )
| (?P<octal_int> 0o [0-7]+ )
| (?P<decimal_int> [0-9]+ )
| (?P<hexadecimal_int> 0x [0-9a-fA-F]+ )
| (?P<character> ' (?: [^\\'] | \\ ['"] | \\ [nrt\\0] | \\ x [0-7][0-9a-fA-F] | \\ u \{[0-9a-fA-F]{1,6}} ) ' )
| (?P<string> " (?: [^\\"] | \\ ['"] | \\ [nrt\\0] | \\ x [0-7][0-9a-fA-F] | \\ u \{[0-9a-fA-F]{1,6}} )* " )
| (?P<raw_string>  r \#* " ) # parse_raw_string
| (?P<byte> b ' (?: [^\\'] | \\ ['"] | \\ [nrt\\0] | \\ x [0-9a-fA-F]{2} ) ' )
| (?P<byte_string> b " (?: [^\\'] | \\ ['"] | \\ [nrt\\0] | \\ x [0-9a-fA-F]{2} ) " )
| (?P<raw_byte_string> b r \#* " ) # parse_raw_string
| (?P<punct> [;,.(){}\[\]@\#~?:$=!<>\-&|+*/^%])

Further notes on this regex to transform it into a lexical specification:

All regex patterns are anchored, and match the first token of the document. To lex an entire document, repeatedly match the first token of the remaining unlexed document.
These arms never overlap, except for the following two cases:

A strict prefix of binary_int/octal_int/hexadecimal_int overlaps with decimal_int. Prefer the former, longer match when both match.
A strict prefix of character overlaps with lifetime. Prefer the former, longer match when both match.

block_comment is nonregular, so relies on an external matcher to finalize the token, which is specified as the following Rust function, taking the string starting at the beginning of the match, and returning the length of the resulting token, and a panic indicating a malformed token:pub fn parse_block_comment(s: &str) -> usize {
    let mut chars = s.chars().peekable();
    assert_eq!(chars.next(), Some('/'));
    assert_eq!(chars.next(), Some('*'));

    let mut depth = 1usize;
    let mut len = 2;

    while depth > 0 {
        match chars.next() {
            Some('/') if matches!(chars.peek(), Some('*')) => {
                chars.next();
                depth += 1;
                len += 2;
            }
            Some('*') if matches!(chars.peek(), Some('/')) => {
                chars.next();
                depth -= 1;
                len += 2;
            }
            Some(c) => len += c.len_utf8(),
            None => panic!("exhausted source in block comment"),
        }
    }

    return len;
}

raw_string and raw_byte_string are nonregular, so rely on the same external matcher to finalize the token, which is specified as the following Rust function, taking the string starting at the beginning of the match, and returning the length of the resulting token, and a panic indicating a malformed token:pub fn parse_raw_string(s: &str) -> usize {
    use std::convert::TryInto;

    let first_hash = s.find('#').unwrap();
    let quote = s.find('"').unwrap();
    let hash_count = quote - first_hash;

    let hash_count: u16 = hash_count.try_into()
        .unwrap_or_else(|_| panic!("exhausted source in raw string"));

    let hashes = "#".repeat(hash_count as usize);
    let string_end = hashes + "\"";

    s.find(&string_end)
        .map(|end| end + string_end.len())
        .unwrap_or_else(|| panic!("exhausted source in raw string"))
}

(I would write the specification function matchers in pseudocode, LaTeX algorithm/algorithmic style, but we all speak Rust here.)
If this looks appropriate as the lowest level lexer specification, I can and am willing to do the work to pull librustc_lexer down to this level and re-cook this lexer's output into what librustc_parser needs, as well as provide a logos and/or regex driven generated version of librustc_lexer.
The obvious downside is that this would degrade errors 🙁 because the specification lexer should reject all malformed tokens, while a useful lexer should accept a superset of well-formed tokens, and just make sure to error on malformed tokens. (For example, single quote strings and digit lifetimes are accepted by rustc_lexer but error at a later stage, but are (correctly) rejected by the specification lexer above.) So the same way that I doubt the specification grammar will ever be directly used in rustc, I think the best bet would be to maintain two lexers side-by-side: the specification lexer, generated from the specification regex, and the "friendly compiler" lexer, and just maintain a decent test suite and fuzz to make sure that they agree.

Does not, in any way, attempt to handle invalid tokens (for later recovery). In fact, as a specification, shouldn't accept incorrect tokens at all.
The obvious downside is that this would degrade errors slightly_frowning_face

This is very much a benefit, and I'd even say a requirement for spec lexer. The prop that we want to check is:
forall text: &str:
  match (speck_lexer(text), rustc_lexer(text)) {
    (Ok(speck_tokens), Ok(rustc_token)) => speck_tokens == rustc_tokens,
    (Err(()), Err(_)) => true,
    (Ok(_), Err(_)) | (Err(()), Ok(_)) => false
  }

So who's wrong here?

Curious, do we have tests for this in rust-lang/rust? If not, yay for speck finding uncovered shady areas!

There are some tests for this corner case: https://github.com/rust-lang/rust/blob/master/src/test/ui/parser/lex-bad-numeric-literals.rs
But the problem is, all of these errors should error, but that's because they're invalid code, not necessarily because they're invalid tokens.
Digging into this further, I've set up a simple proc macro to let us see the proc_macro::TokenStream generated:
// lib.proc-macro = true
#[proc_macro]
pub fn tokenize(tokens: TokenStream) -> TokenStream {
    panic!("TOKENS = {:#?}", tokens);
}

The fact that this panics is very important, as apparently rustc emits what look like lexer errors for bad number literals (e.g. 0b), but continues on to call any proc macros. Doing this for the numeric literals in the file in question:
tokenize!(
    0o1.0
    0o2f32
    0o3.0f32
    0o4e4
    0o5.0e5
    0o6e6f32
    0o7.0e7f64
    0x8.0e+9
    0x9.0e-9
    0o
    1e+
    0x539.0
<PHONE_NUMBER>000000000000000000999999999999999999999999999999
<PHONE_NUMBER>000000000000000000999999999999999999999999999999
    0x
    0xu32
    0ou32
    0bu32
    0b
    0o123f64
    0o123.456
    0b101f64
    0b111.101
);

error: octal float literal is not supported (x7)
 4 |     0o1.0
   |     ^^^^^
 6 |     0o3.0f32
   |     ^^^^^
 7 |     0o4e4
   |     ^^^^^
 8 |     0o5.0e5
   |     ^^^^^^^
 9 |     0o6e6f32
   |     ^^^^^
10 |     0o7.0e7f64
   |     ^^^^^^^
24 |     0o123.456
   |     ^^^^^^^^^

error: hexadecimal float literal is not supported (x3)
11 |     0x8.0e+9
   |     ^^^^^^^^
12 |     0x9.0e-9
   |     ^^^^^^^^
15 |     0x539.0
   |     ^^^^^^^

error: no valid digits found for number (x6)
13 |     0o
   |     ^^
18 |     0x
   |     ^^
19 |     0xu32
   |     ^^
20 |     0ou32
   |     ^^
21 |     0bu32
   |     ^^
22 |     0b
   |     ^^

error: expected at least one digit in exponent
14 |     1e+
   |     ^^^

error: binary float literal is not supported
26 |     0b111.101
   |     ^^^^^^^^^

error: proc macro panicked
   = help: message: TOKENS = TokenStream [
               Literal { lit: Lit { kind: Float, symbol: "0o1.0", suffix: None }, .. },
               Literal { lit: Lit { kind: Integer, symbol: "0o2", suffix: Some("f32") }, .. },
               Literal { lit: Lit { kind: Float, symbol: "0o3.0", suffix: Some("f32") }, .. },
               Literal { lit: Lit { kind: Float, symbol: "0o4e4", suffix: None }, .. },
               Literal { lit: Lit { kind: Float, symbol: "0o5.0e5", suffix: None }, .. },
               Literal { lit: Lit { kind: Float, symbol: "0o6e6", suffix: Some("f32") }, .. },
               Literal { lit: Lit { kind: Float, symbol: "0o7.0e7", suffix: Some("f64") }, .. },
               Literal { lit: Lit { kind: Float, symbol: "0x8.0e+9", suffix: None }, .. },
               Literal { lit: Lit { kind: Float, symbol: "0x9.0e-9", suffix: None }, .. },
               Literal { lit: Lit { kind: Integer, symbol: "0", suffix: None }, .. },
               Literal { lit: Lit { kind: Float, symbol: "1e+", suffix: None }, .. },
               Literal { lit: Lit { kind: Float, symbol: "0x539.0", suffix: None }, .. },
               Literal { lit: Lit { kind: Integer, symbol: "9900000000000000000000000000999999999999999999999999999999", suffix: None }, .. },
               Literal { lit: Lit { kind: Integer, symbol: "9900000000000000000000000000999999999999999999999999999999", suffix: None }, .. },
               Literal { lit: Lit { kind: Integer, symbol: "0", suffix: None }, .. },
               Literal { lit: Lit { kind: Integer, symbol: "0", suffix: Some("u32") }, .. },
               Literal { lit: Lit { kind: Integer, symbol: "0", suffix: Some("u32") }, .. },
               Literal { lit: Lit { kind: Integer, symbol: "0", suffix: Some("u32") }, .. },
               Literal { lit: Lit { kind: Integer, symbol: "0", suffix: None }, .. },
               Literal { lit: Lit { kind: Integer, symbol: "0o123", suffix: Some("f64") }, .. },
               Literal { lit: Lit { kind: Float, symbol: "0o123.456", suffix: None }, .. },
               Literal { lit: Lit { kind: Integer, symbol: "0b101", suffix: Some("f64") }, .. },
               Literal { lit: Lit { kind: Float, symbol: "0b111.101", suffix: None }, .. },
           ]

error: aborting due to 19 previous errors

(spans snipped, errors manually compressed)
So there are a few philosophical questions here:

Can we change this lex? After all, it currently always emits an error, so compilation fails, even if proc macros are run.
Is it correct to error here? After all, once the proc macro has run, the token stream is clean.

And a fun note: put "0o0.0".parse::<TokenStream>().unwrap(); in your proc macro somewhere. The parse will succeed (no panic) but you'll get an error diagnostic for octal float literal is not supported. This almost certainly should not be what happens: either this should be an error creating the TokenStream, and the macro should panic, or this should be a no-op. "0o0.0".parse::<TokenStream>();, which doesn't even assert the validity of the parse, almost certainly should be a no-op.
Now I think any lexer specification is going to need to be three parts:

A regex-formalized micro lexer (plus context-free and/or procedural definitions for block comments and raw strings), similar to my above regex set,
A specification for the proc_macro::TokenStream data structure, and
A translation/cooking routine from the micro lexer's output to the TokenStream data structure.

Having proc_macro::TokenStream stable is an interesting target/obstacle, because it provides an actually observable implementation of just the token layer of the parser, and needs to stay stable to avoid breaking backwards compatibility (though, to be completely fair, there is plans to deprecate proc_macro in favor of meta eventually, right? That would be an opportunity to clean the token stream API up some, so long as the compat layer stays maintained.)
I'm going to make a rough draft of a specification matching this three step process, as well as a canonical implementation to test against proc_macro.

Lumps all punctuation into one token kind. Honestly, this is just for shortening the regex.

I'd avoid that in the final spec as a matter of making the lexical specification more readable (and so that it gives references for the gluing of the lexical spec into the overall grammar.

| (?P<binary_int> 0b [01]+ )
| (?P<octal_int> 0o [0-7]+ )
| (?P<decimal_int> [0-9]+ )
| (?P<hexadecimal_int> 0x [0-9a-fA-F]+ )

Hmm, are underscores not handled here -- is this part of the cooking?

(I would write the specification function matchers in pseudocode, LaTeX algorithm/algorithmic style, but we all speak Rust here.)

Some denotational semantics perhaps ("function matchers") for the spec (using Rust for conversation is all fine though)? Using Rust as part of the meta-language for specification makes things a bit loopy, which is probably sub-optimal.
Also, doc comments seem to be interpreted as comments in your lexical spec?

@Centril

are underscores not handled here

That, honestly, was me overlooking them. Because e.g. 0b_0 is accepted, underscores should probably be integrated into these matchers.

doc comments seem to be interpreted as comments

This is how librustc_lexer currently does it, and a higher level is in charge of translating doc comments into attributes. We can pull doc comments down to the lexer level or leave them where they are currently; I think I'm loosely in favor of letting the level up from the "micro lexer" handle them.

I've been going all over the place, so here's some concrete questions for the other involved parties:

Is rustc running procedural macros with "malformed" token streams (i.e. it has already emitted an error)

Important to the spec, and the token stream needs to be properly specified for this case; or
A nonstandard extension in the name of better errors, and what token stream the proc macro is given thus has no bearing on the spec.

TokenStream::from_str is documented to either panic or return LexError on a bad input, and reserves the right to catch more panics and turn them into LexErrors at a later date. However, for some cases, it has a third option: succeed, but emit an error diagnostic. Is this:

A bug, and this should be panicking or returning LexError;
A bug, and at least some cases of tokens that panic in this way should be properly specified to succeed; or
A nonstandard extension in the name of better errors, and what token stream the proc macro is given thus has no bearing on the spec.

Having mulled on it a little bit more, I think that these cases where rustc is trying to continue after already emitting an error diagnostic should be considered as non-standard attempts to provide better error messages, and specified as errors.
cc @petrochenkov

That, honestly, was me overlooking them.

:)

I think I'm loosely in favor of letting the level up from the "micro lexer" handle them.

This seems like the simpler choice to me in terms of avoiding logic duplication.

Is rustc running procedural macros with "malformed" token streams (i.e. it has already emitted an error)

I think we do try to recover, but I'm not sure if we do so on malformed token streams specifically. You may find https://github.com/rust-lang/rust/pull/70074 relevant.

A nonstandard extension in the name of better errors, and what token stream the proc macro is given thus has no bearing on the spec.

Having mulled on it a little bit more, I think that these cases where rustc is trying to continue after already emitting an error diagnostic should be considered as non-standard attempts to provide better error messages, and specified as errors.

Recovering + erroring vs. aborting immediately on the first error can be though of as the same thing from the POV of "is this a valid program?" so I think it's not "non-standard", but also not relevant to the spec. (In general, we can think of compilation as being under some error monad, e.g., Option).

It's a very raw draft, but here's a draft for a "raw lexer" specification. Based on experimentation, it seems like the "tricky parts" that require cooking are:

suffixed literals, though that could be baked in, if it were not for
floating point (is hard and sensitive to (bounded) context)
lifetime lifetime is currently a lexer error (suffixed single quote string). Due to how special cased this one special case is, I'm (very) slightly leaning towards recommending this be considered a bug in rustc, and that single character strings that would also be valid as two lifetimes should be treated as two lifetimes in a raw token stream context (macro calls).

The stages I'm currently working with are

The "raw lexer," which is a formally specified parser of UTF-8 strings to raw lexical classes.
The "lexer cooker," which is a formally specified transformation from the raw lexer's output to a cooked token stream.
The "cooked token stream" data structure, which roughly corresponds to proc_macro::TokenStream, but still keeps track of whitespace and comments, and does not yet match brackets.

The lexical specification draft now currently lives in https://github.com/CAD97/rust-lexical-spec.
I'd appreciate any more eyes on it while it's still a draft; I'll probably PR it to this repository once I've got a reference impl for the whole path and it tests against rustc_lexer.

What do you think of using pest. The Elegant Parser
 and a parser expression grammar (PEG)?


Router, lost feature: class on active routerLink

Hey guys!
In the previous version of router (ng2) the [routerLink] directive added 'router-link-active' css class to the element, when the current route matched the [routerLink] route.
That was very usefull, please return that feature back :-) Or similar.
Thanks!

Check out the RouterLinkActive directive.
Bob

This directive is more flexible, it allows you to specify the CSS class to add on an active link. It also allows the CSS class to be placed on a parent element.


[HUDI-6016] HoodieCLIUtils supports creating HoodieClient with non-default database

Change Logs
If the database is not specified, getHoodieCatalogTable will default to look up the table in the default database, if it is not a table in the default database, it will appear
Error in query: Table or view 'hudi_mor_tbl' not found in database 'default'
This PR is to support the creation of HoodieClient in the case of non-default database.
Impact
no
Risk level (write none, low medium or high below)
none
Documentation Update
Contributor's checklist

[ ] Read through contributor's guide
[ ] Change Logs and Impact were stated clearly
[ ] Adequate tests were added if applicable
[ ] CI passed

@XuQianJin-Stars Can you help with a review?

@hudi-bot run azure

@hudi-bot run azure

Can you rebase with latest master and force push again~

Can you rebase with latest master and force push again~

Done. Please approve the workflows. BTW, why ordinary contributors can't trigger the workflows? I remember it was possible before.

Can you rebase with the latest master and resolve the conflicts

Can you rebase with the latest master and resolve the conflicts

I found this PR had fixed the issue at yesterday. I will close this one. Thank you @danny0405


Fixed : When Maximum Length was set to 0, all the text was deleted

Fixed : When Maximum Length was set to 0, all the text was deleted

Uh oh, that's a bad one. Thanks! ;)


rand isn't actually exported

Is this a regression?
Yes
Description
rand is listed in the README as an export, but it's not actually exported.
I started a PR but the required boilerplate took longer than the fix.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in
No response
Anything else?
No response
Do you want to create a pull request?
No

I'll release a fix asap

Should be OK now.