Shipping address changes to customer_address_entity data not from quote_address when refreshed on payment page Magento 2

We Noticed that selected shipping address is saved when clicked ‘Next’ on checkout/#shipping page in quote_address table. The address is changing to customer_address_entity data if the customer clicks browser refresh button or F5 when on the payment page. The quote_address is not getting updated even after the refresh, it’s an issue with browser display, so not sure what’s going on. Any clues on how to identify the code that’s switching address upon refresh in Magento 2.2.x?

This will only happen when there is 1 or more addresses in customer profile.

It maybe possible to add an observer as mentioned in this post reset address issue but trying to understand the root cause.

Thanks

Is Forgotten Realms geo-location data copyrighted, or free to use?

I am in the process of creating a gis map of Toril, starting from the Faerun Continent. (More details are in this question on GIS.SE: Starting a QGIS project for a fantasy world map from raster images.)

One commenter asked if I could share this on Google Earth; however, I have no idea of the legal restrictions on using this material.

Let’s say I create a Faerun map completely from scratch; it would be based on copyrighted material, which will be used only as reference and will not be republished in the final work, but obviously I will put in my maps everything related to mapping. Can I distribute it freely?

For example, I want to place Phandelver on the map, so I’ll start gathering everything geo-related from the adventure book, scan it, and retrace it all in QGIS (the geographic information system software I am using), I will not include any of the published maps in the final result.

The final result would be a browsable and zoomable Google-Earth-like map.

In the scope of what I want to do, I think the larger question is: Are Toril, Faerun, and all of the Forgotten Realms geographic information free to use?

Specifically, are the geographic coordinates of mountains, rivers, hills, roads, cities (and the size and shape of the buildings, monuments and roads in them) under copyright?

Who to reduce the size of the data in R?

I’ve a CSV file which has 600,000 rows and 1339 columns making 1.6 GB. 1337 columns are binaries taking either 1 or 0 values and other 2 columns are numeric and character variables.

I pulled the data use the package readr with following code

VLU_All_Before_Wide <- read_csv("C:/Users/petas/Desktop/VLU_All_Before_Wide_Sample.csv") 

When I checked the object size using following code, it’s about 3 gb.

> print(object.size(VLU_All_Before_Wide),units="Gb") 3.2 Gb 

In the next step, using the below code, I want to create training and test set for LASSO regression.

set.seed(1234) train_rows <- sample(1:nrow(VLU_All_Before_Wide), .7*nrow(VLU_All_Before_Wide))  train_set <- VLU_All_Before_Wide[train_rows,] test_set <- VLU_All_Before_Wide[-train_rows,]  yall_tra <- data.matrix(subset(train_set, select=VLU_Incidence)) xall_tra <- data.matrix(subset(train_set, select=-c(VLU_Incidence,Replicate))) yall_tes <- data.matrix(subset(test_set, select=VLU_Incidence)) xall_tes <- data.matrix(subset(test_set, select=-c(VLU_Incidence,Replicate))) 

When I started my R session the RAM was at ~3 gb and by the time I exicuted all the above code it’s now at 14 gb, leaving me an error saying can’t allocate vector of size 4 gb. There was no other application running other than 3 chrome windows. I removed the original dataset, training and test dataset but it only reduced .7 to 1 gb RAM.

rm(VLU_All_Before_Wide) rm(test_set) rm(train_set) 

Appreciate if someone can guide me a way to reduce the size of the data.

Thanks

C++ writing object data to file

I’m trying to write a program that stores usernames and passwords. So I have created a Record class. Each record has an id, title, username, and password field. I want to write each record to a text file.

However, I am having some issues. When I compile I get the following errors.

'Record::getTitle': non-standard syntax; use '&' to create a pointer to member 'Record::getUsername': non-standard syntax; use '&' to create a pointer to member 'Record::getPassword': non-standard syntax; use '&' to create a pointer to member 

The problem:

writeToFile(firstRecord.getTitle, firstRecord.getUsername, firstRecord.getPassword); 

The getTitle(and others) return a string. So I am not sure why this isn’t working. Any suggestions would be appreciated.

Complete code (so far) below..

