Cannot stack models in Model Class API

I cannot stack a classifier model on top of a (partly) pre-trained VGG16 model in Model Class API. There are several threads with people having the same problem Google Groups and StackoverFlow. I have tried all variants, but I keep getting a Graph disconnect error:

Exception: Graph disconnected: cannot obtain value for tensor input_2 at layer "

My last attempt:
from keras.applications.vgg16 import VGG16
from keras.models import Model
from keras.layers import Convolution2D, MaxPooling2D, ZeroPadding2D, GlobalAveragePooling2D
from keras.layers import Dropout, Flatten, Dense, Input

img_width, img_height = 150, 150

input_1 = Input(shape=(3, img_width, img_height))

vgg16_model = VGG16(include_top=False, weights='imagenet', input_tensor=input_1)

input_2 = Input(shape=vgg16_model.output_shape[1:])
x = GlobalAveragePooling2D()(input_2)
x = Dense(256, activation='relu')(x)
x = Dropout(0.5)(x)
predict = Dense(1, activation='sigmoid')(x)
top_model = Model(input=input_2, output=predict)

# load the best saved weights
#top_model.load_weights(os.path.join(data_path, 'VGG16Classifier.hdf5'))
# add the model on top of the convolutional base

model = Model(input=input_1, output=top_model.output)

For info I am trying to re-create this Keras Blog , but with the Model Class API in order to later modify the VGG16 model.
Is there a bug that is preventing this from working? Thanks, Jan
Oh, and I am totally thrilled about Keras!!! Really impressive!

@farizrahman4u I also reported this same issue along with a few others.  How can we help get this fixed?

The issue is exactly what the error message says. There is no path from input_1 to top_model.output. So nothing to fix on keras side.

@farizrahman4u This is rude comment.  This is actually an error that @fchollet fixed, #4477.

@farizrahman4u You've made my irritated with your comment so I will carefully show you the path from input_t to top_model.output.
input_1 feeds into vgg16_model, vgg_model.output feeds into input_2.  Input_2 goes to x via the functional API.  x goes into predict and then predict goes into top_model = Model(input=input_2, output=predict).

vgg_model.output feeds into input_2

No it doesn't. If it does, kindly comment the particular line, Sir.
Here is the original code by OP. You will still get the error, with latest version of Keras; because it is supposed to.
from keras.applications.vgg16 import VGG16
from keras.models import Model
from keras.layers import Convolution2D, MaxPooling2D, ZeroPadding2D, GlobalAveragePooling2D
from keras.layers import Dropout, Flatten, Dense, Input

img_width, img_height = 150, 150

input_1 = Input(shape=(3, img_width, img_height))

vgg16_model = VGG16(include_top=False, weights='imagenet', input_tensor=input_1)

input_2 = Input(shape=vgg16_model.output_shape[1:])
x = GlobalAveragePooling2D()(input_2)
x = Dense(256, activation='relu')(x)
x = Dropout(0.5)(x)
predict = Dense(1, activation='sigmoid')(x)
top_model = Model(input=input_2, output=predict)

# load the best saved weights
#top_model.load_weights(os.path.join(data_path, 'VGG16Classifier.hdf5'))
# add the model on top of the convolutional base

model = Model(input=input_1, output=top_model.output)

Maybe next time ask someone less rude?

Hi Farirz and Isaac, thank you both for trying to help me get unstuck! Fariz, as you can see I do not see how I can make this work. The code above is just one of many configs I've tried. So may I ask you politely to show me how you think this would work? Isaac and I have given it our best, but so far we have not been able to crack it. Thank you very much! Jan

@jdelange Its pretty straight forward:
img_width, img_height = 150, 150
input = Input(shape=(3, img_width, img_height))
vgg16_model = VGG16(include_top=False, weights='imagenet')
x = vgg16_model(input)
x = GlobalAveragePooling2D()(x)
x = Dense(256, activation='relu')(x)
x = Dropout(0.5)(x)
predict = Dense(1, activation='sigmoid')(x)
model = Model(input=input, output=predict)

P.S Not tested.

It compiles, but your solution looks different. How would I now load the pre-trained weights in the "top_model"? It seems that your solution has merged two models into one, but now I cannot access the top part separately to load the weights?
model.load_weights(...) would not work, as that would involve the VVG16 part also.

Just split the model:
img_width, img_height = 150, 150
vgg16_model = VGG16(include_top=False, weights='imagenet')

input = Input(batch_shape=vgg16_model.output_shape)
x = GlobalAveragePooling2D()(input)
x = Dense(256, activation='relu')(x)
x = Dropout(0.5)(x)
predict = Dense(1, activation='sigmoid')(x)
top_model = Model(input, predict)

top_model.load_weights(os.path.join(data_path, 'VGG16Classifier.hdf5'))

input = Input(shape=(3, img_width, img_height))
x = vgg16_model(input)
predict = top_model(x)
model = Model(input, predict)

Looks good. I will try to compile and run this. If it works I will share and close the issue.

The good news: the above code compiles and runs. To replicate the Keras tutorial however, I need a Flatten() as first layer in the top_model. GlobalAveragePooling2D does not converge. Replacing the GlobalAveragePooling2D() layer with a Flatten() layer generates the following error:

File "C:\Program Files\Anaconda2\lib\site-packages\keras\layers\core.py", lin 433, in get_output_shape_for '(got ' + str(input_shape[1:]) + '. '
Exception: The shape of the input to "Flatten" is not fully defined (got (512,
None, None). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.

Adding input_shape=(3, img_width, img_height) to the VVG16 model raised the 3-channel error I mentioned here #4477. I fixed this by creating a stripped version of the VGG16 model taking out all Tensorflow stuff. It then runs and converges. I realize I would do better by figuring out what causes the issue, but I am not experienced enough.
Perhaps there is a better / more logical way to fully define the input shape?
Since I am now able to proceed, I will close this issue and thank you very much for helping me out. I will copy these findings to the Keras Google group for the benefit of others.

 You called me rude and irritating for pointing out a mistake in your code? (assuming @jdelange is in your team), What did you expect? Also, you do realize that I don't get paid for any of this right? Hope you don't find all the free work we do here for you rude or irritating. "Get over it"? Get over what?  And ping "@fchollet" ? You gonna tell on me? Who is the baby now?
#trolls_should_go_back_to_youtube_comments

Everyone, please be professional.

@farizrahman4u @fchollet
This is it for me.  I am moving to tensorflow.


Patch resource types in payloads in the import batch

Motivation
We patch ids in payload but we should also patch their types when they start by a given prefix
Acceptance criteria

When user selects...
When performing this api call...

This section should be about results in domain terms, not implementation details.
Implementation notes
The type can be a string or an array of strings
API changes
Example request/response if applicable.
Mockups
Screenshots or XD export if applicable.
Not in scope

The X will not be...
The Y will be handled separately...

Should be done by patching the payload


Add support for GW1100A

Is your feature request related to a problem? Please describe:
No current support for GW1100A
Describe the solution you'd like:
If you can add support for the GW1100A station. The sensors work but it does not show the temperature / humidity / pressure from the base station
Additional context:
I've manually edited the EcowittPlatform.js  to add the model  GW1100A and it showed up fine in homebridge for me
const modelInfo = dataReport?.model.match(/(HP2551CA|GW1000)_(.*)/);
 case 'GW1000':           this.baseStationInfo.hardwareRevision = dataReport.stationtype;           this.baseStationInfo.firmwareRevision = stationTypeInfo[2];           if (!this.config?.thbin?.hide) {             this.addSensorType(true, 'GW1000');           }           break;

Thanks @slayer1551 I have a GW1000  and a HP2551, but don't yet have a GW1100A . In the meantime, would you be able to help out with what the data payload looks like from the log file? You can see details what I mean in this comment https://github.com/spatialdude/homebridge-ecowitt/issues/2#issuecomment-944851871

Thanks @slayer1551 I have a GW1000 and a HP2551, but don't yet have a GW1100A . In the meantime, would you be able to help out with what the data payload looks like from the log file? You can see details what I mean in this comment #2 (comment)

[16/10/2021, 16:59:07] [Ecowitt] Data report: {   "PASSKEY": "xxx",   "stationtype": "GW1100A_V2.0.3",   "dateutc": "2021-10-16 15:56:10",   "tempinf": "71.6",   "humidityin": "53",   "baromrelin": "29.976",   "baromabsin": "29.976",   "soilmoisture1": "54",   "soilbatt1": "1.5",   "freq": "868M",   "model": "GW1100A" }

Thanks @slayer1551 I'll take a look at what's going in the handling with the differences in the data reports.

Hey @spatialdude I added support for the GW1100A. Right now I have the code in a local branch, I could push it if you want?

I just received a GW1100B. Hopefully this can get dropped in too.

Hi @tragnar . Could you show me the mods you made to get the GW1000A working? I am in the same boat. Thanks.

I am currently not at home till end of month. I can show it to you afterwards. Basically you need to add the GW1100A to every place where the GW1100 is mentioned in the code. And you need to install the plugin from your desktop (this is explained on the GitHub homebridge page somewhere)
Von meinem iPhone gesendet

Am 12.07.2022 um 18:41 schrieb bc-rbennion @.***>:

Hi @tragnar . Could you show me the mods you made to get the GW1000A working? I am in the same boat. Thanks.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.

@tomkinsc how do I install your PR on rpi? thanks!

Ideally @spatialdude will review the PR #15 and merge it or a derived version so the added functionality is available via the 'official' homebridge-ecowitt package in the main Homebridge plugin distribution channel, but you can install my modified version manually.
I'm not much of a node person, so I'm not sure how idiomatic this may be, but what I did is more or less:
# make a subdir in user's home directory to store git repositories like the one for the fork of homebridge-ecowitt
mkdir /home/$(whoami)/git-repositories

# enter said subdirectory
cd /home/$(whoami)/git-repositories

# clone only the branch with modifications, and only the most recent state
git clone --depth 1 --branch ct-add-WH40-GW1100 --single-branch https://github.com/tomkinsc/homebridge-ecowitt.git

# enter the cloned repo
cd homebridge-ecowitt

# install module dependencies
npm install

# build the module
npm run build

# enter directory where homebridge modules are located
cd /var/lib/homebridge/node_modules

# move the directory containing the old homebridge-ecowitt module
sudo mv homebridge-ecowitt homebridge-ecowitt-orig

# create a symbolic link from the git repo version
sudo -u homebridge ln -s /home/$(whoami)/git-repositories/homebridge-ecowitt homebridge-ecowitt

# restart homebridge (will take a moment and likely emit no output)
sudo systemctl restart homebridge

Of note is that if you upgrade Homekit, the homebridge-ecowitt-orig module backup directory created above will be removed. It's easy enough to re-add from the original Homebridge plugin manager once the symlink to the customized version is removed via:
sudo -u homebridge unlink /var/lib/homebridge/node_modules/homebridge-ecowitt

Important: To anyone considering installing the modified plugin (or anything from a secondary source), I'd encourage reviewing the changes to the code before following the steps above.

Hi, did @spatialdude already merge the canned code from @tomkinsc, or do I have to make the mentioned steps myself to get the GW1100 working?

I have also the Gw1100, no error in the log, but the plugin wan´t create any device

any updates on this. anyone? :)


