text:
服务器端日志文件显示接受但是却不能连接墙外网

我参考**https://www.v2ray.com/chapter_05/00_config/10_multi_mode.html**（官网KCP+TCP+动态端口参考脚本）完成了配置并检查，客户端和服务器的UUID和alterId均匹配，客户端也设置了kcp。联网发现国内路由正常访问，国外路由不能访问，检查服务器端access.log显示该IP为accept。服务器端系统为ubuntu 16.04，客户端系统为ubuntu 16.10，均使用2.4版v2ray。多谢解答！

客户端配置
inbound": {
"port": 1080,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": false,
"ip": "127.0.0.1"
}
},
"outbound": {
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "hexieip",
"port": hexieport3,
"users": [
{
"id": "hexieid",
"alterId": 64,
"security": "aes-128-gcm"
}
]
}
]
},
"mux": {
"enabled": true
},
"streamSettings": {
"network": "kcp"
}
},
服务器端配置：
"inbound": {
"port": hexieport1,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "hexieid",
"level": 1,
"alterId": 64
}
]
},
"streamSettings": {
"network": "kcp"
}
},
"inboundDetour": [
{
"port": hexieport2,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "hexieid",
"level": 1,
"alterId": 64
}
]
}
},
{
"port": hexieport3,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "hexieid",
"level": 1,
"alterId": 64
}
],
"detour": {
"to": "detour-kcp"
}
},
"streamSettings": {
"network": "kcp"
}
},
{
"port": hexieport4,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "hexieid",
"level": 1,
"alterId": 64
}
],
"detour": {
"to": "detour-tcp"
}
}
},
{
"protocol": "vmess",
"port": "10000-10100",
"tag": "detour-kcp",
"settings": {},
"allocate": {
"strategy": "random",
"concurrency": 2,
"refresh": 5
},
"streamSettings": {
"network": "kcp"
}
},
{
"protocol": "vmess",
"port": "12000-12100",
"tag": "detour-tcp",
"settings": {},
"allocate": {
"strategy": "random",
"concurrency": 2,
"refresh": 5
}
}
],
其中文件编辑均在编辑器里完成，确保无误，并且检查status后也正常无误。
另外有的时候会出现连接不上但是服务器日志没有记录的情况，请问这样是属于什么情况？感谢～

最新版2.41有同样的问题。双端access.log均显示accepted，但浏览器就是提示连接断开。
实测关闭kcp即可，估计应该是kcp的问题。

确实近期mKCP非常不稳定，也是连接不上服务端日志无记录，我一开始还以为是被运营商QoS了，还换了几次混淆都没啥用

感谢回答，考虑使用bbr代替之。另外目前服务端的alterId和客户端不匹配仍可联网，然而把客户端的修改到和服务器相同反而不能联网。日志文件同样没有任何记录。目前虽可正常使用但担心以后添加协议会出现问题。请问这种情况如何解决？多谢！

当服务器端alterId >= 客户端alterId时可以正常连接，你不能连接的原因应该是其它的，比如时间不匹配。

source: gharchive/issue

authors: DarienRaymond LinusKou chewnglow zhangyz1997

license: MIT

license_type: permissive

license_source: github-api


text:
Update install-release.sh

add proxy support for downloading release ( for client under GFW )
stop v2ray daemon before update release
start v2ray daemon when finished

Current coverage is 88.91%

Merging #82 into master will not affect coverage as of 8d3b9c6

@@            master     #82   diff @@
======================================
  Files          114     114
  Stmts        11116   11116
  Branches       365     366     +1
  Methods          0       0
======================================
  Hit           9884    9884
  Partial        258     258
  Missed         974     974

Review entire Coverage Diff as of 8d3b9c6

Powered by Codecov. Updated on successful CI builds.

thx

"inboundDetour":[{...},{...}]
另外请尽快将配置文件更新至新标准。

source: gharchive/pull-request

authors: codecov-io netcookies v2ray wswaw


text:
There should be an e2e test for the annotate-ref app (not the CLI command)

Part of #65

"True" e2e test for CLI command can be done at a later time or not at all because who cares


text:
GWT Polymer.create not working

Hi
The example ("Using the Element API in Java") here https://github.com/vaadin/gwt-polymer-elements#consuming-web-components-in-gwt suggest using the generated Polymer.create method to create a web component object.
But there is no Polymer#create method (gwt-api-generator --package=PolymerElements/paper-elements --javaDir=src --resourcesDir=src).
The only thing that comes close might be Polymer#createElement. But an Object of type com.vaadin.polymer.paper.PaperButtonElement can not be added by the method RootPanel.get().getElement().appendChild(button), like shown in the example, because the generated PaperButtonElement is not a subclass of com.google.gwt.dom.client.Node.
So is there a proper working way to use the generated classes by the gwt-api-generator?
Thanks and best regards
ano

I see, still open 😉
For anyone who cares:

Polymer.createElement is the way to go.
And though you can just cast to parentElement.appendChilde((com.google.gwt.dom.client.Element)polymerElement), you should do DOM modifications the polymer way. That is: Polymer.dom(parentElement).appendChild(polymerElement)

Best regards

Updated README file

authors: manolo wenzel-k

repo: vaadin/gwt-polymer-elements

license_source: bigquery


text:
JSR380 validation error message interpolation does not work in production mode

Describe the bug
https://hilla.dev/docs/lit/guides/forms/binder-validation#validation-message-interpolation
suggests to use validator.constructor.name to construct the key for localization message lookup.
In production mode, class names are minified (or what causes this), 'NotBlank' changes to e.g. 'Yg' and the lookup fails.
I.e. the key is 'validationError.Yg' and the translation file contains 'validationError.NotBlank'.
JSR380 validation messages are always shown in English.
The documentation is misleading - it appears that there is a clean way to do this, but it does not work in production mode.
Expected-behavior
Hilla should provide a clean and working way to interpolate JSR380 messages. Documentation and sample code should be fixed.
Idea 1:
    Exempt the jakarta.validation.constraints.* from minification (or what causes this). How?
    It will work with the Hilla sample interpolation logic.

Workaround1:
    Define an explicit message for every validation annotation usage. This works, but requires
    a lot of unnecessary and duplicate code in annotations. E.g.
    @Size(max = 15, message = "jsr380Error.Size")
    Then move all the translations in LANG_CODE.json from validationError to jsr380Error subtree.
    Use the following interpolation logic:
    Binder.interpolateMessageCallback = (message, validator, binderNode) => {
        if(message.startsWith('customValidationError.') || message.startsWith('jsr380Error.')) {
            if (translateConfig.lookup(message, translateConfig)) {
                return get(message, validator as any);
            }
        }
        // Fall back to original message if no translations are found
        return message;
    };

Workaround2:
    Detect the validator name from its message in localization.ts. This is bad.
    It will work with the Hilla sample interpolation logic (to do: check DecimalMin, DecimalMax).
    let validatorName : String = validator.constructor.name;
    if(message === 'must not be blank') {
        validatorName = 'NotBlank';
    } else if(message === 'must be true') {
        validatorName = 'AssertTrue';
    } else if(/size must be between [0-9]+ and [0-9]+/.test(message)) {
        validatorName = 'Size';
    }
    key = `validationError.${validatorName}`;

Reproduction
Follow the https://hilla.dev/docs/lit/guides/forms/binder-validation#validation-message-interpolation and run the app in production mode.
System Info
Hilla 2.4.0 (it is very probable that it applies also to previous versions)

Unfortunately message as the key does not work for parametrized messages e.g. "size must be between 0 and 250" unless you want to "translate" all possible values.
I don't think it is possible to add name attribute to validators, those are standard jakarta annotations, unless you provide your own set of validators which simply is not "jsr380 validations support" then.
I like the "Idea 1" the most, but I don't know how to do it. I was hoping that javascript/build specialists at your company would. This might be the cleanest solution.
We went with "Workaround 1", because our app is very small. It breaks the idea of jsr380 validations support, because it requires changes in model pojos extra to jsr380
"Workaround 2" is similar to your concept, but it adds the needed complexity of regular expressions for parametrized messages. This might be quite usable if it was provided with the framework as a blackbox (claiming to have support for jsr380). Some attempt was made here https://github.com/Haprog/vaadin-fusion-message-interpolator-example/blob/main/frontend/localization.ts, still it is a very different approach from the recommended one (and code seems to be a bit complicated maybe) and it tooks us a long time to even find it.

I updated the demo app to use the new name property for localization key https://github.com/TatuLund/hilla-demo/blob/hilla2/frontend/index.ts#L22
For custom validator how to set name https://github.com/TatuLund/hilla-demo/blob/hilla2/frontend/util/validators.ts#L5

authors: TatuLund pm-finamis

repo: vaadin/hilla


text:
Rename @ViewContainer to @SpringViewDisplay

This change is

This pull request is only for code comparison. When it is approved, the source branch should be deleted for sake of better branch naming.

Reviewed 2 of 2 files at r1.
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.

src/main/java/org/vaadin/spring/tutorial/MyVaadinUI.java, line 16 at r1 (raw file):

    @Autowired
    private ViewPanel springViewDisplay;

(does this match the tutorial text, if appropriate?)

Comments from Reviewable

Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.

src/main/java/org/vaadin/spring/tutorial/MyVaadinUI.java, line 16 at r1 (raw file):
Previously, hesara (Henri Sara) wrote…
> (does this match the tutorial text, if appropriate?)

@SpringViewDisplay as a separate class (different form UI)  is not covered by the tutorial.

Comments from Reviewable

Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.

src/main/java/org/vaadin/spring/tutorial/MyVaadinUI.java, line 16 at r1 (raw file):
Previously, elmot (Ilia Motornyi) wrote…
> @SpringViewDisplay as a separate class (different form UI)  is not covered by the tutorial.

The class is renamed, and the line is equal to a tutorial code example

Comments from Reviewable

Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.

Comments from Reviewable

authors: elmot hesara

repo: vaadin/spring-tutorial


text:
Do not modify value

Fixes #130 #136

This change is

