Crash Socket.io when 2 connections at the same moment

Hi all, i've a problem with a repetitive crash on socket.io.
In fact, when i launch 2 connection in the same time (with 2 browsergame), i've this error :
[code]
net.js:391
throw new Error('Socket is not writable');
^
Error: Socket is not writable
at Socket._writeOut (net.js:391:11)
at Socket.write (net.js:377:17)
at Socket. (/home/smet/node/www/test.js:42:8)
at Socket.$emit (events.js:64:17)
at SocketNamespace.handlePacket (/home/smet/node/node_modules/socket.io/
lib/namespace.js:335:22)
at Manager.onClientMessage (/home/smet/node/node_modules/socket.io/lib/m
anager.js:459:38)
at WebSocket.onMessage (/home/smet/node/node_modules/socket.io/lib/trans
port.js:387:20)
at Parser. (/home/smet/node/node_modules/socket.io/lib/transp
orts/websocket/hybi-07-12.js:40:10)
at Parser.emit (events.js:64:17)
at /home/smet/node/node_modules/socket.io/lib/transports/websocket/hybi-
07-12.js:286:16[/code]
I use socket.io with net.js to connect on an other server.
Do you know what is the problem ?

Looks like the problem is with your code:
at Socket._writeOut (net.js:391:11)
at Socket.write (net.js:377:17)
at Socket.<anonymous> (/home/smet/node/www/test.js:42:8)

So idk what is test.js on line 42

test.js is my server page like server.js for example
cd node/www ---> to arrive in my www folder
node test.js ---> to execute this page

Yes but what is in your test.js file, are you doing your net.connection stuff around line 42. If so, then it's not related to Socket.IO

16              io.sockets.on('connection', function (socket) {
18                    var conn = net.createConnection(1547,'<IP_ADDRESS>');
19             	conn.setEncoding('binary');
...
38               //---------- SOCKET CLIENT ------------
39                socket.on('recMsg',function(mess){
40 	                  socket.emit('newMsg', mess); // send broadcast
41 	                  conn.write(mess.msg,'utf8'); // Send to IA Server
42                });
43              }); //end socketio connection

it's when the server socket.io send 2 message in the same time at line 41 :S


Successful Run But No Stories Generated!

Hi, @e-p-armstrong, thanks for the repo!
I am trying to use the rptoolkit using the same samples in raw_txt_input but I am getting:
REALLY BAD EXCEPTION ENCOUNTERED: 'NoneType' object is not subscriptable
TypeError: 'NoneType' object is not subscriptable

And no stories are generated in the output_final files.
Here is my config.yaml (tested these models with openAI ollama calls like here, everything works fine on this front):
API:
  API_KEY_A: key
  API_KEY_B: key2
  BASE_URL_A: http://localhost:11434/v1/
  BASE_URL_B: http://localhost:11434/v1/
  LOGICAL_MODEL_A: llama3.1:8b
  LOGICAL_MODEL_B: llama3.2
PATH:
  DEFAULT_PROMPTS: ./prompts
  INPUT: ./raw_txt_input
  OUTPUT: ./output
  PROMPTS: ./prompts
PHASES:
  PHASE_INDEX: 2
  WORK_IN_PHASES: True
SYSTEM:
  COMPLETION_MODE: False
  CONCURRENCY_LIMIT: 20
  EMOTIONS: ['DOMINANCE', 'FEARLESSNESS', 'EMBARASSMENT', 'NIHILISM',
    'DETERMINATION', 'DESPERATION', 'LOSS', 'NOSTALGIA', 'ANTICIPATION',
    'TRUST', 'FEAR', 'DISORIENTATION', 'DEGRADATION']
  INCLUDE_CHUNK_IN_PROMPT: True
  MODE_A: api
  MODE_B: api
  PICK_EMOTION: True
  RP_PROMPT_END: ''
  RP_PROMPT_START: ''
  STOP: True
  SUBSET_SIZE: 3
  USE_MIN_P: True
  USE_SUBSET: False
  CHUNK_SIZE: 2000
SCRAPING:
  USE_LIGHTNOVELCO: False
  LNCO_BASE_URL: https://www.lightnovelworld.co
  LNCO_RANKING_URL: https://www.lightnovelworld.co/ranking
  LNCO_CHAPTER_COUNT: 5
  LNCO_NOVEL_COUNT: 5
  LNCO_WAIT_TIME: 10
  LNCO_MAX_WORKERS: 5

Final output:
================== ALL DATA WRITTEN!! HERE ARE YOUR STATS: ==================

Total stories generated: 0
Stories that are at least OK across the board, but might slightly flawed ('good' and above, according to the AI rater): 0
Stories that are highly rated by the AI across the board ('incredible' and above, according to the AI rater.): 0
Total tokens of all stories (roughly equivalent to the number of training tokens):  0
Time taken:<PHONE_NUMBER>6753235 seconds
ShareGPT-format .json export is created, and the full dataset is also available in the final_outputs folder.
Hmm... No stories were generated. Check the logs for more information, and consider creating an issue if this is unexpected. If you do make an issue, please include your input data and the logs!

=============================================================================

FULL OUTPUT (pasted on pastejustit for better visual clarity):
https://pastejustit.com/j36pmf1imm
Please, let me know whether I am missing something that may be causing this issue.

Hey thanks for using Augmentoolkit!
This looks like an issue with the model that you're running RPToolkit with -- it's getting the output format of the early steps wrong, so the regex parsing is throwing an error. I really need to improve the error logging to make this a bit more clear. Either way, to fix this, consider running the pipeline with a larger or smarter model? For instance, in the past I have used llama 3 70b for the early steps of this pipeline. I don't think that's the minimum requirement, but starting there and going down can't hurt. Also different finetunes differ in intelligence, finding one that follows formats well is key.


Support of clojure.spec and clojure 1.9

Hi Ryan,
just to let you know that I am working on getting Clara to compile under 1.9-alpha11.
I added an AOT profile and upgraded clojure and other deps to 1.9.
Been fixing minor issues. Now the net is dying here, I will resume this tomorrow.
You can expect a pull request by next Monday/Tuesday.
Meanwhile if I can fix it, I'll maintain my own version aside until you find some time to merge
these mods.

Sounds great, Luc! We'll probably want to wait until 1.9 is released before merging to master, but having this ready in a branch we can can merge with 1.9 drops would definitely be nice.

FWIW I’m able to use Clara under 1.9-alpha12 without any apparent issue.

We always AOT stuff here as a check before deploying.
The main issue so far was the form of imports in ns forms
that does not conform to what specs expects. Tests are not exactly the same but
I am diverted on something else for a while.
Luc
Sent from my iPad

On Sep 15, 2016, at 11:29, Baptiste Fontaine<EMAIL_ADDRESS>wrote:
FWIW I’m able to use Clara under 1.9-alpha12 without any apparent issue.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.


[Bug] [dependent] dependent error

Search before asking

[X] I had searched in the issues and found no similar issues.

What happened
Manually execute the dependent upstream node to run successfully
But running downstream depends on an error
At this time, go to the upstream node that reports the error manually, and the downstream will report other dependent node errors, causing the task to fail to run normally

The upstream has been successfully run many times

downstream dependencies go wrong, but occasionally succeed
What you expected to happen
The upstream operation is successful, the downstream dependency is successful, and the task is running normally
How to reproduce
Appear irregularly
Anything else
No response
Version
1.3.8
Are you willing to submit PR?

[ ] Yes I am willing to submit a PR!

Code of Conduct

[X] I agree to follow this project's Code of Conduct

我也碰到了类似的情况，搞得我不得不把依赖时间定义为今天或昨天


Highlighter breaks when searching for special characters

First, thank you for building this neat react component.
I've found a bug where passing any special character breaks the internal regex matching in Highlighter Component.
Here's a demo demonstrating the bug:
https://codesandbox.io/s/204r9kz6lj

This is rather a bug of react-highlight-words and not of the react-highlighter current one.


DynamoDB Lambda Trigger

All the other events that trigger a lambda function nicely connect with the go aws sdk, except for Dynamodb.
Updating 'Keys', 'NewImage', and 'OldImage' in 'DynamoDBStreamRecord' struct to allow for 'dynamodbattribute.UnmarshalMap()' functionality when triggering a lambda function with dynambodb.

This change heavily bloats dependencies. Also if you are vendoring things, best not to create a dependency loop and vendor the same library. You also should not run tools on things in the vendor folder.

Codecov Report

Merging #110 into master will decrease coverage by 5.88%.
The diff coverage is 63.76%.

@@            Coverage Diff             @@
##           master     #110      +/-   ##
==========================================
- Coverage   69.65%   63.76%   -5.89%
==========================================
  Files          17       17
  Lines         715      872     +157
==========================================
+ Hits          498      556      +58
- Misses        173      272      +99
  Partials       44       44

Impacted Files
Coverage Δ

...endor/github.com/aws/aws-lambda-go/lambda/entry.go
0% <0%> (ø)

vendor/github.com/aws/aws-lambda-go/events/lex.go
0% <0%> (ø)

...com/aws/aws-lambda-go/cmd/build-lambda-zip/main.go
0% <0%> (ø)

...hub.com/aws/aws-lambda-go/events/test/jsonblobs.go
100% <100%> (ø)

...github.com/aws/aws-lambda-go/events/code_commit.go
28.12% <28.12%> (ø)

...github.com/aws/aws-lambda-go/events/test/assert.go
43.75% <43.75%> (ø)

...ub.com/aws/aws-lambda-go/events/test/jsonsyntax.go
53.84% <53.84%> (ø)

...ub.com/aws/aws-lambda-go/events/cloudwatch_logs.go
57.14% <57.14%> (ø)

...or/github.com/aws/aws-lambda-go/lambda/function.go
62.71% <62.71%> (ø)

...hub.com/aws/aws-lambda-go/events/attributevalue.go
66.77% <66.77%> (ø)

... and 41 more

Continue to review full report at Codecov.

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

@leepa I removed any changes to the vendor file to prevent any import cycles and remove the 3000+ file bloat

@sesheffield you still have aws-lambda-go vendored inside aws-lambda-go. At least at the point of writing this.

@leepa Sorry I did not realize I had vendors in the PR still.

closing stale PR - there's a few issues open already tracking the conversation for what else could be done here


Show thumbnail on canvas while full image/video is loading

Feature Description

Note in attached gif that images/videos show blank on canvas. Then suddenly, about 14 seconds in, they all show up. The current hypothesis is that this is driven by a slow server issue and loading the full images (which happens when we drag media into the canvas) took a while.
Propose that when a user drags an asset from the media panel onto canvas, we show the thumbnail on the canvas until the full image loads and replaces the thumbnail. That way we don't have an issue with blank placeholders on canvas during loading.

Alternatives Considered

Additional Context

Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance Criteria

Implementation Brief

@samitron7 There's a good chance that the thumbnail in the media gallery is tiny and would look bad in the canvas. Do we want to blur the image in the canvas until the full sized image loads?
We could accomplish this by doing sth like this: https://codepen.io/diegovar/pen/YzqwNjg

@diego, this happens in the media library correct and not on the page? Can you clarify that.