feat: add station imageURL to returned data

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.12%. Comparing base (0858804) to head (1b8b36c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #88      +/-   ##
==========================================
+ Coverage   78.40%   79.12%   +0.71%
==========================================
  Files           3        3
  Lines          88       91       +3
==========================================
+ Hits           69       72       +3
  Misses         19       19

Flag
Coverage Δ

79.12% <100.00%> (+0.71%)
:arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


actors aren't updated after package_add in the current client

JSX> cl.actors
## gedisclientactors GedisClientActors

### properties:
 - base                 : <770044ee2c8ac6848c2d98527cc24171.GedisClientGenerated object at 0x7f7c5c4b3630>
 - chatbot              : <ed1e8d4715bf6e3afbc70f7a50cefc65.GedisClientGenerated object at 0x7f7c5cca8d68>
 - community            : <b2f64b083d6f665b69d460ada1cfcc70.GedisClientGenerated object at 0x7f7c5c4b3be0>
 - gdrive               : <25774bc9ce28eefe08fbfe32bb2f03c3.GedisClientGenerated object at 0x7f7c5c4b3240>
 - package_manager      : <eb91a93a1a972013f62a554cf09ae10c.GedisClientGenerated object at 0x7f7c5c4b3d68>
 - sonic                : <4e3e7147b8d672df1796944d720c4bb5.GedisClientGenerated object at 0x7f7c5c4b30f0>
 - team                 : <d16468c74d9ffa1f2f1bee59343f7dce.GedisClientGenerated object at 0x7f7c5c4b3668>

JSX> cl.actors.blog
Wed 09 12:17:54 <stdin>              -   1 - <module>                           : EXCEPTION:
    AttributeError("'GedisClientActors' object has no attribute 'blog'",)
--TRACEBACK------------------
<stdin> in <module>
    1
-----------------------------

'GedisClientActors' object has no attribute 'blog'
JSX> gcl = j.clients.gedis.get('main', port=8901)
JSX> gcl.actors
## gedisclientactors GedisClientActors

### properties:
 - base                 : <770044ee2c8ac6848c2d98527cc24171.GedisClientGenerated object at 0x7f7c59f89518>
 - blog                 : <1e667adaee97dcafe4c4233410176004.GedisClientGenerated object at 0x7f7c59f89208>
 - chatbot              : <ed1e8d4715bf6e3afbc70f7a50cefc65.GedisClientGenerated object at 0x7f7c59ddfb38>
 - community            : <b2f64b083d6f665b69d460ada1cfcc70.GedisClientGenerated object at 0x7f7c59f89e10>
 - gdrive               : <25774bc9ce28eefe08fbfe32bb2f03c3.GedisClientGenerated object at 0x7f7c59f89630>
 - package_manager      : <eb91a93a1a972013f62a554cf09ae10c.GedisClientGenerated object at 0x7f7c59f89a90>
 - phonebook            : <98483db471e4096ff9b7cc1ec4179529.GedisClientGenerated object at 0x7f7c59f89748>
 - sonic                : <4e3e7147b8d672df1796944d720c4bb5.GedisClientGenerated object at 0x7f7c59f89048>
 - team                 : <d16468c74d9ffa1f2f1bee59343f7dce.GedisClientGenerated object at 0x7f7c59f89668>

there is a reload method on gedis client to load newly added actors.
This can be used if you have a client, then a new package is added and you want to have the client method for it without recreating a new client from scratch.

Thank you


Microsoft Edge doesn't display nested elements properly when I dynamically remove the hidden attribute on the parent of the nested element.

Please can this issue be fixed? Other browsers including Internet Explorer works pretty fine with respect to this Microsoft Edge error.
This bug is quite unpredictable. When you first load run the plunker on Microsoft Edge, it might work properly, while sometimes it doesn't. But just reload the page, first with a Major reload, and try if the problem appears, if it doesn't, then try the minor reload, (the one with the reload icon) and then the problem will appear. It's in inconsistent but persistent.
It works on Internet Explorer and other browsers but it seems to have some problems in Microsoft Edge

https://plnkr.co/edit/4XalOoE2Y3TiMyYKR3Py?p=preview
This is the link to the code launched in plunker.

Thanks for reporting the issue @mlasell2. This sounds like a web browser issue rather than a JavaScript VM one. Please open an issue on the Edge issue tracker https://github.com/Microsoft/ChakraCore/wiki/External-Issues#edge-issues to get the right set of people looking into it.


Get rid of deperecated scipy function calls

Remove the scipy calls so that the warnings disappear.

Coverage increased (+0.003%) to 84.215% when pulling 82d09c8eaf00848ca4d99a86d9fdfb66579cd209 on bnavigator:scipy-depr into d3142ff24c7af5e2c0843fd16d0e1be82b322bb9 on python-control:master.

Coverage increased (+0.003%) to 84.215% when pulling 82d09c8eaf00848ca4d99a86d9fdfb66579cd209 on bnavigator:scipy-depr into d3142ff24c7af5e2c0843fd16d0e1be82b322bb9 on python-control:master.

Coverage increased (+0.003%) to 84.215% when pulling 82d09c8eaf00848ca4d99a86d9fdfb66579cd209 on bnavigator:scipy-depr into d3142ff24c7af5e2c0843fd16d0e1be82b322bb9 on python-control:master.


Update README.md

Hi @danielperna84,
i'd like to update the readme to better reflect the current state.
Is it necessary to stay with python 3.6?
Current HA supported python version is 3.9.
BR

Sure, we can upgrade this to whatever Home Assistant is using. 👍

No 3rd party Python dependencies are required.

That won't be true anymore as well. Regarding that topic: how do we handle conflicts of HA-requirements vs. hahomematic requirements? Right now we require aiohttp==3.8.0 and HA does as well. But if the dependency gets upgraded for HA (and we may not notice that), we'd also have to build a new hahomematic release for that, which might not be necessary. I guess we could just declare the dependency as aiohttp>=3.8.0. Same for voluptuous. 🤷♂

Good point, i fixed it.

Great. Feel free to merge when you're done. LGTM.


Serialization of relative URI

For now just adding tests to trigger the same exception I get in my code.

 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: DavidDeSloovere sign nowYou have signed the CLA already but the status is still pending? Let us recheck it.

I still need to install not only .NET FW 4.8 but also .NET 6 on my machine. But wanted to get this out earlier.

leave it with me.

I actually just fixed it.
Query property is not available for relative urls
public override void WriteJson(
        JsonWriter writer,
        Uri value,
        JsonSerializer serializer,
        IReadOnlyDictionary<string, object> context)
    {
        if (value.IsAbsoluteUri == false)
        {
            writer.WriteValue(value.OriginalString);
            return;
        }

        if (string.IsNullOrWhiteSpace(value.Query))
        {
            writer.WriteValue(value.OriginalString);
            return;
        }

        var path = GetPath(value);

        serializer.Serialize(writer,
            new UriWrapper
            {
                Path = path,
                Query = HttpUtility.ParseQueryString(value.Query)
            });
    }


Flexible options

Authentication server implementations may differ.  These options allow a bit more flexibility in handling server responses by allowing for the callback jwt parameter name to be customised, and for user claims to be nested separately within the token.
Documentation has also been updated to include a guide to integrating this strategy with Devise.

FYI: I rewrote this gem and modernized it!  If you'd like to rebase your PR on my fork I'd like to consider it.
https://github.com/pboling/omniauth-jwt2


VideoPlayer crashed in IOS when I load video from CameraRoll

My Environment Seeting
**MacOS BigSur
Node 15
"react": "16.13.1",
"react-native": "0.63.3",
"react-native-video": "^5.1.0-alpha8",
**
Here is my code to reproduce the Iuuse.
`import React from 'react';
import {View,Text, StyleSheet, Dimensions, Platform} from 'react-native';
import Video from 'react-native-video';
import { heightPercentageToDP as hp, widthPercentageToDP as wp,} from 'react-native-responsive-screen'
const { width } = Dimensions.get('window');
const videoplayer = ({route}) =>{
return (
<View style={{height:'100%', backgroundColor:"black",width:'100%'}}>
<Text style={{color:"#fff"}}>{route.params.file}
<Video
rate={ 1.0 }
volume={ 1.0 }
muted={ false }
controls={Platform.select({ ios: true, android: false })}
paused={false }
resizeMode={ 'cover' }
repeat={ false }
playInBackground={ false }
playWhenInactive={ false }
onLoadStart={() => console.log('On Load Start') }
onLoad={ () => console.log('On Loaded') }
onProgress={ () => console.log('On Progress') }
onEnd={ () => console.log('On Ended')}
onError={ () => console.log('On Error')}
ignoreSilentSwitch={ "ignore" }
source={{uri:${route.params.file}}}
controls={Platform.OS === 'ios'?true:false}
/>

)
}
export default videoplayer ;
const styles = StyleSheet.create({
overlay: {
...StyleSheet.absoluteFillObject,
position:'absolute',
bottom:hp(1),
alignItems:"center",
justifyContent:"flex-end",
flex:1,
backgroundColor:'rgba(0,0,0,.3)'
},
overlaySet: {
flex: 1,
flexDirection: 'row'
},
control:{
//  position:"absolute",
flexDirection:"row",
justifyContent:'space-between',
paddingHorizontal: 5,
alignItems:'flex-start' ,
bottom:10,
width:('100%')
},
icon: {
color: 'white',
flex: 1,
textAlign: 'center',
textAlignVertical: 'center',
fontSize:20
},
sliderCont: {
position: 'absolute',
left: 0,
right: 0,
bottom: 40,
height:40,
},
timer: {
width: '95%',
alignSelf:'center',
flexDirection: 'row',
justifyContent: 'space-between',
paddingHorizontal: 5,
// bottom:60
},
video: {
width,
height: width * .6,
backgroundColor: 'black'
},
fullscreenVideo: {
backgroundColor: 'black',
height:150,
elevation: 1
}
});`
Her bus the iuuse

Here is my video object : { key: '1606394256.4853153',     size: '2.22 MB',     date: '26-Nov-2020',     uri: 'ph://1351317F-49BA-4F96-9F1E-C1FB7D8FDADB/L0/001',     name: 'FB_VID_1606394256438.mp4' }

@aftabaminzoobiapps I was having the same problem, I used react-native-convert-ph-asset to convert the video uri from camera roll to have the supported 'file://' prefix.
See more here: https://github.com/jzyds/react-native-convert-ph-asset#usage

@aftabaminzoobiapps I was having the same problem, I used react-native-convert-ph-asset to convert the video uri from camera roll to have the supported 'file://' prefix.
See more here: https://github.com/jzyds/react-native-convert-ph-asset#usage

This copies the video which is not the best option

@aftabaminzoobiapps I was having the same problem, I used react-native-convert-ph-asset to convert the video uri from camera roll to have the supported 'file://' prefix.

See more here: https://github.com/jzyds/react-native-convert-ph-asset#usage

This copies the video which is not the best option

Yep, it turned out to be way too u performant to use in production. Ended up killing it and opting for the native gallery picker instead.

Consolidated into #2652


Show data documentation

In GitLab by @franzi233 on Aug 18, 2021, 14:53
"Use Grafana to show data" documentation

In GitLab by @franzi233 on Aug 18, 2021, 14:53
assigned to @franzi233

In GitLab by @franzi233 on Aug 18, 2021, 14:53
marked this issue as related to #9


Snowflake generation and parsing requires the epoch to be of class Snowflake.Epoch

Description
Snowflake generation and parsing requires the epoch to be of class Snowflake.Epoch. This is due to line 432 and line 492 which gets the Epoch's value instead of checking for the class and only getting the value if it is an Epoch.
Expected behavior
As the readme implies, using an integer for the epoch should work.
Actual behavior
You either have to use a default epoch or set up a fake class for this.
Temporary fixes
Making an Enum class and faking the class to be an Epoch class works:
import snowflake

class Epoch(Enum):
    JAN_1_2024 = 1_704_067_200_000

    @property
    def __class__(self):
        # The code checks if the enum's value, which requires it to be an enum [obviously].
        # it also checks if it's a snowflake Epoch, so we need to fake it.
        return snowflake.Epoch

    # noinspection PyTypeChecker
    def __str__(self) -> int:
        # This is a part of the snowflake.Epoch enum, and returns an int. Very weird but technically defined behavior
        return self.name

fixed


colors?

are there any options for coloring or other presentation options for the menu :)

