(SP: 2) Investigate new chat implementation (spike)

Current implementation of chat is not very suitable for our project needs. Also it is a source of bugs and stops project progress a lot. I suggest to investigate this question, how can we rewrite chat and what is the best solution that we can implement. Maybe we need to use websockets instead

So, having studied the packages that can be used to create a chat and more I have chosen Socket IO as the best option for me. To be honest, we have i think only 2 options.

Socket.IO
WebSocket

Socket.IO
Socket.IO is a JavaScript library that enables real-time, bidirectional, and event-based communication between the browser and the server. It consists of two parts: a client-side library that runs in the browser and a server-side library for Node.js.

Client Side: The client-side library runs in the browser and provides an API for emitting and listening to events. It automatically handles connection persistence, disconnection detection, and reconnection logic.

Server Side: The server-side library is a Node.js application and provides an API for sending and receiving messages to/from clients. It also provides rooms and namespaces for managing multiple communication channels.

Advantages:

Connection management: When a connection is interrupted, Socket.IO automatically attempts to reconnect according to the connection strategy that you decide, such as how long it should wait before trying again and how many reconnection attempts it should make.

Rooms: Rooms allow you to group multiple clients together in one channel, so you can broadcast a message to all of them with just one call to Socket.IO.

Multiplexing: Socket.IO’s namespacing lets you divide a single connection into multiple logical connections, which can help you to organize and manage separately the communication for different parts of your application. This is likely to be more resource efficient than running multiple WebSocket connections, especially as it removes the overhead of establishing multiple connections

Reduces development and maintenance overhead: As a realtime messaging library, Socket.IO takes care of a lot of functionality that you would otherwise have to implement yourself if you were using a pure WebSocket implementation, for example, falling back to HTTP if WebSocket is unavailable, reconnecting disrupted connections automatically, and multiplexing.

Disadvantages:

Single region: Socket.IO can only run in one datacenter or cloud region. With no fallback, failures at your cloud provider will take your messaging offline. Driving all traffic to a single geographic location also means users further away will experience higher latencies. In cases where uptime and reliability are critical, consider using a realtime PaaS that has a global network, instead.

Weak message guarantees Socket.IO defaults to 'at most once' delivery. In other words, it promises never to deliver your message more than once - but it doesn't rule out the chance of the message not being delivered at all. That’s largely the same with WebSocket, which relies on TCP’s ordering to deliver messages in order but offers no other guarantees. For anything else, you’ll need to implement it in your application code, whether it’s Socket.IO or WebSocket.

Also i have provided a simple code, that shows you how is easy to use Socket.IO
Server.js:
const express = require('express');
const http = require('http');
const socketIo = require('socket.io');

const app = express();
const server = http.createServer(app);
const io = socketIo(server);

app.use(express.static('public'));

io.on('connection', (socket) => {
    console.log('New client connected');

    socket.on('chat message', (msg) => {
        io.emit('chat message', msg);
    });

    socket.on('disconnect', () => {
        console.log('Client disconnected');
    });
});

server.listen(3000, () => {
    console.log('Server is running on port 3000');
})

Client.js:
import React, { useState, useEffect } from 'react';
import io from 'socket.io-client';

const socket = io('http://localhost:3000');

const Chat = () => {
    const [messages, setMessages] = useState([]);
    const [input, setInput] = useState('');

    useEffect(() => {
        socket.on('chat message', (msg) => {
            setMessages((prevMessages) => [...prevMessages, msg]);
        });

        return () => {
            socket.off('chat message');
        };
    }, []);

    const sendMessage = () => {
        socket.emit('chat message', input);
        setInput('');
    };

    return (

Chat Application

                {messages.map((msg, index) => (

{msg}

                ))}

            <input
                type="text"
                value={input}
                onChange={(e) => setInput(e.target.value)}
            />
            <button onClick={sendMessage}>Send</button>

    );
};

export default Chat;

About WebSocket
WebSocket Wis a standardized protocol that allows for real-time message exchange between clients and servers. It comes with an API that provides access to this protocol. Unlike Socket.IO, which is a comprehensive messaging library, WebSocket is a core web technology maintained by WHATWG, similar to HTML. This means it is supported by all current versions of major web browsers, mobile devices, and backend libraries like ws in the NodeJS ecosystem. Prior to WebSocket, real-time web communication was only possible through methods like HTTP long polling.
WebSocket's main characteristics include:

Bidirectional communication: WebSocket connections are full-duplex, allowing messages to flow in both directions between client and server without interference.

Continuous connections: WebSocket maintains the connection until it is no longer needed or until an issue like a network problem interrupts it. This changes the way we handle messages, as it becomes a continuous resource.

Broad support: As a web standard technology, WebSocket is widely available in browsers, backend languages, and IoT devices.

Emphasis on discrete message delivery: WebSocket operates in self-contained messages, such as a chat message from one participant to all others in a specific chat group. A message is either delivered or not, contrasting with streaming protocols like WebRTC, where losing individual data parts (like a few video frames) is acceptable if it helps maintain the byte flow.

Chat implementation (based on websocket technology)
In this article, I explored websockets and their use. I analyzed many approaches and chose 2 that I liked the most. So grab a cup of tea and let's learn more about these technologies together 🍵😊

WebSocket
Socket.IO

About WebSocket
WebSocket is a standardized protocol that allows for real-time message exchange between clients and servers. It comes with an API that provides access to this protocol. Unlike Socket.IO, which is a comprehensive messaging library, WebSocket is a core web technology maintained by WHATWG, similar to HTML. This means it is supported by all current versions of major web browsers, mobile devices, and backend libraries like ws in the NodeJS ecosystem. Prior to WebSocket, real-time web communication was only possible through methods like HTTP long polling.
WebSocket's main characteristics include:

Bidirectional communication: WebSocket connections are full-duplex, allowing messages to flow in both directions between client and server without interference.

Continuous connections: WebSocket maintains the connection until it is no longer needed or until an issue like a network problem interrupts it. This changes the way we handle messages, as it becomes a continuous resource.

Broad support: As a web standard technology, WebSocket is widely available in browsers, backend languages, and IoT devices.

Emphasis on discrete message delivery: WebSocket operates in self-contained messages, such as a chat message from one participant to all others in a specific chat group. A message is either delivered or not, contrasting with streaming protocols like WebRTC, where losing individual data parts (like a few video frames) is acceptable if it helps maintain the byte flow.

Code example, how to realize chat using WebSocket Protocol
Server.js:
const http = require('http');
const WebSocket = require('ws');

const app = express();
const server = http.createServer(app);
const wss = new WebSocket.Server({ server });

app.use(express.static('public'));

wss.on('connection', (ws) => {
    console.log('New client connected');

    ws.on('message', (message) => {
        console.log('Received:', message);
        // Broadcast the message to all clients
        wss.clients.forEach((client) => {
            if (client.readyState === WebSocket.OPEN) {
                client.send(message);
            }
        });
    });

    ws.on('close', () => {
        console.log('Client disconnected');
    });
});

server.listen(3000, () => {
    console.log('Server is running on port 3000');
});

Client.js

const Chat = () => {
    const [messages, setMessages] = useState([]);
    const [input, setInput] = useState('');
    const [ws, setWs] = useState(null);

    useEffect(() => {
        const socket = new WebSocket('ws://localhost:3000');
        setWs(socket);

        socket.onmessage = (event) => {
            setMessages((prevMessages) => [...prevMessages, event.data]);
        };

        return () => {
            socket.close();
        };
    }, []);

    const sendMessage = () => {
        if (ws) {
            ws.send(input);
            setInput('');
        }
    };

    return (

Chat Application

                {messages.map((msg, index) => (

{msg}

                ))}

            <input
                type="text"
                value={input}
                onChange={(e) => setInput(e.target.value)}
            />
            <button onClick={sendMessage}>Send</button>

    );
};

export default Chat;

Socket.IO
Socket.IO is a JavaScript library that enables real-time, bidirectional, and event-based communication between the browser and the server. It consists of two parts: a client-side library that runs in the browser and a server-side library for Node.js.

Client Side: The client-side library runs in the browser and provides an API for emitting and listening to events. It automatically handles connection persistence, disconnection detection, and reconnection logic.

Server Side: The server-side library is a Node.js application and provides an API for sending and receiving messages to/from clients. It also provides rooms and namespaces for managing multiple communication channels.

