text:
monkeywrench: 0.1.0-1 in 'noetic/distribution.yaml' [bloom]

Increasing version of package(s) in repository monkeywrench to 0.1.0-1:

upstream repository: https://github.com/cst0/ros-monkeywrench.git
release repository: https://github.com/cst0/ros-monkeywrench-release.git
distro file: noetic/distribution.yaml
bloom version: 0.11.1
previous version for package: null

monkeywrench
* Initial code release, demo
* Update documentation
* Create LICENSE

did something went wrong during bloom release? The release repository URL is missing from tracks.yaml.

@hidmic That's certainly possible: the first time I ran bloom I had an authorization-based error. But, I then resolved that error by setting up a token properly, and then deleted my release repo and rosdistro repo fork. Bloom then ran without any complaints, so it should have been fully automated and clean from there.
What should I be seeing in the tracks.yaml? An entry linking the repo to itself? I can attempt to re-do the release repository but I'm not convinced I would see a difference because bloom didn't inform me of an error to resolve.

just to double check, no doc entry?

Thanks for the catch-- I had written up some stuff in the README but probably better to explicitly point to that... Updating now.

Corrected distributions.yaml to have appropriate branch, checks now pass.


text:
Add python modules required for rospeex in rosdep/python.yaml

The modules are required for the next version of rospeex, which will be updated later.

Please consider using the available Debian package instead. Otherwise you won't be able to release any packages depending on this.

Do you mean the package should be obtained by apt-get instead of pip? If so, the solution would be the following. What do you think?
Before:
  debian:
    pip:
      packages: [autobahn]

After:
   debian: [python-autobahn]

Yes, correct. The same for Ubuntu.

For Ubuntu 14.04 or later, we can install python-autobahn by apt-get. For Ubuntu 13.10 or earlier, python-autobahn is not included in the default packages. Therefore, I think the following will work. What do you think?
+python-autobahn:
+  debian: [python-autobahn]
+  fedora:
+    pip:
+      packages: [autobahn]
+  osx:
+    pip:
+      packages: [autobahn]
+  ubuntu:
+    lucid:
+      pip:
+        packages: [autobahn]
+    maverick:
+      pip:
+        packages: [autobahn]
+    natty:
+      pip:
+        packages: [autobahn]
+    oneiric:
+      pip:
+        packages: [autobahn]
+    precise:
+      pip:
+        packages: [autobahn]
+    quantal:
+      pip:
+        packages: [autobahn]
+    raring:
+      pip:
+        packages: [autobahn]
+    saucy:
+      pip:
+        packages: [autobahn]
+    trusty: [python-autobahn]
+    utopic: [python-autobahn]
+    vivid: [python-autobahn]

That looks good. Though I'd suggest not including the past EOL'd distros. We don't have a policy, but usually retain existing records for EOL'd distros. However adding EOL'd distros doesn't make a lot of sense.

Thank you for your suggestion. EOL'd distros are included because some users want to install from source code.
I'll close this and send another pull request.

source: gharchive/pull-request

authors: dirk-thomas komeisugiura tfoote

repo: ros/rosdistro

license_type: permissive

license_source: github-api


text:
Update Understanding-ROS2-Services.rst

change ros2 interface show --> ros2 srv show

ros2 srv <verb> (and msg/action <verb>) are legacy tools from ROS 1. ros2 interface is the universal replacement for all interface/verb commands in ROS 2

authors: fairuskhalid maryaB-osr


text:
Remove -Werror

This removes -Werror from the default set of compiler flags, as @wjwwood mentioned was alright to do in this comment.
This should resolve #402.

CI, just in case there some unforeseen interaction with Jenkins:

Linux
Linux-aarch64
macOS
Windows


text:
popular tv show page updated.

Complete tv show page

Completed

repo: rosanno/moviemania

license: MIT


text:
Video feed

Great project! This was the only information I could find about converting a fermax vds feed into  digital, I’m trying to do something similar, my intercom receiver doesn’t have a video Input, but the wire is there and there is a camera on the buildings intercom, my idea is to convert that signal to digital and either send it via WiFi to a mobile device, or simply make a custom display for it, did you connect the vds wires directly to the usb vídeo card? If so what capture card did you use? I couldn’t quite see the model in the picture.
Kind regards!

Many thanks for the feedback. I used an EasyCap Adapter/Converter to capture the video, directly connected to wires V and M (shield) on the doorstation.
These are the commands I used to set up EasyCap on the Raspberry Pi.
•	wget https://github.com/gkaindl/ambi-tv/archive/master.zip
•	unzip master -zip
•	cd ambi-tv-master
•	cd misc
•	sudo bash get-kernel-source.sh
•	cd usbtv-driver
•	make
•	sudo mkdir -p  /lib/modules.3.6.11+/extra
•	sudo cp usbtv.ko /lib/modules/3.6.11+/extra
•	sudo depmod 3.6.11+
•	sudo modprobe videobuf2_core
•	sudo modprobe usbtv
•	v412-ctl –list-devices /dev/video0
Hope that helps and good luck.

source: gharchive/issue


text:
Simplify the constraints

This is pretty cool. I can get monitoring running in seconds once the images have be downloaded.
This PR just simplifies the constraints a bit so you don't have to fuss with segments IDs. Added some links to relevant resources too.

Hi @everett-toews - Thanks for the PR!  I like your improvements to the constraints and the links.  I'll test your changes out later today.

authors: everett-toews rosskukulinski

repo: rosskukulinski/docker-swarm-monitoring

license: mit

license_source: bigquery


text:
Feature: Server sent events

https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events

#67c45c39b8b99d2c3e90c3922f21670e7ee25d96

repo: routup/routup


text:
What is wrong with a "performance-based" job?

This is related to https://github.com/rowanmanning/joblint/issues/26 but the question wasn't answered in that thread.
One notice includes the phrase 'The job sounds competitive and performance-based'. I understand why a competitive environment may not be good, but I don't understand what's meant by "performance-based". Surely this warning isn't suggesting that employers shouldn't reward employees based on their performance?
Thanks!

Performance-based environments imply your performance is measured. If you figure out how to measure an engineers performance well, let us know :)

@DanielHeath haha, nice! LOC of course! ;)

Performance-based environments imply your performance is measured.

Yes, it implies that your performance is measured, but to me it does not suggest it's some arbitrary metric, but a holistic evaluation using feedback from a variety of peers and your manager.

You mean you get promoted if people like you and not if they don't?

You mean you get promoted if people like you and not if they don't?

Do you honestly think that's what I mean?
I mean that you get promoted if your peers and manager see you as providing value to the business. Is that a perfect system? No. Is is possible to create a review process where you incentivize looking good instead of creating real value? Yes. But is it not desirable to reward the highest achievers? Is there a better way to ensure that those rewards are allocated correctly?

I think there's a little misunderstanding as to the original reasoning behind this rule. If you look at the description for that rule (use the --verbose flag) then it states:

Competition can be healthy, but for a lot of people a heavily competitive environment can be a strain. You could also potentially be excluding people who have more important outside-of-work commitments, such as a family.

This message is notice level rather than warning or error so it's not a must-fix if it appears for your job spec. Possibly the "performance-based" part of the message is what's causing confusion, so I'm open to re-wording.
Thanks

Yes, the "performance-based" part is what I'm getting hung up on. If that were to be omitted, and it just said, "This job sounds competitive", then I think everything would make more sense.

@NickHeiner fair enough.
Is it not desirable to reward the highest achievers?: If I can make every project either fail, or look like I was responsible for its success, I'll be the highest achiever. If you have even one person in your organization who will behave that way, the harm done by performance pay will outweigh the good.
For instance, Microsoft introduced Stack Ranking (from 2006 to 2013) to reward their highest achievers. There was some lag, but over the next few years, many of their best engineers quit and their product lines suffered drastically.

If you have even one person in your organization who will behave that way, the harm done by performance pay will outweigh the good.

That completely depends on the size of your organization. But yes, it is possible for employees to behave badly and hurt the overall organization in a wide variety of ways. That's why culture fit interviews are important, and if necessary, those people can be fired.

For instance, Microsoft introduced Stack Ranking (from 2006 to 2013) to reward their highest achievers.

I agree that Stack Ranking was problematic, and the fact that Microsoft discontinued it means that even they didn't think it was a good idea after a while. However, Stack Ranking is a specific implementation of the idea that the highest performers should receive the highest compensation, and its failure does not mean that the entire idea is bad. For instance, Stack Ranking insists that each team must fit within a distribution of skill levels; if everyone on a team is performing at a high level, it is impossible to reward them all accordingly. In this case, Stack Ranking is not effectively rewarding high performers for the value they contribute to the company, and so it's understandable that those people would want to leave.
What is the alternative to rewarding according to value created? Giving raises based on tenure at the company? Employee age? (I'm not being facetious; I'm genuinely curious what you think. This could explain some of the difference of opinion we have.)

@NickHeiner Yes, it is not desirable to try to incentivise people.  I know it sounds weird but there's actually a lot of studies and what it boils down to is that if the job a person is doing requires anything past basic levels of cognition as part of it's work, the classic model of financial incentivising not only doesn't work, but in fact can make people less effective.
This video (It's an RSA Animate short) explains it pretty well, with pictures, and I've cued it up to the right place:  https://youtu.be/avnHUxSVfVM?t=36s

That's an interesting video. I 100% agree that building an organization purely around financial incentives is not going to be as effective as one that maximizes autonomy, mastery, getting to work on hard problems, and having a purpose. I wish the video had spent a little more time on the part that's directly relevant to your point about how greater rewards make people perform worse.
Anyway, for the purpose of the conversation, let's just say that that's correct, and giving people more money makes them perform worse as software engineers. I would then ask: what alternate model for allocating compensation would you propose? And do you think that Google's success is in spite of its generous compensation?

authors: DanielHeath NickHeiner gerrywastaken rnalexander rowanmanning

repo: rowanmanning/joblint


text:
Support for deoplete plugins

There's a lot of deoplete plugins that exist. Would it be possible to add support for those in this library? Or maybe just to have full deoplete as one of the sources.

It's easier to have full deoplete as one of the sources. But I don't want to maintain this feature. So Here's the code:
" force init deoplete then hack deoplete's mapping
call deoplete#enable()

" register as ncm source
au User CmSetup call cm#register_source({'name' : 'deoplete',
        \ 'priority': 7,
        \ 'abbreviation': '',
        \ })