@samitron7 It happens on the page / canvas. The gif at the top explains it well.

What we want to achieve here sounds simple: we show the thumbnail on the canvas until the full image loads and replaces the thumbnail.
If we use the same thumbnail that is already cached in the media library - we will get an instant effect. If we load any/smallest thumbnail - it will require one additional image to be downloaded. So let's try with the cached one.
Unfortunately using the same thumbnail is not trivial since it's dynamically chosen in the media library (based on the box width) and we can't just pass the chosen thumbnail to the element on canvas via something like onClick argument, but we can store that thumbnail URL along with clicked resource identifier on a temporary list, then access that list from element display and use the cached image until the full-size image is loaded.
I was also thinking that we can store the chosen thumbnail URL on the element itself (in story data) - that way we can load the thumbnail (potentially from cache) when loading the whole story from scratch. That sounds like an initial load improvement, but there is also a high chance that a full-size image is also cached, so there will be no benefit in that case.
Solution for both loading scenarios (when an element is added + when an element is initially loaded) might look like this:

when an image is clicked in the media library, store its cached thumbnail URL on a temporary list
in the element display layer, check if we have something on that temporary list for a given element, if yes - use that (cached image = instant effect), if not - A) first, quickly load the smallest thumbnail or B) just load the full-size image.

WDYT?

I like the idea of trying the cached image. If this works it would work for images but for video, we would need to temporary gray out the play controls on the element (there is already a loading indicator so we are good there) so the users doesn't expect to be able to play it when it loads.

Verified in QA

@csossi is it a mistake? QA is done by ENG https://github.com/google/web-stories-wp/pull/3935#pullrequestreview-476199520

This works, but if I double-click on an image added to the canvas to change the mask while the full image hasn't loaded, it shows the empty container rather than continuing to use the thumbnail.
#4422


create projects page

new projects landing page, waiting for dani to add firebase functionality to it

done @Dani-op thank you for your feedback on the issue


Struct flattening and initialization support

What's the progress on this issue? @csanadtelbisz

Struct inicialization has partial support now (see ). I will not implement struct flattening and proper struct initialization, though.


Full local control of camera possible with cloud disabled.

While troubleshooting some RTSP streaming issues I got majorly sidetracked and ended up looking more into the camera in general. Here are a few things I discovered:

The camera uses the ThroughTek (TUTK) P2P protocol. This DEFCON talk  should tell you all you need to know about it. I was able to parse the traffic on my local network and see the packet contents. I was also able to do a UDP probe on my local network and find all my cameras and their UIDs. The binary p2p_tnp handles the P2P protocol including streaming the video.

It is possible to do almost everything the app can do without the cloud features enabled fairly easily. I was able to find the partial sources for p2p_tnp, cloudAPI, and watch_process. These sources are for a later version of the camera but the code is compatible.

The following control functions are available (this list is incomplete) and they just send IPC commands to the dispatcher program:
set_voice_ctrl()
set_viewpoint_trace()
set_video_backup_state()
set_tnp_work_mode()
set_tnp_init_status()
set_tnp_connect_success()
set_tnp_check_login_success()
set_tnp_check_login_fail()
set_pwd_used_cnt()
set_power()
set_panorama_capture_state()
set_motion_record()
set_motion_detect()
set_mirror_flip()
set_mic_volume()
set_light()
set_ldc()
set_lapse_video()
set_immediate_bitrate()
set_high_resolution ()
set_encode_mode()
set_debug_info()
set_day_night_mode()
set_baby_cry()
set_audio_mode()
set_alarm_sensitivity()
set_alarm_mode()
set_abnormal_sound_sensitivity()
set_abnormal_sound()

I created this function in ipc_cmd.c
typedef struct
{
    int dst_id;
    int src_id;
    short main_op;
    short sub_op;
    int msg_len;
} mqueue_msg_header_t;

int send_rmm_msg(mqd_t mqfd, int msg_type, char *payload, int payload_len)
{
    mqueue_msg_header_t msg;
    char send_buf[1024] = {0};
    int send_len = 0;

    memset(&msg, 0, sizeof(msg));
    msg.dst_id = 1; // mid = 1, rmm = 2, cloud = 4
    msg.src_id = 8;
    msg.main_op = msg_type;
    msg.sub_op = 1;
    msg.msg_len = payload_len;

    memcpy(send_buf, &msg, sizeof(msg));

    if ((NULL != payload) && (payload_len > 0))
    {
        memcpy(send_buf + sizeof(msg), payload, payload_len);
    }

    send_len = sizeof(msg) + payload_len;

    if (mqfd == -1 || send_len > 512)
    {
        fprintf(stderr, "Invalid mqfd or payload_len\n");
        return -1;
    }

    mq_send(mqfd, send_buf, send_len, 1);
}

and was able to successfully toggle the LED on and off
    if (led == LED_OFF)
    {
        send_rmm_msg(ipc_mq, 0x77, NULL, 0);
    }
    else if (led == LED_ON)
    {
        send_rmm_msg(ipc_mq, 0x76, NULL, 0);
    }