Advantages:

Connection management: When a connection is interrupted, Socket.IO automatically attempts to reconnect according to the connection strategy that you decide, such as how long it should wait before trying again and how many reconnection attempts it should make.

Rooms: Rooms allow you to group multiple clients together in one channel, so you can broadcast a message to all of them with just one call to Socket.IO.

Multiplexing: Socket.IO’s namespacing lets you divide a single connection into multiple logical connections, which can help you to organize and manage separately the communication for different parts of your application. This is likely to be more resource efficient than running multiple WebSocket connections, especially as it removes the overhead of establishing multiple connections

Reduces development and maintenance overhead: As a realtime messaging library, Socket.IO takes care of a lot of functionality that you would otherwise have to implement yourself if you were using a pure WebSocket implementation, for example, falling back to HTTP if WebSocket is unavailable, reconnecting disrupted connections automatically, and multiplexing.

Disadvantages:

Single region: Socket.IO can only run in one datacenter or cloud region. With no fallback, failures at your cloud provider will take your messaging offline. Driving all traffic to a single geographic location also means users further away will experience higher latencies. In cases where uptime and reliability are critical, consider using a realtime PaaS that has a global network, instead.

Weak message guarantees Socket.IO defaults to 'at most once' delivery. In other words, it promises never to deliver your message more than once - but it doesn't rule out the chance of the message not being delivered at all. That’s largely the same with WebSocket, which relies on TCP’s ordering to deliver messages in order but offers no other guarantees. For anything else, you’ll need to implement it in your application code, whether it’s Socket.IO or WebSocket.

Also i have provided a simple code, that shows you how is easy to use Socket.IO
Server.js:
const express = require('express');
const http = require('http');
const socketIo = require('socket.io');

const app = express();
const server = http.createServer(app);
const io = socketIo(server);

app.use(express.static('public'));

io.on('connection', (socket) => {
    console.log('New client connected');

    socket.on('chat message', (msg) => {
        io.emit('chat message', msg);
    });

    socket.on('disconnect', () => {
        console.log('Client disconnected');
    });
});

server.listen(3000, () => {
    console.log('Server is running on port 3000');
})

Client.js:
import React, { useState, useEffect } from 'react';
import io from 'socket.io-client';

const socket = io('http://localhost:3000');

const Chat = () => {
    const [messages, setMessages] = useState([]);
    const [input, setInput] = useState('');

    useEffect(() => {
        socket.on('chat message', (msg) => {
            setMessages((prevMessages) => [...prevMessages, msg]);
        });

        return () => {
            socket.off('chat message');
        };
    }, []);

    const sendMessage = () => {
        socket.emit('chat message', input);
        setInput('');
    };

    return (

Chat Application

                {messages.map((msg, index) => (

{msg}

                ))}

            <input
                type="text"
                value={input}
                onChange={(e) => setInput(e.target.value)}
            />
            <button onClick={sendMessage}>Send</button>

    );
};

export default Chat;

Conclusion
Both WebSocket and Socket.IO are powerful technologies for building real-time, bidirectional communication applications, such as chat applications. However, they cater to slightly different needs and come with their own sets of advantages and disadvantages.
Choosing Between WebSocket and Socket.IO
Use WebSocket if:

You need a lightweight, low-level protocol for real-time communication.
You are comfortable implementing reconnection logic, fallbacks, and other features manually.
You require broad support across different platforms and devices.

Use Socket.IO if:

You prefer a higher-level library that handles many of the complexities of real-time communication for you.
You need features like automatic reconnection, rooms, and namespaces.
You are building an application where ease of development and maintenance is a priority.

Thank you for your attention. I hope this small effort has been helpful to you and has assisted with this difficult decision 😊

Thank you for this investigation! Information is really great! Nice work!
I think for this project where we mainly studying new technologies and empowering our knowledge it would be more suitable to choose WebSocket, so we how it's should be implemented under the hood
So when we are comfortable with WebSocket it will be a piece of cake to move to Socket.IO in future work


Rounding Error with scrollToIndex - Looks like an extra pixel is added when using scrollToIndex

Reproduction
https://stackblitz.com/edit/material-scroll-rounding-error
Steps to reproduce:

Keep clicking "NEXT"

Expected Behavior
What behavior were you expecting to see?
Moving next shouldn't make the item look like it moved down. In essence, a pixel is being added at the top and so the view is not on the next item but still on the previous item.
Actual Behavior
What behavior did you actually see?
The scroll should be at the top of the next item.
Environment

Angular: 7
CDK/Material: 7
Browser(s): chrome
Operating System (e.g. Windows, macOS, Ubuntu): Windows

EDIT
This only breaks on my laptop. When I plug into the ThinkPad station, the StackBlitz doesn't break. Maybe the issue has to do with screen size as well.
Material Scroll Error (Laptop only)
https://i.imgur.com/cTzlSrk.mp4

I should note that I am changing the item size to fix the problem in the meantime.
So, this bug might be low priority.

Maybe related to #15259

@jelbourn and I tested this on a few different machines with various screen sizes and couldn't get it to reproduce. Do you have more information about the environment for which this happens?

Closing since we haven't been able to reproduce this on our end.


extract the ValuesAwareExpressionAnalyzer

so that it can be re-used in the insert-from-query case too.

ack


Revert matcher package

The new matcher package deprecates isInstanceOf which seems eggregious.
On the assumption that this will eventually become a function, I've made a function here in flutter_test and removed the "const" from calls that come from the flutter framework. I'll add a note to the changelog.

cc @gspencergoog

is this just for flutter's code – or will this constraint affect all users of Flutter, too?

it affects any pubspec depending on flutter_test or other packages in the flutter sdk.

There are a bunch of places where you're still using const isInstanceOf, more than just the three I pointed out.  You might want to make another pass to remove the consts, if you want to prepare them for using the function.

Ahh, I see.


fix: enable --env-file flag behavior in nerdctl compose

While debugging this issue on finch - Unable to use the "--env-file" option on "finch compose up" command #890
I noticed that nerdctl also fails to set the env variables within the container when using the "--env-file" option.
$ sudo nerdctl compose up --env-file .env.test show-env
INFO[0000] Creating network testing_default
INFO[0000] Ensuring image busybox
INFO[0000] Creating container testing-show-env-1
INFO[0000] Attaching to logs
show-env-1 |PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
show-env-1 |HOSTNAME=show-env
show-env-1 |HOME=/root
INFO[0001] Container "testing-show-env-1" exited
INFO[0001] All the containers have exited
INFO[0001] Stopping containers (forcibly)
INFO[0001] Stopping container testing-show-env-1

This behavior is also seen on nerdctl compose run command as well.
Digging around the up_service.go file I noticed that we're not passing the --env-file flag to the run command here
Adding --env-file to the Run argument fixes the issue for both compose up and compose run commands.
Testing done:
Verified that the env variables are available within the container.
sudo .././_output/nerdctl compose up --env-file .env.test show-env
INFO[0000] Ensuring image busybox
INFO[0000] Re-creating container testing-show-env-1
INFO[0000] Running [/local/home/<user>/<project>/nerdctl/_output/nerdctl run --cidfile=/tmp/compose-3618749869/cid -l=com.docker.compose.project=testing -l=com.docker.compose.service=show-env --env-file=.env.test -d --name=testing-show-env-1 --pull=never --net=testing_default --hostname=show-env --restart=no busybox env]
INFO[0000] Attaching to logs
show-env-1 |PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
show-env-1 |A=1
show-env-1 |B=2
show-env-1 |HOSTNAME=show-env
show-env-1 |HOME=/root
INFO[0000] Container "testing-show-env-1" exited
INFO[0000] All the containers have exited
INFO[0000] Stopping containers (forcibly)
INFO[0000] Stopping container testing-show-env-1

Needs rebase

Updated the doc, running into some issues with testing.
Have a test on my fork,
The docker compose command doesn't seem to pass the env-file to the container either. Container logs


Properly label mtest in CMake to allow external use

Allow mtest to be properly labelled in CMake with project exports to allow distribution and external use.
This would allow one to use find_package(mtest) and (possibly?) pkg-config with mtest such that a package manager can handle the install/update of mtest as a project.
This is compared to the current methods of installing mtest using FetchContent or git submodules. Neither allows an external management of dependencies, for example in packaging up C projects.
An example layout for this would be like:

The include folder gets exported into a include or include/mtest.
The cmake folder gets exported into a share/cmake or share/cmake/mtest folder.
Set up the relevant package descriptions for versioning. (F.x. COMPATIBILITY AnyNewerVersion).

I have personally been looking at how googletest does this, but my skills with CMake is sadly not sufficient for creating a PR with these changes applied.

I will be continuing to work on this, but it may require some time.

I originally attempted this without success, so I decided to keep it simple and just use FetchContent.
Good luck, here is a useful reference: https://cmake.org/cmake/help/latest/guide/importing-exporting/index.html#exporting-targets


protoc-gen-go: fully generate marshaling and unmarshaling code

The Conversation started in https://github.com/golang/protobuf/issues/276

Is there a possibility of golang/protobuf starting to generate some marshaling and unmarshaling code?
I would recommend this over any use of unsafe, since then protocol buffers doesn't just play nice with appengine, but also gopherjs.
Also generated code is much faster, which is one of the reasons people flock to gogoprotobuf.
It would also be great if the generated code didn't depend on the proto package.
But this is just my personal wish, one less dependency for users of a package using protobufs.

Walter Schulze

We're looking into ways to speed up marshal and unmarshal. Entirely generated code seems unlikely to be the right end point (too much code, not enough performance win), but we're evaluating multiple points in the solution space. Code not depending on the proto package at all is an interesting idea, although that implies even more generated code. I don't think that was on our radar.

@rsc

I really think the amount of speed gained is significant enough to warrant the extra code generation for marshal and unmarshal.
Here is an independant benchmark
https://github.com/alecthomas/go_serialization_benchmarks
BenchmarkGoprotobufMarshal-8                2000000        746 ns/op      312 B/op        4 allocs/op
BenchmarkGoprotobufUnmarshal-8              2000000        978 ns/op      432 B/op        9 allocs/op
BenchmarkGogoprotobufMarshal-8             10000000        211 ns/op       64 B/op        1 allocs/op
BenchmarkGogoprotobufUnmarshal-8            5000000        289 ns/op       96 B/op        3 allocs/op

Also once you have those methods, the extra generated code required to not use the proto package is very little.

fyi /cc @randall77 @cherrymui

This surely cannot be news?
But if it is, this is gogoprotobuf, it does code generation (and other gadgets) for protobuffers for go, since 2013.
https://github.com/gogo/protobuf
It has users, including Kubernetes
https://github.com/gogo/protobuf#users

One of the newer things you can do with gogoprotobuf.
Using this command you can still import github.com/golang/protobuf/proto, but get the generated marshaler, size and unmarshaler.  So only your code generation steps depends on gogoprotobuf.
go install github.com/gogo/protobuf/protoc-gen-gofast
protoc --gofast_out=. my.proto

Maybe this can give you an idea of what generating code in golang/protobuf would be like.

Bump, this discussion should be revisited, as it still has no satisfying conclusion. Recent discussion implies this still hasn't been closed as a possibility. What are the current thoughts on this?

Wanted update this thread. @neild and I have talked on/off about this in the past. One of things we'd like to explore first before addressing this is to figure out whether to provide a streaming or scatter/gather API (see #609). One significant challenge with generated code is that the implementation easily grows stale unless users regenerate the code (which rarely occurs as has been observed).
Though it's not a hard ordering requirement, we would presumably want to know if we're going to go anywhere with streaming or scatter/gather APIs before doing generated serialization as the former would likely affect the internal APIs and implementation of the latter.

planetscale/vtprotobuf Can be used to generate these methods. I think it's best if it is optional and don't mind it living in a separate repo (just like grpc). Because a majority will not significantly benefit from the extra speed and most likely will grow to need this rather than need it from the on set.
One important requirement for tools like vtprotobuf to work more seamlessly is to support custom marshal/unmarshal interfaces similar to encoding/json. I am not familiar with how proto.Marshal works but in my understanding it is as simple as checking for the interface on messages and calling the methods if it satisfies.
Eg:
type Marshaler interface {
	MarshalPROTO() ([]byte, error)
}

func Marshal(v Message) ([]byte, error) {
     if m, ok := v.(Marshaler); ok {
           return m.MarshalPROTO()
     }
     // Current implementation
}

Similarly for unmarshal.

I've just finished optimising an application as much as I feasibly can for the time being, and I'm at a point now where just over half of the CPU time when under a load is dedicated solely to unmarshalling ProtoBuf messages. Historically, we did use gogoproto, but of course it's now deprecated, so we now use the most up-to-date official method.
I'm really keen to see this at least become an option. The difference, as has been illustrated in the first comments here, are huge. In my current use-case I'd see a pretty significant speed boost!

I am not sure why they are hesitating to implement this. This clearly has benefits and there is unnecessary fragmentation in Go protobuf ecosystem because of this.


Unable to setup codebase of VSCode to contribute

I cloned this repository and run scripts\npm.bat on my windows machine and got these errors:

@jrieken since saw your name in the error log.

Tried on home network now, it seems like cloning is done but I got another warning and error messages.

Did you go through this guide? https://github.com/Microsoft/vscode/wiki/How-to-Contribute#installing-prerequisites

Closing this because this works well on our dev machines and all our build machines. Feel free to ask more questions, but no code change from our side is planned

Of course, no code needs to be changed. But didn't anyone else get the same error yet? Or any hint after seeing my error screenshots?


Add New Member Services Director & DI

:tada: This PR is included in version 6.9.4 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


PIN Handling

This issue is opened to continue the discussion started in #49 in regards to how user PINs are handled by the cryptoki library wrapper.
Currently, when a user wishes to login, they must first call set_pin in the Pkcs11 struct which stores the pin in a HashMap, keyed to the Slot.  Then the user may call login on the created Session object.
Any other function that directly handles pins (those that expose the C_InitToken, C_InitPIN and C_SetPIN functionality) wraps the provided PIN within a Secret structure and passes a pointer to the appropriate PKCS#11 function.  Upon completion of the function, the Secret structure will drop and zeroize the memory.
My first proposition is to drop the pins HashMap member in the Pkcs11 struct and provide a pins parameter to Session::login
First, if the user wishes to change which user is logged in (say going from CKU_USER to CKU_SO) the must call set_pin to change the pin and then call login. This requires the implementer to track which pin is currently being stored by the library to ensure they are logging in with the correct pin.
Secondly, and this is a personal preference thing, I do not believe the library should be storing the user's passwords.  I believe the user should be the one that controls where their sensitive data is stored and be responsible for it, rather than ourselves.
Thirdly, and this is one of those weird PKCS#11 corner cases, there are situations where you may not want to provide a password to C_Login.  For example, if the flag CKF_PROTECTED_AUTHENTICATION_PATH is set in token flags, that indicates there's a separate way of logging into the token (e.g. finger print reader, smart card reader, etc).  In this situation, you must pass a NULL_PTR to C_Login to take advantage of that alternative authentication path.
My second proposition is to drop Secret and instead just pass the pointer from the provided str slice to the appropriate C_ function.  If this isn't possible, then anytime a pin is provided and needs to be copied somewhere on the stack that is controlled by the library, then use Secret.

To just add one more thing, I think we should wrap any provided attributes used in object creation (e.g. Session::create_object) in Secret to ensure we do erase any sensitive data the user provides.  An example would be creating an AES key using Session::create_object.  In this situation, the operator is required to provide the value of the AES key in the CKA_VALUE attribute.

Thanks for the issue!
I found the original PR where we changed to store the PIN (here). I thought there was a specific reason why we did that but it appears it was only for convenience, to not have to enter it everytime.
However, I fully agree with your points:

calling set_pin multiple times if you change user type feels a bit clunky
the logic could be simplified if the pins field was dropped
no double set_pin method in the interface
not storing the password in the library is actually safer in a security point of view

So I would be in favour to remove that and add the PIN value as a method parameter!

Thirdly, and this is one of those weird PKCS#11 corner cases, there are situations where you may not want to provide a password to C_Login.

I didn't know that but it's a good point as well!

My second proposition is to drop Secret and instead just pass the pointer from the provided str slice to the appropriate C_ function.