" hack deoplete's mapping
inoremap <silent> <Plug>_ <C-r>=g:Deoplete_ncm()<CR>

func! g:Deoplete_ncm()
  " forward to ncm
  call cm#complete('deoplete', cm#context(), g:deoplete#_context.complete_position + 1, g:deoplete#_context.candidates)
  return ''
endfunc

It is possible to support deoplete's python source. But that might take a lot of work. So I have no plan for this currently.

@roxma so, by using this snippet, is not necessary to have installed deoplete too?
I wanna start using this plugin as my only autocomplete manager, but elm autocompletion sources just have support for deoplete and YCM

@charliesbox
The snippet needs deoplete.
Looks like elm-vim has omni function. You could use simillar config as it is for css. Note that omni completion is running on the same thread as nvim's main thread, though. I'd rather create a plugin for ncm if I have the time.
" css completion via `csscomplete#CompleteCSS`
" The `'cm_refresh_patterns'` is PCRE.
" Be careful with `'scoping': 1` here, not all sources, especially omnifunc,
" can handle this feature properly.
au User CmSetup call cm#register_source({'name' : 'cm-css',
		\ 'priority': 9,
		\ 'scoping': 1,
		\ 'scopes': ['css','scss'],
		\ 'abbreviation': 'css',
		\ 'cm_refresh_patterns':[':\s+\w*$'],
		\ 'cm_refresh': {'omnifunc': 'csscomplete#CompleteCSS'},
		\ })

@charliesbox
Please test this fork: https://github.com/roxma/elm-vim
I think it's working for me, though, I'm not familiar with elm.
I'll open a pr after you confirm it's working.

@roxma is not working for me :(
did you added an extra config along with the plugin?
When I press, for example, String., I don't receive a completion of the functions

Something to note when forwarding completions from deoplete as above, you should disable the following:
let g:deoplete#ignore_sources._ = {}
let g:deoplete#ignore_sources._ = [
      \   'buffer',
      \   'member',
      \   'tag',
      \   'file',
      \   'around',
       \ ]

This is because NCM already implements those completions (at relatively the same speed too).

authors: JelteF charliesbox davidosomething roxma

repo: roxma/nvim-completion-manager


text:
.bash_aliases

Should the name of the bash file not be ".bash_aliases" instead of ".bashrc"? It's not a big deal, I'm just curious that there may be something I don't know about going on :)

Definitely the smarter way to do things. I'll go ahead and just leave the non-interactive check in the .bashrc, and move all of the other aliases into a .bash_aliases file. Thanks, Ray 👍

authors: RayWillett roytenberg

repo: roytenberg/brilliant-bash


text:
added gpom and restart to .bashrc

Few things to make lives easier

Why would bash need to reload zsh?

Merging, but I'm changing it to reload .bashrc.

Bigups
On Jan 23, 2017 8:19 PM, "Ben Roytenberg" notifications@github.com wrote:

Merged #4 https://github.com/roytenberg/brilliant-bash/pull/4.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/roytenberg/brilliant-bash/pull/4#event-933926663, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AM_6MUhv8abAFn4tPTWNajjM3Pzl-Yf4ks5rVXvKgaJpZM4LqlMr
.

authors: Phrohdoh massiv64 roytenberg


text:
Feature Request: Read information from embeds