Reviewed 2 of 2 files at r1.
Review status: :shipit: complete! all files reviewed, all discussions resolved

Comments from Reviewable

authors: manolo tomivirkki

repo: vaadin/vaadin-dropdown-menu


text:
Suggested alternate version

Dear,
Is-it possible to have an alternate example, based on this one, but using Spring Boot and Osgi (as bundle) ?

I've managed to run this example on Karaf
I've managed to have a Spring Boot Application on Karaf

But not both at the same time...
In fact, when trying, no route are being registered and FixedVaadinServlet is never called.
Best regards.
Alexandre

spring-boot resources are not OSGi compatible so it is not possible to use boot with OSGi.

authors: caalador jhapy

repo: vaadin/vaadin-flow-karaf-example

license: Unlicense


text:
Text field doesn't hide the error message when it becomes valid

See the code below.
Binder<String> binder = new Binder<>();
        TextField field = new TextField();
        field.setValue("foo");
        binder.forField(field)
                .withValidator(text -> !text.equals("no"), "Error message")
                .bind(item -> item, (item, value) -> {
                });
        add(field);

Steps to reproduce:

Remove the current text field value and type "no" ( which is invalid value).
Check that text field became invalid and shows the error message.
Make the text field valid again.

Expected: no error message is shown (the field by the way became valid since there is no invalid attribute).
Reality: the error message is shown.
It happens because binder doesn't clear the error message when the HasValidation component component becomes valid.
This is consequence of https://github.com/vaadin/flow/issues/3439.
There has been a discussion about this and it has been agreed that this behavior is correct.
But apparently it's not.
As I understand the bug is in the vaadin-text-field component since the behavior has been guaranteed on the elements side.
So this ticket is just to be able to track this on Flow side. Should be fixed on the vaadin-text-field side.

Closing in favor of #200 as both issues are now in the same repository. The unstyled components still behave the same.

authors: denis-anisimov web-padawan

repo: vaadin/vaadin-text-field


text:
Can't override hp with Dice roller integrated

I'd expect the following to give me a stat block for a Nightmare with 40 hit points, but it always gives me the average for the hit dice.
```statblock
monster: Nightmare
hp: 40
```

I assume there is something I could do in the callback to fix this myself, but I haven't been able to play around with that yet, and it does seems like a bug?
TTRPG Statblocks v2.16.2
Dice Roller v8.6.4

I've also noticed that when not using an existing stat block and defining your own, the simple hp: 32 renders with a dice roll icon and brackets as if it were a roll.
When clicking the dice to perform a roll with a static value - there are errors in the console.
Changing to hp: 1d20 you get the same output, but a functioning roller.
It seems that the hp: field is defaulting to a roller?

Closing as this appears resolved by Kylo.

authors: danstreeter irrevenant sigrunixia


text:
🛑 PMANG is down

In 097be01, PMANG (https://www.pmang.jp) was down:

HTTP code: 0
Response time: 0 ms

Resolved: PMANG is back up in 96103b4 after 1 hour, 4 minutes.

repo: valofe/upptime


text:
feat(secure-send): Update styles to match new designs

Description
All just UI updates, no functional change.
Figma
Video
Screen_recording_20231128_150142.webm
Test plan
Manually go through the flow and verify against the designs that everything looks good.
Related issues
Part of https://linear.app/valora/issue/ACT-973/update-secure-send-flow-new-copy-upshift-to-before-sendenteramount

nit: the spacing between the input boxes for last 4 digits and the submit button looks bigger than in the designs

repo: valora-inc/wallet


text:
Fix libp2p connection tests

Proposed changes
This PR moves the integration tests from the test agent to a test connections
Types of changes
What types of changes does your code introduce to agents-aea?
Put an x in the boxes that apply

[ ] Bugfix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist
Put an x in the boxes that apply.

[ ] I have read the CONTRIBUTING doc
[ ] I am making a pull request against the develop branch (left side). Also you should start your branch off our develop.
[ ] Lint and unit tests pass locally with my changes and CI passes too
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] I have checked that code coverage does not decrease.
[ ] I have added necessary documentation (if appropriate)
[ ] Any dependent changes have been merged and published in downstream modules

Codecov Report

:exclamation: No coverage uploaded for pull request base (feat/port-p2p-libp2p-mailbox-tests@611638a). Click here to learn what that means.
Patch has no changes to coverable lines.

:exclamation: Current head 8919e8c differs from pull request most recent head cf099db. Consider uploading reports for the commit cf099db to get more accurate results

Additional details and impacted files
@@                          Coverage Diff                          @@
##             feat/port-p2p-libp2p-mailbox-tests     #324   +/-   ##
=====================================================================
  Coverage                                      ?   94.13%
=====================================================================
  Files                                         ?      217
  Lines                                         ?    18753
  Branches                                      ?        0
=====================================================================
  Hits                                          ?    17654
  Misses                                        ?     1099
  Partials                                      ?        0

Flag
Coverage Δ

unittests
94.13% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

authors: angrybayblade codecov-commenter

repo: valory-xyz/open-aea


text:
Animation Support

Now that we have some patterns we can follow for sharing functionality between components (Symbol('@@brookjs/internals')), that will be easily matched to diffhtml's middleware to register animation configuration, so I'm taking another run at implementing this with it.

Removing the Kefir.IO attempt, because the only allocation we can really removed is the Dispatcher, which only creates 2 extra arrays. We can't remove any of these arrays because these track the subscribers, and regardless of whether we know we're emitting events or not, we'll need to emit the end event, which is handled through the Dispatcher. Trying to monkey patch these won't produce any benefits.

Long-term, I think we can improve this whole process by doing something similar to what Glimmer does. Because we can know at compile time how a template will change in response to data, we should be able to compile a template directly into a patch-returning function and skip a whole series of steps here.

Blocked by https://github.com/tbranyen/diffhtml/pull/136

Only thing missing here is documentation.

I thiiiiink we're looking good!

repo: valtech-nyc/brookjs


text:
how to downgrade?

i side-loaded the latest version (8) and went for a ride today.
curiously enough my temperature sensor and my vertical ascent sensor stopped working at exactly the same time.
as i want to rule out a problem with ki2, i attempted to downgrade back to 7.1.  i tried the following 2 commands:
$ ./adb install -r -d ki2-7.1-release.apk
$ ./adb install -r ki2-7.1-release.apk

but in both situations i received:
Performing Streamed Install
adb: failed to install ki2-7.1-release.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE]

any ideas as to how to uninstall or successfully downgrade the software?
i would like to rule out ki2 as the cause of my sensor problem.
thanks in advance.

Hi, Android does not allow downgrades, you will need to uninstall Ki2 first and then install an older version.
What seems to be the problem with your other sensor?

my karoo is no longer seeing the temperature or any vertical information.  just very curious it started after i loaded ki2 version 8.

authors: proseLA valterc


text:
Missing crossorigin attribute

For scripts from another origin, captured JS errors have no helpful information - just an ambiguous 'Script error'. To deal with this, a crossorigin attribute is introduced.
For example:
<script src="https://unpkg.com/vue@2.5.13/dist/vue.min.js" crossorigin="anonymous"></script>

<!-- or just omit the value -->
<script src="https://unpkg.com/vue-router@3.0.1/dist/vue-router.min.js" crossorigin></script>

@myst729 not sure if we need this if you don’t use protocol in our urls. e.g
<script src="//unpkg.com/vue-router@3.0.1/dist/vue-router.min.js"></script>
Please let me know if this is not true and I’ll look into it. Thanks for reporting.

No, it's not about protocol. I have a sentry service to capture production exceptions.
Say, the app is hosted under a.com, and it loads scripts from unpkg.com cdn. So no matter http or https, the scripts are cross origin.
If the crossorigin attributes are provided, the errors thrown by scripts from unpkg will be captured with meaningful information such as error stack, line and column number, etc. Without crossorigin, the only information is the phrase Script error, doesn't help at all.
So this is what I want. Because scripts from CDN are not only those well-crafted libs like Vue, there are also libs by myself. I want to be aware if they don't work.

@myst729 Sorry for getting back to you late, just got back from my holiday. I had a look at this, but seems quite difficult to fix it without doing a PR to HtmlWebpackPlugin. I will look into this further, unless you can help with this?

Seems this is an upstream issue for HtmlWebpackPlugin, closing.

This looks like doable. https://github.com/waysact/webpack-subresource-integrity/blob/master/index.js#L265

The whole mechanism of Webpack is a bit complicated, but I think I finally make it.
This is the solution for v1.x (works with Webpack 3 and lower): https://github.com/myst729/webpack-cdn-plugin/commit/c329271d029f107ff71b0542f092b00a24e7938d For Webpack 4 just use Tappable API, I'll make a PR later.
However I haven't found an approach to distinguish crossorigin resources from those of the same origin, so all link and script tags will have that attribute (doesn't matter for resources from the same origin though):
<script type=text/javascript src=//unpkg.com/vue@2.5.16/dist/vue.runtime.min.js crossorigin=anonymous></script>
<script type=text/javascript src=//unpkg.com/element-ui@2.4.3/lib/index.min.js crossorigin=anonymous></script>
<script type=text/javascript src=/static/js/app.3fa5813ddded3e93a56d.js crossorigin=anonymous></script>

I leaf a TODO on line 70, any ideas?

Could you create a "legacy" branch from v1.x? So that I could send a PR, since some developers are still using Webpack 3.x.

Hi @myst729 thanks for the PR, regarding the legacy branch seems like a good idea. I'm not sure how much is involved with backporting all the features, since I'm not using v3 of webpack anymore I wouldn't be able to support it fully, are you able to help with maintaining it? I've pushed a legacy branch.

repo: van-nguyen/webpack-cdn-plugin


text:
Is possible set and image at the left and the table at the right of the same line

I have an image position on the left side and i need a table on the right side of an A4 landing, is possible braw the the table at the same line of that image?

Hi @NtsCiccio,
yep, that should be possible. You can specify the coordinates where the table should start to be drawn. E.g.:
package org.vandeseer;