Totally agree if it's possible! Another reason why we clone the PIN on the stack (and then have to zeroize it later) is because we convert it to a CString. I thought that this format was required in order to pass it to PKCS11. If it just works with &str, we maybe actually don't need to do that? I have to admit I have never tried!

To just add one more thing, I think we should wrap any provided attributes used in object creation (e.g. Session::create_object) in Secret to ensure we do erase any sensitive data the user provides.

Agree that generally we should zeroize sensitive memory that we allocate but without necessarely having to force the users to use those funky types. They can be responsible of zeroizing their own memory.

Another reason why we clone the PIN on the stack (and then have to zeroize it later) is because we convert it to a CString. I thought that this format was required in order to pass it to PKCS11. If it just works with &str, we maybe actually don't need to do that?

According to PKCS#11, the PIN may be any valid UTF-8 character, and str slices are always valid UTF-8 so I believe that it should be ok to just pass it in as is. 🤞
I'll take a stab at this.
As a side note, I know one of the main projects that uses this is parsec.  I'd imagine the changes I'm making here (and others that just recently got merged into main) will probably break the PKCS#11 'interface' in parsec.  I don't mind jumping in there and fixing those, but I'd imagine that project is on a stricter release schedule.  What is the plan on integrating updates from this crate into parsec?

Just one note here, though it's mostly a FYI and not directly an argument here (for reasons that I'll mention):
The TPM Software Stack (or more precisely the Enhanced System API layer) does something somewhat similar. Objects can have authorization values in TPM world, which are used to "authorize" commands (via MACs) sent to the TPM, so normally if you work with a low-level API you have to use the authorization values all the time. The ESAPI layer takes care of that for you - you tell it the value (which it stores), and then you can use the object without worrying about the authorization stuff. I think we might've been aiming for a similar "feel" to the API.
The reason that sort of approach doesn't work here is because the use case seems quite different, I guess :) It might be a bit of a change in Parsec to have to provide the pin every time, but it shouldn't be a big deal

It might be a bit of a change in Parsec to have to provide the pin every time, but it shouldn't be a big deal

Is this because Parsec doesn't open and maintain a session for an extended period of time?  (I've only really glanced through the project so I'm not sure all of its use cases).  If you open one session on a PKCS#11 compliant token and log into it, and keep that session open, all other sessions opened on that same token (within the same process) share that same login 'state'.
For example:
Thread 1: Opens R/W session on slot 2, logs in as CKU_USER
Thread 2: Opens R/O session on slot 2 -> Already logged in as CKU_USER

And I appreciate hearing other points of view on how other projects utilize the P11 api... my perspective, as I've said before, is from a spec implementer which is definitely a different point of view than someone who utilizes said spec.

It might be a bit of a change in Parsec to have to provide the pin every time, but it shouldn't be a big deal

I think it should be fine, it should be only one line change here, we would need to store the pin in the Provider structure.

Is this because Parsec doesn't open and maintain a session for an extended period of time?

Everytime Parsec receives a request to be performed on the PKCS11 provider, it creates a new session (in its own thread) via the new_session method linked above.

all other sessions opened on that same token (within the same process) share that same login 'state'

Yes, I remember that we were very surprised to notice that peculiarity when we started working with PKCS11 😅
There is a feature in cryptoki to manage that actually: the crate remembers what sessions are logged on which slot and ignore the login/logout calls if another session is already logged in.
It means that in the Parsec side it is then fine to call login/logout at the start/end of every thread.
It is a bit opinionated and I am happy to discuss that particular feature.

I'd imagine the changes I'm making here (and others that just recently got merged into main) will probably break the PKCS#11 'interface' in parsec.

I think generally for cryptoki and the other crates we maintain we should not care about Parsec when developping but should do what's best for the crate 👍 We want this crate to be successfull and usefull by itself 😃
If you are curious (but you are not required to!!), the PKCS11 Parsec code is in here.

There is a feature in cryptoki to manage that actually: the crate remembers what sessions are logged on which slot and ignore the login/logout calls if another session is already logged in.
It means that in the Parsec side it is then fine to call login/logout at the start/end of every thread.

Yeah I noticed that.  I actually am in the process of removing it 😰
My thinking is that you should rely on the token to maintain it's state and not try to 'help' it.  There's always a risk of the token and the library getting "out-of-sync" when both are trying to maintain the same state.
Here's the page in the P11 spec that talks about session coherency.  Definitely read through section 2.6.8.  It is a bit verbose but does a good job explaining how sessions are supposed to be handled on a token, as well as how session objects are handled.  Session objects created on a session with CKA_TOKEN set to CK_FALSE, but once created are accessible to all sessions opened by the same process on the same token.
Parsec should probably just open a session once it starts up, log into it, and just maintain that session throughout the life of the process.  Than when any request comes in, it can simply open a new session and then either perform the operation or check the state using the get_session_info and check the state value to ensure it's logged in (which it should be).

Thanks for the link. I had a read and I understand that it would definitely make the logic easier if a "login" session is kept open as long as Parsec lives.
I think we thought of that as a possibility but were worried about the security there: Parsec might stay up for a long time (as long as the system is up actually which might be very long) and during all that time all of the sessions will be logged in.
Now reading this page, those are only sessions open by the Parsec application (and not others) so it might be fine.

That type of behavior (opening a 'logged in' session for the lift of the application) is, as far as I've seen, the pretty typical thing that other P11 applications, like CA's, do.  It's a way of P11 putting the onus of security on the user application.
Also, don't kick yourself about not knowing this - during development on a previous project, we completely missed the session object coherency requirement until we shipped... that was a little embarrassing when our customer called and asked why we weren't spec compliant 😓   But hey, live and learn 😄

That type of behavior (opening a 'logged in' session for the lift of the application) is, as far as I've seen, the pretty typical thing that other P11 applications, like CA's, do.

If that's the common thing to do then I am fine to adopt hat in Parsec too! We can always add mitigations to open/close the "logged in" only when it's needed.
But yeah again, what we have to do in Parsec should not influence this crate! So I am happy to go forward with that 😄

Also, don't kick yourself about not knowing this - during development on a previous project, we completely missed the session object coherency requirement until we shipped... that was a little embarrassing when our customer called and asked why we weren't spec compliant 😓 But hey, live and learn 😄

oops 😅

I guess we can close this now?

Yup, I'm good with it


Mongo migration