not at the moment, but I could be convinced to add some.  What would you like to see?  If I add color options, I'll want to add both a programmatic API for it and some way to trigger/configure colors on the CLI.

just a way to make the options a bit more attractive... wrapping in a color tag or something?

are you imagining an across-the-board menu(..., foreground='blue', background='white') option?
that would be pretty simple to add.
If you're looking for more customization, like individual color config for indices/items/prompts/user-input/messages, that would take more thought/planning.
fwiw, it's already possible to do quite a bit just by formatting input to menu:

^ that was accomplished with:
import pimento
import blessed

terminal = blessed.Terminal()

choices = {
    'red': terminal.red('red'),
    'orange': terminal.color(172)('orange'),
    'yellow': terminal.yellow('yellow'),
    'green': terminal.green('green'),
    'blue': terminal.blue('blue'),
    'purple': terminal.color(129)('purple'),
}

pre_prompt = (
    terminal.red('c') +
    terminal.color(172)('o') +
    terminal.yellow('l') +
    terminal.green('o') +
    terminal.blue('r') +
    terminal.color(129)('s')
)

chosen_value = pimento.menu(choices.values(), fuzzy=True, pre_prompt=pre_prompt)

for color, string in choices.items():
    if string == chosen_value:
        print("You chose {}!".format(color))
        break

This relies on a bunch of things:

fuzzy matching to match just the printable characters instead of having to match the literal color code characters
blessed to do the coloring of the strings
using the API, not the CLI
using a dictionary to store/retrieve the actual string you want (because menu returns the formatted string)

It also doesn't work with tab-completion very well.
This might be enough for you, but if it's not, that will be insightful/helpful in refining what it is you are looking for, too :-)

really just wanted to make the pickable items stand out from the surrounding menu text.
the above would do the trick I think!


Connection got disposed when Ctrl-hovering over print

Using jaguar v0.5.0 and the 1.4.0 extension, I consistently get 'Connection got disposed' errors when I hold Ctrl and hover over print in the following simple example:
main:
  print "Hello, World"

The logged error looks like this:
[Error - 9:00:24 PM] Server initialization failed.
Error: Connection got disposed.
	at Object.dispose (/Users/kasper/.vscode/extensions/toit.toit-1.4.0/dist/extension.js:1:81955)
	at Object.dispose (/Users/kasper/.vscode/extensions/toit.toit-1.4.0/dist/extension.js:1:138651)
	at /Users/kasper/.vscode/extensions/toit.toit-1.4.0/dist/extension.js:1:135583

Also happens with Object from the core libs, but not with elements imported from other local libs. Probably related to imports into the SDK bundled libraries?

Looking a bit more into this.
It seems that the lsp-client tries to open a wrong workspace when getting the definition back from the current toitlsp:
2022-01-05T11:26:32.451+0100	DEBUG	lsp/server.go:159	jsonrpc2: --> request #6: textDocument/definition: {"textDocument":{"uri":"file:///Users/jesperlindstromnielsen/projects/jaguar/example/main.toit"},"position":{"line":7,"character":5}}

2022-01-05T11:26:32.452+0100	DEBUG	Compiler	compiler/compiler.go:371	running compiler	{"input": "62740\nGOTO DEFINITION\n/Users/jesperlindstromnielsen/projects/jaguar/example/main.toit\n7\n5\n", "cmd": "/Users/jesperlindstromnielsen/projects/opentoit/build/host/sdk/bin/toit.compile --lsp --project-root /Users/jesperlindstromnielsen/projects/jaguar"}
2022-01-05T11:26:32.521+0100	DEBUG	lsp/server.go:159	jsonrpc2: <-- result #6: textDocument/definition: [{"uri":"file:///Users/jesperlindstromnielsen/projects/opentoit/build/host/sdk/lib/core/print.toit","range":{"start":{"line":10,"character":0},"end":{"line":10,"character":5}}}]

[Trace - 11:26:32] Received response 'textDocument/definition - (6)' in 71ms.
Result: [
    {
        "uri": "file:///Users/jesperlindstromnielsen/projects/opentoit/build/host/sdk/lib/core/print.toit",
        "range": {
            "start": {
                "line": 10,
                "character": 0
            },
            "end": {
                "line": 10,
                "character": 5
            }
        }
    }
]

[Trace - 11:26:32] Sending request 'initialize - (0)'.
Params: {
    "processId": 55110,
    "rootPath": "/Users/jesperlindstromnielsen/projects/jaguar",
    "rootUri": "file:///Users/jesperlindstromnielsen/projects/jaguar",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
                "failureHandling": "textOnlyTransactional"
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "didChangeWatchedFiles": {
                "dynamicRegistration": true
            },
            "symbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                }
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true,
            "workspaceFolders": true
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "deprecatedSupport": true,
                    "preselectSupport": true
                },
                "completionItemKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    }
                }
            },
            "definition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "references": {
                "dynamicRegistration": true
            },
            "documentHighlight": {
                "dynamicRegistration": true
            },
            "documentSymbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "hierarchicalDocumentSymbolSupport": true
            },
            "codeAction": {
                "dynamicRegistration": true,
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                }
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true,
                "prepareSupport": true
            },
            "documentLink": {
                "dynamicRegistration": true
            },
            "typeDefinition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "implementation": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            },
            "declaration": {
                "dynamicRegistration": true,
                "linkSupport": true
            }
        }
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///Users/jesperlindstromnielsen/projects/jaguar",
            "name": "jaguar"
        }
    ]
}

[Trace - 11:26:32] Sending request 'shutdown - (1)'.
2022-01-05T11:26:32.556+0100	DEBUG	lsp/server.go:159	jsonrpc2: --> request #0: initialize: {"processId":55110,"rootPath":"/Users/jesperlindstromnielsen/projects/jaguar","rootUri":"file:///Users/jesperlindstromnielsen/projects/jaguar","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}}},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true}}},"trace":"verbose","workspaceFolders":[{"uri":"file:///Users/jesperlindstromnielsen/projects/jaguar","name":"jaguar"}]}

2022-01-05T11:26:32.556+0100	DEBUG	lsp/server.go:159	jsonrpc2: --> request #1: shutdown: null

2022-01-05T11:26:32.556+0100	DEBUG	lsp/server.go:159	jsonrpc2: <-- result #1: shutdown: null

[Trace - 11:26:32] Received response 'shutdown - (1)' in 11ms.
No result returned.

[Trace - 11:26:32] Sending notification 'exit'.
No parameters provided.
Error - 11:26:32] Server initialization failed.
Error: Connection got disposed.
	at Object.dispose (/Users/jesperlindstromnielsen/.vscode/extensions/toit.toit-1.4.0/dist/extension.js:1:81955)
	at Object.dispose (/Users/jesperlindstromnielsen/.vscode/extensions/toit.toit-1.4.0/dist/extension.js:1:138651)
	at /Users/jesperlindstromnielsen/.vscode/extensions/toit.toit-1.4.0/dist/extension.js:1:135583

Note: the error does not happen if you try to the definition of something that is in the current workspace you are working in.


Fix two broken links of INSTALL.md

Checklist

[ ] documentation is added or updated
[ ] tests are added or updated

This pull request is ready to merge

Merged to master.  Thanks for the fix.


Deauth is not working

I flashed the bun file on d1 mini (clone) evil twin like password validation works file but deauthentication not working