#include <iostream> #include <string> #include <fstream> #include <map> #include <functional> using namespace std;  string GetInput(); void MainMenu(); void Title(); void AddRecord(); void writeToFile(string title, string username, string password);  class Record {  private:      string id;     string title;     string username;     string password;     static int numberOfRecords;  public:      void setTitle(string title) {         this->title = title;     }     string getTitle() {         return title;     }      void setUsername(string username) {         this->username = username;     }     string getUsername() {         return username;     }      void setPassword(string password) {         this->password = password;     }     string getPassword() {         return password;     }      static int GetNumberOfRecords() {         return numberOfRecords;     } };  struct MenuAction {      string description;     function<void()> action; };  static const map <string, MenuAction> actionTable{      { "1",{ "Add entry", []() { AddRecord(); } } },     { "2",{ "Edit entry", []() { cout << "Edit entry" << "\n";  } } },     { "q",{ "Quit", []() { cout << "Quit" << "\n";  } } } };  int main() {      Title();     MainMenu();      return 0; }  void Title() {      cout << "======================================\n"             "|              Database              |\n"             "======================================\n\n"; }  void MainMenu() {      for (auto const& x : actionTable) {         cout << x.first << ". " << (x.second).description << "\n";     }      string input;      while (actionTable.count(input) == 0) {         input = GetInput();     }      actionTable.at(input).action(); }  void AddRecord() {      cout << "============= Add Record ============" << endl << endl;      string id;     string title;     string username;     string password;      cout << "Title: ";     getline(cin, title);     cout << "Username: ";     getline(cin, username);     cout << "Password: ";     getline(cin, password);      Record firstRecord;     firstRecord.setTitle(title);     firstRecord.setUsername(username);     firstRecord.setPassword(password);      writeToFile(firstRecord.getTitle, firstRecord.getUsername, firstRecord.getPassword); }  string GetInput() {      string s = "";      cout << ">> ";     getline(cin, s);      return s; }  void writeToFile(string title, string username, string password) {      ofstream outFile;      outFile.open("database.txt", ios_base::app);     outFile << title << "\t" << username << "\t" << password << "\n";      cout << "============= Record Added To Database ============" << endl; } 

Feel free to comment or nag other portions of my code 🙂

Function to search columns and tally data

I am wondering if I can write a function to search a column in my spreadsheet for a specific name, then return x number of values within the row(s) that contain the name. For example…

enter image description here

M4 holds the function. The function searches Columns D, G, and J to find a match of the name in L4 (Owen). Owen’s name can occur multiple times in following rows. The function returns a cell value, say B4, in M4.

Does it make sense to authenticate a method that exposes non-sensitive data

We’re developing an Angular application that consumes a web method exposing some information that is not sensitive, just bus seat promotions; the user enters where he wants to go and when and he will be presented with the available offers (if any). The site does not require any kind of authentication for this information is publicly available and it is just trying to offer an easy way to gather this information for the public.

There’s been an argument about whether it is convenient to implement OAUTH on the service itself, creating a service account for the angular application so we know that no one else is trying to access this information. The way I see it, I don’t think it is necessary, this is publicly available info and if they want to access it they can parse the information on the site or even figure out the credentials that the Angular app is using. Is there any benefit that I’m missing here?

converting CSV format data to graph sample format for implementing BFS

import collections   def breadth_first_search(graph, root):      visited, queue = set(), collections.deque([root])     while queue:          vertex = queue.popleft()         for neighbour in graph[vertex]:              if neighbour not in visited:                  visited.add(neighbour)                  queue.append(neighbour)    if __name__ == '__main__':     graph = {0: [1, 2], 1: [2], 2: []}      breadth_first_search(graph, 0) 

I am implementing BFS with the help of given sample data. But here I intend to use my own data. I am extracting graph from Neo4j into CSV format but how do I transform that extracted data into the sample format. Here is some of the sample data from CSV file.

"[{name:Keanu Reeves,born:1964},{roles:[Julian Mercer]},{title:Something's Gotta Give,released:2003}]" "[{name:Keanu Reeves,born:1964},{roles:[Shane Falco]},{title:The Replacements,tagline:Pain heals, Chicks dig scars... Glory lasts forever,released:2000}]" "[{name:Keanu Reeves,born:1964},{roles:[Johnny Mnemonic]},{title:Johnny Mnemonic,tagline:The hottest data on earth. In the coolest head in town,released:1995}]" "[{name:Keanu Reeves,born:1964},{roles:[Kevin Lomax]},{title:The Devil's Advocate,tagline:Evil has its winning ways,released:1997}]" 

Data structure for combining adjacent element

I want to solve a question and I need a special data structure. in this the structure, I want to find minimum element and merge it with one of it adjacent (minimum one) and make a new element. I need to do this until I get to a list with size one. at each level, I will sum the two number which merged. for example:
1 1 2 3 2 1
2 2 3 2 1
2 2 3 3
4 3 3
4 4
8

I search a lot but I didn’t find something good for this operation. I think that MinHeap is good but I couldn’t augment it to support this feature.
I’m sorry for bad English. Is it possible to help me?
Thanks.

Need camera suggestion for identifying text on engraved matte metal, to collect data for a machine vision application

The project objective is to read engraved text on matte metal surface. Like below:

enter image description here

The target (targets) is moving on a conveyor belt and contains both text and numbers.

We have a plan of trying different illumination techniques to capture the contours of engraving. We have complete control of the ambient light. We plan to achieve illumination as in the below image:

enter image description here

However, for data collection, one of my colleagues suggests using mobile phones with some app that can click burst shots. Is this a good idea for an industrial application?

Would it be better to use a camera made for this purpose?

Additionally, would appreciate any suggestion on capturing a video (moving target) with low fps and optimized shutter speed and use these video frames as images for training?