Chat stream does a bang-up job of reading information from notes added to a canvas. However, sometimes canvases are put together with references to just one section of a note, by creating a card and referencing the section like this:
![[My Cool Note#Chapter 1]]

Within the canvas, this has the effect of rendering that part of the note in the card. However, it seems Chat Stream doesn't have any current way of resolving those details, so they're quietly left out of the context handed to the LLM. It would be neat if these links within cards were supported.

Fixed in 1.4.3. Thanks for the request!

authors: rpggio wwboynton

repo: rpggio/obsidian-chat-stream


text:
stdout maxBuffer exceeded

Getting Error while generating Flow Coverage Report: Error: stdout maxBuffer exceeded Error: stdout maxBuffer exceeded for some reason.
node: v6.2.0
command: node_modules/.bin/flow-coverage-report -i 'src/**/*.js' -t html -t json -t text

Hitting this issue as well. Here's a test case to reproduce:
# clone https://github.com/mapbox/mapbox-gl-js, then run:
flow-coverage-report -i 'js/**/*.js'

Looks like the dev/0-2-0 branch will fix this issue for mapbox-gl-js.
I just checkout out that branch and ran the script from within the working folder and it worked great. The commands I ran were:
git clone https://github.com/rpl/flow-coverage-report.git
cd ./flow-coverage-report
git checkout origin/dev/0-2-0
npm install
cd ..
git clone https://github.com/mapbox/mapbox-gl-js
cd mapbox-gl-js
../flow-coverage-report/bin/flow-coverage-report.js -i 'js/**/*.js'

@ryan953 wonderful, looking forward to the release!

@alexeygolev  @mourner This issue should be fixed in the released v.0.2.0
In the v.0.2.0 there is also a new -x command line option to specify glob patterns to be excluded, which is helpful to explicitly exclude files that are not supposed to be collected (e.g. bundled and minified files) e.g.:
flow-coverage-report -i 'src/**/*.js' -x 'src/test/fixtures/**' -x 'src/**/*.min.js'

authors: alexeygolev mourner rpl ryan953

repo: rpl/flow-coverage-report


text:
Automated unit test case added for Logger.py successfully.

Issue that this pull request solves
102
Closes: # (issue number)
Proposed changes
test_logger.py file added in tests folder
Brief description of what is fixed or changed
A Log file is created using Logger class in Logger.py and the log is tested in two ways.

The logfile is checked if its created and exists on right path.
Class LoggingTestCase, which inherits from unittest.TestCase. For every test run, logs are automatically captured to self.captured_logs. If the test fails, the contents of self.captured_logs are written to the test output for easy debugging. Using assertLogs to test that at least one message is logged on the logger or one of its children, with at least the given level. Then using asserEqual to compare the file content.

Types of changes
A python file added in tests folder
Put an x in the boxes that apply

[ ] Bugfix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Documentation update (Documentation content changed)
[ ] Other (please describe):

Checklist
Put an x in the boxes that apply

[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings

Screenshots
Please attach the screenshots of the changes made in case of change in user interface

Other information
Any other information that is important to this pull request

 Here is an overview of what got changed by this pull request:

Issues
======
- Added 3

Complexity increasing per file
==============================
- tests/test_logger.py  2

See the complete overview on Codacy

 Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- tests/test_logger.py  2

See the complete overview on Codacy

@rpotter12 @xandao6 @priyansh19 Please review.


text:
add rule (vue-caution): Implicit parent-child communication

https://vuejs.org/style-guide/rules-use-with-caution.html#implicit-parent-child-communication

For this rule would be enough to check for props mutation (prop inside v-model) and check no $parent, getCurrentInstance are present in the file? 🤔

Yes, it will cover most of the problematic parts.

Hi @rrd108 I created a PR for this issue #67


text:
Update current state of Riverpod saved data

Since some days ago which i have this problem i can't get reply on Discord and Stackoverflow.com and i can't found any body to help me to resolve this problem
Like with this sample code which that's into Riverpod sample codes for updating the current state of stored data:
state = [
  for (final todo in state)
    if (todo.id == id)
      Todo(
        id: todo.id,
        completed: todo.completed,
        description: description,
      )
    else
      todo,
];

i try to implementing that on my class data, but it saved data as new without updating selected state, my class data:
class OrderStructure {
  final String title;
  final List<SelectedProducts> products;

  const OrderStructure(this.title, this.products);
}

class SelectedProducts {
  final int id;
  final List<SelectedProductServices> services;

  SelectedProducts(this.id, this.services);
}

class SelectedProductServices {
  final int id;
  final int count;
  final int cost;

  const SelectedProductServices(this.id, this.count, this.cost);
}

here i try to found product's services and updating count of that as decrement count-1, but after search my code cause add new service into product and couldn't update
here i want to decrement count on service when product.id == productId and service.id == serviceId
void decrement(int productId, int serviceId) {
  final newState = OrderStructure(state.title, [
    ...state.products,
    for (final product in state.products)
      if (product.id == productId)

        /* product.services is nested List class data*/
        for (final service in product.services)
          if (service.id == serviceId)

            /* i have problem on this lines*/
            SelectedProducts(productId, [
              ...product.services.where((s) => s.id == serviceId),
              SelectedProductServices(service.id, service.count - 1, service.cost)
            ])

            /* SelectedProducts(productId, [
              ...product.services,
              SelectedProductServices(service.id, service.count - 1, service.cost)
            ]) */

          else
            SelectedProducts(productId,product.services)
  ]);

  state = newState;

Where is state coming from?

its a StateNotifierProvider
this link is Github sample code implementation:
https://github.com/pishguy/riverpod_sample

@smiLLe i published source code on github

authors: pishguy smiLLe


text:
Providers shouldn't be paused if listened using ref.listen when a Flutter app is paused.

Related to https://github.com/rrousselGit/riverpod/issues/2645
Currently, Providers are paused when the app is in the background. This is usually the desired behavior. But when using ref.listen(provider), we likely should keep invoking listeners even when the app is in the background.

That's a bit funny. Everything stops working in the background.
I'm debugging this issue and the debugger froze when I put the Riverpod app in the background.

Well that's kind of what Flutter does overall.
Honestly I'm not fully decided on this issue. Widgets don't quite rebuild anymore when the app is hidden too

Well that's kind of what Flutter does overall.
Honestly I'm not fully decided on this issue. Widgets don't quite rebuild anymore when the app is hidden too

Honestly, it's interesting the Riverpod works in the background as well.
A common example is a clock/stopwatch app that should work in the background.

Depends. A clock/stopwatch app would still stop in the background.
For other cases, a Timer.periodic would keep triggering in the background regardless of Riverpod

That makes sense. I totally agree.

There are cases where developers could need such a functionality. Sometimes, you need to do a lot more than just update the UI. For example, we are now working more closely with Bluetooth and Location. We still need to react to many events and state changes even when the app is in the background.

any update on this ?

authors: HE-LU LeonardoRosaa nateshmbhat rrousselGit

repo: rrousselGit/riverpod


text:
CFRunLoopRun(); crash

CFRunLoopRun();
in ios6.1.3 crash

can you please be more specific? this does not help at all. are you using the latest version of this library? can you provide the crash log? can you replicate it in the demo project?

I have the same problem. It appears randomly and really hard to reproduce.

Hi, we came to the same issue, when scroll the UITableView very fast. randomly the scrolling may be frozen and  here is how we invoke SDWebImage:
 - (void)configureImageWitURL:(NSURL *)imageURL

{
@weakify(self);
[self sd_setImageWithURL:imageURL placeholderImage:nil options:SDWebImageRetryFailed progress:^(NSInteger receivedSize, NSInteger expectedSize) {
@strongify(self);
[self.progressView setProgress:receivedSize / (float)expectedSize];
} completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
@strongify(self);
self.progressView.hidden = YES;
if (cacheType != SDImageCacheTypeMemory) {
self.alpha = 0;
[UIView animateWithDuration:0.3 animations:^{
self.alpha = 1;
}];
}
}];
}
And here is the screenshot of Xcode when the list got frozen and crashs:

Hope this may help figuring out where the problem is.

I think that there is a bug in SDWebImage: progress block gets called on background thread.
try to call the body of the progress block method using dispatch_async:
dispatch_async (dispatch_get_main_queue(), ^{
@strongify(self);
[self.progressView setProgress:receivedSize / (float)expectedSize];
});

@timkoma I tried dispatch_async, and it seems problem solved, (Though I'm not very certain of that, because this happened randomly, but I haven't came to that problem since change the code with dispatch_async). Thanks

https://assets-cdn.github.com/images/icons/emoji/unicode/1f44d.png

Let's close this issue, see if it happens again with 4.0.0 (4.0.0-beta is available for download, 4.0.0 official release is on its way).

authors: armnotstrong bpoplauschi lengqingfeng mythodeia timkoma vidcina

repo: rs/SDWebImage


text:
Creating  vector store for documents error

Traceback (most recent call last):
File "/Users/tim/anaconda3/envs/local/bin/talk-codebase", line 8, in
⠹ Creating vector store for 2770 documents    sys.exit(main())
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/cli.py", line 98, in main
raise e
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/cli.py", line 88, in main
fire.Fire({
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/cli.py", line 82, in chat
llm = factory_llm(root_dir, config)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/LLM.py", line 106, in factory_llm
return OpenAILLM(root_dir, config)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/LLM.py", line 24, in init
self.vector_store = self._create_store(root_dir)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/LLM.py", line 95, in _create_store
return self._create_vector_store(embeddings, MODEL_TYPES["OPENAI"], root_dir)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/LLM.py", line 74, in _create_vector_store
db = FAISS.from_documents(texts, embeddings)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/langchain/vectorstores/base.py", line 317, in from_documents
return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 502, in from_texts
return cls.__from(
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 454, in __from
vector = np.array(embeddings, dtype=np.float32)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5951,) + inhomogeneous part.

Try a different folder path
talk-codebase chat ./your path

repo: rsaryev/talk-codebase


text:
Look into Seal objectives that don't have any associated status

Could be something; could be nothing 🤷♂
04:21:59 [SealRecordMultipleObjectiveView] Objective with no status; objective=886446824, recordHash=848317620
04:21:59 [SealRecordMultipleObjectiveView] Objective with no status; objective=1830374698, recordHash=1002450834
04:21:59 [SealRecordMultipleObjectiveView] Objective with no status; objective=2812917794, recordHash=498183354
04:21:59 [SealRecordMultipleObjectiveView] Objective with no status; objective=3248604205, recordHash=2690631951

Investigated. Couldn't figure out a course of action.

repo: rslifka/vault-zero


text:
Double names should be used in expectation failures

    example do
      foo = double("Foo")
      bar = double("Bar")

      expect([foo]).to include(bar)
    end

Fails with:
     Failure/Error: expect([foo]).to include(bar)
       expected [#<RSpec::Mocks::Double:0x84433530 @name="Foo">] to include #<RSpec::Mocks::Double:0x844333c8 @name="Bar">
       Diff:
       @@ -1,2 +1,2 @@
       -[#<RSpec::Mocks::Double:0x844333c8 @name="Bar">]
       +[#<RSpec::Mocks::Double:0x84433530 @name="Foo">]

...which is pretty ugly.  This would be so much nicer:
     Failure/Error: expect([foo]).to include(bar)
       expected [(Double "Foo")] to include (Double "Bar")
       Diff:
       @@ -1,2 +1,2 @@
       -[(Double "Bar")]
       +[(Double "Foo")]

Care will have to be taken to maintain the independence of rspec-mocks and rspec-expectations. I suspect that this may need changes in rspec-support to support this. (Or perhaps some if defined?(RSpec::Mocks) checks).

@myronmarston I think we can achieve this if we modify inspect method on lib/rspec/mocks/test_double.rb as Double (#{@name}). Please check https://github.com/sivagollapalli/rspec-mocks/commit/42414afc092ed765570c457972f913a2ae460cf6. If it is fine I will send a PR .

I think that's a reasonable solution, although I noticed that the existing inspect and to_s definitions are obviously intentional, to the point of having a spec for it:
https://github.com/rspec/rspec-mocks/blob/v3.2.0/lib/rspec/mocks/test_double.rb#L41-L48
https://github.com/rspec/rspec-mocks/blob/v3.2.0/spec/rspec/mocks/double_spec.rb#L20-L23
That predates my involvement with RSpec, and I'm not sure the reason that was chosen for inspect rather than something like "Double (#{@name})" like you suggest.
@dchelimsky, do you know why RSpec::Mocks::Double#inspect was chosen to be that way in RSpec 1?

@myronmarston Shall I make a PR to rspec-mocks with above change?

Sorry for the delay, @sivagollapalli.  Changing Double#inspect may have undesirable side effects.  We're moving in the direction of centralizing object inspection for the purpose of failure output in rspec-support (see rspec/rspec-support#184), so maybe you can work with @gavingmiller to get support for doubles added to the new RSpec::Support::ObjectInspector?

@myronmarston I made a PR(https://github.com/rspec/rspec-support/pull/190) with the change as discussed above. Please check

I don't remember the motivation, and looking back that example was in place when we split the repos (a64df194cccf5acb9dbdc0b18154d7a1ceebfc37) in 2009, so git history won't help us (the referenced commit doesn't exist in the rspec repo). Sorry I can't help.

So did #190 close this?

No, rspec/rspec-mocks#920 needs to be finished first.

Closing in favor of rspec/rspec-mocks#932.

authors: JonRowe dchelimsky myronmarston sivagollapalli

repo: rspec/rspec-expectations


text:
Expecting kwargs does not work in Ruby 3.2.

Subject of the issue
Your environment

Ruby version: 3.2
rspec-mocks version: 3.12

Steps to reproduce
# set up double
repo_double = instance_double(MyRepo)
expect(repo_double).to receive(:filter).with(first_name: "Michael", last_name: "Knight").and_return([])

# call filter of double in implementation
filter = { first_name: "Michael", last_name: "Knight" }
repo.filter(**filter)

fails with
#<InstanceDouble(Repositories::MyRepo) (anonymous)> received :filter with unexpected arguments
         expected: ({:first_name=>"Michael", :last_name=>"Knight"}) (keyword arguments)
              got: ({:first_name=>"Michael", :last_name=>"Knight"}) (options hash)

Expected behavior
the spec should not fail. This code worked in Ruby 3.1.2
Actual behavior
the spec fails
Thanks

Whats the implementation of filter? As you can see from other issues we're aware of some differences in Ruby 3.2 so this is probably a duplicate.

In general, there should be no difference in 3.2?
a = {a: 1, b: 2}

def x(**opt)
  puts opt.inspect
end
def y(a:, b:)
  puts a + b
end
def x(opt)
  puts opt.inspect
end

x(**a) # => {:a=>1, :b=>2}
y(**a) # => 3
z(**a) # => {:a=>1, :b=>2}

It makes a difference because:

@pirj, in the case of def x(opt) RSpecs output above would be correct, it doesn't take keyword arguments, and in general using **kwargs to an argument as a hash is a duplicate of #1492 and there is something that changed there, but honestly people shouldn't be de-splating keyword arguments to hashes

@JonRowe here's the implementation of filter
def filtered(**filter)
  get("customers", filter)
end

private

def get(path, params = {})
  conn.get(path, params)
end

That's what we came up with to fix this issue https://github.com/platogo/rspec-mocks/commit/6cdc4867952c4c5f8f47fdfea112ca785a9e3cd3

This is interesting, @gregg-platogo !
Wondering if it would work like we do e.g. here:
        @original_implementation_callable ||= original_method ||
          Proc.new do |*args, &block|
            @object.__send__(:method_missing, @method_name, *args, &block)
          end.tap do |proc|
            proc.ruby2_keywords if proc.respond_to?(:ruby2_keywords)
          end

Would you be so kind to check if this would work for your cases?

Digging internet late at night, I think the issue is here no ?

We should capture args and kwargs, I might be wrong of course

yea. When I monkey patch to

My pre-ruby 3 working, now not working test is finally green again

I don't have time nor faith to write the spec, hence make a PR. But I think that's it

This is working for me as well, code for convenience:
module RSpec
  module Mocks
    class MessageExpectation
      def and_call_original
        block = lambda do |original, *args, **kwargs, &b|
          original.call(*args, **kwargs, &b)
        end
        block = block.ruby2_keywords if block.respond_to?(:ruby2_keywords)

        wrap_original(__method__, &block)
      end
    end
  end
end

It still results in a warning:
Skipping set of ruby2_keywords flag for proc (proc accepts keywords or proc does not accept argument splat)
But tests are green.

@jonfreeland I wonder if the issue is fixed in 3.12.6 by this PR: https://github.com/rspec/rspec-mocks/pull/1552
@gregg-platogo 3.12.6 now contains the fix that is very similar to yours: https://github.com/rspec/rspec-mocks/pull/1552. Could you please verify that it works for you?

Yes, we did update to 3.12.6 last week and it does work like a charm ❤ Thank you guys!

@JonRowe I wonder if this issue can be closed now, WDYT?

I noticed that this issue hasn't had any updates in a while and the issue has been resolved, can it be closed?

Seems fixed. Thanks everyone involved.

authors: DylanEtris JonRowe gregg-platogo igor-drozdov jonfreeland ngouy pirj wuarmin

repo: rspec/rspec-mocks


text:
instance_double attributes not using the same class it was given

I'm not sure if this is a duplicate of #744, but here is what I'm seeing in my controller tests.
let(:group){ instance_double("Group", id: 1) }
...
allow(Group).to receive(:find).with(1).and_return(group)

get :show, id: group.id

That should work fine, but here is what I get:
<Group(id: integer, type: string) (class)> received :find with unexpected arguments
         expected: (1)
              got: ("1")
        Please stub a default value first if message might be received with other args as well.

I also tried doing
let(:group){ instance_double("Group") }
...
allow(group).to receive(:id).and_return(1)
allow(Group).to receive(:find).with(1).and_return(group)

get :show, id: group.id

I get the same error as above.

I know this is closed, but to help anyone in future who might want to pass arguments to a stub/mock, you can use Openstruct.
Like so:
let(:group){ OpenStruct.new(id: 1) }
then to mock you can do:
allow(GroupModel).to receive(:find_by).with(id: group.id).and_return(some_group_record)


text:
Conditionally use shared_context_metadata_behavior

See https://github.com/rspec/rspec-core/pull/2834

Going to merge it as soon as the build is green:

https://github.com/rspec/rspec-core/pull/2834 that depends on this is approved
it's an internal spec-only change

Going to merge it as soon as the build is green:

https://github.com/rspec/rspec-core/pull/2834 that depends on this is approved
it's an internal spec-only change

repo: rspec/rspec-rails


text:
Caching bool tasks

I work a lot with Task<bool>, whose two possible valid results could be cached. I added a simple logic:
match continuation() with
| Return r ->
    if typedefof<'a> = typedefof<bool> then
      let rb : bool = unbox(box(r))
      if rb then
        methodBuilder.SetResult(unbox(box(TaskUtil.TrueTask)))
      else
        methodBuilder.SetResult(unbox(box(TaskUtil.FalseTask)))
    else
      methodBuilder.SetResult(Task.FromResult(r))
    null

If that was written in C#, then JIT would treat typedefof<'a> = typedefof<bool> as JIT-time constant and completely eliminate branch. Should we use typedefof or typeof for this? Also C#'s version (T)(object)(value) doesn't cause object allocation for value types since JIT is smart enough to recognize such pattern.
Will those JIT optimizations work for the code above? So that the line let rb : bool = unbox(box(r)) doesn't allocate. Or if it does, how to avoid allocations in F# for such a cast? (I will test later myself, just wanted to discuss/review).
Also (not related, but small for a separate issue) I noticed that on the line let methodBuilder = AsyncTaskMethodBuilder<'a Task>() the type AsyncTaskMethodBuilder is mutable struct but here it is stored in an immutable variable. Is this intentional or the thing works now by chance and doesn't use methods that mutate the struct? There are comments in the source about mutability.

I have to agree with your commentary on the fslang-suggestions topic that Task-building is best implemented in the compiler (i.e. not by me), just like in C#, so optimizations like this can be done without runtime penalty.
If you check the IL, F#'s typedefof is pretty inefficient. C#'s typeof(X<>) compiles straight to a ldtoken, while F#'s typedefof<X<_>> is the same as writing typeof<X<obj>>.GetGenericTypeDefinition(). At least, that's how it was last time I checked.
The methodbuilder should probably be declared mutable as you point out, but I don't think it being "immutable" in the compiler's option actually prevents mutation in this case. Where I'd be concerned is the let-bound method that references it getting a copy instead of closing over the field, but I think that ends up as an instance method of the class so it gets to play with the real field.

If you check the IL, F#'s typedefof is pretty inefficient.

I believe we can fix that!

authors: ForNeVeR buybackoff rspeele


text:
additional data from json

Is there any way to send additional data to bootgrid?

http://www.jquery-bootgrid.com/Documentation#methods
I'd set up a responseHandler, and call any methods you might need. You get access to the JSON data, so you can pass whatever you need from the server and then act upon it client side upon load time.

authors: derrekbertrand iscorporacion

repo: rstaib/jquery-bootgrid


text:
Base branches and compare, help me please!

Hi everybody! I have translated a Rstudio cheatsheet and I know that I need to create a pull request for it to be reviewed and uploaded to the Rstudio community, however, I am new to Github and I don't understand what branches are.
So that my translated cheatsheet is reviewed without issues, what should I put in base branches and compare?
It would be appreciated if you could help me.

@AnthonyRomeroC The process I like to follow (and that I find most intuitive) for pull requests is using functions from the usethis package. This vignette outlines the steps: https://usethis.r-lib.org/articles/pr-functions.html. Happy to help troubleshoot along the way if you have any questions about the process.

Hello, thank you very much for the suggestion. I managed to create a pull request but it does not appear in the pull request list . it does not appear within the 4 pending pull resquests. Sorry for the insistence, I am new to git hub and I have never done this before.

@AnthonyRomeroC Yes, I'm afraid it does not appear there. I'd be happy to help but I'll need a bit more info about the steps you've taken so far.

@AnthonyRomeroC Yes, I'm afraid it does not appear there. I'd be happy to help but I'll need a bit more info about the steps you've taken so far.

Thank yo very much for your help! I did this:

I clicked on "new pull request".
I put AnthonyRomeroC:master and rstudio:main in base and compare.
It took many combinations in both spaces to get this pull request to
appear in my account, however, it does not appear in
Rstudio pull requests.
It also appears in someone else's account, so I think I did it wrong.
I filled in the information as instructed and attached the translated
cheatsheet in pdf format.

I hope this information will help to correct the errors. Again, thank you very much for your help.
pd: Attached are three screenshots
image1.pdf
image2.pdf
image3.pdf

This seems like you're making a pull request from the RStudio cheatsheets repo to your repo, as opposed to the other way around.
Instead of using the "new pull request" button on GitHub, I would recommend following the steps outlined at https://usethis.r-lib.org/articles/pr-functions.html, starting at https://usethis.r-lib.org/articles/pr-functions.html#attach-usethis. This workflow will allow you to make a pull request from your repo to the cheatsheets repo.

Closing this issue since #243 is now in place.

repo: rstudio/cheatsheets


text:
UI: How to create boolean attributes using named arguments?

To create a boolean HTML attribute, the dictionary method of attributes works. But I could not figure out how to create a boolean attribute using a named argument.

You can provide an empty string (e.g. div(foo=""))

True, that does create a valie HTML boolean attribute. I was hoping to have a way to create it in the form of <div foo> where the attribute name is completely dropped - I know functionally they're equivalent, so if there's no way to do this, you can close.

authors: cpsievert daattali

repo: rstudio/py-shiny


text:
Make title optional for navbar_page like it is in the actual function

Fixes #233

Closed because #236 does this.

repo: rstudio/shinyuieditor


text:
spark_connect on OS X El Capitan returns "Failed to open connection to monitor"

I am running on OS X El Capitan using RStudio1.0.31.preview
I am following the introductory process described here https://github.com/rstudio/sparklyr
After running spark_install(version = "1.6.2"), Spark_home is "/Users/michaele4321/Library/Caches/spark/spark-1.6.2-bin-hadoop2.6"
I am getting this error message:
sc <- spark_connect(master = "local")
Error in value[[3L]](cond) : Failed to open connection to monitor
In socketConnection(port = shell_file$monitorPort) :
localhost:52688 cannot be opened

The error message is coming from the start_shell function
tryCatch({
         monitor <- socketConnection(port = shell_file$monitorPort)
     },
     error = function(err) {
            stop("Failed to open connection to monitor")
     })

I originally thought it might be a firewall problem but I've disabled the firewall completely without any effect. Also if I use:
sc <- spark_connect(master = "local", config = list())
instead of the default config value, the connection is made  - but operations like copy_to are very slow and other operations are not available.
I've tried building the config manually to try and isolate the problem.
This config works:
defaultPackages <- NULL
config <- list("config.sparklyr.cores.local" = 4,"config.spark.sql.shuffle.partitions.local"=4,"sparklyr.defaultPackages"=defaultPackages)
sc <- spark_connect(master = "local", config = config)

But this config triggers the problem:
defaultPackages <- c("com.databricks:spark-csv_2.11:1.3.0","com.amazonaws:aws-java-sdk-pom:1.10.34")
config <- list("config.sparklyr.cores.local" = 4,"config.spark.sql.shuffle.partitions.local"=4,"sparklyr.defaultPackages"=defaultPackages)
sc <- spark_connect(master = "local", config = config)

I'm out of ideas for further debugging. spark_log(sc) won't work because I can't even get the connection established.
Any suggestions for further debugging would be appreciated.
Update:
I've tried devtools::install_github("rstudio/sparklyr") but nothing changed
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] dplyr_0.5.0  sparklyr_0.4

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.7     digest_0.6.10   withr_1.0.2     rprojroot_1.0-2 assertthat_0.1  rappdirs_0.3.1
 [7] R6_2.1.3        DBI_0.5         magrittr_1.5    devtools_1.12.0 config_0.2      tools_3.2.2
[13] yaml_2.1.13     parallel_3.2.2  memoise_1.0.0   tibble_1.2

Do you by any chance have an antivirus running, or other similar software that might affect internet connectivity (local or otherwise)?

It doesn't seem to be a connection problem. It seems to be a problem starting spark.
If I'm understanding spark_connect() correctly, it should be building and executing the following command.
'/Users/michaele4321/Library/Caches/spark/spark-1.6.2-bin-hadoop2.6/bin/spark-submit' --class sparklyr.Backend --packages 'com.databricks:spark-csv_2.11:1.3.0','com.amazonaws:aws-java-sdk-pom:1.10.34' '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sparklyr/java/sparklyr-1.6-2.10.jar' /var/folders/xd/tqymkv6d14xf315r731mm71c0000gn/T//Rtmpc1qy76/file15d6f20afa1.out

When I run that from the command line, I don't get a running spark instance. This is the output I get:
Ivy Default Cache set to: /Users/michaele4321/.ivy2/cache
The jars for the packages stored in: /Users/michaele4321/.ivy2/jars
:: loading settings :: url = jar:file:/Users/michaele4321/Library/Caches/spark/spark-1.6.2-bin-hadoop2.6/lib/spark-assembly-1.6.2-hadoop2.6.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
com.databricks#spark-csv_2.11 added as a dependency
com.amazonaws#aws-java-sdk-pom added as a dependency
:: resolving dependencies :: org.apache.spark#spark-submit-parent;1.0
	confs: [default]
	found com.databricks#spark-csv_2.11;1.3.0 in central
	found org.apache.commons#commons-csv;1.1 in central
	found com.univocity#univocity-parsers;1.5.1 in central
	found com.amazonaws#aws-java-sdk-pom;1.10.34 in central
:: resolution report :: resolve 299ms :: artifacts dl 8ms
	:: modules in use:
	com.amazonaws#aws-java-sdk-pom;1.10.34 from central in [default]
	com.databricks#spark-csv_2.11;1.3.0 from central in [default]
	com.univocity#univocity-parsers;1.5.1 from central in [default]
	org.apache.commons#commons-csv;1.1 from central in [default]
	---------------------------------------------------------------------
	|                  |            modules            ||   artifacts   |
	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
	---------------------------------------------------------------------
	|      default     |   4   |   0   |   0   |   0   ||   3   |   0   |
	---------------------------------------------------------------------
:: retrieving :: org.apache.spark#spark-submit-parent
	confs: [default]
	0 artifacts copied, 3 already retrieved (0kB/7ms)
Localhost:bin michaele4321$

There are no running spark instances after this command runs.
lsof -i -n -P -sTCP:LISTEN|grep java
returns nothing.
I can start a spark shell from the command line though.
If I run
/Users/michaele4321/Library/Caches/spark/spark-1.6.2-bin-hadoop2.6/bin/spark-shell I get a running spark instance.
$ lsof -i -n -P -sTCP:LISTEN|grep java
java      8369 michaele4321   25u  IPv6 0x956f783590d0b667      0t0  TCP *:59304 (LISTEN)
java      8369 michaele4321   58u  IPv6 0x956f7835932d5647      0t0  TCP 10.97.23.112:59309 (LISTEN)
java      8369 michaele4321   77u  IPv6 0x956f783590d0d6a7      0t0  TCP 10.97.23.112:59310 (LISTEN)
java      8369 michaele4321   78u  IPv6 0x956f7835932d7be7      0t0  TCP *:4040 (LISTEN)
java      8369 michaele4321  106u  IPv6 0x956f7835932d6107      0t0  TCP *:59311 (LISTEN)

but sparklyr won't use that running instance.
Can anyone suggest what might be happening?

@michaele4321 since this only fails when the default packages are specified, this makes me think that something in Spark is blocking the download of these files. I'm saying, Spark, since sparklyr does not perform any operation with the default packages config appart from passing them to Spark as a --packages parameter.
One thought, you could try to scope down if it's a problem with all packages, or specific ones. FOr instance, would this work?
defaultPackages <- c("com.databricks:spark-csv_2.11:1.3.0")

In sparklyr version 0.4.9 we removed the AWS package since it's not a required package and we added additional logging support while connecting that might help us diagnose this with ease. Could you install 0.4.9, connect and share the error log with us?

The new logging in 0.4.9 is much more useful. It is showing
 Failed while connecting to sparklyr to port (8880) for sessionid (4434): Gateway in port (8880) did not respond after (60) seconds.

I think I was wrong about spark not starting earlier. As I've been testing this I have discovered that spark instances that are started using sparkly seem to shut themselves down after a minute or so - so I only had 60 seconds to test if spark was running.
There seems to be some problem with connecting to port 8880 in my environment.
After running spark_connect(), Spark has started and is listening on 8880
Localhost:~ michaele4321$ lsof -i -n -P -sTCP:LISTEN|grep java
java      18942 michaele4321    5u  IPv4 0x956f783581bd2bd7      0t0  TCP 127.0.0.1:44168 (LISTEN)
java      18942 michaele4321   19u  IPv4 0x956f78358163dfb7      0t0  TCP 127.0.0.1:31718 (LISTEN)
java      18942 michaele4321   42u  IPv6 0x956f7835932d7be7      0t0  TCP 10.96.22.122:8880 (LISTEN)

10.96.22.122 is the ip address assigned to my computer.
I'm guessing that sparkly is trying to connect to port 8880 on either localhost or 127.0.0.1 because I can telnet to 10.96.22.122 8880 without a problem but I can't telnet to 127.0.0.1 8880 or localhost 8880 (I get connection refused). I'm not sure if the IPv6 is possibly causing a problem.
I'm going to assume there is something wrong with my local network configuration - not sparkly - and work on figuring out why I can't make a connection on localhost 8880.
Thank you for your pointers.
BTW - here are the logs for the case where I load both packages and for the case where I leave out the AWS package.
With both packages:
> defaultPackages <- c("com.databricks:spark-csv_2.11:1.3.0","com.amazonaws:aws-java-sdk-pom:1.10.34")
> config <- list("config.sparklyr.cores.local" = 4,"config.spark.sql.shuffle.partitions.local"=4,"sparklyr.defaultPackages"=defaultPackages)
> sc <- spark_connect(master = "local", config = config)
Error in force(code) :
  Failed while connecting to sparklyr to port (8880) for sessionid (4434): Gateway in port (8880) did not respond after (60) seconds.
    Path: /Users/michaele4321/Library/Caches/spark/spark-1.6.2-bin-hadoop2.6/bin/spark-submit
    Parameters: --class, sparklyr.Backend, --packages, 'com.databricks:spark-csv_2.11:1.3.0','com.amazonaws:aws-java-sdk-pom:1.10.34', '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sparklyr/java/sparklyr-1.6-2.10.jar', 8880, 4434
    Traceback:
      tryCatch({
    timeout <- spark_config_value(config, "sparklyr.gateway.start.timeout", 60)
    gatewayInfo <- spark_connect_gateway(gatewayAddress, gatewayPort, sessionId, waitSeconds = timeout, config = config, canConnect = TRUE)
}, error = function(e) {
    abort_shell(paste("Failed while connecting to sparklyr to port (", gatewayPort, ") for sessionid (", sessionId, "): ", e$message, sep = ""), spark_submit_path, shell_args, output_file, error_file)
})
      tryCatchList(expr, classes, parentenv, handlers)
      tryCatchOne(expr, names, parentenv, handlers[[1]])
      value[[3]](cond)
      abort_shell(paste("Failed while connecting to sparklyr to port (", gatewayPort, ") for sessionid (", sessionId, "): ", e$message, sep = ""), spark_submit_path, shell_args, output_file, error_file)

---- Output Log ----
Ivy Default Cache set to: /Users/michaele4321/.ivy2/cache
The jars for the packages stored in: /Users/michaele4321/.ivy2/jars
:: loading settings :: url = jar:file:/Users/michaele4321/Library/Caches/spark/spark-1.6.2-bin-hadoop2.6/lib/spark-assembly-1.6.2-hadoop2.6.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
com.databricks#spark-csv_2.11 added as a dependency
com.amazonaws#aws-java-sdk-pom added as a dependency
:: resolving dependencies :: org.apache.spark#spark-submit-parent;1.0
	confs: [default]
	found com.databricks#spark-csv_2.11;1.3.0 in central
	found org.apache.commons#commons-csv;1.1 in central
	found com.univocity#univocity-parsers;1.5.1 in central
	found com.amazonaws#aws-java-sdk-pom;1.10.34 in central
:: resolution report :: resolve 279ms :: artifacts dl 6ms
	:: modules in use:
	com.amazonaws#aws-java-sdk-pom;1.10.34 from central in [default]
	com.databricks#spark-csv_2.11;1.3.0 from central in [default]
	com.univocity#univocity-parsers;1.5.1 from central in [default]
	org.apache.commons#commons-csv;1.1 from central in [default]
	---------------------------------------------------------------------
	|                  |            modules            ||   artifacts   |
	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
	---------------------------------------------------------------------
	|      default     |   4   |   0   |   0   |   0   ||   3   |   0   |
	---------------------------------------------------------------------
:: retrieving :: org.apache.spark#spark-submit-parent
	confs: [default]
	0 artifacts copied, 3 already retrieved (0kB/9ms)
16/10/05 09:50:55 INFO sparklyr session (4434) starting

---- Error Log ----

Spark has started and is listening on 8880
Localhost:~ michaele4321$ lsof -i -n -P -sTCP:LISTEN|grep java
java      18942 michaele4321    5u  IPv4 0x956f783581bd2bd7      0t0  TCP 127.0.0.1:44168 (LISTEN)
java      18942 michaele4321   19u  IPv4 0x956f78358163dfb7      0t0  TCP 127.0.0.1:31718 (LISTEN)
java      18942 michaele4321   42u  IPv6 0x956f7835932d7be7      0t0  TCP 10.96.22.122:8880 (LISTEN)

Without the AWS package
> defaultPackages = c("com.databricks:spark-csv_2.11:1.3.0")
> config <- list("config.sparklyr.cores.local" = 4,"config.spark.sql.shuffle.partitions.local"=4,"sparklyr.defaultPackages"=defaultPackages)
> sc <- spark_connect(master = "local", config = config)
Error in force(code) :
  Failed while connecting to sparklyr to port (8880) for sessionid (5197): Gateway in port (8880) did not respond after (60) seconds.
    Path: /Users/michaele4321/Library/Caches/spark/spark-1.6.2-bin-hadoop2.6/bin/spark-submit
    Parameters: --class, sparklyr.Backend, --packages, 'com.databricks:spark-csv_2.11:1.3.0', '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/sparklyr/java/sparklyr-1.6-2.10.jar', 8880, 5197
    Traceback:
      tryCatch({
    timeout <- spark_config_value(config, "sparklyr.gateway.start.timeout", 60)
    gatewayInfo <- spark_connect_gateway(gatewayAddress, gatewayPort, sessionId, waitSeconds = timeout, config = config, canConnect = TRUE)
}, error = function(e) {
    abort_shell(paste("Failed while connecting to sparklyr to port (", gatewayPort, ") for sessionid (", sessionId, "): ", e$message, sep = ""), spark_submit_path, shell_args, output_file, error_file)
})
      tryCatchList(expr, classes, parentenv, handlers)
      tryCatchOne(expr, names, parentenv, handlers[[1]])
      value[[3]](cond)
      abort_shell(paste("Failed while connecting to sparklyr to port (", gatewayPort, ") for sessionid (", sessionId, "): ", e$message, sep = ""), spark_submit_path, shell_args, output_file, error_file)

---- Output Log ----
Ivy Default Cache set to: /Users/michaele4321/.ivy2/cache
The jars for the packages stored in: /Users/michaele4321/.ivy2/jars
:: loading settings :: url = jar:file:/Users/michaele4321/Library/Caches/spark/spark-1.6.2-bin-hadoop2.6/lib/spark-assembly-1.6.2-hadoop2.6.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
com.databricks#spark-csv_2.11 added as a dependency
:: resolving dependencies :: org.apache.spark#spark-submit-parent;1.0
	confs: [default]
	found com.databricks#spark-csv_2.11;1.3.0 in central
	found org.apache.commons#commons-csv;1.1 in central
	found com.univocity#univocity-parsers;1.5.1 in central
:: resolution report :: resolve 247ms :: artifacts dl 7ms
	:: modules in use:
	com.databricks#spark-csv_2.11;1.3.0 from central in [default]
	com.univocity#univocity-parsers;1.5.1 from central in [default]
	org.apache.commons#commons-csv;1.1 from central in [default]
	---------------------------------------------------------------------
	|                  |            modules            ||   artifacts   |
	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
	---------------------------------------------------------------------
	|      default     |   3   |   0   |   0   |   0   ||   3   |   0   |
	---------------------------------------------------------------------
:: retrieving :: org.apache.spark#spark-submit-parent
	confs: [default]
	0 artifacts copied, 3 already retrieved (0kB/7ms)
16/10/05 09:57:40 INFO sparklyr session (5197) starting

---- Error Log ----

Spark has started and is listening on 8880
Localhost:~ michaele4321$ lsof -i -n -P -sTCP:LISTEN|grep java
java      19224 michaele4321    5u  IPv4 0x956f783581bd2bd7      0t0  TCP 127.0.0.1:44168 (LISTEN)
java      19224 michaele4321   19u  IPv4 0x956f78358163dfb7      0t0  TCP 127.0.0.1:31718 (LISTEN)
java      19224 michaele4321   41u  IPv6 0x956f7835932d6107      0t0  TCP 10.96.22.122:8880 (LISTEN)

One problem might be these lines:
In shell_connection
 if (spark_master_is_local(master))
    environment$SPARK_LOCAL_IP = "127.0.0.1"

In start_shell(), these lines
  gatewayAddress <- spark_config_value(config, "sparklyr.gateway.address",
    "localhost")

When you have ipv6 127.0.0.1 is not necessarily the same as localhost. Localhost could resolve to ::1 instead.

@michaele4321 good point. With the https://github.com/rstudio/sparklyr/commit/b48d42420d4c9ebde8249bd9e6311db91bf04740 commit, we moved this configuration into the config.yml file. Could you update to sparklyr version 0.4.10 and remove the spark.env.SPARK_LOCAL_IP.local entry or configure it appropiately and report back your findings?

Success! But not with modifying the config.yml file.
first, I copied  inst/conf/config-template.yml to inst/conf/config.yml (I'm assuming this is the correct thing to do?)
I tried modifying the spark.env.SPARK_LOCAL_IP.local value in inst/conf/config.yml without success.
I then realised that this setting only seems to effect the first two ports from Spark  - not the gateway port.
I finally got everything working correctly by adding this line before spark_connect()
Sys.setenv("_JAVA_OPTIONS" = "-Djava.net.preferIPv4Stack=true")
sc <- spark_connect(master = "local")

This changed the network setup from:
lsof -i -n -P -sTCP:LISTEN|grep java
java      35852 michaele4321    5u  IPv4 0x956f783583f7abd7      0t0  TCP 127.0.0.1:10841 (LISTEN)
java      35852 michaele4321   20u  IPv4 0x956f78359672a9e7      0t0  TCP 127.0.0.1:29521 (LISTEN)
java      35852 michaele4321   39u  IPv6 0x956f7835932d6107      0t0  TCP 10.96.22.122:8880 (LISTEN)

To:
lsof -i -n -P -sTCP:LISTEN|grep java
java      34912 michaele4321    5u  IPv4 0x956f7835815c32df      0t0  TCP 127.0.0.1:16080 (LISTEN)
java      34912 michaele4321   19u  IPv4 0x956f783583f674cf      0t0  TCP 127.0.0.1:23471 (LISTEN)
java      34912 michaele4321   44u  IPv4 0x956f783589924bd7      0t0  TCP 127.0.0.1:8880 (LISTEN)

its obviously a workaround (forcing a fallback to IPv4) rather than a proper fix (supporting IPv6 networking) but its perfectly acceptable for my purposes.
Thanks for developing this great package  - and providing the ongoing support.

We removed the use of environment$SPARK_LOCAL_IP entirely, so far, so good; but do let us know through a new issue if this still persists in some form.

authors: javierluraschi kevinushey michaele4321

repo: rstudio/sparklyr


text:
Failed while connecting to sparklyr to port (8880) for sessionid (8227): Gateway in port (8880) did not respond.

Whenever I connect to spark on my mac, I get the following error. I reinstalled java several times and it is not helping me.
Error in force(code) :
Failed while connecting to sparklyr to port (8880) for sessionid (8227): Gateway in port (8880) did not respond.
Path: /Users/chittampalliyashaswini/Library/Caches/spark/spark-1.6.2-bin-hadoop2.6/bin/spark-submit
Parameters: --class, sparklyr.Backend, --jars, '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/sparklyr/java/spark-csv_2.11-1.3.0.jar','/Library/Frameworks/R.framework/Versions/3.3/Resources/library/sparklyr/java/commons-csv-1.1.jar','/Library/Frameworks/R.framework/Versions/3.3/Resources/library/sparklyr/java/univocity-parsers-1.5.1.jar', '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/sparklyr/java/sparklyr-1.6-2.10.jar', 8880, 8227
---- Output Log ----
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/spark/launcher/Main
Caused by: java.lang.ClassNotFoundException: org.apache.spark.launcher.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

Now after I fixed that and when I run the ml_als_factorization() command I get this:
Error: org.apache.spark.SparkException: Job aborted due to stage failure: Task 1 in stage 24.0 failed 1 times, most recent failure: Lost task 1.0 in stage 24.0 (TID 33, localhost): java.lang.NullPointerException: Value at index 1 in null
at org.apache.spark.sql.Row$class.getAnyValAs(Row.scala:475)
at org.apache.spark.sql.Row$class.getInt(Row.scala:218)
at org.apache.spark.sql.catalyst.expressions.GenericRow.getInt(rows.scala:192)
at org.apache.spark.ml.recommendation.ALS$$anonfun$5.apply(ALS.scala:369)
at org.apache.spark.ml.recommendation.ALS$$anonfun$5.apply(ALS.scala:368)
at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:350)
at org.apache.spark.shuffle.sort.BypassMergeSortShuffleWriter.write(BypassMergeSortShuffleWriter.java:126)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:73)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
at org.apache.spark.scheduler.Task.run(Task.scala:89)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:227)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Driver stacktrace:
at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$failJobAndIndependentStages(DAGScheduler.scala:1431)
at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1419)
at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1418)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:1418)
at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:799)
at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:799)
at scala.Option.foreach(Option.scala:236)
at org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:799)
at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.doOnReceive(DAGScheduler.scala:1640)
at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1599)
at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1588)
at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:48)
at org.apache.spark.scheduler.DAGScheduler.runJob(DAGScheduler.scala:620)
at org.apache.spark.SparkContext.runJob(SparkContext.scala:1832)
at org.apache.spark.SparkContext.runJob(SparkContext.scala:1845)
at org.apache.spark.SparkContext.runJob(SparkContext.scala:1858)
at org.apache.spark.SparkContext.runJob(SparkContext.scala:1929)
at org.apache.spark.rdd.RDD.count(RDD.scala:1157)
at org.apache.spark.ml.recommendation.ALS$.train(ALS.scala:596)
at org.apache.spark.ml.recommendation.ALS.fit(ALS.scala:371)
at org.apache.spark.ml.recommendation.ALS.fit(ALS.scala:304)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sparklyr.Invoke$.invoke(invoke.scala:96)
at sparklyr.StreamHandler$.handleMethodCall(stream.scala:89)
at sparklyr.StreamHandler$.read(stream.scala:55)
at sparklyr.BackendHandler.channelRead0(handler.scala:49)
at sparklyr.BackendHandler.channelRead0(handler.scala:14)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:244)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException: Value at index 1 in null
at org.apache.spark.sql.Row$class.getAnyValAs(Row.scala:475)
at org.apache.spark.sql.Row$class.getInt(Row.scala:218)
at org.apache.spark.sql.catalyst.expressions.GenericRow.getInt(rows.scala:192)
at org.apache.spark.ml.recommendation.ALS$$anonfun$5.apply(ALS.scala:369)
at org.apache.spark.ml.recommendation.ALS$$anonfun$5.apply(ALS.scala:368)
at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:350)
at org.apache.spark.shuffle.sort.BypassMergeSortShuffleWriter.write(BypassMergeSortShuffleWriter.java:126)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:73)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
at org.apache.spark.scheduler.Task.run(Task.scala:89)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:227)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
... 1 more