Same issue

same issue evil twin working fine but deauth not working


Doesn't work

Plugin Version: I just downloaded the zip file from github
Server Version: 1.20.50 (I can join on latest version)
Pocketmine-MP Version: 5.10.0
Probably isn't working because plugin is in beta but whatever.
Error:
THIS CRASH WAS CAUSED BY A PLUGIN
BAD PLUGIN: Sell
Thread: Main
Error: Call to undefined method cooldogedev\BedrockEconomy\BedrockEconomy::getAPI()
File: plugins/Sell/src/Terpz710/Sell/Economy/EconomyManager
Line: 74
Type: Error
Backtrace:
#0 plugins/Sell/src/Terpz710/Sell/Commands/SellCommand(89): Terpz710\Sell\Economy\EconomyManager->addMoney(object pocketmine\player\Player#182295, int 10, object Closure#94373)
#1 pmsrc/src/command/SimpleCommandMap(212): Terpz710\Sell\Commands\SellCommand->execute(object pocketmine\player\Player#182295, string[4] sell, array[0])
#2 pmsrc/src/Server(1425): pocketmine\command\SimpleCommandMap->dispatch(object pocketmine\player\Player#182295, string[4] sell)
#3 pmsrc/src/player/Player(1512): pocketmine\Server->dispatchCommand(object pocketmine\player\Player#182295, string[4] sell)
#4 pmsrc/src/network/mcpe/handler/InGamePacketHandler(821): pocketmine\player\Player->chat(string[5] /sell)
#5 pmsrc/vendor/pocketmine/bedrock-protocol/src/CommandRequestPacket(55): pocketmine\network\mcpe\handler\InGamePacketHandler->handleCommandRequest(object pocketmine\network\mcpe\protocol\CommandRequestPacket#189160)
#6 pmsrc/src/network/mcpe/NetworkSession(448): pocketmine\network\mcpe\protocol\CommandRequestPacket->handle(object pocketmine\network\mcpe\handler\InGamePacketHandler#95524)
#7 pmsrc/src/network/mcpe/NetworkSession(386): pocketmine\network\mcpe\NetworkSession->handleDataPacket(object pocketmine\network\mcpe\protocol\CommandRequestPacket#189160, string[27] M./sell..A...............H)
#8 pmsrc/src/network/mcpe/raklib/RakLibInterface(219): pocketmine\network\mcpe\NetworkSession->handleEncoded(string[31] ..e./N..aX.......].1]O...;.....)
#9 pmsrc/vendor/pocketmine/raklib-ipc/src/RakLibToUserThreadMessageReceiver(40): pocketmine\network\mcpe\raklib\RakLibInterface->onPacketReceive(int 0, string[40] .&/M..#...{.>.AZ.*m..&..........n.~..mQ.)
#10 pmsrc/src/network/mcpe/raklib/RakLibInterface(111): raklib\server\ipc\RakLibToUserThreadMessageReceiver->handle(object pocketmine\network\mcpe\raklib\RakLibInterface#199588)
#11 pmsrc/src/TimeTrackingSleeperHandler(58): pocketmine\network\mcpe\raklib\RakLibInterface->pocketmine\network\mcpe\raklib{closure}()
#12 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(120): pocketmine\TimeTrackingSleeperHandler->pocketmine{closure}()
#13 pmsrc/src/TimeTrackingSleeperHandler(77): pocketmine\snooze\SleeperHandler->processNotifications()
#14 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(79): pocketmine\TimeTrackingSleeperHandler->processNotifications()
#15 pmsrc/src/Server(1690): pocketmine\snooze\SleeperHandler->sleepUntil(float<PHONE_NUMBER>.1762)
#16 pmsrc/src/Server(1065): pocketmine\Server->tickProcessor()
#17 pmsrc/src/PocketMine(341): pocketmine\Server->__construct(object pocketmine\thread\ThreadSafeClassLoader#6, object pocketmine\utils\MainLogger#3, string[16] /home/container/, string[24] /home/container/plugins/)
#18 pmsrc/src/PocketMine(364): pocketmine\server()
#19 pmsrc(11): require(string[60] phar:///home/container/PocketMine-MP.phar/src/PocketMine.php)
Code:
[65]         if ($this->eco == null) {
[66]             $this->plugin->getLogger()->warning("You don't have an Economy plugin");
[67]             return;
[68]         }
[69]         switch ($this->eco->getName()) {
[70]             case "EconomyAPI":
[71]                 $callback($this->eco->addMoney($player->getName(), $amount, EconomyAPI::RET_SUCCESS));
[72]                 break;
[73]             case "BedrockEconomy":
[74]                 $this->eco->getAPI()->addToPlayerBalance($player->getName(), (int) ceil($amount), ClosureContext::create(static function(bool $success) use($callback) : void {
[75]                     $callback($success);
[76]                 }));
[77]                 break;
[78]         }
[79]     }
[80] }

Do you have bedrock economy installed? Also this bug is on BedrockEconomy end but I’ll look into it.

Yea it’s a BedrockEconomy related issue. Mostly all plugins that uses that plugin is affected. I sent an issue myself so we’ll see.

I fixed the issue. Please download the latest version through poggit.

Thank you for bringing this to my concern.


Calibrate HS-485HB servos & add software adjustment

We can't assume that the new HS-485HB servo motors act exactly the same as the old MG 996R servos. We will likely need to use different PWM numbers for a given rotation, and need to measure the new motors to see how we generate these. Hopefully, the new motors are as consistent as the old ones, and we can use a universal algorithm, with per servo calibration values. This will allow us to fine tune the positioning using a 24 position horn.

new MQTT commands to allow testing of servos:
Servo_Test_PWM  <side (0-1)> <port(0-15)> <PWM (100-500?)>
Shortform: STP
Example: STP 0, 15, 300
Servo_Test_Angle <side (0-1)> <port(0-15)> <angle (-90-+90)>
The second command assumes that you have logic in place to translate angles to PWM, which won't be known right away.

Will need to find some of the new bolts needed to attach new servo horns to leg parts. They're tiny. I found 4 in the right thread in my junk box, but none are long enough to do the job.

Purchased bolts on Amazon. Delivery should be in a couple of days.

software adjustment of servo position was implemented and documented under issue #173, Add robot specific boot up logic. Can't close this issue until testing is done with new servos using new body parts that match mounting bolt positions.


class AutoBase and AutoAbstract

🚀 Feature Request

Auto and Tune share the same logic and methods
We should move it to unified class

Proposal

add class AutoBase with methods fit, summary, top_k
add interface AutoAbstract with fit, summary, top_k, objective , _init_optuna
inherit Auto from AutoBase

Test cases

refactor test_auto to test common methods of AutoBase where it's necessary

Additional context
No response

I'd like to take this issue after completing 1025.

What is the planned difference and similarities between classes Tune and Auto?
I believe that the code I have to write in AutoBase's fit, summary, top_k should implement general logic that will work for both class Tune and class Auto, am I right?
If so, I think that knowing expected functionality of class Tune will be beneficial to me.

Throughout ETNA code 'Base' classes are abstract classes, implementing part of its functions and leaving another part abstractmethods. In this issue, however, class Auto inherits neccessary abstractmethods from AutoAbstract, making adding abstractmethods to AutoBase redundant.
Would it be more appropriate to implement AutoBase class as AutoMixin (which will contain implementations of summary, top_k, fit and no abstractmethods)? Or, alternatively, remove AutoAbstract altogether, moving _init_optuna and objective to AutoBase as abstractmethods?
If I misunderstand proposed inheritance structure completely and proposed AutoBase/AutoAbstract functionalities are the best solution, would you please mind explaining me why?

As I currently understand it, classes Tune and Auto will have vastly different fit methods: the first is going to optimize hyperparameters for one selected Pipeline, while the second will pick the best-fitted pipeline from a user-determined pool without any hyperparameter optimization for any given pipeline. The question is:
Should fit method in AutoBase class be an abstractmethod, that later will be uniquely set separately in Tune and Auto classes?
Or should I rather strive to write fit method in such a way that it will work with both Tune and Auto classes without any overrides?
If I am wrong in my understanding, please correct me.

Should fit method in AutoBase class be an abstractmethod, that later will be overridden separately in Tune and Auto classes?
Yes, you're right

It's better to implement it mostly separately. In case they have something in common we will refactor it next.
In the future tasks fit in Auto will call Tune.fit for the best configs to be fine turned - so the logic will be more complicated

In case you worry that I left the project silently, I'm still working on the issue and will submit code tomorrow.


Header dependency

In third party library, when I include pinocchio/multibody/joint/joint.hpp before pinocchio/multibody/joint/joint-composite.hpp, I get a long unreadable error the first message of which is posted below.
I have no error if I include pinocchio/multibody/joint/joint-composite.hpp first.
include/pinocchio/multibody/joint/joint-composite.hpp: In constructor ‘std::vector<T, Eigen::aligned_allocator<T> >::vector(std::vector<T, Eigen::aligned_allocator<T> >::size_type, const value_type&) [with T = se3::JointModel; std::vector<T, Eigen::aligned_allocator<T> >::size_type = long unsigned int; std::vector<T, Eigen::aligned_allocator<T> >::value_type = se3::JointModel]’:
include/pinocchio/multibody/joint/joint-composite.hpp:126:43: error: invalid use of incomplete type ‘std::vector<se3::JointModel, Eigen::aligned_allocator<se3::JointModel> >::value_type {aka struct se3::JointModel}’

The issue can be reproduced by including joint.hpp before joint-composite.hpp in unittests/joint-composite.cpp.

You must include joint-composite.hpp before joint.hpp
The reason is currently jointcomposite has a member that is std::vector so that he must know completely Joint, that itself must know completely jointocmposite due to jointocmposite being inside the variant.
This can, in the future be solved by changing in joint-ocmposite the std::vector by std::vector

One solution consists in changing the std::vector of Joint{Model,Data} with Joint{Model,Data}Variant, to avoid circular inclusion.
Also, we need to delete the global EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION for all the vector types in the se3 namespace. We need to properly specify them in each classes needing std::vector of  classes containing Eigen objects.

I like the idea of deleting the global EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION.

Solved by #340.

Thanks


Include i18n externalized strings in the binary

