I'm not asking what's technically possible; I know you can do const a = []; const b = {}; a.push['sup']; b.test = 'earth'; What I'm wondering is whether there's any convention for preferring let over const when it comes to arrays and objects that will have their internals modified. If you see an object declared with const, do you assume the intention was for the object to be immutable, and would you have preferred to see let instead, or, since some linters (like tslint) have a problem with that, is it better just to declare it with const and trust that anyone else reading the code knows that t
EMV contactless card payments have 7 kernels. There are two kernels (Visa FDDA and Union Pay) just support Offline Authorization by either generate cryptogram TC (in case of approval) or AAC (in case of decline) the transaction by the contactless card itself (without going online to the Issuer bank). on the other hand, the rest five kernels (Visa, MasterCard, American Express, JCB and Discover) support both online and offline transaction authorization. In case of Online transaction Authorization, the contactless card will generate ARQC and will be sent to the Issuer Bank through the POS and th
I have a dropdown which has a nested menu as shown below. The dropdown upon expanding shows two options: The problem is upon clicking any of the items the children options under Tenant Name or Dealer ID display for a second and disappear. How to solve this problem and next is how to store values which the user selects? My code is as follows: export default class DropDownMenuSimpleExample extends React.Component { constructor(props) { super(props); this.state = { dropDownData: [ { value: '', tenantName: '', dealerId: '', }, ], }; } handleChange = (event, index, value) => { this.setState({ value
My project is transitioning to Bazel from CMake and I am including a snapshot of Abseil by checking it into a third_party/ top-level directory within our repository. I need to support both build systems during the transition, so I created CMakeLists.txt files and noticed that quite a lot of warnings need to be disabled for the Abseil headers to compile. For CMake, this okay because I can include the headers where I use them by using the #include <absl/strings/str_cat.h> syntax. This tells my compiler that it's a system header and to ignore the warnings so I don't have to disable them globally.
I'm using sass on windows and applied sass --watch through cmd. it is giving css output initially, but not detecting and updating any changes that I'm making in .scss file. This is what I'm doing. I've style.scss in which I'm making changes and each time I've to apply sass --watch style.scss:style.css to convert it into style.css. sass version : 'sass 3.5.1 (bleeding edge)' ruby version : 'ruby 2.4.2p198' where I'm making mistake?
I am working on an image search engine. I use an algorithm to extract features from images and get a 560 dimensions float vector. This dimension is too high for Elasticsearch to index, Elasticsearch will be very slow. So I want to reduce dimensions of the feature vector. One approach I am thinking is to hashcode a series numbers, for example, hash 20 numbers in a row as one hash value, so dimensions is 28, which is reasonable to Elasticsearch. The problem is that I do not find any theory to support my solution. Is there a proved solution to solve this problem?
I am working on an image search engine. I use an algorithm to extract features from images and get a 560 dimensions float vector. This dimension is too high for elasticsearch to index, es will be very slow. So I want to reduce dimensions of feature vector. One approach I am thinking is to hashcode a series numbers, for example, hash 20 numbers in a row as one hash value, so dimensions is 28, which is reasonable to ES. The problem is that I do not find any theory to support my solution. Is there any proved solution to solve this problem? Thanks in advance.
I want to change the behaviour of the "del" HTML tag, such that it overlays a diagonal slash on each character. This could be done with a bitmap graphic, a colour gradient, placing a "/" character over each previous character, or something else, but hopefully not using javascript. Is this possible?
I need to import only one table from a full backup (expdp) to a newly create table on the same database. So can i import the table directly with a new name? or i have to create a new table first with the same parameters then import? impdp hr DIRECTORY=dpump_dir1 DUMPFILE=expschema.dmp TABLES=hr.employees REMAP_TABLE=hr.employees:emps Another question will remap_table effect my already exist employees table? or it will only create a new table called emps and import the data of employees from the dump to it? ...................... Update ...................... I found that there is no remap_tabl
I am creating a web service in visual studio 2015 using MySQL databases. I want implement only a GET method using HTTP. Now when I am doing it I cam accross and error. Which is cannot implicitly convert type 'system.net.http.httpresponsemessage' to 'system.web.httpresponse' The point where it comes is below public HttpResponse Get() { try { return Request.CreateResponse(HttpStatusCode.Found, mEntities.meters_info_dev.ToList()); } catch (Exception) { return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Data found"); } } Below is the image I couldn't find the solution for it. Any help
currently using mysql 5.7 I can execute the following query accessing a json field in the database: select myData->'$[0].dataflow' from flowtable limit 1; If I try the same query on MariaDB it does not work, is there any solution to this problem? I thought MariaDB was fully compatible with mysql and what would it be the correspondent MariaDB syntax? cheers
How to deploy a jar file using Jenkins deployment jobs? Is there any specific plugin available for jar deployments. For War or EAR, we can go to Jenkins_deployment Jobs >> Post-build Actions >> Deploy war/ear to a container - and provide the below info. WAR/EAR files, Context path, Containers Can anyone please help in this?
I'm creating a VB.NET program that I'd like to interface with dropbox. I'm starting with the "list_folder" command which will return the contents on a specified path. Here is the URL where you can play with the command: https://dropbox.github.io/dropbox-api-v2-explorer/#files_list_folder The HTTP request syntax provided is as follows: POST /2/files/list_folder Host: https://api.dropboxapi.com User-Agent: api-explorer-client Authorization: Bearer HBNBvdIls8AA12AAFTvyzhNJrdwwpQcswxpRVjmwRIJANPIea7Jc1Ke Content-Type: application/json { "path": "/Backups" } What I'm trying to do is the equivalent
I'm working on an app that needs multiple permissions from the user (location, external storage, camera and phone state) and if i put the requests one after the other, only one is asked to the user when i run the app, which is a problem : if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { //ask for the location permission ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.AC
In my for loop I am trying to build a vector from local variables. But something weird is happening. When I build my vector I expect it to contain 3 doubles (1x3). But instead it contains hundreds doubles (1x1XX). What the heck is going wrong? Am I misunderstanding m's scope or vector building? for i=0:ncols for j=0:nrows ... roi = imcrop(img, [cx, cy, cw, ch]); %Extract 3 channels red = roi(:,:,1); green = roi(:,:,2); blue = roi(:,:,3); %Get most frequent colour [freqR, f, c] = mode(red); [freqG, f, c] = mode(green); [freqB, f, c] = mode(blue); freqR = double(freqR) / 255; freqG = double(freq
I have included below lines of code in my Web.Config and Global.asax.cs file. Still when I use developer tools in browser I could see secure flag not set to the below Cookies. Also Configured SSLSettings in my IIS(Selected checkbox requireSSL). I would like to set Secure attribute to all Cookies not only to received but also to Sent cookies. Any suggestion please. In Web.config: <httpCookies requireSSL="true"/> In Global.asax.cs: protected void Application_EndRequest(object sender, EventArgs e) { if (Request.IsSecureConnection == true && HttpContext.Current.Request.Url.Scheme == "https") { Req
I can execute my Selenium scripts without any issues if the screen is not locked. As per our organization policy, our system will be locked automatically after 3 minutes of inactivity (but system will never sleep or hibernate). The problem is that the test execution stops because of NoSuchElementException sometimes after the screen is locked. This exception occurs randomly on different elements after the screen is locked. So I cannot run my tests unattended I guess. Selenium test should run without any problem regardless the screen is locked. I run the tests on Google Chrome on Windows machine
i'm new at java language. I try to make my first program that refer from Youtube. but when i click "run" button, it won't work. I don't know why but all the build or the code is successful. Maybe i have some little some mistake there..(?) Can anyone help? enter image description here
Anyone able to give me some info on the relative performance of code running under following conditions, Just compiled Compiled with --coverage Running under kcov Am I going to need twice a long to run my test suite if I integrated code coverage tool like gcov or kcov?
I have a Redshift Cluster in my AWS account. I am able to connect to it in python and when I run the script locally, it runs perfectly fine: import psycopg2 con = psycopg2.connect(dbname='some_dbname', host='hostname.us-east-2.redshift.amazonaws.com', port='port#', user='username', password='password') cursor=con.cursor() query = "select * from table;" cursor.execute(query) data = np.array(cursor.fetchall()) cursor.close() con.commit() con.close() But, when I copy the above script to my EC2 instance (Amazon Linux AMI), and then try running it, I get the following error: conn = _connect(dsn, co
I'm using web project with VR functionality implemented via A-frame and three.js to display VR/360 content with some additional functionality, the whole web project is located in assets folder, and successfully displays 360 images/videos from project directory (HTML is "source src="./default.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'). Target is to replace video source with URI from device external memory (downloads directory for example). I've tried to use URI's in following formats : Android standard : file:///storage/emulated/0/Download/Trafalgar_Square_360.mp4 URI formats found
I wrote a Django project and I use supervisor with gunicorn /etc/supervisor/conf.d/weather.conf [group:weather_station] programs=site [program:site] directory=$PROJECT command=/home/nhcc/.local/bin/gunicorn -c /$PROJECT/weather_station/gunicorn.conf.py -p gunicorn.pod weather_station.wsgi autostart=true autorestart=true stdout_logfile=/var/log/supervisor.log environment=my-environment-variable ~ sudo supervisorctl reread sudo supervisorctl reload sudo supervisorctl status It showed up the error weather_station:site FATAL Exited too quickly (process log may have details) So I checked out the lo
I use AWS API Gateway + AWS Cognito (Federated Identity + User Pool). I'm creating REST API in API Gateway. There are methods for getting users list and for getting user by id. What should I use as user ID? Response should contain te following user data: ID, username, first name, last name etc. Username, first name, last name are stored in User Pool attributes. I see in examples that they use cognitoIdentityId as User ID. If I will use cognitoIdentityId as ID, then how should I get user data by this ID? Please give me an example or link to API reference how to get user data by cognitoIdentityI
I have a simple test.py script that I would like to run from an MQL4 EA. How can I implement this? I have tried using ShellExecute() but that will not work in my case as I am running MetaTrader4 Terminal on a linux machine and thus cannot call windows based ShellExecute() ( even with a wine ).
How can I plot the 'peak' (local maxima) in Matlab/Octave? My below code loads in an image, extracts the red channel and attempts to find and plot the local maxima but it fails with the error: error: findpeaks: DATA must be a vector of at least 3 elements Here is my simple code: pkg load image; pkg load signal; i = imread('foo.jpg'); % Get red channel red = i(:,:,1); % Attempt to find and plot peaks findpeaks(red); % Error on the above line: error: findpeaks: DATA must be a vector of at least 3 elements
I am trying to read data from an excel file, i am using the following code : File src = new File("T:\\SeleniuminputFiles\\input.xlsx"); FileInputStream fis = new FileInputStream(src); XSSFWorkbook wb = new XSSFWorkbook(fis); XSSFSheet sheet1 = wb.getSheetAt(0); but i am getting the compilation error as The constructor XSSFWorkbook(FileInputStream) is undefined. I have downloaded External Jar files from The latest stable release Apache POI 3.16 http://poi.apache.org/download.html#POI-3.16 Your help would be highly appreciated.
I have tried to follow the documentation https://www.elastic.co/guide/en/logstash/current/environment-variables.html but it does not seem to work. I have a bunch of log files to process. Say I have an input file /share/log-2017.09.07.json that I am trying to process with logstash. An excerpt of my logstash config file is as follows : input { file { 'exclude' => ['*.gz'] 'path' => ["/share/log-${INPUT_DATE}.json"] 'type' => 'json' start_position => "beginning" codec => json sincedb_path => "/dev/null" } } I launch logstash as follows : export INPUT_DATE="2017.09.07" logstash -f myconfigfile.con
I am using QueryDSL with jpa and i want to find records between date range somethig like this query.from(timeSheet) .where(timeSheet.date.between(fromDate, toDate)).fetch(); but between only supports boolean and String expressions
I recently set up an Artifactory repository and secured it with an SSL certificate. It's not self-signed but while most operating systems come with it pre-installed, the JRE doesn't. The problem is that the record containing my server in the Maven Repositories Preferences window (IntelliJ Preferences > Build, Execution, Deployment > Build Tools > Maven > Repositories) gives an error when pressing the Update button. Here's the abstract from idea.log: Caused by: java.lang.RuntimeException: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requ