@cyadusha do you get the same error while running the sparklyr version installed form CRAN? Would help to share sessionInfo().

I actually got it working on a pc system. but thanks anyway.

@cyadusha do you remember how you solved the NoClassDefFoundError, I've seen it once but went away after a machine restart, for me. Thanks!

authors: cyadusha javierluraschi


text:
Add mkdocs documentation

Resolves: #9
TODO:

[x] Init mkdocs documentation
[x] Add base documentation contents
[x] Add usage documentation contents
[ ] Add deployment documentation contents
[x] Add workflow for building and deploying doc to GH pages

Codecov Report

Merging #33 (d8ca7ea) into master (fe2ca54) will not change coverage.
The diff coverage is n/a.

:exclamation: Current head d8ca7ea differs from pull request most recent head 8cd7606. Consider uploading reports for the commit 8cd7606 to get more accurate results

@@           Coverage Diff           @@
##           master      #33   +/-   ##
=======================================
  Coverage   99.18%   99.18%
=======================================
  Files          15       15
  Lines         369      369
=======================================
  Hits          366      366
  Misses          3        3

Continue to review full report at Codecov.

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

authors: codecov-commenter rszamszur

repo: rszamszur/fastapi-mvc


text:
AttributeError: 'TimeSeriesKMeans' object has no attribute 'gamma_sdtw'`

First of all, thank you so much for sharing this wonderful package!
You're making my master's thesis much more enjoyable :)
I'm getting a weird error and haven't been able to figure it out. Here's a minimal working example (I can call TimeSeriesKMeans(metric='softdtw').fit(X) without Pipeline() without problems).
I'm on p36, Windows 7 x64. Thanks in advance!
import numpy as np
from sklearn.pipeline import Pipeline
from tslearn.clustering import TimeSeriesKMeans
from tslearn.utils import to_time_series_dataset

X = to_time_series_dataset(np.array([1,2]))
pipeline = Pipeline([
        ('kmeans', TimeSeriesKMeans())
        ])
parameters = {
        'kmeans__metric' : 'softdtw'
        }
pipeline.set_params(**parameters)
pipeline.fit(X)

Traceback (most recent call last):

  File "<ipython-input-8-c4ba89694fd5>", line 10, in <module>
    pipeline.fit(X)

  File "C:\...\sklearn\pipeline.py", line 250, in fit
    self._final_estimator.fit(Xt, y, **fit_params)

  File "C:\...\tslearn\clustering.py", line 531, in fit
    self._fit_one_init(X_, x_squared_norms, rs)

  File "C:\...\tslearn\clustering.py", line 460, in _fit_one_init
    self._assign(X)

  File "C:\...\tslearn\clustering.py", line 480, in _assign
    dists = cdist_soft_dtw(X, self.cluster_centers_, gamma=self.gamma_sdtw)

AttributeError: 'TimeSeriesKMeans' object has no attribute 'gamma_sdtw'

The problem always occurs when changing the parameter "metric" to "softdtw" after creating an instance of TimeSeriesKMeans() with a different metric.
I'm not sure how this is handled in sklearn in general, so this probably is not a bug, but maybe it's safer to allow it. An easy fix would be deleting line 450 from classifiers.py:
if self.metric == "softdtw":
to always set (regardless of the metric paramter)
self.gamma_sdtw = metric_params.get("gamma_sdtw", 1.)

Hi,
Thanks for the bug report and for the fix! :)
It's implemented now (on github and in version 0.1.10.7).

Thanks for committing the fix, glad I could help!

authors: jscheithe rtavenar

repo: rtavenar/tslearn


text:
[Doc] Comparison chart

WIP

Done on a separate branch, waiting for the appropriate time to merge.


text:
Sustainability banners often don't show

Details

Project URL:  <various>.readthedocs.io

Expected Result
Banner adverts appear for non-gold user.
Actual Result
Banner adverts show with broken image.

This happens in a new incognito window so appears not to be extension related. However I am behind a corporate proxy.
This what appears in the Network pane in Developer Tools:

The first request is plain HTTP, redirecting to HTTPS.

Is there any further information here? Brand of corporate firewall or something might help track this down.

Guessing this is an ad blocker issue or similar.

authors: agjohnson ericholscher lordmauve


text:
Update docs on python version

Adds info for new build images.

No, think we can punt on that for the time being. For now it's just the form to build up a small beta access list.

Opened rtfd/readthedocs-build#24 to discuss there.


text:
Memoria llena

Es posible que necesite comprimir los datos de los mapas, puesto que con 6 pantallas con tiles y 6 en negro la memoria queda llena.

Se pueden aproximadamente 40 pantallas y seguramente con próximas actualizaciones se podrán más, cuando las funcionalidades básicas estén terminadas daremos varias vueltas de optimización.

De: rtorralba @.>
Enviado: domingo, 26 de noviembre de 2023 11:50
Para: rtorralba/zx-game-maker-skeleton @.>
Cc: Fransouls @.>; Author @.>
Asunto: Re: [rtorralba/zx-game-maker-skeleton] Memoria llena (Issue #3)
Se pueden aproximadamente 40 pantallas y seguramente con próximas actualizaciones se podrán más, cuando las funcionalidades básicas estén terminadas daremos varias vueltas de optimización.
—
Reply to this email directly, view it on GitHubhttps://github.com/rtorralba/zx-game-maker-skeleton/issues/3#issuecomment-1826749944, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZQMJ54LQEHK7KHZCMNDNALYGMNGDAVCNFSM6AAAAAA7O242EWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWG42DSOJUGQ.
You are receiving this because you authored the thread.Message ID: @.***>

authors: Fransouls rtorralba

repo: rtorralba/zx-game-maker-skeleton


text:
Retrieving class properties underlying type

Is there any way to get the value of a property without knowing its underlying type? The method variant::get_value() is a function template that requires the class member type, which kind of defeat the purpose of the registration?
struct Foo {
    int bar;
};

RTTR_REGISTRATION {
    rttr::registration::class_<Foo>("Foo")
        .property("bar", &Foo::bar);
}

void serialize(Stream& stream, int& value) {
    // serialize int value...
}

void serialize(Stream& stream, Foo& foo) {
    auto type = rttr::type::get<Foo>();
    for (auto& prop : type.get_properties()) {
        auto name = prop.get_name();
        auto var = prop.get_value(foo);
        stream.serialize(name, var.get_value</* here how to get Foo::bar original type? */>());
    }
}

Perhaps there is a way to store metadata along each property to store its underlying type? I'm looking for whatever solution that works, could be metadata, plugin, anything!
Thanks

You can do following:
void serialize(Stream& stream, Foo& foo) {
    auto type = rttr::type::get<Foo>();
    for (auto& prop : type.get_properties()) {
        auto name = prop.get_name();
        auto var = prop.get_value(foo);
        if (var.get_type() == type::get<int>())
        stream.serialize(name, var.to_int());
      else if (var.get_type() == type::get<double>())
        stream.serialize(name, var.to_double());
     else if (....)
    }
}

Does this help?

No unfortunately, the type is unknown at the time I need to get the member value. And anyway how would that work for my own types? I would have expected variant to be a template class, so that get_value() doesn't require we pass a type.

@gouletr
When variant it would be a class template, RTTR would not work how it works.
Because with RTTR you can work with types, which are unknown at compile time. You don't even need the header file. variant::get_value<T> is a function template. there you can provide your needed type.
However, you can always register functions so that the variant can convert to these types. E.g. providing a function which converts your custom type to a std::string.
Then you could simply write: stream.serialize(name, var.to_string());
See:
type::register_converter_func

Yes I get that right now RTTR works with types that are unknown at compile time. But my point is that it would be nice if it also supported types that are known at compile time, so that we can iterate through members with types preserved. Right now the type erasure is a major drawback imho.

@gouletr
Actually, its not a major draw back. It's a missing feature. Because having the possibility to work with unknown types is one of RTTR's major feature.
However, I have a PR https://github.com/rttrorg/rttr/pull/154 ready to merge (after some more added unit tests), which basically allows you to do what you want. Iterate over all members of an object at compile time. Right, that is what you want?

Yes, this is what I need. Can you share a snippet of what the code will look like? Your PR is quite massive.

There is an scripting example and a unit test for it. Take a look here:
Test:
https://github.com/rttrorg/rttr/pull/154/files#diff-94c545f2663bcabce4f5ce5fc027fd65
Scripting:
https://github.com/rttrorg/rttr/pull/154/files#diff-6d632bcaf15bd4e69c4fe2c9c82130ff

Done. It's now merged and ready to used. See the examples and the unit test for more information.

authors: acki-m gouletr

repo: rttrorg/rttr


text:
GravitySnapHelper.SnapListener not callback when scroll to first position.

The issue when I set GravitySnapRecyclerView equal center and also set SnapListener for GravitySnapHelper. So the listener never callback "onSnap" when the recyclerview scrolled to top position and rest positions that working fine.

The top position won't be called in onSnap if it can't be snapped. This usually happens when you don't have padding or decoration for the top or bottom items.

@rubensousa rube
I looked into your example, in the row Center with decoration, it's same issue i mentioned above. In fact my project I have added decoration to make item center horizontal. So do you have any advices for me? Thanks

@leeprohacker I can confirm there's a problem. Sometimes the position 0 isn't dispatched on onSnap. I'll fix this in the next release

@leeprohacker it should be fixed in the develop branch now. Can you check if now it behaves like you would expect?

You can check this in your app by installing the version 2.2.1-beta01

Released on 2.2.1

@rubensousa
Hi!
I have a problem. I can not scroll to the top position when the call method smoothScrollToPosition(0)
in source code:
`ryclerviewTopic.apply {
layoutManager = LinearLayoutManager(context)
            enableSnapping(false)
            adapter = topicAdapter
        }`

ryclerviewTopic.smoothScrollToPosition(0)
 <com.github.rubensousa.gravitysnaphelper.GravitySnapRecyclerView                         android:id="@+id/ryclerviewTopic"                         android:layout_width="match_parent"                         android:layout_height="match_parent"                         app:layout_constraintEnd_toEndOf="parent"                         app:layout_constraintStart_toStartOf="parent"                         app:layout_constraintTop_toTopOf="parent"                         app:layout_behavior="@string/appbar_scrolling_view_behavior"                         app:snapEnabled="false"                         app:snapGravity="top"                         app:snapMaxFlingSizeFraction="2"                         app:snapScrollMsPerInch="50"                         android:paddingTop="@dimen/_30dp"                         tools:listitem="@layout/item_home_topic" />

authors: Hoalq-0026 leeprohacker rubensousa

repo: rubensousa/GravitySnapHelper


text:
Please add option to ignore safe navigation in Metrics/CyclomaticComplexity

Is your feature request related to a problem? Please describe.
With rubocop 0.86, CyclomaticComplexity now considers the safe navigation operator. Unfortunately, this makes some mapper code particularly prone to hitting the limit:
def to_hash_for_api obj
  {
    username: user&.name,
    email: user&.email,
    active_until: user&.active_until,
    role_name: user&.role&.name,
    role_group: user&.role&.group,
    permission_a: user&.role&.permission_a,
    permission_b: user&.role&.permission_b,
  }
end

This method has a cyclomatic complexity of 11, where previously it was 0.
Describe the solution you'd like
An option that when set, restores the pre-0.86 behavior of not considering the safe navigation.
Describe alternatives you've considered
Disabling the cop altogether is not optimal, because it sets limits for how var can methods grow.

I'm sorry the multiple adjustments to this metric is causing you issues.
Could you update your example to reflect better your usecase? In particular, your example has 5 times the same key definitely not what you intended, which makes it difficult to know if you actually intended the 5 repetitions of the same obj&.prop&....

Could please you update your example to reflect better your usecase? In particular, your example has 5 times the same key definitely not what you intended

Sorry, done.

Thanks, so much better  :smile:
I feel that if you used a local variable role = user&.role this would become be quite legible and you'd have your complexity down to 8.
One interesting point is the successive &. in a single expression, which are needed since I can't convince Matz yet and you can't write user&.role.name... Just curious, in your particular example, are there user for which user.role can be nil?
I'll quote @jonas054 :

broadly speaking, cyclomatic complexity is a metric that tells you how difficult is this to test.

The fact that you have these user&. mean that a test is needed for the case where user is nil. The sad thing here is that it is repeated 7 times, but clearly you don't need 7 tests for this. So maybe an option to count +1 for each unique receiver&. would make sense. In your example, this would give a complexity of +1 for user&. and +1 for role&..
I don't know what others think about this...

I feel that if you used a local variable role = user&.role this would become be quite legible and you'd have your complexity down to 8.

True. But going from 11 to 8 is still going to make the cop fail :wink:

Just curious, in your particular example, are there user for which user.role can be nil?

Yes, in our app that's how we distinguish people who have not been given any special permission (instead of an "empty" role).

The sad thing here is that it is repeated 7 times, but clearly you don't need 7 tests for this. So maybe an option to count +1 for each unique receiver&. would make sense. In your example, this would give a complexity of +1 for user&. and +1 for role&..

That would be nice, indeed.

ping @jonas054 / @bbatsov:
Should I discount repeated uses of &. or not (with a setting?)
This would impact AbcSize #8037 & PerceivedComplexity #8204  too, which are waiting for final word from @bbatsov

Should I discount repeated uses of &. or not (with a setting?)

Yes. Based on your detailed explanation, @marcandre, that makes a lot of sense.

Yes. Based on your detailed explanation, @marcandre, that makes a lot of sense.

Great.
Now I wonder: setting on or off by default?
Only discount for same variable&.method_call (like user&.methods above) which can't be factorized), or also for method_call&.other_method_call (which can, like user&.role&.permission above)? 😆

I think that without a setting it is ok to count some_var&.foo ; some_var&.bar as a single condition (given that some_var is a variable and that it isn't reassigned in between). I'll start with that.

I think that without a setting it is ok to count some_var&.foo ; some_var&.bar as a single condition (given that some_var is a variable and that it isn't reassigned in between). One could imagine Ruby doing that optimization internally. I'll start with that.

Implemented 🎉
I'm very satisfied with this solution. It requires no config, provides a justifiable discount for repeated my_var&.something and also provides a way for users to reduce their complexity by avoiding repeated method calls.
In the example above, it discounts 6 of the 7 uses of user&. and if further reduction is needed, role = user&.role could be used so that all role&. count as one condition. I feel this represents well the actual complexity of the method.
@fsateler : thank you for opening this issue and providing your real-life example! This will improve the CyclomaticComplexity metric, as well as PreceivedComplexity and AbcSize.

authors: fsateler jonas054 marcandre

repo: rubocop-hq/rubocop


text:
Add IncludedMacros to default rubocop config for Style/MethodCallWithArgsParentheses

My bad, this should have been done in https://github.com/rubocop-hq/rubocop/pull/6337
I didn't realize parameters to cops were validated in this file, and it doesn't look like the spec codepath hits the relevant logic. I ran into this when trying to remove the forked version of the cop locally in favor of upstream with the fix.

Before submitting the PR make sure the following are checked:

[x] Wrote good commit messages.
[x] Commit message starts with [Fix #issue-number] (if the related issue exists).
[x] Feature branch is up-to-date with master (if not - rebase it).
[x] Squashed related commits together.
[ ] Added tests.
[x] Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
[x] The PR relates to only one subject with a clear title
and description in grammatically correct, complete sentences.
[x] Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

You'll have to regen the manual as well.

Fixed and ready to merge -- no test for this though, since I don't think specs test this config?

authors: bbatsov maxh


text:
[Fix #7537] Fix a false positive for Layout/SpaceAroundOperators

Fixes #7537.
This PR fixes a false positive for Layout/SpaceAroundOperators when using a Rational literal with / (e.g. 2/3r).

Before submitting the PR make sure the following are checked:

[x] Wrote good commit messages.
[x] Commit message starts with [Fix #issue-number] (if the related issue exists).
[x] Feature branch is up-to-date with master (if not - rebase it).
[x] Squashed related commits together.
[x] Added tests.
[x] Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
[x] The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
[x] Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

Thanks!

authors: bbatsov koic


text:
Fix  edge case in omit_parentheses style of Style/MethodCallWithArgsParentheses

Before this change:
foo(a) || bar(b) do
             ^^^ Omit parentheses for method calls with arguments.
  pass
end

This resulted in a SyntaxError if corrected. The check for a call
with a logical operator did not take into account that the parent of a
send node with a block is the block node itself.
After this change, the code below is lawful:
foo(a) || bar(b) do
  pass
end

This looks good to me. Can you rebase with the latest master branch?

Of course, I just rebased it.

Thank you!

authors: gsamokovarov koic


text:
Fix an incorrect autocorrect for Style/SoleNestedConditional

This PR fixes an incorrect autocorrect for Style/SoleNestedConditional with Style/MethodCallWithArgsParentheses.
if items.include? item
  if condition
    do_something
  end
end

Before
$ bundle exec rubocop -a --only Style/MethodCallWithArgsParentheses,Style/SoleNestedConditional
Inspecting 1 file
F

Offenses:

example.rb:1:4: C: [Corrected] Style/MethodCallWithArgsParentheses: Use parentheses for method calls with arguments.
if items.include? item
   ^^^^^^^^^^^^^^^^^^^
example.rb:1:24: F: Lint/Syntax: unexpected token tRPAREN
(Using Ruby 3.3 parser; configure using TargetRubyVersion parameter, under AllCops)
if items.include?(item)) && condition
                       ^
example.rb:2:3: C: [Corrected] Style/SoleNestedConditional: Consider merging nested conditions into outer if conditions.
  if condition
  ^^
example.rb:3:3: F: Lint/Syntax: unexpected token kEND
(Using Ruby 3.3 parser; configure using TargetRubyVersion parameter, under AllCops)
  end
  ^^^

1 file inspected, 4 offenses detected, 2 offenses corrected

Syntax error with redundant closing parentheses.
if items.include?(item)) && condition
    do_something
  end

After
Valid syntax.
if items.include?(item) && condition
    do_something
  end

Before submitting the PR make sure the following are checked:

[x] The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
[x] Wrote good commit messages.
[ ] Commit message starts with [Fix #issue-number] (if the related issue exists).
[x] Feature branch is up-to-date with master (if not - rebase it).
[x] Squashed related commits together.
[x] Added tests.
[x] Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
[x] Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

Thanks!

repo: rubocop/rubocop


text:
Revert "Add default tags to issue templates"

Reverts #12644.
It's been a few days since the introduction, but there are false reports of the "bug" label being applied to items that are not confirmed as bugs or are not bugs. The default "bug" label is confusing for unconfirmed feedback. Despite considering user likelihood to change labels, submissions are often made with the default.
For feature request, sometimes labels other than "enhancement", like "feature" or others, are more appropriate.
Labeling can suit mechanical operations (e.g., bot), but may not fit uncertain feedback needing review, as seen in this repository.
To avoid misleading labels on unresolved issues, the default labels will be removed from the issue template for maintenance reasons.

Before submitting the PR make sure the following are checked:

[x] The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
[x] Wrote good commit messages.
[ ] Commit message starts with [Fix #issue-number] (if the related issue exists).
[x] Feature branch is up-to-date with master (if not - rebase it).
[x] Squashed related commits together.
[ ] Added tests.
[x] Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
[ ] Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

I was thinking that this might happen, but I'm also seeing that we have quite a few unlabeled issues which is another kind of problem. Anyways, I'm fine with reverting this.


text:
Unable to create users without tags - status 400

client.create_user('test', password: 'test')
Faraday::ClientError: the server responded with status 400
from /usr/local/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/response/raise_error.rb:13:in `on_complete'

