Categories
Mastering Development

Do the multiple postfix-expression(subscripting) evaluations result in UB

#include <iostream> int main(){ int arr[7] = {0,1,2,3,4,3,2}; arr[0]++[arr]++[arr]++[arr]++[arr]++[arr]++[arr] = 5; //#1 for(auto i = 0;i<7;i++){ std::cout<<i<<" : "<< arr[i]<<std::endl; } } Consider the above code, Is this evaluation at #1 would result in UB? This is a example I have saw in twitter. According to the evaluation sequence for postfix ++: expr.post.incr#1 The value […]

Categories
Mastering Development

CreateEventSource doesn’t create event log entry and windows service can’t be launched

I’m developing a new windows service and I follow the steps provided in this instuction. In the service class, I do pretty much the same things as the article static EventLog _eventLog; public CMSMetadata() { InitializeComponent(); _eventLog = new EventLog(); if (!EventLog.SourceExists(“CMSMetadata_Processing”)) { EventLog.CreateEventSource(new EventSourceCreationData(“CMSMetadata_Processing”, “CMSMetadata”)); } _eventLog.Source = “CMSMetadata_Processing”; _eventLog.Log = “CMSMetadata”; } protected […]

Categories
Linux Mastering Development

How can I run sshpass command with the remote environment, taking the source ~/.bashrc effect

For example, I run a command: sshpass -p passwd ssh dennis@ip python xx.py But, in this way, this command is running without the environment variables, which is set in /home/dennis/.bashrc. e.g.: export PYTHON_HOME=/python is there any way to solve this issue? Thanks.

Categories
Development

Popup route taking all the screen

I try to make a popup with some content that will cover only a part of the screen, in the center (something like modalBottomSheet, but in the center of the screen) that will close if I press outside of it. I was able to create a class that extends PopupRoute, but the content takes all […]