htop shows Ubuntu has up to 1.3GB of RAM even though PC has 32GB RAM; dual boot with Win10 which can see ALL RAM

I have a Dell Precision 5510 with 32GB RAM but, when running htop I see that Mem is about 1 / 1.29GB. Why only 1.29GB? ‘free – h’ confirms that 1.3GB are available: total used free shared buff/cache available Mem: 1.3G 944M 108M 58M 267M 121M Swap: 14G 1.5G 13G But running ‘dmidecode –type memory’…

Details

C++ deserializing a binary tree

I’m attempting to serialize and then deserialize a binary tree, but seem to have run into a roadblock during the deserialization part. I have the following code: // Encodes a tree to a single string. string serialize(TreeNode* root) { std::ostringstream oss; preorder_traversal(root, oss); return oss.str(); } void preorder_traversal(TreeNode *root, ostringstream &oss) { if(root == nullptr)…

Details

How to receive the return of a promise in Angular? [duplicate]

This question already has an answer here: How do I return the response from an asynchronous call? 36 answers getCardHash: function (cardData, success, error) { this._checkPublicKey(function () { if (this.isValidCardData(cardData, error)) { this._internalGetCardHash(cardData).then(function (cardHash) { success(cardHash); }, function (e) { error(e); }); } }.bind(this)); }, _internalGetCardHash: function (cardData) { return new Promise(function (resolve, reject) {…

Details

Getting a error 500 in my code but not in my browser

I am trying to use theDuckDuck go api with this code val mainVal = searchQuery.replace(” “, “+”) val url = URL(“https://api.duckduckgo.com/?q=$mainVal&format=json”) println(url.host) url.openConnection() val json = url.readText() I am getting this error as a result java.io.IOException: Server returned HTTP response code: 500 for URL: https://api.duckduckgo.com/?q=duck+duck+go&format=json at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1919) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1515) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250) at java.base/java.net.URL.openStream(URL.java:1139) at kotlin.io.TextStreamsKt.readBytes(ReadWrite.kt:150)…

Details