Maybe the method should do some argument verifying and provide an empty list of tags if missing?

Wow that was super quick, thank you!


text:
FFI (V2) has incorrect args for raptor_free_world?

Hello, thanks for your gem!
I'm just wondering is possibly an issue with the interface definition for raptor_free_world:
https://github.com/ruby-rdf/rdf-raptor/blob/76411d511d9d81b49eb99657a12e61ebe18e0cfc/lib/rdf/raptor/ffi/v2.rb#L33
As it seems to me the underlying c function accepts a pointer, so I would think we would need [:pointer] instead of [] in the above line? But I could be mistaken. See:
https://librdf.org/raptor/api/tutorial-initialising-finishing.html
When using the gem, we've been encountering this warning:
`raptor_free_world': wrong number of arguments (1 for 0) (ArgumentError)

      V2.raptor_free_world(ptr)
                           ^^^

Which sent me looking at the FFI definition.
Thank you!

I think it would actually be [:raptor_world] in place of [] (I had suggested [:pointer]), but again, I could be mistaken on this.

repo: ruby-rdf/rdf-raptor

license: unlicense


text:
Add the type of allow_browser in actionpack

Rails 7.2 adds allow_browser to disallow browsers that don't satisfy the version specified in the :versions option.
https://edgeguides.rubyonrails.org/7_2_release_notes.html#add-browser-version-guard-by-default
This method is included in the generated ApplicationController if a developer runs rails new since Rails 7.2, so I think it's worth being added in gem_rbs_collection.
This patch also includes symbolic links to RBS files located in gems/actionpack/6.0.

Thank you!
/merge

/merge