Is your feature request related to a problem? Please describe.
Our binary does not include any of our externalized strings and depends on them being at a certain relative path. This means it is easy to run the binary and find none of the UI strings present e.g.
~/github/lyra/build ᐅ ./lyra
 _
| |
| |    _   _ _ __ __ _
| |   | | | | '__/ _` |
| |___| |_| | | | (_| |
\_____/\__, |_|  \__,_|
        __/ |
       |___/

Description:
  rootCmdLong

Usage:
  rootCmdUse [flags]

Available Commands:
  applyCmdUse    applyCmdShort
  controller     controllerCmdShort
  deleteCmdUse   deleteCmdShort
  generateCmdUse generateCmdShort
  validateCmdUse validateCmdShort
  versionCmdUse  versionCmdShort

Flags:
      --debug             rootFlagDebug
  -h, --help              help for rootCmdUse
      --loglevel string   rootFlagLoglevel
      --version           version for rootCmdUse

Describe the solution you'd like
All (or at least one set of) strings present in binary. This can probably best be achieved using go generate and https://github.com/kevinburke/go-bindata.

Oh yikes, yeah that's terrible.

Easy fix though so I think we're cool.

Closed by https://github.com/lyraproj/lyra/pull/156


chore(ci): Move ASUS, Framework, and Surface images here

@EyeCantCU This still draft or should we land it? Asking because it appears to build fine

Let me get ASUS and Surface Nvidia stuff in here real quick and it should be good to go :)


distinct query in Realm database

hello, realm is super fast db
but very necessary distinct query from database e.g.  schedules = Schedules.objectsWhere("areas.id = '(idAreas)' distict")

+1 here :)

+1
This would be especially useful when number of sections in a grouped tableView is dynamic, iterating over all objects to find distinct sectionIdentifier properties after every change notification seems extremely inefficient, especially for large datasets.
It would be even better if this could be built into RLMResults or another similar class, and potentially support change/fine grain notifications in the future.

yes, something like @distinctUnionOfObjects is badly needed

+1 - 10,000+ records with a lot of duplicates, just need to know the distinct/unique values in a column!

+1

+1

+1

+1

+1

For Swift 1.2 (due to the contains func) you could do something like this
import Foundation
import RealmSwift

extension Results {

    func uniqueValueForObject<U : Equatable>(objectKey: String, paramKey: String, type: U.Type)->[U]{

        var uniqueValues : [U] = [U]()

        for obj in self {
            let obj = obj as T
            if(obj.valueForKey(objectKey) != nil){
                let uniqueObj: Object = obj.valueForKey(objectKey) as! Object
                if(uniqueObj.valueForKey(paramKey) != nil){
                    let uniqueObjValue = uniqueObj.valueForKey(paramKey) as! U
                    if !contains(uniqueValues, uniqueObjValue) {
                        uniqueValues.append(uniqueObjValue)
                    }
                }
            }

        }
        return uniqueValues
    }

    func uniqueValue<U : Equatable>(paramKey: String, type: U.Type)->[U]{

        var uniqueValues : [U] = [U]()

        for obj in self {
            let obj = obj as T
            if(obj.valueForKey(paramKey) != nil){
                let uniqueValue = obj.valueForKey(paramKey) as! U
                if !contains(uniqueValues, uniqueValue) {
                    uniqueValues.append(uniqueValue)
                }
            }

        }
        return uniqueValues
    }

    func uniqueObject(paramKey: String)->[Object]{

        var uniqueObjects : [Object] = [Object]()

        for obj in self {
            let obj = obj as T
            if(obj.valueForKey(paramKey) != nil){
                let uniqueObj : Object = obj.valueForKey(paramKey) as! Object
                if !contains(uniqueObjects,uniqueObj) {
                    uniqueObjects.append(uniqueObj)
                }
            }

        }
        return uniqueObjects
    }

}

Then you can use it like this...
Let's say we have a two very simple models Item and SubItem
class SubItem : Object {
     dynamic var name : String = ""
}

class Item : Object {
     dynamic var name : String = ""
     dynamic var subItem : String = ""
}

To use the extension one would use:
Realm().objects(Item).uniqueValue("name", type: String.self)
Realm().objects(Item).uniqueValueForObject("subItem", paramKey: "name", type: String.self)
Realm().objects(Item).uniqueObject("subItem")

Here's an updated version of the extension above, using Swift 2.0 (and Swift 2.0 compatible version of Realm)
@jpsim and @segiddins  - thoughts on this implementation?
extension Results {

    func uniqueValueForObject<U : Equatable>(objectKey: String, paramKey: String, type: U.Type)->[U]{

        var uniqueValues : [U] = [U]()

        for obj in self {

            if let o = obj.valueForKeyPath(objectKey) {

                if let v = o.valueForKeyPath(paramKey){

                    if(!uniqueValues.contains(v as! U)){
                        uniqueValues.append(v as! U)
                    }

                }
            }

        }
        return uniqueValues
    }

    func uniqueValue<U : Equatable>(paramKey: String, type: U.Type)->[U]{

        var uniqueValues : [U] = [U]()

        for obj in self {

            if let val = obj.valueForKeyPath(paramKey) {

                if (!uniqueValues.contains(val as! U)) {
                    uniqueValues.append(val as! U)
                }

            }

        }
        return uniqueValues
    }

    func uniqueObject(paramKey: String)->[Object]{

        var uniqueObjects : [Object] = [Object]()

        for obj in self {

            if let val = obj.valueForKeyPath(paramKey) {
                let uniqueObj : Object = val as! Object
                if !uniqueObjects.contains(uniqueObj) {
                    uniqueObjects.append(uniqueObj)
                }
            }

        }
        return uniqueObjects
    }

}

Instead of doing all that jazz above, I took the functional programming approach:
// Query all users
let allUsers = Realm().objects(User)
// Map out the user types
let allTypes = map(allUsers) { $0.type }
// Fun part: start with empty array [], add in element to reduced array if its not already in, else add empty array
let distinctTypes = reduce(allTypes, []) { $0 + (!contains($0, $1) ? [$1] : [] )

Or for a nice one-liner
let distinctTypes = reduce(map(Realm().objects(User)) { $0.type! }, []) { $0 + (contains($0, $1) ? [] : [$1] ) }

Couple of notes here:
Suffix'd map/reduce (Realm().objects(User).map { $.type } for example) don't play nice with the Result object but the standalone map() and reduce() do just fine.
I'm not sure of performance benefits over above solution but for brevity and concision, its a winner :D
And finally, I'm not sure how efficiently Realm handles object/property loading, they are lazily loaded supposedly so there shouldn't be any real benefit to having the Library itself do this over using something as simple as the one-liner above (aside from indexed lookups however?)

@kevinmlong Thanks for sharing!

or, more efficient (but stringly typed):
let distinctTypes = Set(Realm().objects(User).valueForKey("type") as! [String])

+1

@apocolipse it's not very efficient to use reduce to build arrays, see e.g. http://airspeedvelocity.net/2015/08/03/arrays-linked-lists-and-performance/

I'm kinda confused here. :confounded:
I use the latest version of RealmSwift & when I try to use @distinctUnionOfObjects in valueForKeyPath I get this error:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<RLMAccessor_v0_KXStatus 0x16574e00> valueForUndefinedKey:]: this class is not key value coding compliant for the key @distinctUnionOfObjects.'

On (Realm's NSPredicate Cheatsheet)[https://realm.io/news/nspredicate-cheatsheet/] it's documented as an available feature & yet here this issue is still open.
Am I  doing something wrong or this feature is still not in production?

@kexoth We don't support @distinctUnionOfObjects in queries yet, everything with the pink dot next to it is what we currently support.

@kishikawakatsumi this is the fastest response on Github Issues ever!! :+1:
Thanks for the info, I missed that detail in the documentation, now I saw that :sweat_smile:

+1

Support for this has been added in Realm's core, so it's no longer blocked. We do need to implement it in cocoa though, probably via @distinctUnionOfObjects.

Any info about when it will be implemented to realm-cocoa?

We've made lots of progress in core on this recently, but no one's actively working on exposing it via the Objective-C or Swift APIs. So no timeline we can share.

+1 for this.
The number of times I've used Realm on a project then regretted it when somewhat fundamental tools like this are lacking... It's a bit grating :)
Love the work you guys are doing though, just probably worthwhile waiting another half year or so next time.

+1
Started moving an app from CoreData to RealmSwift and the first query to convert uses request.returnDistinctResults on a table with approximately 100k+ rows. ;)

+9

+1

+1

+1

This needs a detailed API design to be proposed before we can move forward

In this category the functionality is implemented in a simple way at high level. Until the guys from Realm implement the functionality at low level I don't think it’s a bad solution.:
https://github.com/torcelly/RLMObjectDistinct/blob/master/README.md

@torcelly It's important to note that that solution loses the lazy-loading functionality of RLMResult.

Totally agree. The performance isn't optimal and the value returned it's an NSArray . As I mentioned before, it's a temporal solution until the Realm guys add the feature. However it could be valid in some cases and the measure times is good even for a huge RLMResults count.

You could also improve performance from polynomial to linear by making uniqueIDs an NSMutableSet instead of an NSMutableArray. 🙂

It would be a great solution to improve the performance. However several methods add sort and we won't access to the indexes. I could return NSMutableSet in the methods without sort but I don't know if the category lose consistency. Thoughts?

uniqueIDs is never returned, so this shouldn't be an issue, no? uniqueArray would not change type.

My mistake! you're right. I thought you were talking about uniqueArray. Changed and committed. Thanks for the feedback.

+1

+1

Any updates?

+1

+1

+1

+1

+1

+1

Any updates? This seems to be a dead end, as RBQ or realm results controller don't work for swift 3!

Work on this is ongoing here: realm/realm-object-store#235.
However, we still need to design how this feature should be exposed in our Objective-C and Swift APIs. Unfortunately, NSPredicate's @distinctUnionOfObjects isn't appropriate as that only returns the unique values of the property being "uniqued" (e.g. @distinctUnionOfObjects.name returning an array of unique names, not one object for each unique name).
A new method on Results (e.g. extension Results { func distinct(property: String) -> Self }) is an obvious way to expose this, but like I said, we haven't discussed it internally and no one from the community has stepped up to make a proposal.

+9

+100500