import org.apache.pdfbox.io.IOUtils;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;
import org.vandeseer.easytable.TableDrawer;
import org.vandeseer.easytable.structure.Row;
import org.vandeseer.easytable.structure.Table;
import org.vandeseer.easytable.structure.cell.TextCell;

import java.io.IOException;

public class MinimumWorkingExample {

    public static void main(String[] args) throws IOException {

        try (PDDocument document = new PDDocument()) {
            final PDPage page = new PDPage(PDRectangle.A4);
            document.addPage(page);

            try (PDPageContentStream contentStream = new PDPageContentStream(document, page)) {
                final byte[] bytes = IOUtils.toByteArray(MinimumWorkingExample.class.getClassLoader().getResourceAsStream("glider.png"));
                final PDImageXObject img = PDImageXObject.createFromByteArray(document, bytes, "test1");
                contentStream.drawImage(img, 20, page.getMediaBox().getUpperRightY() - 70f, 50, 50);

                // Build the table
                Table myTable = Table.builder()
                        .addColumnsOfWidth(200, 200)
                        .padding(2)
                        .borderWidth(1)
                        .addRow(Row.builder()
                                .add(TextCell.builder().text("One One").build())
                                .add(TextCell.builder().text("One Two").build())
                                .build())
                        .addRow(Row.builder()
                                .padding(10)
                                .add(TextCell.builder().text("Two One").build())
                                .add(TextCell.builder().text("Two Two").build())
                                .build())
                        .build();

                // Set up the drawer
                TableDrawer tableDrawer = TableDrawer.builder()
                        .contentStream(contentStream)
                        .startX(120f)
                        .startY(page.getMediaBox().getUpperRightY() - 20f)
                        .table(myTable)
                        .build();

                // And go for it!
                tableDrawer.draw();
            }

            document.save("example.pdf");
        }
    }

}

That renders to:

Obviously enough you need to adapt it a bit but I leave this to the interested reader :wink:
HTH
Stefan

thank you very much this is what i need. i really thank you.

authors: NtsCiccio vandeseer

repo: vandeseer/easytable


text:
How to use PostgreSQL transaction in vapor

I want to save a lot of data at once ,but I don't how to use postgresql transaction,Who can give an example.

Closing in favor of vapor/vapor#1113.

authors: AgoniNemo vzsg

repo: vapor-community/postgresql-provider


text:
compiling error in Arch linux

Don't know what is happening, i've installed every packages as instructed but I got this error
make all
make[1]: Entering directory '/home/cancel/Hyprland'
make config
make[2]: Entering directory '/home/cancel/Hyprland'
make[2]: Nothing to be done for 'config'.
make[2]: Leaving directory '/home/cancel/Hyprland'
make release
make[2]: Entering directory '/home/cancel/Hyprland'
mkdir -p build && cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -H./ -B./build -G Ninja
Not searching for unused variables given on the command line.
-- Configuring Hyprland!
-- Configuring Hyprland in Release with CMake!
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cancel/Hyprland/build
cmake --build ./build --config Release --target all -j 10
ninja: no work to do.
make[2]: Leaving directory '/home/cancel/Hyprland'
cd ./hyprctl && make all && cd ..
make[2]: Entering directory '/home/cancel/Hyprland/hyprctl'
g++ -std=c++20 ./main.cpp -o ./hyprctl
make[2]: Leaving directory '/home/cancel/Hyprland/hyprctl'
make[1]: Leaving directory '/home/cancel/Hyprland'
cp ./example/hyprland.desktop /usr/share/wayland-sessions/
cp: cannot create regular file '/usr/share/wayland-sessions/': Not a directory
make: *** [Makefile:72: install] Error 1****

sudo mkdir -p /usr/share/wayland-sessions

sudo mkdir -p /usr/share/wayland-sessions

I'm an idiot., thanks it worked!

repo: vaxerski/Hyprland


text:
how to evaluate the Liberty using Notredame

The test accuracy is always change. Did you get the average precision of the test data ?
I mean, If we train 10 epoch, we can get a precision. If we train 20 epoches, we can get another result. How did you solve this problem ?

how many epoches did you use to evaluate a dataset ?

In your code, you only train 10 epoches. But if we do several experiments, each time we can get a test result. So did you try several times, and then average them ?

Training code with the evaluation part is now available as an ipython notebook.

repo: vbalnt/tfeat


text:
Add Pagination for Jobs List

Implements #37
This PR contains

Prev / Next buttons for navigating pages
Jump to page by number input, easier to inspect later on jobs when job list is large. (press enter to take effect - perhaps not so intuitive, but comparing to taking effect on every typing changes, this approach would save unnecessary request on redis. But any feedback are welcome)
User input validation & error prevention
Pagination boundary checks

Screenshot

This PR is based on the javascript version (0.6.0) to avoid wait on the latest TypeScript rewrite (see discussion), therefore this PR can only be merged to version 0.6.0 and not the latest alpha version. But once the project moves forward probably will need to refactor this ticket into TypeScript as well.
In case anyone wants to try use it in your project you can install by yarn install @shaungc/bull-board@0.6.0--debug-01.

awesome PR! can you please close it and re-open but pointing to latest-stable instead of master please? this way we can keep releasing stable versions before our alpha 👍
thanks again :D

Ah I see, no prob.

authors: rivernews vcapretz

repo: vcapretz/bull-board


text:
🛑 Criptodolar & Covid API is down