The relevant get_() functions can be created by reading the values from /tmp/mmap.info which is the single most important file on the camera and controls everything/stores all the camera settings and secrets!
Here is a partial list of the values stored in mmap.info extracted from the p2p_tnp source. It's just a matter of comparing the location of the string to the decompiled binary to get the offsets. I've been able to do this for a few and can verify that they are indeed correct. Unfortunately I don't have a lot of extra time right now to do the full mapping.
abnormal_sound_enable
abnormal_sound_sensitivity
aec_key
alarm
alarm_day_ctx.day_count
alarm_day_ctx.time[i]
alarm_event_ctx.arr[i].duration
alarm_event_ctx.arr[i].start_time
alarm_event_ctx.arr[i].type
alarm_event_ctx.num
ap_enable
ap_tnp_did
api_server
auto_ota_enable
baby_cry_enable
check_net_disconnected
cloud_storage_enable
day_night_mode
debug_mode
did
dlproto
encode_mode
high_resolution
human_face_enable
human_motion_enable
hw_ver.hor
hw_ver.ptz_func
hw_ver.ver
hw_ver.white_led_close
in_packet_loss
init_finish
irlight_mode
is_sd_exist
is_xiaomirouter
key
language
lapse_video_enable
lapse_video_end_time
ldc_percent
light_mode
mac
mic_audio_enable
mic_volume
mirror
motion_detection_enable
motion_rect.bottom
motion_rect.left
motion_rect.mode
motion_rect.resolution
motion_rect.right
motion_rect.top
motion_sensitivity
out_packet_loss
p2p_viewing_cnt
p2pid
panorama_capture_count
panorama_capture_state
power_mode
pre_pwd
ptz_cruise_end_time
ptz_cruise_flag
ptz_cruise_mode
ptz_cruise_start_time
ptz_info[i].preset_enable
ptz_info[preset_id
ptz_motion_track_switch
ptz_panoramic_sleep
ptz_sleep
ptz_y_angle
pwd
record_mode
refresh_ping
region_id
sd_leftsize
sd_size
speak_mode
start_with_reset
systick
tf_status.stat
time_sync
tmp_pwd
tnp_info.tnp_did
tnp_info.tnp_init_string
tnp_info.tnp_license
ts
version
video_backup_info.backup_period
video_backup_info.enable
video_backup_info.extra_sd_cam_used_size
video_backup_info.extra_sd_free_size
video_backup_info.extra_sd_total_size
video_backup_info.resolution
video_backup_info.router_sd_cam_used_size
video_backup_info.router_sd_free_size
video_backup_info.router_sd_total_size
video_backup_info.user_path
video_occlusion
viewpoint_trace
voice_ctrl
water_mark_enable
white_led_mode
white_light_alarm_time
wifi_connected
wifi_mode

With all this info we should be able to have all the functionality available on the cloud app within the local web interface.

Oh yeah the camera also definitely uploads logs to China. That combined with the p2p vulnerabilities is a good idea to disable the cloud features.

Some define:
#define DISPATCH_SET_POWER_ON 0x74
#define DISPATCH_SET_POWER_OFF 0x75
#define DISPATCH_SET_LIGHT_ON 0x76
#define DISPATCH_SET_LIGHT_OFF 0x77
#define DISPATCH_SET_MOTION_RCD 0x78
#define DISPATCH_SET_ALWAYS_RCD 0x79
#define DISPATCH_SET_MIRROR_ON 0x7a
#define DISPATCH_SET_MIRROR_OFF 0x7b
#define DISPATCH_P2P_CONNECTTED 0xe1
#define DISPATCH_P2P_DISCONNECTTED 0xe2
#define DISPATCH_P2P_VIEWING 0xe3
#define DISPATCH_P2P_STOP_VIEWING 0xe4
#define DISPATCH_P2P_CLR_VIEWING 0xe5
#define DISPATCH_SET_TNP_INIT_STATUS 0x7f
#define DISPATCH_SET_TNP_WORK_MODE 0x80
#define DISPATCH_SYNC_INFO_FROM_SERVER 0x89
#define RMM_SET_MOTION_DETECT 0x1023
#define RMM_SET_DAY_NIGHT_MODE 0x1024
#define RMM_SET_MOTION_SENSITIVITY 0x1027
#define RMM_SET_LDC 0x1028
#define RMM_SET_BABY_CRY 0x1029
#define RMM_SET_MIC_VOLUME 0x102a
#define RMM_SET_ENCODE_MODE 0x1032
#define RMM_SET_HIGH_RESOLUTION 0x1033

I tried to send RMM_SET_ENCODE_MODE and it works:

value 1 = avc
value 2 = hevc

That's great, thanks! I just started mapping out mmap.info -- I copied it over to my dev machine and created a simple Python script to manually check the offsets.
import mmap

fd = open("./mmap.info", mode="r", encoding="utf8")

mmap_pointer = mmap.mmap(fd.fileno(), length=0, access=mmap.ACCESS_READ)

def read_offset(offset, bytes, is_int=False):
    mmap_pointer.seek(offset)
    val = mmap_pointer.read(bytes)

    if is_int:
        return int.from_bytes(val, "little")
    else:
        return val.decode()

                            # offset, bytes, is_int
MMAP_UUID =                 (0x230, 20, False)
MMAP_PASSWORD =             (0x50C, 15, False)  # Add '0' to get 16 character AES encryption key
MMAP_PROTOCOL =             (0x1CC, 4, False)
MMAP_ENCODE_TYPE =          (0x4E4, 1, True)
MMAP_KEY =                  (0x290, 16, False) # Used for p2p comms I believe
MMAP_DEBUG_MODE =           (0x86C, 1, True)
MMAP_POWER =                (0x5e0, 1, True) # ??
MMAP_IN_PACKET_L0SS =       (0x570, 4, True)
MMAP_OUT_PACKET_L0SS =      (0x574, 4, True)
MMAP_ABNORMAL_SOUND_EN =    (0x4d0, 1, True)
# MMAP_ABNORMAL_SOUND_SENS =  (0x4d4, 4, True) # Bytes?
# MMAP_BABY_CRY_EN =          (0x4c8, 1, True)

# MMAP_TEST =                 (0x580, 4, True)
# print("Testing...: ", read_offset(MMAP_TEST[0], MMAP_TEST[1], MMAP_TEST[2]))
# print(" ")

print("UUID: ", read_offset(MMAP_UUID[0], MMAP_UUID[1], MMAP_UUID[2]))
print("Password: ", read_offset(MMAP_PASSWORD[0], MMAP_PASSWORD[1], MMAP_PASSWORD[2]))
print("Protocol: ", read_offset(MMAP_PROTOCOL[0], MMAP_PROTOCOL[1], MMAP_PROTOCOL[2]))
print("Encode type: ", read_offset(MMAP_ENCODE_TYPE[0], MMAP_ENCODE_TYPE[1], MMAP_ENCODE_TYPE[2]))
print("Key: ", read_offset(MMAP_KEY[0], MMAP_KEY[1], MMAP_KEY[2]))
print("Debug mode: ", read_offset(MMAP_DEBUG_MODE[0], MMAP_DEBUG_MODE[1], MMAP_DEBUG_MODE[2]))
print("Power off?: ", read_offset(MMAP_POWER[0], MMAP_POWER[1], MMAP_POWER[2]))
print("In packet loss: ", read_offset(MMAP_IN_PACKET_L0SS[0], MMAP_IN_PACKET_L0SS[1], MMAP_IN_PACKET_L0SS[2]))
print("Out packet loss: ", read_offset(MMAP_OUT_PACKET_L0SS[0], MMAP_OUT_PACKET_L0SS[1], MMAP_OUT_PACKET_L0SS[2]))
print("Abnormal sound enable: ", read_offset(MMAP_ABNORMAL_SOUND_EN[0], MMAP_ABNORMAL_SOUND_EN[1], MMAP_ABNORMAL_SOUND_EN[2]))
# print("Abnormal sound sensitivity: ", read_offset(MMAP_ABNORMAL_SOUND_SENS[0], MMAP_ABNORMAL_SOUND_SENS[1], MMAP_ABNORMAL_SOUND_SENS[2]))
# print("Baby cry enable: ", read_offset(MMAP_BABY_CRY_EN[0], MMAP_BABY_CRY_EN[1], MMAP_BABY_CRY_EN[2]))

So far so good!  I'll keep updating this.

Also I found the source  for an older version of the app and between that and Ghidra I've figured out how to identify the video stream network traffic and the meanings of the packet headers (i-frame vs p-frame).
It generally sends an i-frame at the very beginning and then p-frames for the rest of the stream. Only the i-frame is encrypted but I know how to get the key from the camera (changes whenever p2p_tnp starts I believe) and I think I was able to decrypt one but I I have no way of verifying since I suck at h264 stuff and I would need to re-assemble the packets. I'll post some code later but it's fairly low priority for me right now. Also I think I should be able to figure out how to get it to start streaming the video without a client from the app.

There are several possible approaches to obtain the stream using the code you found.
1 - Create a client app that communicates with p2p_tnp like the android app.
2 - Read fshare_frame_buf using the same method used by p2p_tnp.
I tried to follow the 2nd way but I stopped because the intersting functions (fshare_set_read_pos, fshare_must_read, etc...) are not contained in p2p_tnp.c. They are probably contained inside a library statically linked (see -frameshare in the Makefile).

There are several possible approaches to obtain the stream using the code you found.
1 - Create a client app that communicates with p2p_tnp like the android app.
2 - Read fshare_frame_buf using the same method used by p2p_tnp.
I tried to follow the 2nd way but I stopped because the intersting functions (fshare_set_read_pos, fshare_must_read, etc...) are not contained in p2p_tnp.c. They are probably contained inside a library statically linked (see -frameshare in the Makefile).

I made good progress into figuring out those fshare_ functions by using the variable names from p2p_tnp.c and then following them through but it's hard without knowing all the data structures.  Option 1 might be the best for a high quality stream.
I also couldn't find the PPPP_API SDK, I don't think it's anywhere on the internet!
So I think I've finally decrypted the stream... Can you try to parse this and tell me if it's a valid start to an i-frame?
0001674d0014965405017bcb37010101020000000168ee3c80000000016588804000

SPS (67) and PPS (68) are ok.
IDR (65) starts correctly but it's truncated.

Great! Glad the decryption works. I think I'll hold off on posting the steps until we've figured out if we can get the stream going without the app or can't improve the frame_buf algorithm anymore just so the decryption knowledge isn't needlessly in the wild if we don't end up using it. Let me know if there any specifics that would be helpful at improving the frame_buf algorithm -- I've now become quite familiar with the disassembled code but I can only go so far since I don't know the technical aspects of the video stuff well.
Regarding the mmap.info work, I've figured out most of the useful offsets and also started porting the corresponding "p2p_set" functions. These functions send the commands then read mmap.info to verify that the change happened. This code should get us most of the way there but I haven't tested it because it's not yet done.
What needs to be done is replacing all the calls to "g_p2ptnp_info.mmap_info->" with a function call that includes the proper offset and number of bytes to read. For the strings I have the number of bytes in inline comments but for the rest it can be easily worked out from the offset values, especially if it's just an on/off flag. I've also included functions that load mmap.info and another that can read bytes from it (in theory, I haven't tested it).
Hopefully this is all helpful. I won't be able to work on this for a bit due to other commitments but I'll be keeping an eye on it.

cmd_srv.c.txt
cmd_srv.h.txt

Great! Glad the decryption works. I think I'll hold off on posting the steps until we've figured out if we can get the stream going without the app or can't improve the frame_buf algorithm anymore just so the decryption knowledge isn't needlessly in the wild if we don't end up using it. Let me know if there any specifics that would be helpful at improving the frame_buf algorithm -- I've now become quite familiar with the disassembled code but I can only go so far since I don't know the technical aspects of the video stuff well.

I have no ideas on how to improve decoding of the fshare_frame_buf file. I realize that the overall quality of the rtsp stream can be improved but it is not clear to me where the problem is.
If I extract the frames from the buffer and save them on a file I have no errors.

Regarding the mmap.info work, I've figured out most of the useful offsets and also started porting the corresponding "p2p_set" functions. These functions send the commands then read mmap.info to verify that the change happened. This code should get us most of the way there but I haven't tested it because it's not yet done.

I also tried to reverse the file and rewrote some code.
We should check if the file is the same for all models.

What needs to be done is replacing all the calls to "g_p2ptnp_info.mmap_info->" with a function call that includes the proper offset and number of bytes to read. For the strings I have the number of bytes in inline comments but for the rest it can be easily worked out from the offset values, especially if it's just an on/off flag. I've also included functions that load mmap.info and another that can read bytes from it (in theory, I haven't tested it).
Hopefully this is all helpful. I won't be able to work on this for a bit due to other commitments but I'll be keeping an eye on it.

I hope to have some time to work on it.

Do you know what's the meaning of set_motion_detect() and set_high_resolution()?

My first result of this study:
02 00 00 00 08 00 00 00 07 10 01 00 0C 00 00 00 2F 74 6D 70 2F 63 61 70 2E 6A 70 67

Take a snapshot in low res

Do you know what's the meaning of set_motion_detect() and set_high_resolution()?

set_motion_detect() sets the rectangular motion detection mask.  I attempted to recreate the struct. My current assumption based on variable names is:
left = top left x
top = top left y
right = bottom right x
bottom = bottom right y

I haven't had a chance to check with the app. I think set_high_resolution() is for changing the resolution of the streaming video.

My first results of this study.
1 - 02 00 00 00 08 00 00 00 07 10 01 00 0C 00 00 00 2F 74 6D 70 2F 63 61 70 2E 6A 70 67
 It takes a snapshot in low res
2 - 10 00 00 00 02 00 00 00 00 20 01 00 44 00 00 00 2F 74 6D 70 2F 63 61 70 2E 6D 70 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 AB 59 54 62
 It starts a 6s video capture. I don't know what's the meaning of the timestamp at the end of the message. Changing 00 20 with 01 20 at offset 8 the video lasts 10s.

This is great! How did you capture the messages?
I was able to find the receiving function for that second message in mp4record.c (which is id 0x10). The name is RCD_START_SHORT_VIDEO and
0x2000 = 6 seconds
0x2001 = 10 seconds
0x2002 = 15 seconds

It didn't seem to use any other data from the message.

I haven't had a chance to check with the app. I think set_high_resolution() is for changing the resolution of the streaming video.

I tried to send this command but nothing has changed.

This is great! How did you capture the messages?

I didn't capture it, I reversed cloud application.
See cloud_make_video() and cloud_cap_pic() functions.
I'm not sure, but probably these are the constants:
#define MID_RMM 0x2
#define MID_DISPATCH 0x4
#define MID_RCD 0x10

#define RMM_START_CAPTURE 0x1007
#define RCD_START_SHORT_VIDEO 0x2000
#define RCD_START_SHORT_VIDEO_10S 0x2001
#define RCD_START_VOICECMD_VIDEO 0x2002
#define RCD_START_SHORT_FACE_VIDEO 0x2003
#define RCD_START_SHORT_HUMAN_VIDEO 0x2004

typedef enum
{
    E_NORMAL_TYPE = 0,
    E_FACE_TYPE,
    E_HUMAN_TYPE,
    E_BUTT
} e_short_video_type;

p2p_tnp.c is #define MID_P2P 0x8 I believe.

Unfortunately I was unable to create a file in high quality.
Neither image nor video.

Okay, that makes sense since it only uses these to send to the app so they save on bandwidth.

I can confirm set_motion_detect() struct:
typedef struct
{
    int mode;
    int resolution;
    short left;
    short top;
    short right;
    short bottom;
} motion_rect_t;

But it's based on the real resolution of the sensor: 1280x720.
Example in hex: 0100 0000 0500 0000 0000 0000 0005 d002

I can confirm set_motion_detect() struct:

That's great - good to know.
I've figured out how to put it into factory mode. I copied /tmp/wpa_supplicant.conf to /tmp/sd/Factory/wpa_supplicant.conf. I then restarted p2p_tnp by killing it and letting the watchdog restart it. This disabled the outgoing connection and made the camera fully local - the app sees it as offline.

By looking at the code this also disables the encryption on the video stream. I'm sure there other things it does but I haven't explored it much. I also have not rebooted the camera with that file in place so no idea what happens then.

Interesting.


main

pydantic updated to v2.3.0
fixed 'allow_mutation' attribute

Thank you for submitting this pull request! We appreciate you spending the time to work on these changes.
What is the motivation?
I'm developing a Telegram Bot using<EMAIL_ADDRESS>which depends on<EMAIL_ADDRESS>so I decided to update surrealdb.py.
Type of Change

[x] 📚 Examples / docs / tutorials / dependencies update
[x] 🔧 Bug fix (non-breaking change which fixes an issue)
[ ] 🥂 Improvement (non-breaking change which improves an existing feature)
[ ] 🚀 New feature (non-breaking change which adds functionality)
[ ] 💥 Breaking change (fix or feature that would cause existing functionality to change)
[ ] 🔐 Security fix

What does this change do?
Migration to pydantic v2.
What is your testing strategy?
Building my bot.
Is this related to any issues?
No.
Have you read the Contributing Guidelines?

[x] I have read the Contributing Guidelines

Closing this as #66  has been merged


Implement a method which computes .NET tensor from NDArray

I was thinking that it could be very beneficial to create a method "ToDotNetArray" which convert the 1D NDArray to a jagged array in .NET World.

Name --> ToDotNetArray
Input --> nothing
output --> dynamic

The reason for this is "better integration of NumSharp for other .NET packages". So no Numpy based reason for implementation.

Agree with you.

ok will do ;)

Why not use public T[] ToDotNetArray<T[]>() for 1-d, public T[][] ToDotNetArray<T[][]>() for 2-d?

adapted the interfaces (input parameter and output value).
Used Jagged Arrays because this is the more general array and better performance.
Anyway still not general enough - so keep issue open ;)

These methods already exist and were rewritten by me.


Fix record extractor when ByteBuffer can be reused

Some record reader implementation might reuse the ByteBuffer (e.g. parquet-avro 0.10.0). Make a slice before reading to ensure nothing is modified in the original buffer

Codecov Report

Merging #9549 (ac7cb8c) into master (1c202c7) will decrease coverage by 47.18%.
The diff coverage is 0.00%.

:exclamation: Current head ac7cb8c differs from pull request most recent head 13deab0. Consider uploading reports for the commit 13deab0 to get more accurate results

@@              Coverage Diff              @@
##             master    #9549       +/-   ##
=============================================
- Coverage     62.86%   15.67%   -47.19%
+ Complexity     5073      174     -4899
=============================================
  Files          1917     1876       -41
  Lines        102523   100535     -1988
  Branches      15561    15324      -237
=============================================
- Hits          64449    15759    -48690
- Misses        33257    83589    +50332
+ Partials       4817     1187     -3630

Flag
Coverage Δ

integration1
?

integration2
?

unittests1
?

unittests2
15.67% <0.00%> (?)

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

 Learn more


Use param hooks allow specifying history update type on set

useQueryParam or usePathParam hooks when setting the param, the update type (push or update, default: push) can be set to specify the how history is updated.

Looks good, can we update also the docs, adding this bits of API? Also can you update the flow types (index.flow)?

Looks good to me, if you can update the flow types then we can get this in

Looks good @billyjs. I'm thinking a config object as the second param would make more sense but it also feels like overarching for a simple case that might never need to be extended again.
Eg.
const [param, setParam] = useQueryParam('abc');

setParam('hello', { method: 'PUSH' });

Config object can be
type config = {
 method: 'PUSH' | 'REPLACE'
}

But if we think deeply about it, this definitely seems like over-complicating a simple case. Just leaving my thoughts here for feedback from other maintainers. @albertogasparin @jackbrown

@flexdinesh I don't think this is necessary for now as we are only planning to add the single argument. We can always extend the API in future if we feel there are more arguments required

Can we resolve the conflicts and get this in today?


Typo

I hesitate to suggest a change here, but there's an input variable "ommit_computed_cols" which should likely be "omit" with a single "m".  Not sure I'd change it, as it's likely used by somebody?

That's annoyed me for years 😄 Have added new params and deprecated the old ones in #111


Add sumneko/lua-language-server

Added packages:

sumneko/lua-language-server

Thank you for your contribution.

Internally, aqua executes lua-language-server on the current directory by the absolute path $(aqua which lua-language-server<EMAIL_ADDRESS>In the above case,
/Users/shunsuke-suzuki/.local/share/aquaproj-aqua/pkgs/github_release/github.com/sumneko/lua-language-server/3.0.2/lua-language-server-3.0.2-darwin-x64.tar.gz/bin/lua-language-server $@

Hmm, lua-language-server managed by aqua works well on my environment, but there may be some problem I don't know.

In my understood, It is for logging that why lua-language-server requires such thing. The log files have been created in $(basename $(aqua which lua-language-server)/../log, so probably there is no problem.

$ rm /Users/shunsuke-suzuki/.local/share/aquaproj-aqua/pkgs/github_release/github.com/sumneko/lua-language-server/3.0.2/lua-language-server-3.0.2-darwin-x64.tar.gz/log/service.log
$ lua-language-server --version
3.0.2
$ ls /Users/shunsuke-suzuki/.local/share/aquaproj-aqua/pkgs/github_release/github.com/sumneko/lua-language-server/3.0.2/lua-language-server-3.0.2-darwin-x64.tar.gz/log
service.log  token

service.log was created properly.

I see. Thank you for your explanation.

Released. https://github.com/aquaproj/aqua-registry/releases/tag/v2.5.0


add tap-postgres to the Meltano UI

Migrated from GitLab: https://gitlab.com/meltano/meltano/-/issues/877
Originally created by @dmor on 2019-08-14 15:52:41

When I follow this tutorial, I have to do everything on the command line
https://www.meltano.com/docs/tutorial.html#advanced-using-tap-postgres-with-meltano

[ ] We claim this "is not supported" but have it in our docs, which is confusing
[ ] We need to add tap-postgres to the UI

View 2 previous comments from the original issue on GitLab


Add prober README

Add a doc under https://github.com/abcxyz/jvs/tree/main/prober to describe how it works

fixed by https://github.com/abcxyz/jvs/pull/260


Function that exports emoji throws TypeError on npm run build

I have used the open-wc project generator to create a project using lit (with npm init @open-wc).
Everything was woking great, until i created a function that returns a random emoji from an emojis array.
When i had this function on the component file, it worked well.
I moved this function to an extra file, where i export it, and now when i run npm run start i get a TypeError: A.charCodeAt is not a function Error.
Expected behavior
I expected moving the  function to an extra file wouldn't break starting up the server
Actual Behavior
After i moved the function to its own file and import it on my component i get a TypeError: A.charCodeAt is not a function Error:

Additional context
this is the function i have on the getRandomEmoji.jsfile:
export function getRandomEmoji() {
  const emojis = ['🚀', '📦', '🧪'];
  return emojis[Math.floor(Math.random() * emojis.length)];
}

i import it on my component like this:
import { getRandomEmoji } from '../../helpers/getRandomEmoji.js';

and then i use it like this:
<i class="stage__empty-emoji">${getRandomEmoji()}</i>

Packages and dependencies
"devDependencies": {
    "@open-wc/building-rollup": "^1.10.0",
    "@open-wc/eslint-config": "^4.3.0",
    "@open-wc/testing": "^2.5.33",
    "@web/dev-server": "^0.1.18",
    "@web/test-runner": "^0.12.20",
    "deepmerge": "^4.2.2",
    "eslint": "^7.30.0",
    "eslint-config-prettier": "^7.2.0",
    "husky": "^4.3.8",
    "lint-staged": "^10.5.4",
    "prettier": "^2.2.1",
    "rimraf": "^3.0.2",
    "rollup": "^2.53.0",
    "rollup-plugin-copy": "^3.4.0"
  }

and
  "dependencies": {
    "lit": "*"
  }

Things i have tried
If i change the emojis array into a strings array (for instance const emojis = ['a', 'b', 'b'];) then it works.
So i wonder if this is some kind of encoding problem, and if i can change something on the server config to fix the problem...?!

hmmm potentially an encoding problem in es module lexer... but yeah @web/dev-server-core uses quite an old version of https://github.com/guybedford/es-module-lexer...
maybe you can try the latest version of es module lexer? (hack it somehow - easiest is usually copying over the latest code in your node_modules)
if that works then a PR to update it in dev-server-core would be nice 🤗

good idea. i tried using the latest es-module-lexer (0.7.1), but i still get the same error on npm run start

maybe raise an issue with es module lexer? including a reproduction always helps 🤗

yes, i'll do that. thank you!


Lspsaga finder (ref & implementation) --> Empty Window

Describe the bug
When I try to use the finder function like this:
:Lspsaga finder
I get an empty Floating Window as shown in the image below (Left side).

Any idea why that is?
Steps to reproduce
Link to my config:
https://github.com/MrWelsch/nvim
Plugin is configured in: /lua/lsp/lspsaga.lua
Keybind to call the finder function: /lua/general/mappings.lua
Expected behavior
Showing me references or implementations inside the floating window when the keybind is pressed or the command is entered.
Neovim version (nvim -v)
0.9.1
lspsaga commit
2fea9e5
Terminal name/version
kitty / 0.29.1

:message does there has finder print ? i can't reproduce it works fine always ..

This is a screenshot when using :message.

I also tried it on another file, specifically the /lua/lsp/handlers.
Line 74: lsp_highlight_document(client)
Expected behavior: As shown in the image below: :NiceReference (Another Plugin which i wanted to replace with Lspsaga)

Definition works as expected:

Everything else works as well. e.g. Code Actions:

could you try the min config like  nvim --clean -u min.lua
vim.opt.rtp:append '~/workspace/nvim-lspconfig'
local lspconfig = require 'lspconfig'
lspconfig.lua_ls.setup {}
vim.opt.rtp:append '~/workspace/lspsaga.nvim'
require('lspsaga').setup {}
vim.keymap.set('n',  'gh', '<cmd>Lspsaga finder<CR>')

Thank you for your time.
Doesn't seem to work for me or something intereferes.
Sadly I do not have the time doe fiddle with it, especially since the alternative works seemlessly.


Disable pushtarget preference, hardcode to Kube

Signed-off-by: John Collier<EMAIL_ADDRESS>What type of PR is this?
/kind deprecation
/kind cleanup
What does does this PR do / why we need it:
As discussed on today's odo contribtor's call, we decided to disable the pushtarget preference for the v2 release of odo, and hardcode any values for it to Kube. After the v2 release, we may look at removing the Docker support in odo entirely.
This PR disables the pushtarget preference in odo (but does not remove it), preventing users from setting values for it. The pushtarget.IsPushTargetDocker() function, which we use to determine the pushtarget throuoghout odo), is now hardcoded to return false as well.
Which issue(s) this PR fixes:
Fixes https://github.com/openshift/odo/issues/3955
PR acceptance criteria:

[x] Unit test

[ ] Integration test

[ ] Documentation

[x] I have read the test guidelines

How to test changes / Special notes to the reviewer:
Documentation changes will be handled via https://github.com/openshift/odo/pull/3954

/hold
https://github.com/openshift/odo/issues/3955#issuecomment-692792113

so can we close this PR while we finalise on this decision?

Closing til we decide what to do, will re-open if needed


no-extraneous-dependencies: use case missing?

Let's say you have a project that publishes with no public dependencies, but you do use some... however, you bundle them with bundledDependencies and specify them in devDependencies. How could import/no-extraneous-dependencies be configured to show an error if you reference a dependency that is not in the set of dependencies | bundledDependencies?

The rule supports bundledDependencies, so you'd configure it with { dependencies: false, bundledDependencies: true, devDependencies: true }.

ah, I will try that. Thanks!


🚧Exchange preview label for label link

I have done the items below . . .

[X] I have updated the title without removing the 🚧 emoji.

Description
Currently, in the preview feature pr template, the todo checkbox that explains to add a preview label uses an image to some github user content for the project, instead of using a direct ref link to the label.
Change this to use the ref link.
Refer To Image Below:

Acceptance Criteria
This issue is finished when:

[ ] Preview label link exchanged for label link

ToDo Items

[X] Priority label added to this issue.  Refer to the Priority Type Labels section below.
[X] Change type labels added to this issue.  Refer to the Change Type Labels section below.
[X] Issue linked to the correct project.
[X] Issue linked to the correct milestone.
[ ] Draft pull request created and linked to this issue.

Issue Dependencies
No response
Related Work
No response
Additional Information:
Change Type Labels

Change Type
Label

Bug Fixes
https://github.com/KinsonDigital/Velaptor/labels/🐛bug

Breaking Changes
https://github.com/KinsonDigital/Velaptor/labels/💣breaking changes

Enhancement
https://github.com/KinsonDigital/Velaptor/labels/enhancement

Workflow Changes
https://github.com/KinsonDigital/Velaptor/labels/workflow

Code Doc Changes
https://github.com/KinsonDigital/Velaptor/labels/📑documentation%2Fcode

Product Doc Changes
https://github.com/KinsonDigital/Velaptor/labels/📝documentation%2Fproduct

Priority Type Labels

Priority Type
Label

Low Priority
https://github.com/KinsonDigital/Velaptor/labels/low priority

Medium Priority
https://github.com/KinsonDigital/Velaptor/labels/medium priority

High Priority
https://github.com/KinsonDigital/Velaptor/labels/high priority

Code of Conduct

[X] I agree to follow this project's Code of Conduct.

@Kshitiz-Mhto Yes,  that will work perfectly.

@Kshitiz-Mhto Have you already created a pull request?  I clicked the hash just above and it shows me some commits or code changes that you have made but I don't see a PR made in my project.

@Kshitiz-Mhto
I can see your branch and code change on that branch just fine in your fork.   I do not see any open pull requests for this issue.
Here is what I am currently seeing for open pull requests for Velaptor.

Closed without merging
Reason: The direction the organization has taken to deal with ISSUE and PR templates has shifted.  This is no longer needed due to the templates being managed at the organization level.


support push docker images for multi architectures

What would you like to be added/modified:
In order to use one deployment config to deploy edgemsh-agent in different arcarchitectures, we should use docker buildx push https://yeasy.gitbook.io/docker_practice/buildx/multi-arch-images
Why is this needed:

/close


Set variables in conditions to use in actions

Hey everyone,
In Drools we can set variables in conditions to use before, like that:
when
   user: user()
   user.age > 18
then
   user.setAsAccepted()

I know that I can do that passing into facts, but I think that it's not so hard to implement, and it will be very useful to create more dynamic rules.
I really appreciate if someone has an opinion about it.

Any update on this?

@brunofrank There is no current plan to add variables as I see no added value here. I'm closing this issue for now but feel free to add comments if necessary.
Thank you for opening this issue anyway!

Hi @benas
I am also facing the same problem. I try to use value of fact in actions
Example :
[ {         "name" : "high temperature alert",         "description" : "The ambient temperature should always be maintained below 30 degree Celsius",         "priority" : 2,         "condition" : "value > 30",         "actions" : [ "AddNotification(value);" ] }]

@DrAyoub This is not a problem. Take a look at this discussion on gitter where you can find an example of how to do that.

Thank you @benas  for your quick reply,
I have read the discussion. In discussion, I found "facts.get('foo')" which does not solve my problem. Because I am using kafka stream, I receive thousands of messages per second, each received message I take value from it and put it in facts, so if I use "actions" : [ "AddNotification(facts.get('value'));" ] maybe when the action executed take the value of the following message.
In my use case, I have to use the actual fact value that verified the condition.

Well, that cannot happen since the call to the rules engine is blocking. If for each event you add the value to the facts then call the rules engine with these facts, then the listener will add/remove the fact immediately before/after rule executions (and this is a blocking call). So I see no way how facts can overlap.
That said, I don't know what is your experience with this (interesting!) use case, but IMO calling a blocking code (the rules engine in this case) for each event on a stream is not appropriate. I think a non-blocking reactive stream library is more appropriate (to handle back pressure, non blocking IO, etc).

I think you are right. In case of blocking call, the facts can't overlap. I'm really confused between still working with easy-rules or search another alternative.


Fix description of download-file macro

Signed-off-by: Mesbah<EMAIL_ADDRESS>

Tested with :  https://urv-jenkins.canlab.ibm.com:9095/view/SV_Tests/job/test.personal/179/console


Add Docker support

This PR adds a Dockerfile and a reference to a built Docker image in Docker Hub.
Feel free to move the docker image to another user.

Docker image is out of project scope.


Updating Defender for SQL alerts

Updating Defender for SQL alerts:

Adding Synapse.SqlPool as supported database type.
removing unsafe action and data exfiltration to abnormal location.
Adding external source execution anomaly and obfuscation anomaly.
General description improvements.

Learn Build status updates of commit 15ec611:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

articles/defender-for-cloud/alerts-reference.md
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching the learn.microsoft.com contributor guidesPost your question in the Learn support channel

@microsoft-github-policy-service agree [company="{Microsoft}"]

@microsoft-github-policy-service agree company="your company"

@microsoft-github-policy-service agree company="Microsoft"

@bmansheim
Can you review the proposed changes? IMPORTANT: When the changes are ready for publication, add a #sign-off comment to signal that the PR is ready for the review team to merge.
#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team


move examples out of src

Basic reorganisation so examples aren't in the source of the code

Codecov Report

Merging #110 (2b40b23) into main (7e8b755) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #110   +/-   ##
=======================================
  Coverage   80.81%   80.81%
=======================================
  Files          12       12
  Lines         318      318
=======================================
  Hits          257      257
  Misses         61       61

Continue to review full report at Codecov.

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


Replicates psispace in rust

Replicates psispace-sys in rust
Implements table.erase
Adds number of secondary keys in the Table trait (to optimize erase operation)
General improvements on the election service (now it supports current time and serves the simple ui)
Improves table interface adding the methods: new(), with_service() and with_prefix()

I'm merging but I can address above comments in a next PR.


Spot Fleet doesn't work as expected

Describe the bug
I list multiple EC2 instance types for Spot Fleet workers, but only one instance type used to generate spot requests. The spot request type is "instance" but I believe it should be of "fleet" type to be able to request multiple instance types. I've tried with docker_machine_version = "0.16.2-gitlab.19-cki.2" and 0.16.2-gitlab.19-cki.4 - same result.
To Reproduce
Configure the module similar to Scenario: Use of Spot Fleet from documentation, specify several instance types. Observe the same instance type launched for all jobs.
Expected behavior
AWS spot requests created should be of "fleet" type with multiple EC2 instance types.
Configuration used

My terraform config
terraform:
module "gitlab-runner" {
  source = "npalm/gitlab-runner/aws"
  version = "v7.3.1"
  environment = var.gitlab_environment
  vpc_id                   = var.aws_vpc_id
  subnet_id                = element(var.aws_private_subnets, 0)

  runner_cloudwatch = {
    enable = true
    retention_days = 60
  }

  runner_gitlab = {
    url = var.gitlab_url
  }

  runner_gitlab_registration_config = {
    registration_token = var.gitlab_registration_token
    tag_list           = var.gitlab_tags
    description        = var.runners_description
    locked_to_project  = "true"
    run_untagged       = "false"
    maximum_timeout    = "7200"
  }

  runner_instance = {
    name = var.runners_name
    type = "t3a.large"
    ssm_access = true
    root_device_config = {
      volume_size = 50 # GiB
    }
  }

  runner_install = {
    amazon_ecr_credential_helper = true
    docker_machine_version = "0.16.2-gitlab.19-cki.2"
  }

  runner_worker = {
    type = "docker+machine"
    ssm_access = true
  }

  runner_worker_docker_machine_fleet = {
    enable = true
  }

  runner_worker_docker_machine_instance = {
    types = ["t3a.large", "t3.large", "m5a.large", "m5.large", "m6a.large"]
    subnet_ids = var.aws_private_subnets
    start_script = file("${path.module}/worker_userdata.sh")
    volume_type = "gp3"
    root_size = 50
  }

  runner_worker_docker_options = {
    privileged = true
    volumes = [
      "/var/run/docker.sock:/var/run/docker.sock",
      "/gitlab-runner/docker:/root/.docker",
      "/gitlab-runner/ssh:/root/.ssh:ro",
      "/root/.pypirc:/root/.pypirc",
      "/root/.npmrc:/root/.npmrc"
    ]
  }
}

Hello @Leonidimus
I understand what you are asking, but this is not how this module works.
Let me explain.
If you want to see what the code do, you can check in your CloudTrail > Event history and look for CreateFleet events.
You will see something like this:
    "eventTime": "2024-03-13T18:50:12Z",
    "eventSource": "ec2.amazonaws.com",
    "eventName": "CreateFleet",
    "awsRegion": "eu-west-3",
    "sourceIPAddress": ""***********:",
    "userAgent": "aws-sdk-go/1.44.153 (go1.12.9; linux; amd64)",
    "requestParameters": {
        "CreateFleetRequest": {
            "TargetCapacitySpecification": {
                "DefaultTargetCapacityType": "spot",
                "TotalTargetCapacity": 1
            },
            "Type": "instant",
            "SpotOptions": {
                "AllocationStrategy": "price-capacity-optimized",
                "MaxTotalPrice": "0.50"
            },

The important part is "TotalTargetCapacity": 1 and "Type": "instant".
It means that you want 1 instance, and the Fleet is destroyed after the instance is created.
"AllocationStrategy": "price-capacity-optimized" means that you want the best price with the best capacity.
In the launchTemplate configuration, you will see your choice of instance types:
"LaunchTemplateConfigs": {
                "LaunchTemplateSpecification": {
                    "LaunchTemplateName": "gitlab-runner-dev-shr-small-ai-worker-20230510162620868300000001",
                    "Version": "$Latest"
                },
                "Overrides": [
                    {
                        "tag": 1,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "t3a.medium"
                    },
                    {
                        "tag": 2,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "t3a.medium"
                    },
                    {
                        "tag": 3,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "t3a.medium"
                    },
                    {
                        "tag": 4,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "t3.medium"
                    },
                    {
                        "tag": 5,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "t3.medium"
                    },
                    {
                        "tag": 6,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "t3.medium"
                    },
                    {
                        "tag": 7,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "c5a.large"
                    },
                    {
                        "tag": 8,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "c5a.large"
                    },
                    {
                        "tag": 9,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "c5a.large"
                    },
                    {
                        "tag": 10,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "t3.large"
                    },
                    {
                        "tag": 11,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "t3.large"
                    },
                    {
                        "tag": 12,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "t3.large"
                    },
                    {
                        "tag": 13,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "c6a.large"
                    },
                    {
                        "tag": 14,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "c6a.large"
                    },
                    {
                        "tag": 15,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "c6a.large"
                    },
                    {
                        "tag": 16,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "c5d.large"
                    },
                    {
                        "tag": 17,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "c5d.large"
                    },
                    {
                        "tag": 18,
                        "SubnetId": "subnet-"***********:",
                        "InstanceType": "c5d.large"
                    }
                ],

In my configuration we use 6 different types of instances, in 3 AZs.
The Fleet will always launch the same kind of instances, because it thinks it's the best right know in term of price and capacity. If the capacity is low, it will switch automatically the type or AZ while launching the next docker+machine requested.
This is NOT perfect, because I am sure you may want to spread the instances right from the start with multiple types, to reduce the chance of multiple instances being retaken at the same time. Unfortunately, this is not how the software was developed, and we are limited by the VERY OLD and deprecated docker+machine code base :-) .
In any way, we use this features for our production runner fleet, launching 10k+ jobs per day for over 200+ developers, and this is running like a charm on eu-west-3, with very few availability incidents.
Best regards,
Do not hesitate if you have any additional questions.
You may also want to improve cki codebase if you have some ideas, I will be very happy to test any new release in our setup.

@Tiduster Thanks for explaining that.


[AutoPR machinelearning/resource-manager] Add an Operations API for Commitment Plan RP

Created to sync https://github.com/Azure/azure-rest-api-specs/pull/5222

This PR has been merged into https://github.com/Azure/azure-sdk-for-go/pull/4117


Add option to auto match height for Quest Tracker

Add configuration option that allows Quest Tracker to match content height with a limit of the space left to the bottom of the page. This should not affect the width that was set by a user.
If you set it up to if would be nice to have Quest Tracker auto-adjust to the quests that it is displaying to prevent big gray opaque space or hiding quests because of scroll bar.
Hidden feature: enable "auto-adjust" when double clicking the resize handle. Disable it when user manually resized something or double clicks again.
Example:
Basic view:

What's left after you remove/hide one of the quests:

How should it be displayed (height should be automatically adjusted, ignore different width it wasn't an intended change)

It should behave in similar way when new quests shows up - the tracker should expand.

Hi @happy-cujo. Thanks for checking out the RC1 / release candidate. You have the module setting "Quest Tracker Resizable" set to true. Unselect it like below and the Quest Tracker auto-resizes.

Oh, silly me. That's awesome! So this can be closed then.

Also if you want to easily switch between resizable and auto there is a macro you can drop into the hotbar in the player macros.


Getting a runtime error inside the QuotationCompiler library...

Getting the following exception at runtime:
'System.Reflection.TargetException' occurred in mscorlib.dll
Additional information: Object does not match target type.

It is failing in util.fs here:
let uci,_ = FSharpValue.GetUnionFields(dummy, propertyInfo.DeclaringType, true)
It is also failing on the first (of many) expression that it has to compile.
Naturally I am looking at what could be wrong with the expression but what makes me post an issue is that I am able to run through and compile the same expression with QuotationEvaluator (without any error).
What should I be on the lookout for?

On Thu, 2 Jul 2015 at 12:13 Sam Isaacson<EMAIL_ADDRESS>wrote:

Getting the following exception at runtime:
'System.Reflection.TargetException' occurred in mscorlib.dll
Additional information: Object does not match target type.
It is failing in util.fs here:
let uci,_ = FSharpValue.GetUnionFields(dummy, propertyInfo.DeclaringType,
true)
It is also failing on the first (of many) expression that it has to
compile.
Naturally I am looking at what could be wrong with the expression but what
makes me post an issue is that I am able to run through and compile the
same expression with QuotationEvaluator (without any error).
What should I be on the lookout for?

(1)
The expression is: <@ sl.ToScalar @>
[this is inside a function which resolves to Expr]
(2)
The `ToScalar` is a property on a type with the following code:
member this.ToScalar =
        match this with
        | FloatLiteral f -> f |> Float
...etc...

(3)
And the expression inside QuotationCompiler UnionCasePropertyGet active pattern when it fails is:
expr = {PropertyGet (Some (ValueWithName (FloatLiteral 900.0, sl)), ToScalar, [])}

In VS2015 I suppose?
On Thu, 2 Jul 2015 at 12:40 Sam Isaacson<EMAIL_ADDRESS>wrote:

(1)
The expression is: <@ sl.ToScalar @>
[this is inside a function which resolves to Expr]
(2)
The ToScalar is a property on a type with the following code:
member this.ToScalar =
match this with
| FloatLiteral f -> f |> Float
...etc...
(3)
And the expression inside QuotationCompiler UnionCasePropertyGet active
pattern when it fails is:
expr = {PropertyGet (Some (ValueWithName (FloatLiteral 900.0, sl)),
ToScalar, [])}
—
Reply to this email directly or view it on GitHub
https://github.com/eiriktsarpalis/QuotationCompiler/issues/5#issuecomment-117979347
.

:-)
Yes.
Interestingly I put together a little self-contained Console App test to try and replicate the issue but it fails (on the compile step) for a different reason:
type ScalarLiteral =
    | Float of float
    | Int of int
    with

    member this.StringIt =
        match this with
        | Float f -> f.ToString()
        | Int i -> i.ToString()

[<EntryPoint>]
let main argv =

    // works fine
    let sqrtExpr = (*TestFunction.GetReflectedDefinition*) <@ TestFunction.sqrt @>
    let f = QuotationCompiler.QuotationCompiler.Eval sqrtExpr
    printfn "%f" (f 9.0)

    // just a check
    let a = 9.0 |> Float
    let testResult = a.StringIt
    printfn "%s" testResult

    let expr1 = <@ a.StringIt @>    // fine
    let f1 = QuotationCompiler.QuotationCompiler.Eval expr1 // BOMBS
    printfn "%s" f1

    System.Console.ReadLine() |> ignore
    0 // return an integer exit code

This time the error is:

An unhandled exception of type 'System.MemberAccessException' occurred in mscorlib.dll

Additional information: Cannot create an abstract class.

Are there maybe a bunch of unit tests I could run within the master version of the QuotationCompiler solution to see if it is working as expected on VS 2015, given that you seem concerned about this aspect ?

I have a suggestion for what may be wrong in the production example I started this issue with:
expr = {PropertyGet (Some (ValueWithName (FloatLiteral 900.0, sl)), ToScalar, [])}

From a little internet searching it seems that ValueWithName is a new concept in the Quotations.Expr library. Perhaps it can't find anything to match this with in your convertExprToAst function because it's new and you haven't added it yet?
It is instead trying to match it with UnionCasePropertyGet which doesn't seem to be the right construct here?

Possibly. There's also a bug that I could reproduce in VS2013.
For now, given that VS 2015 is prerelease and FSCS is still on the F# 3.1
codebase, I will only be supporting VS 2013.
On Thu, 2 Jul 2015 at 14:22 Sam Isaacson<EMAIL_ADDRESS>wrote:

I have a suggestion for what may be wrong in the production example I
started this issue with:
expr = {PropertyGet (Some (ValueWithName (FloatLiteral 900.0, sl)), ToScalar, [])}
From a little internet searching it seems that ValueWithName is a new
concept in the Quotations.Expr library. Perhaps it can't find anything to
match this with in your convertExprToAst function because it's new and
you haven't added it yet?
It is instead trying to match it with UnionCasePropertyGet which doesn't
seem to be the right construct here?
—
Reply to this email directly or view it on GitHub
https://github.com/eiriktsarpalis/QuotationCompiler/issues/5#issuecomment-118003876
.

Which was the reproducible bug?

Same as yours. It's been fixed in 0.0.2.
On Thu, 2 Jul 2015 at 14:47 Sam Isaacson<EMAIL_ADDRESS>wrote:

Which was the reproducible bug?
—
Reply to this email directly or view it on GitHub
https://github.com/eiriktsarpalis/QuotationCompiler/issues/5#issuecomment-118007000
.

Managed (with some assistance) to get it working with the following modification to the code:
                //let dummy = System.Runtime.Serialization.FormatterServices.GetUninitializedObject propertyInfo.DeclaringType
                //let uci,_ = FSharpValue.GetUnionFields(dummy, propertyInfo.DeclaringType, true)
                let unioncases = FSharpType.GetUnionCases(propertyInfo.DeclaringType)
                let uci = unioncases |> Seq.head

From what I can see, nothing to do with VS2015.
In the master code it looks like the dummy instance created is not quite what is needed. Per my above example it is giving back the ScalarLiteral (the union type) instead of ScalarLiteral.Float (the type of the case you want).
Looking at your NUnit testing I would assume that this permutation is missed because none of the test types have properties on them that you are trying to get. [This all starts with a PropertyGet]

This is wrong, it will fail if you try using the second union case. Try
syncing with the github repo, code has been changed.
On Thu, 2 Jul 2015 at 17:19 Sam Isaacson<EMAIL_ADDRESS>wrote:

Managed (with some assistance) to get it working with the following
modification to the code:
            //let dummy = System.Runtime.Serialization.FormatterServices.GetUninitializedObject propertyInfo.DeclaringType
            //let uci,_ = FSharpValue.GetUnionFields(dummy, propertyInfo.DeclaringType, true)
            let unioncases = FSharpType.GetUnionCases(propertyInfo.DeclaringType)
            let uci = unioncases |> Seq.head

From what I can see, nothing to do with VS2015.
In the master code it looks like the dummy instance created is not quite
what is needed. Per my above example it is giving back the ScalarLiteral
(the union type) instead of ScalarLiteral.Float (the type of the case you
want).
Looking at your NUnit testing I would assume that this permutation is
missed because none of the test types have properties on them that you are
trying to get. [This all starts with a PropertyGet]
—
Reply to this email directly or view it on GitHub
https://github.com/eiriktsarpalis/QuotationCompiler/issues/5#issuecomment-118048047
.

The last change of GitHub repo I can see was 2 days ago and that is the version I was working with. Did you push this change to GitHub?

Oops, no. Just updated the nuget package.
On Thu, 2 Jul 2015 at 17:28 Sam Isaacson<EMAIL_ADDRESS>wrote:

The last change of GitHub repo I can see was 2 days ago and that is the
version I was working with. Did you push this change to GitHub?
—
Reply to this email directly or view it on GitHub
https://github.com/eiriktsarpalis/QuotationCompiler/issues/5#issuecomment-118050216
.

No worries.

Pulled the latest version off GitHub and recompiled - still getting the same error as before.
In particular, looking at your code in util.fs for the UnionCasePropertyGet active pattern; I cannot see how the dummy variable could possibly work for a general Union and I put together a script to verify this. I ran the script in both F#3.1 and F#4.0 REPL to check.
fsharp

type Union1 =
    | Red
    | Green
    | Blue

// runs fine yields the first case
let dummy1 = System.Runtime.Serialization.FormatterServices.GetUninitializedObject typeof<Union1>

type Union2 =
    | Red of int
    | Green of float
    | Blue of string

// crashes with "Cannot create an abstract class..."
let dummy2 = System.Runtime.Serialization.FormatterServices.GetUninitializedObject typeof<Union2>

type Union3 =
    | Red of int
    | Green of float
    | Blue of string
    with
    member this.DoSomething =
        match this with
        | Red _ -> "hello"
        | _ -> "goodbye"

type Union4 =
    | Red of int
    | Green of float
    | Blue of string
    with
    member this.Convert =
        match this with
        | Red _ -> Union1.Red
        | _ -> Union1.Green

let v = Union4.Red 1
let expr1 = <@ v.Convert @>
let pInfo = typeof<Union4>.GetProperty("Convert")

// // crashes with "could not create an abstract class"
let dummy = System.Runtime.Serialization.FormatterServices.GetUninitializedObject pInfo.DeclaringType

The fix I pushed addresses exactly this issue, i.e. quotations referencing
user-defined union properties. So all the cases that you describe are not
valid as far as the current state of the library is concerned. Please
provide a self-contained failure case that demonstrates failure
reproduction in which the library fails.
On Thu, 2 Jul 2015 at 19:00 Sam Isaacson<EMAIL_ADDRESS>wrote:

Pulled the latest version off GitHub and recompiled - still getting the
same error as before.
In particular, looking at your code in util.fs for the
UnionCasePropertyGet active pattern; I cannot see how the dummy variable
could possibly work for a general Union and I put together a script to
verify this. I ran the script in both F#3.1 and F#4.0 REPL to check.
fsharp
type Union1 =
| Red
| Green
| Blue
// runs fine yields the first case
let dummy1 = System.Runtime.Serialization.FormatterServices.GetUninitializedObject typeof
type Union2 =
| Red of int
| Green of float
| Blue of string
// crashes with "Cannot create an abstract class..."
let dummy2 = System.Runtime.Serialization.FormatterServices.GetUninitializedObject typeof
type Union3 =
| Red of int
| Green of float
| Blue of string
with
member this.DoSomething =
match this with
| Red _ -> "hello"
| _ -> "goodbye"
type Union4 =
| Red of int
| Green of float
| Blue of string
with
member this.Convert =
match this with
| Red _ -> Union1.Red
| _ -> Union1.Green
let v = Union4.Red 1
let expr1 = <@ v.Convert @>
let pInfo = typeof.GetProperty("Convert")
// // crashes with "could not create an abstract class"
let dummy = System.Runtime.Serialization.FormatterServices.GetUninitializedObject pInfo.DeclaringType
—
Reply to this email directly or view it on GitHub
https://github.com/eiriktsarpalis/QuotationCompiler/issues/5#issuecomment-118078061
.

You are right - I was previously missing the guard checking for abstract properties in the active pattern. However, through trial and error I seem to have come up with the reason my code is failing: namely that when there are four or more cases and one of them does not have fields/tags then the union is not considered abstract anymore by the runtime (not sure why to be fair).
See failure case script against QuotationCompiler library below:
fsharp
module Test

type Union1 =
    | Red of int
    | Green of int
    | Black
    | Orange of float

    with
    member this.Convert =
        match this with
        | Red i -> "happy"
        | Green _ -> "sad"
        | Black -> "neutral"
        | Orange _ -> "wow"

typeof<Union1>.IsAbstract   // false !!! We expect all union types to return true here though - root cause of problem.
let pInfo = typeof<Union1>.GetProperty("Convert")
let dType = pInfo.DeclaringType
System.Runtime.Serialization.FormatterServices.GetUninitializedObject dType // error

#r "QuotationCompiler.dll"

let expr1 = <@ (Red 1).Convert @>
let f1 = QuotationCompiler.QuotationCompiler.Eval expr1     // System.Reflection.TargetException: Object does not match target type.at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target)

let b = Orange 10.0
let expr2 = <@ b.Convert @>
let f2 = QuotationCompiler.QuotationCompiler.Eval expr2  // Error: System.Reflection.TargetException: Object does not match target type.

Fixed in aeb72f8ff587a3a9ef1e36a4f152d99db257243a

Legend. Thanks. Will keep running it through my codebase.


What flavor tests do we want?

From @wking on September 7, 2016 9:57
#257 shows we could really use a test suite.  I'm flexible, but it feels like our command line API is more stable than our current Go APIs.  How would folks feel about a test harness exercising the command line API?  Do we have a sharness/bats preference (I have more experience with sharness, but runC uses bats)?  Should this wait until after opencontainers/tob#18 (is there an estimated timeframe for that decision)?
Copied from original issue: opencontainers/image-spec#272

From @wking on September 7, 2016 15:49
On Wed, Sep 07, 2016 at 06:24:42AM -0700, George Lestaris wrote:

I would prefer if we could use a Go testing framework, even though
it's a CLI. Ginkgo [1] is being used in Cloud Foundry for all types
of testing (API/CLI/unit).

Ginko looks nice, but I prefer shell-oriented test harnesses for the
command line because there's less boilerplate around invocation.
However, any framework around the command line is better than none, so
if maintainers want tests in Ginko (or whatever), I'll add them in
that framework.

Also, I guess this issue is mainly targeting a CLI test suite, but,
would it make sense to consider having unit tests on some of the
most complex operations?

As things currently stand, I think ‘oci-image-tool unpack SRC DEST’ is
more likely to be around in two months than manifest.unpack(walker,
dest), and testing I'd rather test the more stable interface.  Testing
the command line API is also going to cover
cmd/oci-image-tool/unpack.go, and I'd rather have coverage first.  We
can fill in unit tests later to make it easier to isolate errors and
avoid combinatoric issues ;).  But again, if maintainers want Go tests
in image/*_test.go first, I'll go that way.

From @glestaris on September 7, 2016 13:24
I agree that the CLI should be tested instead of any Go API. I would prefer if we could use a Go testing framework, even though it's a CLI. Ginkgo [1] is being used in Cloud Foundry for all types of testing (API/CLI/unit).
Also, I guess this issue is mainly targeting a CLI test suite, but, would it make sense to consider having unit tests on some of the most complex operations?
[1] http://onsi.github.io/ginkgo/


ERROR GitLab-Runner

Can any one help me with this?

I'm having a similar error whenever I use the -Mode flag


SyntaxError: Unexpected strict mode reserved word

When I try to lift app in development mode I get this error
/usr/local/bin/node app.js
error: /Users/baskerville42/WebstormProjects/toprovidepr-site/toprovidepr-backend/node_modules/sails-hook-jsonapi/lib/hook.js:5
  let moduleUtils = require('./utils/module-utils');
  ^^^
SyntaxError: Unexpected strict mode reserved word
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/baskerville42/WebstormProjects/toprovidepr-site/toprovidepr-backend/node_modules/sails-hook-jsonapi/index.js:1:80)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at /Users/baskerville42/WebstormProjects/toprovidepr-site/toprovidepr-backend/node_modules/sails/lib/hooks/moduleloader/index.js:432:26
    at /Users/baskerville42/WebstormProjects/toprovidepr-site/toprovidepr-backend/node_modules/sails/node_modules/lodash/dist/lodash.js:3741:15 [SyntaxError: /Users/baskerville42/WebstormProjects/toprovidepr-site/toprovidepr-backend/node_modules/sails-hook-jsonapi/lib/hook.js:5
  let moduleUtils = require('./utils/module-utils');
  ^^^
Unexpected strict mode reserved word]

Process finished with exit code 0

But in production mode it's all right

What version of node are you using?  Initially I was using let, but replaced most of them with var in https://github.com/IanVS/sails-hook-jsonapi/commit/cf6dfc1d647ff16dae40f501c5d77e615e971fc3.  Apparently I missed a few.

$ node -v
v0.12.9
$ npm -v
3.5.3

Would you like to submit a PR to change let to var in that file?  Or, you can install node 4 or above.  If you'd rather not do either, I can make a fix within a few days.

Fixed see https://github.com/listepo/sails-hook-jsonapi/commit/4071a6fa93aa00fa306a8cdb9241633507d6a25b

Thanks!


Configuration Request: Skip By Default

Rather than using the name of the route as the default breadcrumb, it would be nice to (optionally) just skip any states that aren't explicitly given labels.

I'm not very kind of this behaviour. I will be confusing for users to not see a step in breadcrumb (is it abstract ? is the parent step overrided ? Oh no I forgot the name...).
I recognize it could be useful. For example if the breadcrumb must display only the first step like:

Home > Rooms
Home > Booking
Further steps inside 'Rooms' step are never displayed.
It could be done easily with such an option.


feat: indexSelector widget

First pass on the indexSelector widget (as discussed in #38).
Still need to work on:

[x] cssClass option
[x] If the selected index is not one from the list, then we should throw an error.

allowing for custom template

Maybe at some point we should allow http://wix.github.io/react-templates/ which will allow us to provide templates + data + events

For now I feel the cssClass option for the <select> should be sufficient to move on

Do you want us to look at the PR or are you still working on it? Otherwise you can close and reopen later

I'd rather keep the PR open. I'll add the missing element, but that way we can discuss the current code

I've added support for the cssClass attribute, to be able to add a custom form-control class when using Bootstrap. Turns out that we will actually need more than that. In that case, we will also need to add a custom id on the select, so we can correctly set the for of the label.
I don't want to explicitly list all the attributes that can be passed and that I will copy on to the inner select. I think the best way would be to let the user define its own template, that MUST be a select element and use that one if provided (this is already discussed above).
The issue is that I have no idea how to add handler (or more generally do DOM manipulation) inside React without a JSX template. I mean I'll have to import a DOM element through dangerouslySetInnerHTML, and then add a onChange handler to that element. Maybe using React.findDOMNode? cc @bobylito

This usecase seems to be what react templates are made for. But we can also try to use a hogan template and see what we can do
OnChange should bubble up to the root element so it might work.

@bobylito @vvo: I consider this PR over for now. Could you have a look?
Instead of a template, I've allowed an htmlAttribute object to be passed as HTML attributes to the generated select.

Rename htmlAttributes to selectAttributes or inputAttributes ?

Needs:

[ ] jsdoc
[ ] remove quotes around keys in example app

What I am worried about is that we already have four methods to set attributes on the html:

cssClass
rootClass
itemClass
htmlAttributes

So we need to find what is necessary and then provide it.
Maybe we should just have htmlAttributes but automatically adding attributes to a namespace that is managed and used by react is maybe dangerous.
From our discussions I understood that the need for htmlAttributes was motivated by the fact that to generate a select with the corresponding label we needed to provide the id of the select.
If htmlAttributes is only here to be able to add an id and if that's the only need we have right now. Then I would automatically add an id in all our widgets based on the widget name:
ais-sortIndex-1 something like that.
This should be sufficient if the only need that we can think of right now is adding an id. We would then see if we really need anything else like htmlAttributes.

I'm also concerned about having so many different ways to do the same thing. We need a more common method for letting user have a bit more freedom on the markup generated.
For the tests I have to do today, I only need the id, but I'm pretty sure I will need a lot more html attributes in the future and we cannot handle every specific need in our widgets. Users might need to add other custom classes, acceskey shortcuts, aria attributes for screen readers and a lot more things.
htmlAttributes might not be the right choice, though. It is a Javascript object, and some keys (like class and for) will have to be renamed (as cssClass and htmlFor) before being actually passed to React.

We need a more common method for letting user have a bit more freedom on the markup generated.

We do not have a way to do this right now. And the solution to this ultimately is full blown templates with events like <ul><li onClick...
I don't want to go too far in the "control the generated DOM" beside adding css classes mostly because I cannot right now think of use cases where it really makes sense.

I'm pretty sure I will need a lot more html attributes in the future

If we cannot think of any use case right now I would prefer to stick with something simpler and see in the future if we need more than that. We will have more use cases and experiences of using the instantsearch.js.
I'd rather solve the label + select use case by adding an id rather than add an API that the user might use. So that we can keep the rootClass itemClass. Instead of itemHtmlAttributes, rootHtmlAttributes etc..

htmlAttributes might not be the right choice, though. It is a Javascript object, and some keys (like class and for) will have to be renamed (as cssClass and htmlFor) before being actually passed to React.

And we do not know what are the other possible keys that will need to be renamed because attributes here are somehow managed by react.

So you advocate we "patch" the current widget to pass the issues we currently have and wait for the complete implementation of the instant search demo and a few other integrations (magento, wordpress, etc) to see how we can find a more generic way?
Works for me, as long as we don't officially release the hackish versions

So you advocate we "patch" the current widget to pass the issues

Yes I would like to be able to answer the instant search demo need. And for this demo it seems that the id= is not needed.
I would prefer us to answer theses implementations and only them before thinking of more API needs.
Then when we start integrating more deeply maybe we will need to draft and then rewrite the widgets for them to provide htmlAttributes:{root, item} but maybe not.

My main issue with "htmlAttributes" is that as a user POV it's giving the idea that they could manage everything.
From the attributes to the dom tagName and the complete layout which is not the case.
Until we get the need (use case) or find a complete react compatible (dom diff compatible) templating solution I would not got this way.

I've remove the htmlAttributes in favor of cssClass. I've also added an automatic id to the select, based on the id of the parent element. I know this can break if the parent has no id, but it currently works for our demo, but we'll fix that later.

@redox @vvo @bobylito: Comments? Otherwise ready to be merged.

LGTM :+1:


Double navController.pop() execution when quickly tapping auto-generated back button

Short description of the problem:
When tapping twice the auto-generated back button in an <ion-navbar> (mostly by accident), the navController.pop() gets called twice, thus causing the previous page also to be popped, and even worse if the previous page was the first on the stack, you get a blank page.
What behavior are you expecting?
Execute navController.pop() only the first time the button is pressed, ignore any other presses.
Steps to reproduce:

Create a new Ionic 2 project with the sidemenu template:

```
ionic start ionicbug sidemenu --v2
cd ionicbug
```

Run the project in an Android or iOS device, the older and slower the device the better
In the app, go to the "Page Two" on the side menu and select an Item
On the Item page, press the back button repeatedly as fas as possible before it gets dismissed
Retry until you get a blank page

This is hard to reproduce because the double tapping must be done very fast, but on older and slower devices it becomes a problem as you have more time to do the tapping, also when debugging via chrome, which makes the device slower, it's relatively easy to reproduce.
I got this problem on iOS (iPad 4 iOS 10) and Android (Moto X 2013 Android 5.1) devices, I could't reproduce it on desktop.
Which Ionic Version? Ionic 2.0 RC1
Run ionic info from terminal/cmd prompt:
Your system information:
Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
Ionic App Scripts Version: 0.0.36
ios-deploy version: 1.9.0
ios-sim version: Not installed
OS: Mac OS X El Capitan
Node Version: v6.6.0
Xcode version: Xcode 8.1 Build version 8B62

This should be fixed in RC2!

I have same issue in RC3.
System information:
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v4.2.6
Xcode version: Not installed


Use envoy with symbol and add gdb, strace, pstack to docker image

Use envoy with symbol.
Add gdb, strace, pstack for debugging envoy

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: crazyxy
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: costinm
If they are not already assigned, you can assign the PR to them by writing /assign @costinm in a comment when ready.
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sdake @wattli @liminw  @costinm  Please see if having these packages to base image do not add any security risks.

@crazyxy: The following test failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

prow/integ-galley-k8s-presubmit-tests.sh
5b22afff242cc4a0256d496b96460e58103a26c7
link
/test integ-galley-k8s-presubmit-tests-master

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

@crazyxy: The following tests failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

prow/integ-galley-k8s-presubmit-tests.sh
5b22afff242cc4a0256d496b96460e58103a26c7
link
/test integ-galley-k8s-presubmit-tests-master

prow/integ-mixer-k8s-presubmit-tests.sh
5b22afff242cc4a0256d496b96460e58103a26c7
link
/test integ-mixer-k8s-presubmit-tests-master

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

/test integ-galley-k8s-presubmit-tests-master
/test integ-mixer-k8s-presubmit-tests-master

build image and do du -sh for the binary?
On Fri, May 31, 2019 at 12:46 PM Yan Xue<EMAIL_ADDRESS>wrote:

@crazyxy commented on this pull request.
In docker/Dockerfile.deb_debug
https://github.com/istio/istio/pull/14483#discussion_r289528214:

@@ -33,5 +36,8 @@ RUN apt-get update && \

net-tools (0.7M): netstat
lsof (0.5M): for debugging open socket, file descriptors
knot-dnsutils (4.5M): dig/nslookup
+# gdb: for debugging envoy
+# pstack: display a stack trace for each process
Do you know how did we get these numbers?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/istio/istio/pull/14483?email_source=notifications&email_token=AAMVXB7DHBHL2JWTQS3CEETPYF6BHA5CNFSM4HR43732YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2JJXFQ#discussion_r289528214,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAMVXB6WHZFPRJGKYYXD37DPYF6BHANCNFSM4HR4373Q
.

build image and do du -sh for the binary?
…
On Fri, May 31, 2019 at 12:46 PM Yan Xue @.> wrote: @.* commented on this pull request. ------------------------------ In docker/Dockerfile.deb_debug <#14483 (comment)>: > @@ -33,5 +36,8 @@ RUN apt-get update && \ # net-tools (0.7M): netstat # lsof (0.5M): for debugging open socket, file descriptors # knot-dnsutils (4.5M): dig/nslookup +# gdb: for debugging envoy +# pstack: display a stack trace for each process Do you know how did we get these numbers? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#14483?email_source=notifications&email_token=AAMVXB7DHBHL2JWTQS3CEETPYF6BHA5CNFSM4HR43732YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2JJXFQ#discussion_r289528214>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMVXB6WHZFPRJGKYYXD37DPYF6BHANCNFSM4HR4373Q .

It seems not correct for curl and others.

/retest

From security perspective, it seems fine. It is local debugging tool. And it requires admin permission to that, I assume.

@crazyxy: The following test failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

prow/integ-security-k8s-presubmit-tests.sh
5b22afff242cc4a0256d496b96460e58103a26c7
link
/test integ-security-k8s-presubmit-tests-master

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

@mandarjog Can you please take a look at this pr? Thanks!

/test integ-security-k8s-presubmit-tests-master

@crazyxy: The following test failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

prow/integ-security-k8s-presubmit-tests.sh
5b22afff242cc4a0256d496b96460e58103a26c7
link
/test integ-security-k8s-presubmit-tests-master

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

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: crazyxy
To complete the pull request process, please assign costinm
You can assign the PR to them by writing /assign @costinm in a comment when ready.
The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

/assign @costinm @mandarjog

@crazyxy: The following tests failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

prow/integ-security-k8s-presubmit-tests.sh
5b22afff242cc4a0256d496b96460e58103a26c7
link
/test integ-security-k8s-presubmit-tests-master

prow/integ-mixer-k8s-presubmit-tests.sh
0c4de8cecb6df5e5a24102b32a5d44010a193258
link
/test integ-mixer-k8s-presubmit-tests-master

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

/test integ-mixer-k8s-presubmit-tests-master

@crazyxy: The following test failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

prow/integ-mixer-k8s-presubmit-tests.sh
0c4de8cecb6df5e5a24102b32a5d44010a193258
link
/test integ-mixer-k8s-presubmit-tests-master

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


Potential Fix for Issue #167

Quick and easy way of allowing end users to still have static constructors in their [MemoryPackable] structures

ok, thanks


Visual Studio 2015 plugin completely broken

So i got the latest typescript plugin for VS 2015.
If i open a .ts file, VS does correctly recognize the tsconfig.json file in the root folder. However, it does not seem to be compiling any of my files to .js. I also cannot see any menu for settings when i right click on project name.

It is surprising that the plugin comes with zero documentation on how to setup a typescript project

tsconfig.json is not a project file. it is just a json file that tells the editor how to interpret your files. to build you have one of two options: 1. build from the command line e.g tsc --p <path to the folder containing tsconfig> or 2. using compile-on-save (disabled by default, to enable it go to tools\options\Text Editor\TypeScript\Project and select "Automatically compile TypeScript files which are not part of a project") see image below:

If you want your are normal project system support in VS, just create a new project from template, add your files to the project using add new/add existing, and edit the project properties using the project property pages.

for more documentation about tsconfig.json please see: https://github.com/Microsoft/TypeScript/wiki/tsconfig.json, hope that helps!

the link you gave has no mention of visual studio. I know how a tsconfig file works.
If I have to give visual studio all the settings in that dialog box, then what is the use of tsconfig.json?

For systems like node.js, where vs (and msbuild) aren't at all involved in the build.

You have the options, either use your MSBuild project file, with a normal .csproj/.vbproj, .jsproj, etc.. TypeScript will fit in there like a any other language in VS.
The other option is to use tsconfig.json, use your json editor to modify it, and the language service will pick it up.
The choice is yours.

yeah well if u use tsconfig, visual studio has no idea of any other files in the directory like gulpfile or package.json.
this is as good as tsconfig not being supported at all, since you cant use this to develop a real app.

I also must agree with pdeva.
In comment in blog post about release of TS 1.6 you say that "VS2015 has full support for tsconfig.json since RTM" (link)
But can we really use tsconfig.json in existing ASP.NET MVC app that is using MSBuild and make VisualStudio to use tsconfig.json to get options to compile .ts files correctly?
Right now I still don't know if it is possible.

One thing to note, all compiler flags that are available through tsconfig.json are already available through your MSBuild project file, here is a list of mappings compiler options to MSBuild properties: https://github.com/Microsoft/TypeScript/wiki/Setting-Compiler-Options-in-MSBuild-projects
ASP.net 5 project having to put tsconfig.json files in the script directory has been resolved in 1.6, you can now place it at the root, and it should work normally. see #4161 for more information.
For the next release, we intend to make the interaction smoother, allowing for tsconfig support in a project file is tracked by #3949, and multiple tsconfig in a single project is tracked by #4714


Adjust Fulltext Search

SimpleFulltextQuery execution in PostgreSQL is adjusted as follows:

Query terms are now tokenized and the individual words are ORed
By default, Prefix-Matching is employed (i.e., every token is post-fixed with a wildcard)

I opened a PR for this, since the change might affect the behavior of existing logic.
In addition, I would propose to add a more powerful AdvancedFulltextQuery class in the future, for which the desired behavior can be steered. This is, however, not in scope for this PR.

Sounds reasonable to me. How does this behavior compare to what is implemented in the CottontailDB connection? I think the two should be as aligned as possible.

Adjusted!