We have sortedResultsUsingKeyPath:, could be possibly have distinctedResultsUsingKeyPath: ?
PS: Without having looked it up, I'm not sure if 'distincted' is the correct past-prticiple for 'distinct' (English isn't my first language).

Sorted isn't used as a verb in the past tense but rather as an adjective: "the results are sorted".
So the equivalent naming for distinct would be distinctResultsUsingKeyPath:: "the results are distinct".
But I think the current implementation doesn't support nested key paths, so they can only be applied to direct properties of an object, so we might not call it a "key path" either, simply just "property".

I think the objectstore part doesn't support nested keypaths, but that would be pretty easy to fix. The core distinct logic does support all the same things as sorting.

+1

Please implement it at last

Hi
Any status? 220000 rows.  Query are fast, but get distinct are very slow.

Any updates? This issue open at 2014; and seems the "Core" already finished the distinct API.

I need it so badly, pls implement it ;)

@FreudGit  what's your meaning??  so,  Is there any indirectly way to implement it ?

@0xdatou you can perform a distinct operation in memory by copying data out of a Realm: https://github.com/realm/realm-cocoa/issues/1103#issuecomment-125381124
This issue is tracking adding built-in support in Realm itself, with auto-updating Results consistent with all our other querying capabilities.

The database I want to use distinct on has about 100.000 objects, also to be able to make sections in the table that displays the data. Post-query filtering/mapping to figure out the section count and titles is a hit on performance, because the user can filter the data using a search bar on the fly. Currently that means it'll need to re-map the sections and go over those 100.000 records with every keystroke.
Is there any other way to keep this performing well without the use of distinct? Or can we expect this feature soon?

@krummler you can checkout this pull request.

@qubblr Thanks, sounds great, but so far this hasn't been implemented/merged? Is there any alternative or temporary solution?

With Realm-Core 3.0+ the behavior seems well-determined enough so that this could be made available in Cocoa, just like in Realm-Java

@jpsim Will this be implemented in Cocoa version?  :)

Fixed by #5467.

When will the next release be in which this is included?

» When will the next release be in which this is included?
+1

https://github.com/realm/realm-cocoa/releases/tag/v3.1.0


D435.   start_streaming(...) failed. UVC device is already streaming!    xioctl(VIDIOC_S_CTRL) failed Last Error: Numerical result out of range

Required Info

Camera Model
D435

Firmware Version
<IP_ADDRESS>

Operating System & Version
Linux 16,04

Kernel Version (Linux Only)
(4.16.0)

Platform
PC

SDK Version
2.17.0

Language
{c++}

Segment
{Robot }

Issue Description
 Hi,everyone. when I run the command "roslaunch  realsense2_camera rs_camera.launch", error happens.And from roslaunch realsense2_camera, only "demo_pointcloud.launch" works properly. I hope someone can help me solve this issue. Thank you!

PARAMETERS

/camera/realsense2_camera/accel_fps: 1000
/camera/realsense2_camera/accel_optical_frame_id: camera_accel_opti...
/camera/realsense2_camera/align_depth: False
/camera/realsense2_camera/aligned_depth_to_color_frame_id: camera_aligned_de...
/camera/realsense2_camera/aligned_depth_to_fisheye_frame_id: camera_aligned_de...
/camera/realsense2_camera/aligned_depth_to_infra1_frame_id: camera_aligned_de...
/camera/realsense2_camera/aligned_depth_to_infra2_frame_id: camera_aligned_de...
/camera/realsense2_camera/base_frame_id: camera_link
/camera/realsense2_camera/color_fps: 30
/camera/realsense2_camera/color_frame_id: camera_color_frame
/camera/realsense2_camera/color_height: 480
/camera/realsense2_camera/color_optical_frame_id: camera_color_opti...
/camera/realsense2_camera/color_width: 640
/camera/realsense2_camera/depth_fps: 30
/camera/realsense2_camera/depth_frame_id: camera_depth_frame
/camera/realsense2_camera/depth_height: 480
/camera/realsense2_camera/depth_optical_frame_id: camera_depth_opti...
/camera/realsense2_camera/depth_width: 640
/camera/realsense2_camera/enable_color: True
/camera/realsense2_camera/enable_depth: True
/camera/realsense2_camera/enable_fisheye: True
/camera/realsense2_camera/enable_imu: True
/camera/realsense2_camera/enable_infra1: True
/camera/realsense2_camera/enable_infra2: True
/camera/realsense2_camera/enable_pointcloud: False
/camera/realsense2_camera/enable_sync: False
/camera/realsense2_camera/filters:
/camera/realsense2_camera/fisheye_fps: 30
/camera/realsense2_camera/fisheye_height: 480
/camera/realsense2_camera/fisheye_optical_frame_id: camera_fisheye_op...
/camera/realsense2_camera/fisheye_width: 640
/camera/realsense2_camera/gyro_fps: 1000
/camera/realsense2_camera/gyro_optical_frame_id: camera_gyro_optic...
/camera/realsense2_camera/infra1_fps: 30
/camera/realsense2_camera/infra1_frame_id: camera_infra1_frame
/camera/realsense2_camera/infra1_height: 480
/camera/realsense2_camera/infra1_optical_frame_id: camera_infra1_opt...
/camera/realsense2_camera/infra1_width: 640
/camera/realsense2_camera/infra2_fps: 30
/camera/realsense2_camera/infra2_frame_id: camera_infra2_frame
/camera/realsense2_camera/infra2_height: 480
/camera/realsense2_camera/infra2_optical_frame_id: camera_infra2_opt...
/camera/realsense2_camera/infra2_width: 640
/camera/realsense2_camera/json_file_path:
/camera/realsense2_camera/pointcloud_texture_index: 0
/camera/realsense2_camera/pointcloud_texture_stream: RS2_STREAM_COLOR
/camera/realsense2_camera/rosbag_filename:
/camera/realsense2_camera/serial_no:
/rosdistro: kinetic
/rosversion: 1.12.14

NODES
/camera/
realsense2_camera (nodelet/nodelet)
realsense2_camera_manager (nodelet/nodelet)
auto-starting new master
process[master]: started with pid [6811]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to 31ac2a52-00fb-11e9-82a4-dc8b28039517
process[rosout-1]: started with pid [6824]
started core service [/rosout]
process[camera/realsense2_camera_manager-2]: started with pid [6841]
process[camera/realsense2_camera-3]: started with pid [6842]
[ INFO] [1544941448.791179174]: Initializing nodelet with 12 worker threads.
[ INFO] [1544941448.828606927]: RealSense ROS v2.1.2
[ INFO] [1544941448.828631100]: Running with LibRealSense v2.17.0
[ INFO] [1544941449.123237168]: getParameters...
[ INFO] [1544941449.164742641]: setupDevice...
[ INFO] [1544941449.164763039]: JSON file is not provided
[ INFO] [1544941449.164779655]: ROS Node Namespace: camera
[ INFO] [1544941449.164796728]: Device Name: Intel RealSense D435
[ INFO] [1544941449.164807047]: Device Serial No:<PHONE_NUMBER>18
[ INFO] [1544941449.164815537]: Device FW version: <IP_ADDRESS>
[ INFO] [1544941449.164823914]: Device Product ID: 0x0B07
[ INFO] [1544941449.164831191]: Enable PointCloud: Off
[ INFO] [1544941449.164838269]: Align Depth: Off
[ INFO] [1544941449.164845488]: Sync Mode: Off
[ INFO] [1544941449.164903510]: Device Sensors:
[ INFO] [1544941449.164923850]: Stereo Module was found.
[ INFO] [1544941449.164934199]: RGB Camera was found.
[ INFO] [1544941449.164982870]: (Fisheye, 0) sensor isn't supported by current device! -- Skipping...
[ INFO] [1544941449.164995837]: (Gyro, 0) sensor isn't supported by current device! -- Skipping...
[ INFO] [1544941449.165004018]: (Accel, 0) sensor isn't supported by current device! -- Skipping...
[ INFO] [1544941449.165017579]: setupPublishers...
[ INFO] [1544941449.166832419]: Expected frequency for depth = 30.00000
[ INFO] [1544941449.185863519]: Expected frequency for infra1 = 30.00000
[ INFO] [1544941449.202491228]: Expected frequency for infra2 = 30.00000
[ INFO] [1544941449.219663576]: Expected frequency for color = 30.00000
[ INFO] [1544941449.236620822]: setupStreams...
16/12 14:24:09,238 WARNING [140178048231296] (sensor.cpp:338) Unregistered Media formats : [ UYVY ]; Supported: [ ]
[ INFO] [1544941449.239939411]: depth stream is enabled - width: 640, height: 480, fps: 30
[ INFO] [1544941449.240115329]: infra1 stream is enabled - width: 640, height: 480, fps: 30
[ INFO] [1544941449.240268252]: infra2 stream is enabled - width: 640, height: 480, fps: 30
16/12 14:24:09,241 WARNING [140178048231296] (backend-v4l2.cpp:1248) Pixel format 36315752-1a66-a242-9065-d01814a likely requires patch for fourcc code RW16!
16/12 14:24:09,242 WARNING [140178048231296] (sensor.cpp:338) Unregistered Media formats : [ RW16 ]; Supported: [ ]
[ INFO] [1544941449.246570658]: color stream is enabled - width: 640, height: 480, fps: 30
[ INFO] [1544941449.257971991]: num_filters: 0
[ INFO] [1544941449.258000941]: publishStaticTransforms...
[ INFO] [1544941449.258166850]: RealSense Node Is Up!
[ INFO] [1544941449.258205804]: Start updating dynamic parameters...
16/12 14:24:09,310 WARNING [140178048231296] (types.cpp:57) start_streaming(...) failed. UVC device is already streaming!
16/12 14:24:09,310 WARNING [140178048231296] (types.cpp:57) start_streaming(...) failed. UVC device is already streaming!
16/12 14:24:09,310 WARNING [140178048231296] (types.cpp:57) start_streaming(...) failed. UVC device is already streaming!
16/12 14:24:09,310 WARNING [140178048231296] (types.cpp:57) start_streaming(...) failed. UVC device is already streaming!
16/12 14:24:09,376 ERROR [140178048231296] (types.h:188) xioctl(VIDIOC_S_CTRL) failed Last Error: Numerical result out of range
[ERROR] [1544941449.376423759]: Failed. Skip initialization of parameter 24
[ INFO] [1544941449.376899586]: Done updating dynamic parameters...
<IP_ADDRESS>