Mongo migrations (#810) for flyway are here! Specify migrations using the db.runCommand in javascript files. You can also write mongo migrations in java class. Please refer to flyway-sample-mongodb project for a quick example.

Is there a timeline for the merge and subsequent release?

@nedkoh Not sure when this PR will be merged. If you don't want to wait, you can use the Mongo feature here.

@khatkar any chance that you will update this PR. Can I help you somehow to speed up merge?

@stalniy I will update this PR in couple of days.

@axelfontaine is there anything what delays this PR?

Could anybody tell if this PR will be merged someday? I'm really waiting for this. Maybe their are some reason why this isn't still merged.
Any progress, even a discussion, would be nice!

same here, it would be really useful...

Closing because I'm no longer able to maintain this.


Error on release task

TypeError: Cannot read property 'replace' of undefined
The error occurs because git push does not work properly. Changes are not made in origin/master, the new tag does not appear.

Adding url: 'https://api.github.com/' to the auth param of conventionalGithubReleaser() solved the problem, because the value endpoint is no longer undefined.


Create happiness bar

Create health bar functionality above pet so we can monitor how we are taking care of the pet

2/13: Changed the issue to be a happiness bar since the feeding mechanic might be better suited to deal with the health bar.

Acceptance Criteria:

Have a visible bar element that keeps track of pet's overall health.
The health bar should go down over time.
Feeding the pet should restore the health bar by some value.


When TRITON_CONFIGS is not defined, default to a null configuration.

This is a PR to address some of the errors I've had in making example sites. If you don't define TRITON_CONFIGS as an env variable, you get an error like:
2016-02-11T16:54:46.959Z - error: [react-server.core.renderMiddleware] Error rendering element 0 message=TRITON_CONFIGS environment variable required to start server., stack=Error: TRITON_CONFIGS environment variable required to start server.
    at module.exports (/Users/sashaaickin/code/react-server-test-2/node_modules/react-server/target/server/config.js:17:11)
    at getNonInternalConfigs (/Users/sashaaickin/code/react-server-test-2/node_modules/react-server/target/server/renderMiddleware.js:904:19)
    at bootstrapClient (/Users/sashaaickin/code/react-server-test-2/node_modules/react-server/target/server/renderMiddleware.js:809:13)
    at writeElements (/Users/sashaaickin/code/react-server-test-2/node_modules/react-server/target/server/renderMiddleware.js:773:4)
    at doElement (/Users/sashaaickin/code/react-server-test-2/node_modules/react-server/target/server/renderMiddleware.js:601:3)
    at /Users/sashaaickin/code/react-server-test-2/node_modules/react-server/target/server/renderMiddleware.js:609:11
    at /Users/sashaaickin/code/react-server-test-2/node_modules/continuation-local-storage/context.js:74:17
    at _fulfilled (/Users/sashaaickin/code/react-server-test-2/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/Users/sashaaickin/code/react-server-test-2/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/Users/sashaaickin/code/react-server-test-2/node_modules/q/q.js:796:13)

If you do define TRITON_CONFIGS but there's no config.json in that directory, then you get another, similar error about the file not existing. In either case, the render messes up and doesn't send down window.__tritonState, so the client code never reconnects.
I'm not entirely sure if an empty config.json is valid, although it seems to work in my limited testing.
Longer term, I think it may be best to follow the eslint/babel convention of having a .reactserverrc file and/or a section in package.json, but for now, this makes it so you don't have to make a dummy config.json just to get things running.
Note that this code still throws an error if TRITON_CONFIGS is defined but there's no config.json in the directory. That's by design, as it seems like an error to me if you deliberately set the variable but don't have a config file there.

Thanks @aickin.  This is way nicer default behavior.
@davidalber is getting the CLA set up, then we can get this merged in.

Longer term, I think it may be best to follow the eslint/babel convention of having a .reactserverrc

Yeah, that sounds cool.  Also, when there's a CLI, being able to point to config with a command-line option would nicer than setting an environment variable.

👍 Thanks, @gigabo!

Thanks for jumping right in, @aickin! We have added a CLA and integration to this repository since you opened this PR. Please take a look here.

Read and signed. Thanks!


Relicense to dual MIT/Apache-2.0

This pull request was automatically generated because my scripts detected that
everyone in the relicensing issue agreed to
relicensing.
License headers in files were not updated, if they exist. I've reproduced an
example license header below if you want to copy-paste it in. If you don't
have license headers, don't feel compelled to add
them.
// Copyright 2016 approx Developers
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.

I recommend publishing a new patch version (the z in x.y.z) so that the
metadata propagates to crates.io.
Please be sure to check the README.md for style. I've try to
review these PRs as they go out, but I might miss something.
Thanks for relicensing!
(For my bookkeeping: this is repository id approx-f4d1f465-b562-4afa-ab14-4265ccd864d2)

I'm afraid this has to be closed, because now there are more contributors who would have to be asked.


Tflite own trained model is not running

I am using tflite object detection android sample the project is running perfectly with default model but when i change my custom object trained model and build on phone then application crushed. Is there are some steps to change model ? I just imported my tflite model in asset folder and changed name in DetectorActivity.java and DetectorTest.java. Is there any more step i need to do please let me know.
Thank you

@syedali1621,
In order to expedite the trouble-shooting process, please provide a code snippet to reproduce the issue reported here. Thanks!

@syedali1621,
In order to expedite the trouble-shooting process, please provide a code snippet to reproduce the issue reported here. Thanks!

@syedali1621,
Please find the steps for using a Custom Object Detection Model.
Thanks!

@syedali1621,
Please find the steps for using a Custom Object Detection Model.
Thanks!

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!


2.0 connect order

Fixes #4228. Introduces in PropertyEffects a _readyClients method which is called the first time client elements need to be flushed. It can be used (and is in ElementMixin) to attach element dom to the element to ensure that element dom connected to the element by the time element property observers, ready, and connected are called.

@kevinpschaaf LGTM'd.

This commit may have affected the ready/attached(connected) order between parent and child elements (under the native shadow DOM at least). The parent's ready used to be called before the child's attached and it is now reversed.
There are quite a few instances across PolymerElements where child elements fire 'xxx-register' event from their attached callback and parent adds them to a collection (a property that's initialized when parent becomes ready).


Fix #if

:tada: This PR is included in version 1.0.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Correct orientation of JPEGs with EXIF rotation

See https://github.com/golang/go/issues/4341 for details of the underlying problem, but in a nutshell, many common image editors avoid lossy recompression of JPEGs by setting an orientation flag in the EXIF metadata of the file. Unfortunately, Go's image/jpeg library still does not correctly handle this as of Go 1.12 beta, but it's a real pain if you have an image that "looks right" in Finder, Safari, etc. but is incorrectly oriented when processed by Hugo.

#5181


Cursed rx 6800m installation/ better support for gfx1031

I wasted 4 days trying to install rocm in ubuntu 20.04 to no avail, either amdgpu-dkms didn't wanted to install or the 5.13 ubuntu kernel was too old, or it had no candidates for 5.17, the only 2 times i got it "working" (after restarting my laptop it just blanked out) running hipinfo returned me "hipErrorInvalidDevice(101) at hipInfo.ccp:205" failing the test, i tried following the 5.1.1 guide to no avail, i tried other methods even diferent kernels, amdgpu-dkms would always fail me

Your GPU is not supported. Given that Navi 21 is supported like 2 months ago, I don't think Navi 22 support will be available anytime soon, possibly never.

Your GPU is officially not supported. Given that Navi 21 is supported like 2 months ago, I don't think Navi 22 support will be available anytime soon, possibly never.

why is that?, it's a rdna2 gpu, that is ridiculous

Your GPU is officially not supported. Given that Navi 21 is supported like 2 months ago, I don't think Navi 22 support will be available anytime soon, possibly never.

why is that?, it's a rdna2 gpu, that is ridiculous

To be honest I do not know lol. It just one of those AMD and their infinite wisdom thing. Though I did think someone got success when compiling from the source with the 6700 XT (Also Navi 22). Try #1668
Hey, if you got it up and running, please tell me. I will be heading out and buy one 6700XT too.

@ROCmSupport could you share insight into why there is little to no support for consumer cards? even though it's the same architecture?

@ROCmSupport could you share insight into why there is little to no support for consumer cards? even though it's the same architecture?

Well it does work with consumer card, it just has to be Navi 21: Rx 6800 and above.
The reason I guess is that AMD do not have the intend or resource to do the testing for Navi 22 and lower, so they just drop the bomb altogether. Seeing compiling from the source by replacing gfx1030 with gfx1031 works, this is the most likely reason imo.

Really do wish AMD spend more of their budget on Rocm. Their strategy of approaching ML is basically giving the consumer market to Nvidia at this point lol.

@ROCmSupport could you share insight into why there is little to no support for consumer cards? even though it's the same architecture?

Well it does work with consumer card, it just has to be Navi 21: Rx 6800 and above. The reason I guess is that AMD do not have the intend or resource to do the testing for Navi 22 and lower, so they just drop the bomb altogether. Seeing compiling from the source by replacing gfx1030 with gfx1031 works, this is the most likely reason imo.  Really do wish AMD spend more of their budget on Rocm. Their strategy of approaching ML is basically giving the consumer market to Nvidia at this point lol.

@ROCmSupport is that true?

@ffleader1 I am new (again) at AMD and, while I am not working on this project, I am trying to understand the full story and see how the current situation can be improved.

@ffleader1 I am new (again) at AMD and, while I am not working on this project, I am trying to understand the full story and see how the current situation can be improved.

Well that is interesting. I do wonder how many people are working on Rocm at AMD. It is confidential for sure but my wild guess is 2-3 ppl as the core programmer.
There is not much to talk about besides the obvious fact that Rocm is dragging their feet while even Microsoft is arguably doing AMD a better job in this field.
Rocm has 2 majors disadvantages compared to CUDA:

It does not work on Windows
Its number of supported GPU is countable by toddler
Issue 1 is a huge problem for sure, but I imagine it will require major code revision. And also since Microsoft is dọig AMD favor on Windows already, that conversation could be put away for another day.
Issue 2 is what gets me. Like AMD rep promised of Navi 1 gen supported... Nope, did not happen. There has been so many issues opened on this so I really don't feel like bother citing.
For Navi 2 gen, AMD technically support it... for like 3 cards on the consumer side (Navi 21 includes 6800, 6800 XT, 6900 XT), and they don't event include it in the official doc. Worst part it Rocm actually could support lower Navi 21 GPU, evident by the fact that changing the gfx1030 number in the source code, to say gfx1031, and compile from the source and Rocm could work on 6700 XT {not sure the latest version does but previous version can for sure). I think this is the lack of resources for AMD to do the testing for lower card, thus basically abandon them together.
So yes, both issues have led to the state in which Rocm is used exclusively by 3 people. Rocm is like the bulldozer in ML world.
I think AMD is despair for resource on this project. So their strategy now is abandoning the consumer segment and only aim for the big-budget enterprise environment. This is imo a bad move, but what do I know.
Anyway, at least they can provide support for more GPU. That is for sure within their range. They do not have to test it though. They can just come out and say: Look, here is the "Unstable" rocm version that supports 6700XT, 6600XT, 6500XT, 6400 or whatever. We did not do a lot of testing, hence the label "Unstable", but is still here, for you (the consumer market, not the enterprise market) to chew, and we welcome feed back.

@ffleader1 I am new (again) at AMD and, while I am not working on this project, I am trying to understand the full story and see how the current situation can be improved.

Please move strings, make noise, there are lots of talented people who could develop stuff for hip, but can't because of its little support

I haven't tried compiling the source with gfx1031 yet, but honestly if it is all it takes, I don't get it.
A bit over a year ago, PyTorch started support for ROCm, and AMD has a community build for support of Tensorflow since September 2019.
Before that it was arguably better to ignore the consumer market but now that both of the major ML frameworks support ROCm, the only thing stopping AMD from having an actual impact on the ML market is their lack of support for consumer cards.
Even research labs don't necessarily use "pro" cards because of the costs, the uni I went to had a cluster that was mostly made of 2080 Ti, and in that case using AMD hardware was not even a question because support for ROCm takes so long to come on their last consumer cards, as if it is an afterthought (which is likely the case, unfortunately)...
As a result, consumer cards don't have ROCm => interest in ROCm is limited => people think CUDA is required for ML, so they buy Nvidia by default.

I haven't tried compiling the source with gfx1031 yet, but honestly if it is all it takes, I don't get it.
A bit over a year ago, PyTorch started support for ROCm, and AMD has a community build for support of Tensorflow since September 2019. Before that it was arguably better to ignore the consumer market but now that both of the major ML frameworks support ROCm, the only thing stopping AMD from having an actual impact on the ML market is their lack of support for consumer cards.
Even research labs don't necessarily use "pro" cards because of the costs, the uni I went to had a cluster that was mostly made of 2080 Ti, and in that case using AMD hardware was not even a question because support for ROCm takes so long to come on their last consumer cards, as if it is an afterthought (which is likely the case, unfortunately)... As a result, consumer cards don't have ROCm => interest in ROCm is limited => people think CUDA is required for ML, so they buy Nvidia by default. All it would take to change that is thinking about ROCm when shipping new hardware, and actually giving support, rather than hiding it from the official documentation. They are losing the ML market for no real reason.

I think it is because there is not enough resources for them to validate those lower-end cards, and so they think of the bad reason like: Rocm is aimed for processional, so **** you all casual consumers.
Anyway, I believe this whole stinky state is due to AMD has lost its interest in the ML side of thing, or Rocm precisely.
Rocm was written for Linux, and only Linux. No matter how much PR or master-racism from Linux fanboy (and there is a lot), a niche software stack written only for Linux will never prosperous with the mass. And when it doesn't you can really have much to show about its potential, isn't it? And when you do not have much to show, you lose interest. And when you lose interest, you do not spend more money to upgrade the software stack...
We have gone through the full circles of Rocm.
I know many companies using 3090 Ti for training. Seems like a good deal considering for the price of a Tesla A100, you can get 16 of the 3090 Ti. So, abandoning the consumer market is a bad bad bad move. But, well... no interest then no budget, no budge then no progress, no progress and no interest.
 But that would require some kind of major direction change, which... meh... I would rather trust Microsoft DirectML than this.

It seems amd won't give a proper explanation, turns out its easier to use rocm stuff on windows  than in linux thanks to antares.

First time I heard of this. Learned something new. Thank you. But does it work with your 6800M though?

it did, hipinifo werked, and i could do other things

it did, hipinifo werked, and i could do other things

What Rocm version though. I want to get a 6700 because it's more in my budget than a 6800. But the 6700 is not supported by Rocm current version. Does antares have some kind of special "sauce".

it has some sauce, it's not meant for full rocm emulation, for what i understand it compiles something you can add to your sourcecode so your code uses amdhip64.dll, and it seem that dll has a wide support for gpu's You can compile hip code and run it on windows, and so on, pytorch stuff too.

@LuisB79 GFX1031 (AMD Radeon 6800m, Flounder) works great on python-pytorch-rocm archlinux package.


chromium: update

Motivation for this change
Chromium just released another stable with several CVEs fixed.
Things done

[o] currently building stable on my machine

cc @aszlig

Let's link #20274

Does some of you watch backports of updates? Ref: https://github.com/NixOS/nixpkgs/issues/20748


getMetaData().getPrefix() is returning null

Description
Im using the latest version of LuckPerms but when I try getting the prefix from the group metadata it returns null. The metadata isn't null so its a problem with the prefix.
Reproduction Steps
Get the metadata of a group and then use .getPrefix() which returns null.
Expected Behaviour
I expected to receive the prefix from the group a player is currently parented inside.
Server Details
git-Paper-55 (MC:1.20.1)
LuckPerms Version
v5.4.98
Logs and Configs
https://gist.github.com/ItsIsaacIO/c1e50b317ac1020ac3ef093485953095
Extra Details
No response

Can you also provide your code that you used?

CachedMetaData.getPrefix() is able to return null when there is no resulting prefix (no prefix was set, no existing prefix applies in current context, etc.). If that's unexpected, it suggests wrongly configured prefixes in your permission setup or plugin configuration.


gemcitabine ref

@aarmey do you mind merging this? I replaced the doi by pmid but I am not sure If the problem is resolved. If it still was ??? I will add it to the references manually.


String Filter doesn't convert field values to strings automatically

Hi there,
I run into a problem with String filter.
Let's say for User model, we have a string column called age.
We can do it in rails:
 User.create(age: 21)

But we can't do the same thing with interaction
class UserCreate < ActiveInteraction::Base
  string :age

  def execute
    User.create(age: age)
  end
end

UserCreate.run(age: 21).errors.messages
=> {:age=>["is not a valid string"]}

How do you think about adding auto cast feature to String filter?

In this case why wouldn't you use an integer filter?

Let's say we want to create a record from params.
class Listing < ActiveRecord::Base
  connection.create_table :listings, force: true do |t|
    t.string :listing_type
  end
end

class CreateListing < ActiveInteraction::Base
  string :listing_type

  def execute
    Listing.create(listing_type: listing_type)
  end
end

However, the params listing_type sent from JSON request is integers; while the params listing_type sent from the web form is strings.
In this case, CreateListing.run(params) would raise error.
Since integer filter does convert the input to integers, I wonder why string filter doesn't convert the input to strings.

Converting between types can get tricky. The only reason we convert from strings into other types is that strings rule the world. All the params from the web request will be strings. Not handling strings would make everything incredibly painful. You'd have to convert everything yourself. Outside of that we've taken the trade-off of safety over convenience. You won't accidentally pass an array to a string input and get some crazy outcome.

@AaronLasseigne , thanks for the explanation. 👍


Fixed #13875 -- Made submit_row templatetag pass whole Context

See [#13875] submit_row templatetag should pass whole context.

buildbot, add to whitelist.

The test doesn't seem to be a proper regression test as it passes before the fix is applied.

@timgraham I can't think of a proper regression test which wouldn't need to add a custom app and a custom admin, maybe you can point me to a simpler solution

Would it be feasible/simple to call the submit_row template tag standalone?

I didn't think about that. I will try and let you know. Thanks.

I followed your suggestion and I have been able to write a proper regression test which fails before applying the patch. Will leave some questions with inline comments.

@timgraham style issues corrected

One more request: could you move the new test to a new test_templatetags.py file?

yes, that's a good idea. The main tests.py file is really too long. I just moved the changes to test_templatetags.py, ran isort and flake8. Let's wait for the build..

merged in e972a7d03d81b2b336eb430a61d7215a3e6c4763, thanks!

:+1:  thank you


Use k8s/client-go v8.0.0

Avoids including juju/ratelimit licensed under LGPL3.
Updated with dep v0.5.0.
Fix #3358

LGTM. Don't see any breaking changes with v8.0.0 that can impact so should be fully compatible.


added new C programs, moved misplaced files

Associated Issue: #57
Summary of Changes

Moved euler/4/squarediffs.py and euler/6/palindrom.py to their correct locations.
Added first solution to duplicate-element in C++ with solutions discussed in the README.
Added additional solutions to closed-loops and reverse-string in C as well as factorial in Haskell.

Yay! Thanks for the solutions. 👍


Dynamically load the questionnaire within ngx-formly based on business rules [multiple condition].

Using ngx-Formly we need to render form dynamically based on the questions response from backend i.e. CMS which we will be getting it via API call but along with it all questions should not render to user.
Subsequent Questions should be shown based on previous questions [more than one] answer.
e.x. :
Q1 - First question [ YES/NO]
Q2 - Second question [ Dopr Down with Option 1,2,3]
Q3 - Third question [ This question should show if Q1 answe is YES and Q2 option selected is 2]  .
I have tried using oneAll, allOf from JSONFormlySchema but not able to added more than one condition.
Can you please let me know what is the best approach and how can we solve this using ngx-form?

Don't even really need json schema specifically here
Sounds like you can just take advantage of hiddenExpression for each of the fields.
See example here https://formly.dev/examples/field-options/hide-fields
If you want to use jsonschema there is a map function you can pass to it to further manipulate the fields or use the widget option to set the firmly config for hidden expression for that field.

Yes, we tried that one but rules need to be governed by backend content server or in some JSON file to show and hide. On the Fly rules might change to show questionnaire.
As of now we have not finalized the contract but below details we will get from backend CMS :
Question Label
Question Option
IsRequired
Question Depend on which question and output of question.
Below are few usecase where business rule to render Q3 might change on the fly.
UseCase 1 :
Q1 - First question [ YES/NO]
Q2 - Second question [ Dopr Down with Option 1,2,3]
Q3 - Third question [ This question should show if Q1 answe is YES and Q2 option selected is 2] .
UseCase 2 :
Q1 - First question [ YES/NO]
Q2 - Second question [ Dopr Down with Option 1,2,3]
Q3 - Third question [ This question should show if Q1 answer is NO and Q2 option selected is 1] .

You can also bind the same key more than once. So question 3 can have 2 field configs one with one expression one with the other. Then you can use formstate in your hide expression to decide which one should show.
The important thing here is when are you deciding which use case. If the server is doing it just simply use the different config. If it is client side the latter option might be more viable.

Also you can put all of the logic you have for question three in a single hideExpression .  What you have given in the example is mutually exclusive due to question 1.

I need to evaluate JSON into hideExpression logic.
E,X : Below is JSON File : Second Question shown only if it meets ConditionToShowThisQuestion condition i.e. Question 1 answer is Yes else hide.
How can I evaluate this into hideExpression on the fly.
{
"schema":[
{
"key": "areYouCitizen",
"label": "Are You a Citizen?",
"options":[
{
"label":"Yes",
"value":"Yes"
},
{
"label":"No",
"value":"No"
}
],
"isRequired": true,
"hasChildren": false,
"directParent": [],
"isDependantonQuest": true,
"dependencyTree": {},
"order": 1,
},
{
"key": "areYouTravelling",
"label": "Are You Travelling?"
"options":[
{
"label":"Yes",
"value":"Yes"
},
{
"label":"No",
"value":"No"
}
],
"isRequired": true,
"hasChildren": false,
"directParent": [],
"ConditionToShowThisQuestion": {
"dependantQuest": ["areYouCitizen"],
"ifValue": "Yes"
}
},
"order": 2
}
]
}

What type of configuration is this?  It doesn't look like formly config or json schema to me so it would be hard for me to advise you on how to fix it.
Could you please setup an example in stackblitz with your problem?

You can alter the definition using a callback function.
Here is an example based on something I'm trying to working.
@Component({
  selector: 'classifieds-ui-create-profile',
  templateUrl: './create-profile.component.html',
  styleUrls: ['./create-profile.component.scss']
})
export class CreateProfileComponent implements OnInit {

  activedStep = 0;

  steps: Array<StepType> = [
    {
      label: 'Profile Type',
      fields: [this.formlyJsonschema.toFieldConfig(schema, {
        map: (mappedField: FormlyFieldConfig, mapSource: JSONSchema7) => {
          const label = mappedField.templateOptions.label;
          /*if(!['Profile','Type', 'Subtype', 'Adspace'].includes(label)) {
            mappedField.hideExpression = 'true';
          }*/
          return mappedField;
        }
      })]
    }
    /*{
      label: 'General Info',
      fields: [this.formlyJsonschema.toFieldConfig(schema, {
        map: (mappedField: FormlyFieldConfig, mapSource: JSONSchema7) => {
          const label = mappedField.templateOptions.label;
          if(['FirstName','LastName', 'PreferredName', 'MiddleName'].includes(label)) {
            mappedField.hideExpression = 'model.Type !== 0';
          } else if(['CompanyName'].includes(label)) {
            mappedField.hideExpression = 'model.Type === 0';
          } else if(mapSource.title !== 'Profile') {
            mappedField.hideExpression = 'true';
          }
          return mappedField;
        }
      })]
    }*/
  ];

  form = new FormArray(this.steps.map(() => new FormGroup({})));
  options = this.steps.map(() => <FormlyFormOptions> {});
  model = new Profile();

  constructor(private formlyJsonschema: FormlyJsonschema) { }

  ngOnInit(): void {
  }

  prevStep(step) {
    this.activedStep = step - 1;
  }

  nextStep(step) {
    this.activedStep = step + 1;
  }

  submit() {
    console.log(this.model);
  }

}

The questionnaire can be done using hideExpression or a multistep form:

Hide expression: https://formly.dev/examples/field-options/hide-fields
Multi-Step form:

using custom field type: stackblitz.com/edit/angular-yu7bzv-uucyxg
without custom field type: https://formly.dev/examples/advanced/multi-step-form

For json-schema to apply hideExpression or extra definition check https://github.com/ngx-formly/ngx-formly/issues/2222#issuecomment-623602210


Question about color withOpacity

When I drag the marker, the transparency of the shape changed to opaque. I want it to keep transparent as it is. How can I fix this problem?

Hi, I don't think that could be related to the editor, as it doesn't know (or care) about the shape (iirc, it's a while since I did it), it just edits a list of points. So I'm unsure that it could be related to it, unless there's something I'm missing.
Maybe it's worth showing the code...are you sure you aren't repeatedly redrawing the shape multiple times or something ?

i am sure ,i aren't repeatedly redrawing the shape multiple times

Feel free to post the code, I'm not sure what else it could be. As I said,
the line editor doesn't know anything about shapes...the only other thing I
can think of, is if its duplicating a lot of points on the shape, so its
added multiple times. Maybe dump out the list of points each build, see if
there's just 3, or a lot more.
On Tue, Sep 1, 2020 at 11:52 AM zozeei<EMAIL_ADDRESS>wrote:

i am sure ,i aren't repeatedly redrawing the shape multiple times
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ibrierley/flutter_map_line_editor/issues/4#issuecomment-684765017,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5YN5IJFWUPHNJZSTFBKKTSDTG5PANCNFSM4QRR55ZA
.

my code
class _RequestDrawScreenState extends State {
// USAGE NOTE 1: Add a controler and marker list:
final MapController mapController = MapController();
final List userLocationMarkers = [];
PolyEditor polyEditor;
List polygons = [];
var testPolygon =
new Polygon(color: Colors.deepOrange.withOpacity(0.1), points: []);
@override
void initState() {
super.initState();
polyEditor = new PolyEditor(
    points: testPolygon.points,
    pointIcon: Icon(
      Icons.crop_square,
      size: 23,
    ),
    intermediateIcon: Icon(Icons.lens, size: 15, color: Colors.grey),
    callbackRefresh: () => {this.setState(() {})});

}
@override
Widget build(BuildContext context) {
polygons.add(testPolygon);
return Scaffold(
body: SafeArea(
child: Stack(
children: [
FlutterMap(
mapController: mapController,
options: MapOptions(
onTap: (latLog) {
polyEditor.add(testPolygon.points, latLog);
print(latLog);
},
plugins: [
// USAGE NOTE 2: Add the plugin
LocationPlugin(),
DragMarkerPlugin(),
],
center: LatLng(45.5231, -122.6765),
zoom: 6.4,
),
layers: [
TileLayerOptions(
urlTemplate:
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
),
// USAGE NOTE 3: Add the layer for the marker
MarkerLayerOptions(markers: userLocationMarkers),
PolygonLayerOptions(polygons: polygons),
DragMarkerPluginOptions(markers: polyEditor.edit()),
        ],
      ),
      Positioned(
          right: 10.0,
          bottom: 100.0,
          child: Column(children: <Widget>[
            IconButton(
              iconSize: 30.0,
              icon: const Icon(Icons.map),
              tooltip: "Map Type",
              onPressed: null,
            ),
          ])),
    ],
  ),
));

}
}

I haven't run it, but it looks like you're not resetting your polygons list every build, so as mentioned you're readding it every build, so you will end up with a list of repeated testpolygons. Try adding in polygons = [] as first line in build method.

Thanks for the answer, it works. @ibrierley


Fixes #1793 and #1710

This pull request allows botkit conversation handlers for question to be able to get the complete message payload. Also the message augmented by botkit controller middlewares to be made available to the conversation handlers.
This essentially fixes #1710 and #1793

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

I'm closing this request as this does not address other botkit adapters :(
I'll re-submit this after I make appropriate changes to other adapters


Add nan warning in get_bitinformation; Closes #200

Let's start by closing the issue on warnings, but I think the implementations could be rewritten to handle NaN's, which would be good for masked datasets.

I apologize, my organization is swapping SSL certs and that seems to be preventing me from running the unit test, but this PR is straightforward.

Thanks for the PR. First time contributors cannot run the tests automatically. We allow those manually. So no issue on your side.

Ideally NaNs should be masked and then ignored in the bit pair count algorithm so that in a bitstream of 1 0 NaN 0 1 it would only count two bit pairs 10 and 01 instead of counting across the bits of the NaN (which is a valid operation as it's also just bits, but not really meaningful). This is how I've implemented it in BitInformation.jl
https://github.com/milankl/BitInformation.jl/blob/953dac3b5ae12a719456f1be3ae0ef4317f24e86/src/bit_count.jl#L127-L131
although NaN's are not automatically converted to a mask at the moment, but that could easily be added. Well maybe requires some work to avoid a double pass of the data, but yes.

Changelog updated.
And I meant that the SSL was preventing me from running tests locally. I don't fully understand why, though I could see this going awry if Julia, pip, conda aren't all configured correctly...But that's for me to worry about.

Well, this is awkward. xb.get_bitinformation calls itself such the warning is thrown at least twice (+1 per additional dim). Need to ponder the simplest way to avoid that.

Eh, I don't particularly like my solution, which just loosens the unit test to permit the multiple warnings. The alternative is to import some other module that let's us inspect the calling function to decide whether or not to throw the warning. Let me know if you'd prefer that.

Well, this is awkward. xb.get_bitinformation calls itself such the warning is thrown at least twice (+1 per additional dim). Need to ponder the simplest way to avoid that.

Oh, that is unfortunate. Let me fix this in https://github.com/observingClouds/xbitinfo/issues/261.


Added multi language support

And add multi-language support for the Syllabus Generator.
I've implemented this such that the "lang" is optional in the request. The default "lang" is English.
{
  "user": {
    "id": "string",
    "fullName": "string",
    "email": "string"
  },
  "type": "chat",
  "tool_data": {
    "tool_id": 6,
    "inputs": [
      {
        "name": "grade_level",
        "value": "college"
      },
      {
        "name": "course",
        "value": "Linear Regression"
      },
      {
        "name": "instructor_name",
        "value": "Amrutha Vinayakam"
      },
      {
        "name": "instructor_title",
        "value": "Master in Artificial Intelligence"
      },
      {
        "name": "unit_time",
        "value": "week"
      },
      {
        "name": "unit_time_value",
        "value": 8
      },
      {
        "name": "start_date",
        "value": "July, 4th, 2024"
      },
      {
        "name": "assessment_methods",
        "value": "project and exams"
      },
      {
        "name": "grading_scale",
        "value": "In percentages (100%)"
      },
      {
        "name": "file_url",
        "value": "https://firebasestorage.googleapis.com/v0/b/kai-ai-f63c8.appspot.com/o/uploads%2F510f946e-823f-42d7-b95d-d16925293946-Linear%20Regression%20Stat%20Yale.pdf?alt=media&token=caea86aa-c06b-4cde-9fd0-42962eb72ddd"
      },
      {
        "name": "file_type",
        "value": "pdf"
      },
      {
        "name": "lang",
        "value": "chinese"
      }
    ]
  }
}

Good job @TekuriSaiAkhil. As a result of Mikhail review of our PR, we made some updates for decoupling the syllabus generator args. Please, do git pull and adapt your approach to the new format. Then, I'll merge your PR. Thank you.

Good job @TekuriSaiAkhil. As a result of Mikhail review of our PR, we made some updates for decoupling the syllabus generator args. Please, do git pull and adapt your approach to the new format. Then, I'll merge your PR. Thank you.

Updated the code to adapt new appraoch


Min/max time is treated as if it spans midnight-midnight

You can see the problem with e.g.
python transitflow.py --name="CrossCountry" --operator o-gc-crosscountry
The first train is at 04:44, last train ends at 00:07.
The start/end frames of the trips are calculated by treating minDate-maxDate as mapping to all the frames. But the counts are treated as one count per frame, starting at midnight. This means that the displayed lines/counts do not match the display of the trips.

I have worked around this by editing the csv files to match up the counts to the right times.

Thanks! I'm glad you worked around it by editing the csv files manually. Will look into it.

Fixed. count_vehicles_on_scree() no longer assumes a 24 hour window, but finds the true min and max dates from the dataset. @dracos

Thanks :)


Shrinking takes an enormous amount of time

When a counterexample is found, the shrinking process can take up to 10 minutes. This is not acceptable. We should try to tweak the generators so that the shrinking becomes more efficient. Alternatively, we might have to change our testing approach so that we use state-machine-based testing, instead of generating the whole abstract trace at once.
The first thing to try is to replace the use of frequency:
      Gen.frequency [ (5, return acc)
                    -- The probability of continue with the recursion depends
                    -- on the size parameter of the generator. Here the
                    -- constant factor is determined ad-hoc.
                    , (unSize d * 2, do
                          mStSig <- genSigSt @s env sti aSigGen
                          case mStSig of
                            Nothing ->
                              go d sti acc
                            Just (stNext, sig) ->
                              go d stNext ((stNext, sig): acc)
                      )
                    ]

Since this will generate a very large shrink three. An alternative suggested by @dcoutts is to generate an arbitrary number that determines the trace length, and then generate a trace of that size.
The other thing to try, is generating only valid signals, so that the chance of failure is smaller when composing large generators.
Finally, we might need to incorporate more knowledge of the operational rules into our generators.

This will be solved by the work @ruhatch carried out, combining hedgehog state machine models with our STS framework.

Should be helped by PR https://github.com/input-output-hk/cardano-ledger/pull/451

@dnadales Maybe we should reopen this as you're going to look into Trace shrinking further?

I don't think so. What we will be doing is experimental. The issue was solved by using hedgehog state machine, so whatever proposal results from our experiments with an improved traces generator should take shrinking time into consideration. Does that make sense?


Remove unneeded await

This is unneeded async code generation, when we can return the result Renamer.

tag @dotnet/project-system


feat(ViewSlot): moving Views across the slot

Needed for: https://github.com/aurelia/templating-resources/pull/215.
Fixes: https://github.com/aurelia/templating-resources/issues/213.

@jdanyow @martingust Related to the other perf work from @niieani Can you review?

looks good to me other than the missing test for this- @niieani- hold on while we review the other PR and if that one looks good we'll just need test for both (should be easy, the repeat and the view-slot already have a test suite) and then we can merge.

@jdanyow @martingust Added tests for the new move method. However it seems you have some tests which fail on templating-resources@master. Can either of you check?