In 957574c, Criptodolar & Covid API (https://exchange.vcoud.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Criptodolar & Covid API is back up in c4b91f0.

repo: vcoud/upptime


text:
⚠ Spryr has degraded performance

In cf9b3fa, Spryr (https://spryr.com) experienced degraded performance:

HTTP code: 200
Response time: 7860 ms

Resolved: Spryr performance has improved in ff3d87c after 7 minutes.

repo: vcsphere/upptime


text:
⚠ Spryr has degraded performance

In 23d18dd, Spryr (https://spryr.com) experienced degraded performance:

HTTP code: 200
Response time: 4335 ms

Resolved: Spryr performance has improved in aaf696b after 7 minutes.


text:
⚠ Spryr has degraded performance

In c161ff4, Spryr (https://spryr.com) experienced degraded performance:

HTTP code: 200
Response time: 3427 ms

Resolved: Spryr performance has improved in 1b95b92 after 7 minutes.


text:
Fix some grammatical errors in README documentation

I corrected some of grammatical errors in your README.md file.

I already commit the latest one ; to bind to and to listen for, And all should be ready to merge since I have changed only one file.

Thanks to @nnarct and @eltfshr for fixing the grammatical issues in our Springpress documentation.

authors: nnarct riflowth

repo: vectier/springpress


text:
End-to-end encryption

I saw "End-to-end encryption using Olm (https://matrix.org/git/olm)" on https://play.google.com/store/apps/details?id=im.vector.alpha.
Any progress or ETA?

E2E is in alpha on vector-web - once we've got it working well there
we'll add it on iOS & Android :)
On 23/06/2016 20:47, Bruno Bigras wrote:

I saw "End-to-end encryption using Olm (https://matrix.org/git/olm)"
on https://play.google.com/store/apps/details?id=im.vector.alpha.
Any progress or ETA?
— You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/vector-im/vector-android/issues/246, or mute
the thread
https://github.com/notifications/unsubscribe/ABO_vVc_l8V9D5UH5NiJzQwdNo-ViNIcks5qOuK0gaJpZM4I9K-R.

Where does one go to follow the developments in this? Should I subscribe to this thread or is there somewhere else that I can go to see if an ETA is available?

matrix.org/jira/browse/SPEC-162 is the "master bug", although gets
updated fairly infrequently relative to the work going on on the core
e2e repo at https://matrix.org/git/olm.
ETA on Android will probably be 1-2 months away.  It's already landed on
vector-web/develop however.
On 03/07/2016 23:46, Paul Ganssle wrote:

Where does one go to follow the developments in this? Should I
subscribe to this thread or is there somewhere else that I can go to
see if an ETA is available?
— You are receiving this because you commented. Reply to this email
directly, view it on GitHub
https://github.com/vector-im/vector-android/issues/246#issuecomment-230171556,

or mute the thread

https://github.com/notifications/unsubscribe/ABO_vcK7lxhcBReykU_oKcmanawKBaKwks5qSBGIgaJpZM4I9K-R.

@alefteris Thanks for the information. I'm not particularly interested in the web version, but how does E2E encryption work with cross-device syncing if E2E is only implemented on the web portal? Wouldn't the encryption either be compromised by syncing plain text or the Android version would just get a bunch of gibberish synced to it?

No, we support cross-device syncing of encrypted history.

Any news regarding E2E ?

#627 lists the roadmap & progress regarding the E2E user interface.

Randomly came across this issue today.  It can probably be closed now?

Is it already stable on Riot Android?

I think it's still in beta, but the basic functionality is there.

just for protocol: encryption is very stable and I have been using it for months now in various rooms without mayor issues

authors: JonasDralle ara4n brunoqc florianjacob pganssle takiainen tuxayo uhoreg

repo: vector-im/riot-android


text:
it sometimes takes several presses of the send button to get the message out

Sometimes tapping on the send button doesn't do anything. Coffee says: 'It's not a mistap because I get the usual audible feedback on tapping. Just... nothing happens.'

I still reproduce this on build 1086 (699ec70). There doesn't seem to be any change in behaviour.

There is a waiting PR.
https://github.com/vector-im/riot-android/pull/990

authors: Matrixcoffee richvdh ylecollen


text:
SDK version

hi
please remind - is there ability to specify which WinSDK is current in the use?

by the way - do I understand this right, cmaketools currently doesn't support auto-detect VS2017/VCBuildTools2017 toolchains?

At the moment, it will just call vsvarsall.bat to discover all the environment variables required for the build toolchain. There is no support ATM for specifying what version of the Windows SDK to use. I'd be open to pull requests if you have an idea of how that could be done (I'm not entirely sure how it would fit into the current environment selection framework).
As for VS2017: No, I have not yet added the detection support for those toolchains yet. It is probably a trivial change, I just haven't gotten around to doing it yet. I'll definitely get it in for RTM, at the latest. Again, PRs are welcome.

do you know what this can mean :

I wouldn't know without seeing more output and logs.

I'm going to close - was something wrong with a few VC toolchains. re-intstall VC build tools and works fine

repo: vector-of-bool/vscode-cmake-tools


text:
0.11.0 Docs

This change addresses item #366
Still a WIP at the moment, but filling out the documentation. Want to make it nice.
I'm adding all as reviewers because I want to make sure I don't have dumb mistakes and be sure that the wording is clear, useful, and unambiguous.

I've pushed up the docs to https://vector-of-bool.github.io/docs/vscode-cmake-tools/index.html so that you may view them in their nice rendered output. Almost got them all done.

I've addressed the commentary above, and all the tests should be running now. I'm feeling ready to merge this, unless anyone has any last-minute objections.


text:
How to build locally?

Hi
I saw your promption here https://huggingface.co/TheBloke/Yi-34B-GPTQ/discussions/2#654b063883e7bfc43160ca0e
Maybe a stupid question, just wonder if this building is suffice for local deploy w/o docker (since my remote instance is already a docker instance, and I cannot create docker inside docker due to admin privilege not being granted), assumed all dep are resolved.
# build
RUN cmake -G Ninja -S . -B build
RUN cmake --build build --target all --config Release -j$(nproc)

# install
RUN cmake --install build --prefix /app
RUN pip3 install -r ./requirements.txt

Yeah it should be enough for binary. Let me know if you encounter any
problems.
On Wed, Nov 8, 2023 at 12:53 AM 俞航 @.***> wrote:

Hi
I saw your promption here
https://huggingface.co/TheBloke/Yi-34B-GPTQ/discussions/2#654b063883e7bfc43160ca0e
Maybe a stupid question, just wonder if this building is suffice for local
deploy w/o docker (since my remote instance is already a docker instance,
and I cannot create docker inside docker due to admin privilege not being
granted), assumed all dep are resolved.
build
RUN cmake -G Ninja -S . -B build
RUN cmake --build build --target all --config Release -j$(nproc)
install
RUN cmake --install build --prefix /app
RUN pip3 install -r ./requirements.txt
—
Reply to this email directly, view it on GitHub
https://github.com/vectorch-ai/ScaleLLM/issues/16, or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABV4CLW6BKEYJKDD25VER5LYDNCADAVCNFSM6AAAAAA7CP5HN2VHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4DGMBWGY4TOOI
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

Just a reminder, this project depends on huggingface safetensors. You need to install rust to get a success build.
install rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH=$HOME/.cargo/bin:$PATH

repo: vectorch-ai/ScaleLLM


text:
ci: really use python 3.9 on windows runners

Use python 3.9 on windows Jenkins runners.
Missed some python invocations in #82.

Seems to be all of them 👍

A final direct python in line 473 (outside of where I can add comments).
This one should be safe, our package.py doesn't have any external dependencies. I think it would even run with python2 :-).

A final direct python in line 473 (outside of where I can add comments).

This one should be safe, our package.py doesn't have any external dependencies. I think it would even run with python2 :-).

Wonderful 😸

authors: MariusBgm VDanielEdwards

repo: vectorgrp/sil-kit


text:
Синий экран смерти после нажатия кнопки "i"

После того, как я начал компилировать код (исходный) сначала возникла 1 проблема - не видит функции popen, ну пошел лазить по сайтам. Нашел типо _popen и popen одинаковы. Так она запустилась, но проблемы остались. Зашел в игру и начал изучать клавиши нажатием. После мелкого тыканья мне вылетел BSoD о видео драйвере. Он полетел, после того как я нажал кнопку "I". Тогда моя ОС просто подвисла ии... все - BSoD. Не знаю с чем это связано, но дальше играть я не намерен. У меня Windows

Thank you for your report – we will work to handle this questions.

authors: AnikeyPS vectozavr

repo: vectozavr/shooter


text:
Interests tag user-input while sign up

the app should show mini-blogs in the domain that interests user. thus, it is important that we collect that information.
Add an option in the sign up form to multi-select following predefined tags. It should be tap and select based system.
Domain(s): Software Engineering, Web Dev, Mobile App Dev, Product Designing, Machine Learning, Cyber Security
As of now, we will keep the domains limited for the initial version of the project.

@vedantbahel Can I take up this feature and work on it on the weekend?

Done!
Good luck and thank you!

@vedantbahel Thanks!

Please add one more feature. The user must select at least 3 domains to continue.

@vedantbahel I have implemented the feature with validation using the multi_select package. I have opened a PR on this please do check it out and let me know if any changes are required.

authors: ShivamMenda vedantbahel

repo: vedantbahel/viteED


text:
Market list

User Story
As a liquidity provider
I want to see a list of markets with their current liquidity status
So that I can decide if providing liquidity is right for me on vega - and see how great the returns could be
Acceptance Criteria

I can view a tabular list of market data
I can see the market name for each market
I can see the settlement asset for each market
I can see the volume (24h) for each market
I can see the Total liquidity committed for each market
I can see the status of each market

Sketch for reference: https://miro.com/app/board/uXjVOs_PBKk=/?moveToWidget=3458764531971937952&cot=14

Visual styles can be used from this early version of a design: https://www.figma.com/file/qgCd4r61Z1r3tUkxKehhmu/Website-Design-Updates?node-id=399%3A20530
Tasks

[x] Create new repository in github
[ ] Swat up on Vega api integration in docs
[ ] Create page skeleton
[x] Set up new app in frontend-monorepo
[x] Create simple page
[x] Find a way we can preview app (without having to merge to avoid dependencies)

Link to preview site (showing whatever is on the develop branch) https://liquidity-provision-dashboard.netlify.app/

@malinantonsson https://explorer.near.org/nodes/validators

@joellecharlotte please can you update the link to the figma file for Malin. Ta

New preview link: https://deploy-preview-1529--liquidity-provision-dashboard.netlify.app/

authors: malinantonsson pennyandrews

repo: vegaprotocol/frontend-monorepo


text:
feat(trading): margin mode selector

Related issues 🔗
Closes #5523
Description ℹ
Add margin mode selector hidden behind feature flag
Demo 📺

@bglownia I am unable to click and use the selector. When I click nothing happens. No errors in console etc.

authors: bglownia bwallacee


text:
Datasource named ${DS_PROMETHEUS} was not found

None of the panels show up, and all I see is this error.

Any clue?

@sasanka-hl This should be fixed now. Pull the updated version. I hard-coded the datasource and dashboards to use the name prometheus which fixed the issue.

authors: sasanka-hl vegasbrianc

repo: vegasbrianc/github-monitoring


text:
Multiple Instances

This little program is fantastic - thank you for creating!
Do you know if it is possible to do the following all with one Pi 3...?
I have 5 x ipads running TouchOSC and 5 pieces of midi equipment (5 x behringer P16-M). I've got a 4x4 usb midi interface and also a 1x1 usb midi interface which touchosc2midi recognises all of when I list ports.
I need ipad 1 to be able to control P16M 1, ipad 2 to control P16m 2 and so on...And I was rather hoping to do this all with just one pi 3.
Unfortunately the midi parameters on the P16s use channels 1-16 and control so it's not possible to use the same midi port to control all 5 of them separately (there's no way of altering the midi mapping) - they each need a separate midi out port.
I've had a go at trying to fire up two terminal windows and run touchosc2midi twice, but it throws up error that address is already in use. I tried also seeing if entereing the ips of each iPad - but it won't connect to a manual ip that I enter for some reason.

Hmm, I never tried to run multiple instances on the same host. The first hurdle would be the network port used for the MidiBridge (it is not configurable from TouchOSC settings). What you could try:
Run your second touchosc2midi instance from source code and adjust the PORT setting in https://github.com/velolala/touchosc2midi/blob/master/touchosc2midi/advertise.py#L13 -- this setting is currently not exposed at the commandline and I am not sure, if TouchOSC would accept a different port when it is announced via zeroconf.

license: mit


text:
Don't ignore the static folder.

See discussion at https://github.com/vendure-ecommerce/vendure/issues/2138

Thanks!

authors: agoransson michaelbromley


text:
Support CodecID 12 for HEVC

Several existing implementations used CodecID of 12 to support HEVC before this project began, and there are also hardware implementations based on those concepts, so could this be added to Enhanced RTMP as well?

Hey Dave,

Gotcha, can you list some of the hardware and software implementations
let's us consider this
curious: switching to fourcc HEVC is straight forward and minimal work. Is that not possible?

thx

Here's some of the implementations that I'm aware of:

https://github.com/ossrs/srs/issues/465
https://github.com/ksvc/FFmpeg/wiki
https://github.com/shogo4405/HaishinKit.swift/issues/343
https://blog.wmspanel.com/2019/05/support-hevc-rtmp-nimble-streamer-larix.html

I agree that switching appears to be doable, but getting all of the existing implementations to do this can be a difficult and the even bigger challenge is then upgrading all of the existing installs
And then when you consider all of the existing content that has been generated over the years with CodecID of 12, it would be really nice to have that brought into the standard as valid. From my perspective, it could be introduced as "deprecated" or "not recommended", so future implementations and uses would be using fourcc but all of the existing usage would still work as is

i'm concerned that making "id 12 == HEVC" official is a negative incentive to transition to the fourCc way, no matter how much you say it's "deprecated" or "NOT RECOMMENDED", especially given the inertia of existing implementations.

there is no Protocol Police, and nobody is stopping anyone from using any codec ID any way they want (i'm currently using audio codec id 15 ("Device Specific") for Opus in my Javascript+WebCodecs implementation). the only reason to document video codec id 12 as HEVC would be to encourage interoperation and adoption in new implementations, but new implementations should be preferring the fourCc way.
IMO use of any "unassigned" or "reserved" code points should be considered ad hoc, uncoordinated, and nonstandard, and especially now that there's Enhanced RTMP, doing so should be considered "NOT RECOMMENDED".

Hey David,
I understand the suggestion and appreciate you bringing it up. After thinking about this some more, it feels like the best course of action is to leave this alone. Some of the thinking behind this is:

Introducing CodecID 12 for HEVC as part of the spec while at the same time deeming it as “deprecated” or “not recommended” feels at odds with each other and ultimately will not have any real effect.

While unlikely,  Introducing CodecID 12 for HEVC, could perhaps be incompatible with other unofficial implementations.

Leaving this alone will not break anything, and future implementations for HEVC will be compelled to adopt the FourCC approach as outlined in the enhanced RTMP specification.

Hope this helps. I will close this issue out for now. If a compelling argument comes up, we will reopen.
Thanks!

closing per previous reason (https://github.com/veovera/enhanced-rtmp/issues/24#issuecomment-1731658053)

authors: daveisfera veovera zenomt

repo: veovera/enhanced-rtmp


text:
Craft3: Calling unknown method: craft\elements\db\UserQuery::client() in CP

Description
CP Yii toolbar reporting an error
verbb\cpnav\services\CpNavService::modifyCpNav Calling unknown method: craft\elements\db\UserQuery::client()

Steps to reproduce

Install plugin
Load Plugin
Create  profile

Additional info

Plugin version: 2.0.3
Craft version: 3.0.1

This should be fixed in 2.0.4.

authors: engram-design sergeifilippov

repo: verbb/cp-nav


text:
Fix: type "any" for correct type

Hi just a little type fix in _app.tsx
before:
const Layout = (Component as any).Layout || Noop

After:
type LayoutT = FC & { Layout: typeof Layout }
 const Layout = (Component as LayoutT).Layout || Noop

@niko20 Hi there and thank you for the PR. Closing per https://github.com/vercel/commerce/pull/251#discussion_r679634165

repo: vercel/commerce


text:
Possible to support object keys?

Would it be possible to support objects as keys rather than forcing everything to be a string?
In my case I'm looking to do something like
const { data } = useSwr(userDetail.prepare({ id: 5 }));

which returns the same object given the same inputs. The object itself has a method on it that is called by the fetcher:
function fetcher(preparedAction) {
    return preparedAction.call();
}

As it is this doesn't work because the object returned is forced to a string here: https://github.com/zeit/swr/blob/master/src/use-swr.ts#L66
Given the cache is a Map using an object as a key works, eg. changing that line to the following appears to do what I want:
else if (!key || typeof key !== 'object') {
        // convert null to ''
        key = String(key || '');
}

Wrapping it in an array does also work:
const { data } = useSwr([userDetail.prepare({ id: 5 })]);

but the ergonomics aren't as good (especially given if you forget to wrap it in an array it just doesn't work - no errors).
Unfortunately other things assume it's a string as well - eg. CONCURRENT_PROMISES etc are just plain objects rather than a Map.
Is this something that you would be willing to extend the API to accomodate?
My alternative to make this work within the current API constraints would be to have prepare return a string that fetcher can look up into my own global cache... but I was thinking it would be nice to avoid this if swr already did that internally.

For simple cases, you could do something along the lines of what I did for Axios here: https://github.com/zeit/swr/tree/master/examples/axios
It basically just wraps useSWR in a new hook which uses JSON.stringify to create the key. Works fine so far here at least 🙂

If you need a typescript example: https://github.com/zeit/swr/tree/master/examples/axios-typescript
Although your case might be a bit simpler since that example also handles the initialData and axios response object to equal the API of useSWR

@davecoates I like the idea 👍

CONCURRENT_PROMISES etc are just plain objects rather than a Map.
I think we'll keep it as a plain object for now, because otherwise the keys (if you use an object as key) can't be garbage collected (string keys are fine for now).

However it's okay to wrap it with an array automatically internally:
useSwr(object)
// equivalent to
useSwr([object])

Thanks @Svish for the JSON.stringify suggestion (it can be handy sometimes too).

If you wrap it in an array like that, just make sure it's actually the exact same object each time... i.e. that userDetail.prepare({ id: 5 }) doesn't return a new object each time, because if it does, it will fail the reference check and trigger a new fetch. At least pretty sure that's what will happen... make sure to check in your network log to make sure it doesn't go nuts with new requests for the same id...

@Svish Yeah. The ideal use case of object keys is not "params". The ideal case should be:
const { data: user } = useSWR('/api/user', fetch)
const { data: userPhotos } = useSWR(['/api/photos', user], fetchUserPhoto)

Because SWR deep compares & caches the data (user in this example), if you're managing all the data dependencies with SWR, the issue you mentioned will never happen ;)

@quietshu Looks like you'd need a custom fetcher for every new data dependency type or something then? 🤔
const { data: user } = useSWR(['/api/user', userId], fetchUser)
const { data: userPhotos } = useSWR(['/api/photos', user], fetchUserPhoto)

const { data: post } = useSWR(['/api/post', postId], fetchPost)
const { data: comments } = useSWR(['/api/comments', post], fetchPostComments)

...

@Svish If you want to use objects as the arguments — yes. But you can hide them inside custom hooks:
const { data: user } = useUser(userId)
const { data: userPhotos } = useUserPhoto(user)

const { data: post } = usePost(postId)
const { data: comments } = usePostComments(post)

...

But under the hood, it will always be a URL + headers in the HTTP request. So no matter which pattern you want to use inside your components, I'd always suggest to transform and pass it as a string key (w/ options) to useSWR:
function useUserPhoto(user, fetcherOpts = null) {
  return useSWR(user ? ['/api/photos?uid=' + user.id, fetcherOpts] : null, fetcher)
}

In that case you don't need any custom fetcher.

@quietshu Don't think I like how that looks, hehe. Think I'll stick with my JSON.stringify for now. 😛
Anyways, hope @davecoates found the answer he needed! And I do agree it would be super handy if useSWR allowed to use objects as keys, although also not sure how that would work internally, so personally I'll just stick with my hack, and not complain. 🤷♂😛

Yeah @Svish it's good to use what works the best in different cases  👍
What I was sharing is, this pattern makes great sense from the point of view of the app structure too. In complex web applications, you definitely don't want to put the APIs and fetch handlers inside every single component that uses the data. Instead you can have a /data directory with all your data sources and use them like the example above.

And that works really well for us in the past 6 months. I'll share more details in the future with a concrete example.

Yeah, that's pretty much what we do now, except we have an api folder with files that generates Axios request objects. Basically like this:
// src/api/foobar/index.ts
import { ApiRequest, ApiRequestDetails } from 'api';
import config from 'config';

export const foobarRequest = <Data>(
  request: ApiRequestDetails<Data>
): ApiRequest<Data> => ({
  baseURL: config('foobarBaseUrl'),
  withCredentials: true,
  ...request,
});

// src/api/foobar/user/search
import { foobarRequest } from 'api/foobar';
import { GetRequest } from 'util/useRequest';
import { User } from '.';

export type SearchResult = User;

export const getSearchRequest = (term: string): GetRequest<SearchResult[]> =>
  term
    ? foobarRequest({
        url: '/api/user/search',
        params: { term },
      })
    : null;

The Api types are just subsets of the Axios request and response types.

Used in search component like this:
  const { data: searchResult, isValidating } = useRequest(getSearchRequest(term));

The useRequest hook is more or less what I added in the axios-typescript example, except it uses a subset of Axios types, rather than the full ones.

@quietshu
cc @Svish
Please let us know, if you would accept to include the:

useRequest
as a built-in method of the useSWR API?

The major issue with it being an example is all of the developers, who use axios with swr and that should be the majority of those who fetch RESTful API, are all duplicating the same concept and maintain it separately from the community.
It would be better, if you would accept a refactored built-in method, that would:

allow to initialize the hook with global settings for both axios and swr, we could name it

setUseSWRAxios

the initializer would return a named function (hook) useSWRAxios

personally, I'm against of naming useRequest, as the naming pattern above allows us to add other modified useSWR hooks for other libraries useSWRAnotherLib

minimize the memory footprint, by not duplicating data in data, and response returned keys

I suppose? Want me to try put together a PR?

Btw, re your second point about minimizing memory footprint, I'm pretty sure it's not really duplicating anything. The returned data is just a reference to response.data, there's no data being copied anywhere as far as I know.

@Svish you are not passing a reference, but creating a new object. Hence, duplicating data.
Regarding a PR, I'm also fine creating it, just want an approval from the maintainers to write the proposal.

@Svish
Actually, I'm wrong on the reference aspect:

@Svish
From the readability perspective, I'd still suggest to accept the following design, as it is clearer what's going on, separating the entities:

Aha, well, if you do get approval feel free to make the proposal. Just pay attention to the typings, and if at all possible, make it possible to override them. The axios types are quite "big" and allow a lot of things, which might be good to hide. For reference, here's what we actually use in our current project where I use this useRequest hook of mine, with some comments added:
// api/index.ts
import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';

/**
 * A bare minimum subset of AxiosRequestConfig,
 * which also leaves out method forcing it to be
 * a GET request, which is the default.
 * Also note the unused <Data> type which is there
 * so the request can define its return data type.
 */
export interface ApiGetRequest<Data>
  extends Pick<
    AxiosRequestConfig,
    'baseURL' | 'headers' | 'params' | 'data' | 'withCredentials'
  > {
  url: string;
}

/**
 * Adding in the method for use in other cases than useRequest
 */
export interface ApiRequest<Data> extends ApiGetRequest<Data> {
  method?: 'DELETE' | 'POST' | 'PUT' | 'PATCH';
}

/**
 * A bare minimum subset of AxiosResponse
 */
export interface ApiResponse<Data = unknown>
  extends Pick<AxiosResponse, 'status' | 'statusText' | 'headers'> {
  data: Data;
}

/**
 * A bare minimum subset of AxiosError
 */
export interface ApiError<Data = unknown> extends Pick<AxiosError, 'message'> {
  response?: ApiResponse<Data>;
}

/**
 * Axios wrapped to accept and return the subset types
 */
export function apiRequest<Data = unknown>(
  request: ApiRequest<Data>
): Promise<ApiResponse<Data>> {
  return axios(request);
}

// util/useRequest.ts
import useSWR, { ConfigInterface, responseInterface } from 'swr';
import { apiRequest, ApiGetRequest, ApiResponse, ApiError } from 'api';

/**
 * An `ApiGetRequest`, or `null` if no request is to be performed (e.g. in the case of an empty search term)
 */
export type GetRequest<Data> = ApiGetRequest<Data> | null;

/**
 * Adjusted useSWR return type, which corrects the data and response keys
 */
interface Return<Data, Error>
  extends Pick<
    responseInterface<ApiResponse<Data>, ApiError<Error>>,
    'isValidating' | 'revalidate' | 'error'
  > {
  data: Data | undefined;
  response: ApiResponse<Data> | undefined;
}

/**
 * Adjustment of the useSWR ConfigInterface to make initialData
 * work the same, i.e. so you can pass in just the data, and not
 * a full axios response, which useSWR would expect
 */
export interface Config<Data = unknown, Error = unknown>
  extends Omit<
    ConfigInterface<ApiResponse<Data>, ApiError<Error>>,
    'initialData'
  > {
  initialData?: Data;
}

export default function useRequest<Data = unknown, Error = unknown>(
  request: GetRequest<Data>,
  { initialData, ...config }: Config<Data, Error> = {}
): Return<Data, Error> {
  const { data: response, error, isValidating, revalidate } = useSWR<
    ApiResponse<Data>,
    ApiError<Error>
  >(
    request && JSON.stringify(request),
    // @ts-ignore Typescript complains that request can be null, but this won't be called if it is
    () => apiRequest(request),
    {
      ...config,
      // If we have initial data, wrap it in a simple fake axios response
      initialData: initialData && {
        status: 200,
        statusText: 'InitialData',
        headers: {},
        data: initialData,
      },
    }
  );

  return {
    data: response && response.data,
    response,
    error,
    isValidating,
    revalidate,
  };
}

@o-alexandrov
Re the reference thing, yeah, I was pretty sure it was just a reference 😛
Re the axios response, yeah, it includes several things, which might be useful or not, but I would prefer to leave it as it is. I pull out a reference to response.data it in the return object so that the API matches useSWR (so data is the actual data, and not the full axios response), but it should still be part of the axios response. I should be able to pass the returned response from useSWRAxios to any function expecting an object of type AxiosResponse, and that type includes the data.

Thanks for the suggestions everyone :+1:
I think custom hooks are a good idea here for my use case

@Svish
To be clear, I see your solution as too opinionated, eliminating the flexibility from the user and therefore, it's unreasonable to think it'd make sense to maintain the solution that's prone to changes in axios due to the opinionated nature.

api/index.ts you are redefining axios types for no reason, the axios request is already fully typed, you shouldn't define scenarios as developers would have different use cases

Instead of discussing your proposal, I'll just leave my unopinionated version that doesn't decide for the user how to interact with useSWR and axios.
@quietshu I ask to include it as part of the library API as devs would otherwise recreate the same thing, with axios being optionalDependency of the project:
export const setUseSWRAxios = (
  initialRequest?: Omit<AxiosRequestConfig, "method" | "data">,
  initialConfig?: ConfigInterface,
) => {
  return function useSWRAxios<Data = unknown, Error = unknown>(
    /**
     * it's possible to add "| keyof InitialRequest or | keyof InitialConfig"
     * but we should leave the ability to override global config
     */
    request: Omit<AxiosRequestConfig, "method" | "data">,
    config?: ConfigInterface,
  ) {
    const modifiedRequest: AxiosRequestConfig = {
      ...initialRequest, // for global customizations
      ...request,
      method: `GET`,
    }
    const modifiedConfig: ConfigInterface = {
      ...initialConfig, // for global customizations
      ...config,
    }
    /**
     * Axios has a wrapper object around data => filter response
     */
    const { data: response, ...responseUseSWR } = useSWR<
      AxiosResponse<Data>,
      AxiosError<Error>
    >(
      JSON.stringify(modifiedRequest),
      async () => axios(modifiedRequest),
      modifiedConfig,
    )
    const { data, ...responseAxios } = response || {}
    return { ...responseUseSWR, responseAxios, data }
  }
}

@o-alexandrov Yeah, of course I wasn't expecting such limited types to be used in a generic hook like this. The original Axios types are fine for that, but I just wondered if it would be possible to allow for overriding the types in the setUseSWRAxios call. That way it'd work for both cases.
Anyways, comments to your proposal:

I think initialData should be handled like in my example, otherwise the API for initialData will be different from useSWR and rather clunky. One should be able to pass something in to initialData and expect to see it returned back via data.
I still think you shouldn't remove data from the responseAxios object because it will then no longer be a complete and valid AxiosResponse.
Looks like the hook has no defined return type.

I really like the idea of setUseSWRAxios 👍

I ask to include it as part of the library API as devs would otherwise recreate the same thing, with axios being optionalDependency of the project

Here's my proposal, and I think it's more general, and works better for all libs & scenarios: #172

The problem I see with this kind of custom hooks that wrap a specific fetcherFn is that it also hides away the logic for SWR keys generation - which are needed for things like mutate. I can see how they are convenient, but from an API design standpoint, that's a big hole for me. I don't see this topic being covered often. Having to JSON.stringify a request object is an implementation detail.
I'm playing with the idea of returning something like swrKey from the hook itself. Any thoughts on this?

@nfantone
Later, I found a problem with the code of @Svish and mine slightly different proposal.
When mutating the data, we should pass to the mutate function the exact same structure of the AxiosResponse

an object, where data is a property, containing the backend response

Regarding the proposal of making the mutate function as part of the response of the useRequest (or useSWRAxios or useData in your example), swr already has an existing open issue below:

https://github.com/zeit/swr/issues/136

@o-alexandrov Seems like #136 got implemented through #245. Good stuff!
However, the way I see it, there's still an issue with locality: the returned, partially applied, mutate function is still only available on the component using SWR hook - everywhere else, you'd still need the original key. The problem still persist. We just moved it around.

The docs still say one should not use objects as keys.
https://swr.vercel.app/docs/arguments#passing-objects
So whats with that now? I also see several tests that use object keys now.

For simple cases, you could do something along the lines of what I did for Axios here.
It basically just wraps useSWR in a new hook which uses JSON.stringify to create a key for the request object. Works fine so far here at least 🙂

I did something similar with swr-firestore when creating a Firestore collection query from an object here.

Update: I’m planning to add key serialization and object key support in #1429.

Added to SWR 1.1.0-beta.0 🎉 ! You can now do this:
useSWR({ query: graphql`...`, variables }, request)
useSWR({ query: graphql`...`, variables }, request)
// ^recognized as the same resource

So it does deep compare on the object fields?

@pke yes, same for array keys.

authors: Svish davecoates nandorojo nfantone o-alexandrov pke quietshu shuding

repo: vercel/swr


text:
added docs/repo link to homepage

Description

Changed the navigation component to add repo/docs link in homepage
Testing Instructions

the conditional logic was earlier checking if site returned repo or pack and then showed the docs
i changed the logic to check if docs has not been added it will add docs on all pages navigation and then if site has not returned repo or pack it will set the default docs route to repo/docs

@nirban07 Sorry about this. Could you fix the ESLint error here? https://github.com/vercel/turbo/actions/runs/7535505924/job/20511603210?pr=7008#step:5:320

repo: vercel/turbo


text:
Adding cache false to a previously cached process fails

What version of Turborepo are you using?
latest
What package manager are you using / does the bug impact?
Yarn v1
What operating system are you using?
Mac
Describe the Bug
Adding cache: false to a task that was previously cached still hits the cache.
Expected Behavior
Adding false should not hit the cache.
To Reproduce

Add a task a let it generate a cache
Add cache: false
Run the task again and the cache will hit.

Agreed, tasks that cannot be cached should also not read from cache. I'll get a PR up to address this.

authors: gsoltis zomars

repo: vercel/turborepo


text:
package ban list

recently npm poisoning more and more common,if there is a ban list to refuse user visit malicious packages would be better.
this feature need satisfy ban the package and ban some package specified version and regex expression  supported.
please consider this to make this software have some anti-malware protect functions

Seems you need this https://www.npmjs.org/verdaccio-plugin-secfilter

Seems you need this https://www.npmjs.org/verdaccio-plugin-secfilter
source: https://verdaccio.org/dev/plugins-search

yes, thank you for reply

have a good day

@joebnb give it a try and would be great to have feedback, maybe we can include it as dependency if is good enough

@joebnb give it a try and would be great to have feedback, maybe we can include it as dependency if is good enough

ok, I will give feedback after use it,it's probably  in a few months

authors: joebnb juanpicado

repo: verdaccio/verdaccio


text:
Watchdog Daemon Process Issues

Constantly showing

OpenClash 守护程序		NOT RUNNING

While the core itself is running normally.
A thing to note was when installing the ipk there was a prompt of
sh: bad number
displayed during package configuration. Don't know whether it is related.
So, what is the path to the daemon? I think I'd first to check whether the file exists.
FYI I'm running it on a GL.iNet B1300 router w/ linux-armv7 kernel installed.
Thanks,

For now, there has an Permission denied error with some scripts after build firmware .
I will fix it as soon as possible, you can find the script in the /usr/share/openclash/openclash_watchdog.sh and don't forget ensure the file's executable privilege.

Would you mind testing the lastest release and feedback?

On the new release, v0.34.5-beta, I checked the file you mentioned above. It seems the script is actually running, despite the Luci UI reports it as NOT RUNNING.

Both TOP and Luci Status > Processes are showing its running, too. Although whether or not it's running NORMALLY is unknown. Any ways to check that?

I use this command ps |grep openclash_watchdog.sh |grep -v grep 2>/dev/null to confirm whether the scripts is working, the luci page just do the same thing.  Maybe you should confirm this command work well first.
Also, watchdog will clean the log file when the size reaches limitation(90kb).

root@GL-B1300:~# ps |grep openclash_watchdog.sh |grep -v grep 2>/dev/null
1008 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh
15268 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh
17771 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh
26653 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh
28697 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh
30043 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh
31233 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh

Is it normal to have so many watchdog instances running?

This is abnormal, The script should have only one process running.

After a reboot and a continuous running for several hours, it seems it's normal now.

root@GL-B1300:~# ps |grep openclash_watchdog.sh |grep -v grep 2>/dev/null
4544 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh

I will continue to test its reliability and report any issue I encounter. Thanks for the work @vernesong !

After an extended running, multiple watchdog instances are appearing again.

root@GL-B1300:~# ps |grep openclash_watchdog.sh |grep -v grep 2>/dev/null
4544 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh
6972 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh

Also, two new problems arose.

The Log is not showing any recent entries. The latest one entry was from 8 hours ago. The cleaning up notice on the top IS showing a recent time, while everything below were from 8+ hours ago. Don't know whether it's a logging service malfunction or an erroneous truncation made by the watchdog daemon.

The server appointment I made to the Clash Dashboard hours ago, was gone. The selection, when I checked, was on the Fallback, which is also the starting up default. Don't know whether or not this was caused by a restart of the Clash daemon during the hours' running, as the log was missing and I'm having nowhere to check. Also, whether this is related to the multiple watchdog symptom worth an inspection, I suspect.

root@GL-B1300:~# ps |grep openclash_watchdog.sh |grep -v grep 2>/dev/null
4550 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh
22603 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh

Confirmed that, on my router (GL.iNet GL-B1300), the watchdog process is not exiting correctly when a restart of the main service takes place. Again, from my System Log:

My observations and suspicions are as follows.
I'm setting an automatic subscription update at 21:00 every day, so by that time today and yesterday, the service was getting a restart to make the config changes to take effort. Yet the restart only kills the previous core process correctly. When it comes to the watchdog process, it fails to keep it in singleton.
From my earlier manually starting test, I could see that the design was to discover the previously running watchdog process, and exit itself on a secondary run, so that the old one keeps to be the only one up and running.

root@GL-B1300:/usr/share/openclash# ./openclash_watchdog.sh
another clash_watchdog.sh is running,exit

Yet, my suspicion is that, this mechanism does not work as planned, when it comes to the automatic restart during a config update. A service restart initiates a new watchdog process, yet for some reason it keeps on running. So, that day when I made several changes and committed the configs, the service got restarted several times. Then, when I checked back there was 7 running instances of the watchdog.
A peek into the watchdog script code reveals that there's a checking for the running status of the core. I suspect that your service design is to having the watchdog process running first, then, when the watchdog discovers that there's no core process running, it creates a new core process. If that's the case, on a service restart occasion, there's a chance that the forking of a new core process marks the watchdog a parent process. And for a parent process, whether or not it is allowed to quit without the termination of all its children is an OS specific design. My suggestion on this is to have a non-watching code in the service to initiate the core process prior to the running of a watchdog, so that the watchdog processes can become standalone and terminate normally when appropriate.
Meanwhile, I'm not seeing any significant side effect of having multiple watchdogs running. Yet still, I'm turning off the automatic update for now, just in case for a potential malfunction.

I can not find the reason so far why openclash_watchdog.sh started others processes while these commands below existing, witch means only one process be allow starting-up.
status=$(ps|grep -c openclash_watchdog.sh)
[ "$status" -gt "3" ] && echo "another OpenClash_watchdog.sh is running, exit "
[ "$status" -gt "3" ] && exit 0
Maybe, multiple processes is the reason why the script can not stop watchdog and the luci state abnormal, so I have changed some commands in the lastest commit that will avoid this situation.
You can confirm these commands below first that work for stopping the watchdog on your router.
kill -9 "$(ps |grep openclash_watchdog.sh |grep -v grep |awk '{print $1}' 2>/dev/null)" >/dev/null 2>&1
By the way, There are few serious side effects when multiple watchdogs running, but unstabitily

Well, can you explain to me why the number you're testing against is 3? I did tested with a little mod to your code:
ps |grep openclash_watchdog.sh
status=$(ps|grep -c openclash_watchdog.sh)
echo $status
[ "$status" -gt "3" ] && ...
And the output was like

root@GL-B1300:~# /usr/share/openclash/openclash_watchdog.sh
578 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh
6651 root      1412 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh
6653 root      1412 S    grep openclash_watchdog.sh
4
another clash_watchdog.sh is running,exit

There were 3 instances showing yet the returned number is 4. Was it because of the parentheses? A sub-bash process?
Another discovery is that when running in background, $status always gets a number of 1:

root@GL-B1300:# /usr/share/openclash/openclash_watchdog.sh &
8028
root@GL-B1300:#  8030 root      1412 S    grep openclash_watchdog.sh
1

The output messed up with the prompt, yet still we can see it was getting a single process detected, which was the grep nested in the testing code. None of the other watchdog processes, including the original one ran by the service, and the newly created watchdog itself, was detected. So the [ "$status" -gt "3" ] test never gets passed, and you can create as many watchdog processes running on the system with & or nohup. I don't know what has caused this, but if you're using a similar method to initiate the watchdog during a service restart, this might be the cause of the multiple watchdog issue. The detection code in the script seems to be only working with non-background executions.

I did a further test and found the reason. I created a test.sh and put a simple ps command in it. I then tested running it with and without &:

root@GL-B1300:/tmp# ./test.sh
PID USER       VSZ STAT COMMAND
1 root      1388 S    /sbin/procd
...
30163 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openclash_watchdog.sh
...

root@GL-B1300:/tmp# ./test.sh &
17803
root@GL-B1300:/tmp#   PID USER       VSZ STAT COMMAND
1 root      1388 S    /sbin/procd
...
30163 root      1420 S    {openclash_watch} /bin/sh /usr/share/openclash/openc
...

The background running output was truncated after char 78 for each line. All the long cmdlines are getting a truncation. I think this should be related to some environment variable in my router firmware.
Meanwhile, I've changed the code to:
status=$(ps|grep -c {openclash_watch})
And it solved the problem. The truncation won't affect the detection anymore. Confirmed with a config update, no more parallel watchdogs haunting. If there could be a side effect by using {openclash_watch}, please let me know.
And if you're using the same mechanism for the Luci UI, same explanation could be used for the erroneous running status report. This is a minor bug. Yet, it is always a better solution to register the watchdog as a separate service and report its own running status upon inquiry (like openclash_watch status), I feel. A service can record the PID when it creates the process, thus ensures a singleton running without messing up with dynamic detections.

Another (better) way to ensure singleton is to use flock: How to implement singleton in shell script, FYI.
Closing the issue.

authors: hsghost vernesong

repo: vernesong/OpenClash


text:
Support for copy local from file

*Added backend message parsers and frontend message serializers for all copy messages
*Added getRejectedRows() returning a private variable that is otherwise hidden from normal logging of a result object
*Added 64bit little-endian parser required for copy protocol messages
*Added handlers for all backend messages received, not all have actions associated with them for copy from local file
*Removed postgres replication protocol message (should have been removed awhile ago, but isn't hurting anything)
*Fixed ND test failure in query-tests.js
*Added test cases for copy from local file
*Other general refactoring

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Danny Mickens seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

authors: CLAassistant DMickens

repo: vertica/vertica-nodejs


text:
COPY FROM LOCAL does not work?

I am not sure, if COPY FROM LOCAL should work, so do not hesitate to close this issue with status "not yet implemented" ;-)
Please, see simple PoC demonstrating the issue here:
https://github.com/jaceksan/vertica-python/blob/copy_local_poc/jacek/copy_local_poc.py

ah yes. copy from stdin is the only thing we support at the moment. ill leave this open as a feature request, but i dont think we have any plans to add this at the moment.

Just for comparison to other Vertica native adapter projects:
The Ruby project does not implement COPY FROM LOCAL either:
https://github.com/wvanbergen/vertica/issues/33
And the recently released Python native adapter from HP Vertica supports COPY FROM STDIN but not from a filepath.
https://my.vertica.com/docs/7.2.x/HTML/Content/python_client/loadingdata_copystdin.html
It's great that vertica-python supports COPY FROM STDIN (via the cursor.copy method).  Ideally COPY FROM LOCAL could just be done from a cursor.execute call (to make it more portable to pyodbc and jaydebeapi), but it must be tricky to implement since many projects extend the DBAPI2 with cursor.copy.  Even psycopg2 has cursor.copy_from and cursor.copy_expert.

Denis,
nice to see, that somebody read my request / concern ;-)
Meanwhile things have changed a lot on my side.

COPY FROM STDIN can be an alternative to FROM LOCAL in all cases
so it is not necessary to rely on implementation of COPY FROM LOCAL any more
We use COPY ON ANY NODE if possible
it is incredibly faster and it works using standard cur.execute() method.

Hi,
There are definitely some use cases where COPY FROM LOCAL works really well, one example being while adding sequence numbers to records while loading them to vertica (see https://community.dev.hpe.com/t5/Vertica-Forum/Add-sequence-numbers-to-a-bulk-load-in-vertica/td-p/237457).
We have tried to do the same thing using COPY FROM STDIN and we see that ordering of sequence numbers is not guaranteed to be the same as the records in the file.
So definitely, COPY FROM LOCAL wins here and it would be great if we could see the support added for the same !

How can we use copy command to load data to vertica using Pycharm in Python ?

@son2 Here's an example function that takes a vertica-python connection to load the data in the dataframe df into the table loading_table.  This will also work with pyodbc or turbodbc connections.
def copy_dataframe_to_table(connection, loading_table, df):
    """Use Vertica COPY to load the data in the dataframe `df` into `loading_table`.
    The columns of `df` must match the columns of `loading_table`.

    """
    cursor = connection.cursor()
    csv_buf = io.StringIO()
    df.to_csv(csv_buf, header=False, index=False, encoding='utf-8', quoting=csv.QUOTE_MINIMAL, escapechar='\\')
    query = """
    COPY {loading_table}
    ({column_names})
    FROM stdin
    DELIMITER ',' ABORT ON ERROR NO COMMIT;
    """.format(loading_table=loading_table, column_names=', '.join(df.columns))
    cursor.copy(query, csv_buf)
    connection.commit()
    return len(df)

Thanks  Dennis.
On Wed, Aug 15, 2018 at 3:51 AM dennisobrien notifications@github.com
wrote:

@son2 https://github.com/son2 Here's an example function that takes a
vertica-python connection to load the data in the dataframe df into the
table loading_table. This will also work with pyodbc or turbodbc
connections.
def copy_dataframe_to_table(connection, loading_table, df):
"""Use Vertica COPY to load the data in the dataframe df into loading_table.    The columns of df must match the columns of loading_table.    """
cursor = connection.cursor()
csv_buf = io.StringIO()
df.to_csv(csv_buf, header=False, index=False, encoding='utf-8', quoting=csv.QUOTE_MINIMAL, escapechar='\')
query = """    COPY {loading_table}    ({column_names})    FROM stdin    DELIMITER ',' ABORT ON ERROR NO COMMIT;    """.format(loading_table=loading_table, column_names=', '.join(df.columns))
cursor.copy(query, csv_buf)
connection.commit()
return len(df)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/vertica/vertica-python/issues/43#issuecomment-413034526,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AcAtQ7onKA6kBh_Pq_whI3vSfnrcKZPSks5uQ01bgaJpZM4DoG5g
.

Hi
I tried the above example but it is not working. I can see the data in the buffer but it is not getting loaded into Vertica
Could someone please help me if i am missing anything in my code.
Thanks
My Code:
import vertica_python
import csv
from datetime import datetime
import pandas as pd
with open('test.csv', newline='') as csvfile:
data = list(csv.reader(csvfile))
Enable using server-side prepared statements at connection level
conn_info = {'host': '127.0.0.1',
'user': 'dbadmin',
'password': '',
'database': 'VMart',
}
connection = vertica_python.connect(**conn_info)
rows = []
for i,row in enumerate(data):
rows.append(row)
cur = connection.cursor()
dfObj = pd.DataFrame(rows)
csv_buf = io.StringIO()
dfObj.to_csv(csv_buf,header=False, index=False, encoding='utf-8', quoting=csv.QUOTE_MINIMAL, escapechar='\')
column_names="id_threatparent,date,ip_source,ip_destination,ip_source_latitude,ip_source_longitude,ip_source_country_name,ip_source_region_name,ip_source_city_name,ip_source_organization_name,ip_destination_latitude,ip_destination_longitude,ip_destination_country_name,ip_destination_region_name,ip_destination_city_name,ip_destination_organization_name,threat_type,threat_severity,threat_name,threat_description,status,ip_destination_isp_name,id_isp_lokasi_perangkat,ta_ip"
query = """ COPY {loading_table} ({column_names}) FROM stdin DELIMITER ',';""".format(loading_table="parent",column_names=column_names)
cur.copy(query, csv_buf)
connection.commit()

@arumugaguru Can you enclose your code with ``` so that it displays the indentation correctly? Your current code is hard to read. Thanks.

i encountered the same problem as @arumugaguru.  it seems that
csv_buf.seek(0)
needs to be added before calling
cur.copy(query, csv_buf)

authors: alexjikim arumugaguru babinu dennisobrien haishao jaceksan sitingren son2

repo: vertica/vertica-python


text:
An exception occurred when executing the select script using SQL Gateway

$FLINK_HOME/conf/flink-conf.yaml
execution.target: yarn-session

An exception occurred when executing the SELECT script using SQL-Gateway
-INFO-2021/01/13 20:23:09,166-org.apache.flink.yarn.YarnClusterDescriptor.getLocalFlinkDistPath(YarnClusterDescriptor.java:196)-196-No path for the flink jar passed. Using the location of class org.apache.flink.yarn.YarnClusterDescriptor to locate the jar
-ERROR-2021/01/13 20:23:09,176-com.ververica.flink.table.gateway.operation.SelectOperation.executeQueryInternal(SelectOperation.java:249)-249-Session: 2c436c304a0b7a697c1e005ad34c32bc. Error running SQL job.
java.lang.RuntimeException: Could not execute program.
	at com.ververica.flink.table.gateway.deployment.ProgramDeployer.deploy(ProgramDeployer.java:83)
	at com.ververica.flink.table.gateway.operation.SelectOperation.executeQueryInternal(SelectOperation.java:247)
	at com.ververica.flink.table.gateway.operation.SelectOperation.execute(SelectOperation.java:87)
	at com.ververica.flink.table.gateway.rest.session.Session.runStatement(Session.java:106)
	at com.ververica.flink.table.gateway.rest.handler.StatementExecuteHandler.handleRequest(StatementExecuteHandler.java:81)
	at com.ververica.flink.table.gateway.rest.handler.AbstractRestHandler.respondToRequest(AbstractRestHandler.java:77)
	at com.ververica.flink.table.gateway.rest.handler.AbstractHandler.channelRead0(AbstractHandler.java:178)
	at com.ververica.flink.table.gateway.rest.handler.AbstractHandler.channelRead0(AbstractHandler.java:75)
	at org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.apache.flink.runtime.rest.handler.router.RouterHandler.routed(RouterHandler.java:110)
	at org.apache.flink.runtime.rest.handler.router.RouterHandler.channelRead0(RouterHandler.java:89)
	at org.apache.flink.runtime.rest.handler.router.RouterHandler.channelRead0(RouterHandler.java:54)
	at org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.apache.flink.shaded.netty4.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.apache.flink.runtime.rest.FileUploadHandler.channelRead0(FileUploadHandler.java:174)
	at org.apache.flink.runtime.rest.FileUploadHandler.channelRead0(FileUploadHandler.java:68)
	at org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.apache.flink.shaded.netty4.io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
	at org.apache.flink.shaded.netty4.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328)
	at org.apache.flink.shaded.netty4.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302)
	at org.apache.flink.shaded.netty4.io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.apache.flink.shaded.netty4.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1421)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.apache.flink.shaded.netty4.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)
	at org.apache.flink.shaded.netty4.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
	at org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:697)
	at org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632)
	at org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549)
	at org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511)
	at org.apache.flink.shaded.netty4.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)
	at org.apache.flink.shaded.netty4.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException
	at org.apache.flink.util.Preconditions.checkState(Preconditions.java:179)
	at org.apache.flink.client.deployment.executors.AbstractSessionClusterExecutor.execute(AbstractSessionClusterExecutor.java:61)
	at com.ververica.flink.table.gateway.deployment.ProgramDeployer.deploy(ProgramDeployer.java:81)
	... 47 more
-ERROR-2021/01/13 20:23:09,183-com.ververica.flink.table.gateway.rest.handler.AbstractHandler.handleException(AbstractHandler.java:224)-224-Unhandled exception.
java.lang.RuntimeException: Error running SQL job.
	at com.ververica.flink.table.gateway.operation.SelectOperation.executeQueryInternal(SelectOperation.java:250)
	at com.ververica.flink.table.gateway.operation.SelectOperation.execute(SelectOperation.java:87)
	at com.ververica.flink.table.gateway.rest.session.Session.runStatement(Session.java:106)
	at com.ververica.flink.table.gateway.rest.handler.StatementExecuteHandler.handleRequest(StatementExecuteHandler.java:81)
	at com.ververica.flink.table.gateway.rest.handler.AbstractRestHandler.respondToRequest(AbstractRestHandler.java:77)
	at com.ververica.flink.table.gateway.rest.handler.AbstractHandler.channelRead0(AbstractHandler.java:178)
	at com.ververica.flink.table.gateway.rest.handler.AbstractHandler.channelRead0(AbstractHandler.java:75)
	at org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.apache.flink.runtime.rest.handler.router.RouterHandler.routed(RouterHandler.java:110)
	at org.apache.flink.runtime.rest.handler.router.RouterHandler.channelRead0(RouterHandler.java:89)
	at org.apache.flink.runtime.rest.handler.router.RouterHandler.channelRead0(RouterHandler.java:54)
	at org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.apache.flink.shaded.netty4.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.apache.flink.runtime.rest.FileUploadHandler.channelRead0(FileUploadHandler.java:174)
	at org.apache.flink.runtime.rest.FileUploadHandler.channelRead0(FileUploadHandler.java:68)
	at org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.apache.flink.shaded.netty4.io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
	at org.apache.flink.shaded.netty4.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328)
	at org.apache.flink.shaded.netty4.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302)
	at org.apache.flink.shaded.netty4.io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.apache.flink.shaded.netty4.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1421)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.apache.flink.shaded.netty4.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)
	at org.apache.flink.shaded.netty4.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
	at org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:697)
	at org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632)
	at org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549)
	at org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511)
	at org.apache.flink.shaded.netty4.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)
	at org.apache.flink.shaded.netty4.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Could not execute program.
	at com.ververica.flink.table.gateway.deployment.ProgramDeployer.deploy(ProgramDeployer.java:83)
	at com.ververica.flink.table.gateway.operation.SelectOperation.executeQueryInternal(SelectOperation.java:247)
	... 46 more
Caused by: java.lang.IllegalStateException
	at org.apache.flink.util.Preconditions.checkState(Preconditions.java:179)
	at org.apache.flink.client.deployment.executors.AbstractSessionClusterExecutor.execute(AbstractSessionClusterExecutor.java:61)
	at com.ververica.flink.table.gateway.deployment.ProgramDeployer.deploy(ProgramDeployer.java:81)
	... 47 more

When configuring execution.target:yarn-per-job, I can execute the select script.

When configuring execution.target:yarn-per-job, I can execute the select script.

@zhuangchong Maybe you need to specify application id in $FLINK_HOME/conf/flink-conf.yaml.

@zhuangchong Maybe you need to specify application id in $FLINK_HOME/conf/flink-conf.yaml.

Can you share details on the parameter for specifying application Id?

repo: ververica/flink-sql-gateway


text:
don't specify fixed, too old Vespa version

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

We should ensure this example is tested in CI too

repo: vespa-engine/sample-apps