I am receiving the same error messages when using the D415. I am using the latest firmware and librealsense2 versions.


UI: Fix template is deselected if other zone is selected

Description
This PR fixes a minor UI issue on multiple zones:

Select another zone -> default template appears selected however it is not shown in the right side ('Your Instance')
Deploy VM -> ERROR: Please select a template or ISO to continue.

Types of changes

[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] New feature (non-breaking change which adds functionality)
[x] Bug fix (non-breaking change which fixes an issue)
[ ] Enhancement (improves an existing feature and functionality)
[ ] Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale

[ ] Major
[x] Minor

Bug Severity

[ ] BLOCKER
[ ] Critical
[ ] Major
[x] Minor
[ ] Trivial

Screenshots (if appropriate):
How Has This Been Tested?

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

UI build: :heavy_check_mark:
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6415 (SL-JID-1632)


Add rake task to merge pre- & post-migration users

This is to handle the case where a legacy_subject_id isn't being
returned from the userinfo, and so we're trying to create a new
OidcUser record with the same email address as an existing,
pre-migration, one.
We have one such case so far (brought to light by the new unique index
on the email field).  I've asked DI to check the record for that user,
as they should have been migrated across.  But, so that the user can
log in, we need to merge their two records.
The task will only merge users where:

the post-migration user has no legacy_sub or email.
the pre-migration user has the same sub and legacy_sub.
both users were created on the right sides of the migration.

Trello card

Upon further investigation, we had a bug on our end where users could confirm their email addresses after the cut-off point, as we didn't take down the route which does that.
This affects 179 users.  Some of these have brexit checker results saved, so we don't really want to delete them.  Instead we can just use this task to merge them as they come up.


nani is abstraction???

Description
could anyone kindly explain what is data abstraction and functional abstraction? preferably with examples too!! thanks peeps
Topic:
abstraction
Screenshots
Screenshots (if any)
`

To add on, from my understanding, the philosophy of data abstraction is to separate the client (i.e. someone who wants to find radius, a number) from the implementation (e.g. double, int, Integer, etc.). For example, you want to make a shopping list. It has stuff that you expect to be able to do like add/remove items, lookup items, check the length etc. How this may be implemented in Java is by linkedlists, arraylists, etc., but the client should not need to know about those things to be able use a shopping list, nor should they care. All the client needs to know are methods that the shopping list exposes to them, not how the data is stored.

Instead of writing a very customised chunk of code that only does one thing. The idea of abstraction is to write methods and customisable functions to make your chunk of code more customisable so that you can reuse the methods/functions instead of re writing repeated codes.

Data Abstraction <- Information hiding. The client don't need to know how/where the implementer store the data.
Functional Abstraction <- Allow the client to call the function implemented by the implementer without knowing how the function algorithm/ calculation works.


Fileprivate to private

Use a stricter access control, as the properties and function do no need to be fileprivate - private will do just fine.

Thanks for the contribution!


Small cleanup in EventLoop.

Small cleanup in EventLoop.
Motivation:
Cleaner code.
Modifications:
Change () throws -> (T) to () throws -> T
Result:
Cleaner code.

@swift-nio-bot test this please

As @Lukasa already approved it (the one with the different commit message) I will merge this once the CI pass

@sunlubo thanks!


Is bit shifting really faster than integer multiplication/division?

I think there is not much reason to prefer shift operators over multiplication operators. It just makes source code harder to read.
http://stackoverflow.com/questions/6357038/is-multiplication-and-division-using-shift-operators-in-c-actually-faster
https://github.com/openfl/openfl/blob/0433654517dff7ac57c1cf0d550d24cc1d644dc3/openfl/utils/ByteArray.hx#L720

Saves you from having to type out Std.int which gets annoying after a while, especially if you've used as3 where floats are automatically truncated to ints. Your link was for integers anyway, not floats. It doesn't matter either way.

@vroad I think that is derived from code that Nicolas Cannasse wrote, I agree it's confusing to read :smile:


Support temporal 1.22.x

Branch: https://github.com/temporalio/temporal/tree/release/v1.22.x
Tag: https://github.com/temporalio/temporal/releases/tag/v1.22.0
Not sure how much effort it takes to support a new minor version. If there is a brief developer guide, more contributors may help if needed.

Hi!
Looks like we'll only need to add a new API field for frontend http support.
It should not take too many time.


Account should not be passed into the methods to call the functions

there will be overlap between the web3 instance and the account being passed in.
the calling address should be passed in for example, but probably not the full web3 account

@cyberliem @secmask  -> we only need the caller address when calling the contract functions right?
Why do we need the account per se?

I see account pass in for using account.address only, so we can reduce to not pass full account.

yup, we do need to asset permissions to make sure that the address is both in the web3 instance, as well as authorized to execute as admins.


[REQUEST] Adding multiple wordlists

Is your feature request related to a problem? Please describe.
No, It's just a suggestion.
Describe the solution you'd like
I would like you to add an option to add multiple wordlists together instead of choosing one by one.
Describe alternatives you've considered
hmm i don't have. I was just choosing it one by one.
Additional context
No

You can already do it, just drag and drop multiple files into the Wordlist Manager list. OB will automatically recognize their type (you must be on the latest version) and import them.

You can already do it, just drag and drop multiple files into the Wordlist Manager list. OB will automatically recognize their type (you must be on the latest version) and import them.

Oh, Didn't know. Thank you 😁


Add support for the NX (not exists) option to flags

There are some Flag usage Redis patterns that benefit from having the flag set only if doesn't exist. SET support that use case with the NX option.

I'd like to see a use case for this from your app because just opening up to nx might not be what we want here.
For instance, we use nx: true as a trick in Counter to keep the original expiry and not reset on a subsequent call. We may want similar here.

The use case is a flag to mark that we've communicated with a client in last week. We currently use the counter, since it's the only one supporting nx at the moment, but we really need a simple flag so the counter usage feels off since we discard the second return param of .increment just using the first param as an indication of a successful SET. I've used the same pattern plenty of time with a regular Redis usage so feels that Kredis would benefit from it.

Let's flip the binary, so the attribute name can be in the affirmative:
def mark(expires_in: nil, force: true)
  set 1, ex: expires_in, nx: !force
end

And then it would be nice to add this to the attribute definition too:
class User
  kredis_flag :banned, expires_in: 2.days, force: false
end

This would follow the addition of expires_in to the attribute specification in https://github.com/rails/kredis/pull/52.

Let's flip the binary, so the attribute name can be in the affirmative:

I like it better for sure. Renamed in https://github.com/rails/kredis/pull/51/commits/5d6bcd0427896cf7d56031d4b13b1e766af4c846


Update node-providers.md

Proposing to update additional possible free RPC endpoint powered by All That Node.
What changed? Why?
Notes to reviewers
How has it been tested?

Oh sorry, I've changed the link!

I've chenaged it! Thanks in advance.


browser not automatically popping up

Since the update, the chrome browser doesn't pop up when I hit enter in Cmd. I see it scanning for inventory. Will it open up a browser automatically when it picks up stock?

Yes. Run the test and you'll see how it works.

thanks!!


v0.9 Planning

Probably the last version before stable v1.0

[ ] Improve the build scripts and process
[ ] Detect Profiles for Chromium browsers
[ ] Explore migrating to upcoming WinAppSDK 1.4 from WPF-UI
[ ] Browser Extension #20
[ ] Explore #66
[ ] Explore Improving app startup time

As part of v0.8.x updates

[ ] Custom Keyboard shortcuts
~Hurl Settings Alpha for editing Rules~ (See comment https://github.com/U-C-S/Hurl/issues/67#issuecomment-1868419374)
~Include Hurl Settings alpha in Installer~
~Better UI for quick adding Rules~

If I can help with anything, please let me know

@neoOpus  The project is bit struck at designing settings application UI for Hurl. I will get back to you on this soon.
Also, Anything like might also helpful

code quality review/improvements (U could do this by commenting in specific commits)
Initializing test project and Writing some basic tests

Will you accept if I do some mockups in Photoshop or other software about how it should looks? and I can help this way making decisions based on other users feedback

Yes... That would be great, Thanksi. Do them at your own pace.

Settings App UI for adding rules

Do you have access to a Mac, @U-C-S ?
I think sindresorhus's velja is one of the best in this category. I've tried many, many similar programs on Win/Mac, and his is IMO the best on mac (and yours on Windows of course). More importantly, its Rules settings seems to offer similar features to the ones you appear to be after.
His website doesn't include any settings screenshots AFAICT so if you don't have a Mac, I'd be happy to provide any screenshots or videos you want.

Tho tbh if I could put my vote in, as much as I'd want this feature (rules UI), I'd prefer to have keyboard shortcuts for the browser choices sooner first. I'm sure you know what other users might prefer so I'll defer to your judgement, but if there's any way I can help implement that feature - lmk

Do you have access to a Mac

I might have access to one either from work or one of friend's very soon. I will take a look, just from the site's screenshots it looks pleasing to use.
Currently, I'm having trouble with developing WinAppSdk apps in Visual Studio (for Hurl Settings App). I have opened an issue in VS Forums, and I'm trying to reproduce the said issue to pinpoint the cause, but couldn't yet as I find it so random.
(issue: XAML editor shows up a lot of errors that aren't actually errors, and I rely a lot on Intellisense to understand the framework, which also stops working). Im also trying to use MVVM pattern to have some quality code, with bit no success yet so far.

prefer to have keyboard shortcuts for the browser choices sooner first

I will priortize that, as of now I cannot work on Hurl Settings app but can make custom keyboard shortcuts possible for the small v0.8.1 release.

It's pointless I guess. This issue https://github.com/microsoft/WindowsAppSDK/issues/2597 won't let me publish the Hurl Settings App properly😑. Hurl Settings app have to wait till that gets fixed.

Are you trying to create a separate app/executable for the settings? I was assuming it would be another window from the same executable

I want Settings App to be a seperate executable to keep the Selector window light and Have more options on how the settings app can be developed.
This way I could eventually try to move Selector window to more faster C++ or something like that and need not change anything on the settings app side

It's pointless I guess. This issue microsoft/WindowsAppSDK#2597 😑won't let me publish the Hurl Settings App as I needed it (Unpackaged, framework-dependent and optionally single file output). Hurl Settings app have to wait till that gets fixed.
RANT: I am really hoping Microsoft works on AoT for C#/WPF, Better Visual Studio support atleast in 2024. It's really a pain for a hobby dev like me to develop anything pleasingly usable as I want it.

I feel your pain, working with the WindowsAppSdk is a nightmare. It's been out for 3 years (!) and it still feel like its a beta release.

I feel your pain, working with the WindowsAppSdk is a nightmare. It's been out for 3 years (!) and it still feels like its a beta release.

Same goes for their MAUI environment too, when trying to develop mobile apps! I miss the days when MS was focused on making the developer's experience as smooth as possible!

https://github.com/U-C-S/Hurl/pull/96#issuecomment-1981583351

Just to note

PublishSingleFile will be supported in Windows App SDK 1.5

https://github.com/microsoft/WindowsAppSDK/issues/2597#issuecomment-1912841882

PublishSingleFile will be supported in Windows App SDK 1.5

YEESSSS....  🤩

Idea for the framework: if converting to WinUI (latest version) is too big of a step, what about using Microsoft's WPF?

converting to WinUI (latest version) is too big of a step

I don't think that's a concern for me, it's just that app is not format I want it to be... i.e smaller executable sizes

what about using Microsoft's WPF?

I am already using it, aren't I ?

what about using Microsoft's WPF?

I am already using it, aren't I ?

I meant dropping the WPF-UI. But just an idea. If WinUI is possible that sounds good too.

TODO:

[ ] Update README
[ ] Add a Setting option to change default app settings
[ ] win10Testing (installer, settings app)
[ ] Ponder over UIElement sizing changes

win10Testing

Right, because (the setting) mica won't work on W10.


PHP7.2 warning with uninitialised $header variable

Issue Summary
In function SendGrid\Email::getHeadersJson a check of the headers array is done with count() to check if any headers have been set. The $headers variable is not initialised in the class definition or in the constructor to an empty array. Since PHP7.2 a warning is generated when count() is performed on a non-countable array. This leads to the log file being spammed on every email sent.
Steps to Reproduce

Send email via SendGrid php client without setting any headers
Check php error logs.

Warning: count(): Parameter must be an array or an object that implements Countable in /src/vendor/sendgrid/sendgrid/lib/SendGrid/Email.php on line 522
An easy fix is to initialise the $headers variable in the constructor with an empty array.
Technical details:

sendgrid-php Version: master (latest commit: [commit number])
PHP Version: 7.2

PHP RFC reference to the change.
https://wiki.php.net/rfc/counting_non_countables

Hi @lucasnetau,
Thanks for reporting this and offering an easy solution!
I've added this to our backlog for implementation.
With Best Regards,
Elmer

Is this resolved? Unable to reproduce / find the file.

Hi, yes this can be closed, I was porting a system over to PHP7.2 and failed to see that the version of the sendgrid client was installing an older version 3.2 locked by composer, surprisingly this one change was all that needed to be done to get it working in PHP7.2


Inference Error for EfficientNet-B0

Hi, I have trained efficientnet_b0 and the checkpoint has been produced. When I ran the inference.py using this command
python inference.py /home/usr/images/ --model efficientnet_b0 --checkpoint ../efficientnet_b0-224/checkpoint-13.pth.tar
I got the following error, any idea what's the reason behind this?
Traceback (most recent call last):
  File "inference.py", line 124, in <module>
    main()
  File "inference.py", line 68, in main
    checkpoint_path=args.checkpoint)
  File "/ssd/pytorch/pytorch-image-models/timm/models/factory.py", line 42, in create_model
    load_checkpoint(model, checkpoint_path)
  File "/ssd/pytorch/pytorch-image-models/timm/models/helpers.py", line 22, in load_checkpoint
    model.load_state_dict(new_state_dict)
  File "/home/ivan/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 839, in load_state_dict
    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for GenEfficientNet:
	size mismatch for classifier.weight: copying a param with shape torch.Size([30, 1280]) from checkpoint, the shape in current model is torch.Size([1000, 1280]).
	size mismatch for classifier.bias: copying a param with shape torch.Size([30]) from checkpoint, the shape in current model is torch.Size([1000]).

Looks like you trained with num_classes=30 but are running inference with default of 1000, try adding --num_classes 30 to the inference cmd line


Add shortening for long titles and author names

Add shortening for long titles that sometimes occur, so that they don't mess up the layout. Ideally there should be a fixed space for title / author display that always stays the same.
Potential solution might be to hide the overflow and add animation that slowly scrolls the title horizontally to reveal the full text (like in a car radio).

I'd like to tackle this issue. 😀

I'm curious, would you like the width to be more limited? This would allow for the overflow to be scrollable. Attached is an image for a long name and name of a song.

@Jwright707 Yeah, good example, some of the titles are messed up and way too long. I'm thinking they should always stay about the same width as the album art and probably be limited to 1 line. The full title can then animate back and forth slowly within these boundaries.

Just merged a working fix #9. Still space for improvement though :)

Next step could be to find a way to make the scroll animation always have the same speed, no matter the length of the title.
Right now it's just set to 10 seconds so it moves very slow on short titles and fast on long ones. Not optimal 🤔

Hey @luk-str , sounds good! I can take a look at trying to improve the scroll speed tomorrow 👍

Awesome Joshua! 🖖


Add overrides array

Changes

I wanted to be able to use whichkey.bindings as a default for an extension, but also have overrides for that extension. One solution with the current architecture is for my extension to use a register of
const register = {
  bindings: "whichkey.bindings",
  overrides: "myextension.overrides"
}

. But this also means if a user wanted to modify the extension's keybindings, the entire "myextension.overrides" JSON object (potentially hundreds of lines) would be in that user's settings.json.
Another way would be like VSpaceCode's solution, where the bindings is defined in full, even though many of it overlaps with whichkey defaults.
I wanted to have another override binding setting on top of the default one.
My solution was to have an overrides array, extension.bindingOverridesArray, that holds a list of settings to look for as overrides. This could entirely replace the extension.bindingOverrides settings, but it has been kept for backward compatibility.
Here is an example:
"vim.normalModeKeyBindingsNonRecursive": [
    { "before": ["<space>"], "commands": ["whichkey.show"] },
},
"whichkey.bindingOverrides": [{ "keys": "?", "position": -1 }],
"vspacecode.bindingOverrides": [
  { "keys": "\t", "position": -1 },
  { "keys": "!", "position": -1 }
],
"whichkey.bindingOverridesArray": ["vspacecode.bindingOverrides"],

Here, the default binding used is the whichkey defaults. Without this PR, the menu would only remove the ? keybind. With this PR, \t and ! are removed as well.
One use case is that extensions can make use of other base bindings without having to maintain (copy the entire binding into package.json) it themselves. For example, VSpaceCode uses many keybindings based off of whichkey. If whichkey updated its default bindings, VSpaceCode would also have to update theirs.
Now, VSpaceCode can have a register that looks like this:
const register = {
  bindings: "whichkey.bindings", // extension base bindings
  overrides: "vspacecode.providedOverrides", // extension overrides
  overridesArray: ["vspacecode.bindingsOverride"] // user overrides
}

or
const register = {
  bindings: "whichkey.bindings",
  overridesArray: ["vspacecode.providedOverrides", "vspacecode.bindingsOverride"]
}

Notes
I noticed some inconsistent formatting (probably due to different developers working on the project). Does the project prefer single or double quotes?
I took the liberty to include a prettier config in this PR. If someone thinks it's unnecessary, feel free to remove it.
If having a consistent format seems like a good idea, A pre-commit hook can be added to make sure all commits conform to the formatting. This would make reviewing PRs easier as well.

Sorry for the late reply. Having both overridesArray and overrides makes the registration object complicated. One option is to support both string and array in the overrides property. However, the thing you are trying to achieve may be solved by the implementation of https://github.com/VSpaceCode/VSpaceCode/issues/199. Layer is designed and naturally supports add-on layer (as extension) on top of existing base layer.

Thank you for taking a step to adding prettier. Having consistent formatter would be nice. Can you separate out into a separate PR.

Does the project prefer single or double quotes?

I don't really have a preference, but gut sense is telling me double quotes?


RemoveNodes can't handle big renders

Related to #22, which removed the initialRender feature for big updates.
There are two solutions here:

refactor removeNodes to handle big updates
add initial render logic back in

I'm leaning toward 2 right now

Done via 2


Windlines defaultconfig error

Missing default raycast params, throws error
https://github.com/bubshayz/libraries/blob/45d6cfb9d4e154212c840bd63776806ff4342667/src/windLines/init.lua#L78

This has been fixed in the latest version of windLines, please update your package! 🎉


Add Search Tag Filters

Features:

Added toggle buttons to the search menu to filter search results by an item's MenuItemTag

NOTE: this is the first of multiple PRs related to search filtering. Filtering by Buildings and Open Hours is also planned.


Possible to change FD "threshold" in .html for QA purposes?

When opening the .html file showing visual reports of the output, the FD shows a seemingly arbitrary bar that doesn't correspond to the default .5mm threshold. For example, one subject's .html shows a FD bar at .48mm, and another shows at .41mm. It would be convenient to have this bar be constant for all subjects for quality assessment across subjects. I know that there are commands to censor volumes that are FD>.5mm, but I'm more concerned about the visual inspection aspect. Is there any way to set this to be the same (preferably .5mm) for all subjects?
Thanks!

Thanks @ryanw412 and @julfou81 for this suggestion. I think this would be very useful.
I'm transferring the issue to nipreps/niworkflows, which is where the code to generate that plot lives:
https://github.com/nipreps/niworkflows/blob/5792f74b24f529590584b36be8df07a5833d963e/niworkflows/viz/plots.py#L574-L755
Any suggestions in the form of PR (or patches, or anything) will be very welcome. Otherwise, we cannot really give any timeframe for the implementation of this feature. Please join our fMRIPrep bi-monthly meetings for more info.


Keyboard macros

Description of the new feature / enhancement
Use few keystrokes to e.g. write repetitive blocks of txt.
Scenario when this would be used?
In coding lines of code are often repeated eg. Console.WriteLine
Supporting information
Bing chatgpt is saying the option is in Keyboard Manager,. But then it also says that ver 0.46.2 is the latest release. I cant find the utility. Only ways to remap shortcuts

/dup https://github.com/microsoft/PowerToys/issues/5668