Posts

Showing posts from September, 2021

Music Bot doesn't connect to Voice channel

Trying to make a simple music bot that only plays one link, but it doesn't connect to the voice channel, it doesn't give as a result any error so I can't do anything other than put all my code. Here is my Main.js const {Intents} = require('discord.js'); const Discord = require('discord.js'); const botIntents = [ Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGE_REACTIONS, Intents.FLAGS.GUILD_PRESENCES, Intents.FLAGS.GUILD_VOICE_STATES, Intents.FLAGS.GUILD_MEMBERS]; const client = new Discord.Client({ intents: botIntents }); const prefix = '-'; const fs = require('fs'); const teo = "<@---------->"; const aime = "<@------------>"; const pagliac = "Di di no alla vita sociale! Ogni giorno migliaia di gamer perdono i propri amici per questa Vita sociale, Non si sa cosa sia pero se donate una piccola somma di: 4 reni, tua madre e forse anche tua sorella"; client.commands = ne...

Trying to compare array but getting "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()"

Can someone help me understand and correct my short code for the error in the title? import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, 1, 100) a = 2 def f(x): if x<0.5: return a*x elif x>=0.5: return a*(1-x) plt.plot(x, f(x)) plt.show() 6 7 def f(x): ----> 8 if x<0.5: 9 return a*x 10 elif x>=0.5: from Recent Questions - Stack Overflow https://ift.tt/3CUp9TC https://ift.tt/eA8V8J

Requesting list of a users microhone and headset & phone devices

The audio, video conferencing devices, microhones headset and other devices which are used for microsoft team calls and conferences, where are thisdata is stored? How can I request a list for this devices overall users or for a special user. Is an intune -license needed for that or are there other ways to request this information e.g. with a graph api call? from Recent Questions - Stack Overflow https://ift.tt/39M0PXE https://ift.tt/eA8V8J

Is cos(x) required to return identical values in different C++ implementations that use IEEE-754?

Is there any sort of guarantee - either in the C++ standard or in some other document - that C++ code computing cos(x) will produce identical values when compiled with g++, clang, MSVC, etc., assuming those implementations are using IEEE-754 64-bit double s and the input value x is exactly equal? My assumption is "yes," but I'd like to confirm that before relying on this behavior. Context: I'm teaching a course in which students may need to compute trigonometric functions of inputs. I can assure that those inputs are identical when fed into the functions. I'm aware that equality-testing double s is not a good idea, but in this specific case I was wondering if it was safe to do so. from Recent Questions - Stack Overflow https://ift.tt/39P9kkB https://ift.tt/eA8V8J

New flutter rules caused this ERROR: The argument type 'String?' can't be assigned to the parameter type 'String'

I have a code like this: String? _token; DateTime? _expiryDate; String? _userId; Timer? _authTimer; Future<bool> tryAutoLogin() async { final prefs = await SharedPreferences.getInstance(); if (!prefs.containsKey('userData')) { return false; } final extractedUserData = json.decode(prefs.getString('userData')) as Map<String, Object>;// FIRST ERROR final expiryDate = DateTime.parse(extractedUserData['expiryDate']);// SECOND ERROR if (expiryDate.isBefore(DateTime.now())) { return false; } _token = extractedUserData['token']; //THIRD ERROR _userId = extractedUserData['userId']; // THIRD ERROR _expiryDate = expiryDate; notifyListeners(); _autoLogout(); return true; } But it gives me these errors: The argument type 'String?' can't be assigned to the parameter type 'String'. The argument type 'Object?' can't be assigned t...

git use only from specific range of commit

I have a branch with several commits, example: commit40 commit39 commit38 ... commit02 commit01 How could I make a new branch using the previous one with a range of commits? let's say since commit 38 to 40 from Recent Questions - Stack Overflow https://ift.tt/2Y3j74x https://ift.tt/eA8V8J

Insert into table 10000 rows by 10000 in SQL Server

I am doing a query that retrieves 450 million rows, every time I run it I get an 'Active Transaction Full' error message. I want to insert 10,000 rows by 10,000 rows on my table, instead of trying to insert all at once, is it possible please? My query : INSERT INTO ZED_COTIS.stockdenorm.[DossierRecouvrement_Ind] SELECT DISTINCT A.* FROM STOCK_Pleiade.stock.TDossierRecouvrement A INNER JOIN STOCK_Pleiade.stock.TClientIndividuel B ON A.RefUnClient = B.OID from Recent Questions - Stack Overflow https://ift.tt/3F2uMRs https://ift.tt/eA8V8J

Try figuring out features which causes NaN loss

I'm trying to train the speech recognition model through our company's database. When I used Librispeech DB, there was no problem with model training. On the other hand, when using our company's DB, it causes NaN loss when training first epoch. As a result of searching, I found that certain wave files had problems like low quality, small volume, unmatched wave and text, and so on. Is there any way that I can check if wave file causes NaN loss when putting to model? from Recent Questions - Stack Overflow https://ift.tt/2Y2D7Us https://ift.tt/eA8V8J

Constant DB already define

Image
I have several functions to get data from the database. And for that, I have a connection database. My several functions are located in one file function. And when I run the code I have a message notification like this. And this is for my function code function getDataToko() { $db = getDBConnection(); $query = "SELECT * FROM master_toko WHERE status_ot='1' ORDER BY nama_ot DESC"; $result = mysqli_query($db, $query); mysqli_close($db); return $result; } function getDataAkses() { $db = getDBConnection(); $query = "SELECT tk.nama_ot, ha. * FROM master_toko AS tk, master_hak_akses AS ha WHERE tk.id_ot = ha.id_ot AND ha.status_ha = '1'"; $result = mysqli_query($db, $query); mysqli_close($db); return $result; } And this for the page html i called the function <select class="form-control select2bs4" name="namaToko" required> <option disabled="disable...

How do I turn a PKDrawing into a String? [closed]

I want to allow people to write text using the Apple Pencil via PencilKit and then do character recognition on the resulting PKDrawing. Apple's notepad app does this in iOS 14+ but there doesn't seem to be any API to do this on a PKDrawing? Is there any way to do this other than do my own recognition using the individual strokes? It looks like even in iOS 15, Apple is not exposing the internal API they are using. Or am I missing something? Thanks in advance. from Recent Questions - Stack Overflow https://ift.tt/2Y8Qv9K https://ift.tt/eA8V8J

Why is there an error message even though the interaction is successful is working in discord.py?

I have created a !work command where the buttons help in navigating through pages. Each time a button is clicked, the embed is edited to the required page. I am getting an error message saying that the interaction failed even though the embed was edited properly. How do I fix this? The code for editing the embed is here: await interaction.message.edit(embed=new_embed) from Recent Questions - Stack Overflow https://ift.tt/3kQCyWv https://ift.tt/eA8V8J

check multiple files if they are empty in python

I have an n number of log files that a script regularly downloads and upload on slack for monitoring purposes. However with recent improvements in our postgresql database some of the log files are now empty (meaning no errors or long queues were recorded) this being said, I would need to segregate files that are empty vs not empty and if it's empty skip the file from being uploaded entirely and proceed with the ones that are not empty. 348 postgresql.log.2021-09-28-0000 679 postgresql.log.2021-09-28-0100 0 postgresql.log.2021-09-28-0200 0 postgresql.log.2021-09-28-0300 0 postgresql.log.2021-09-28-0400 0 postgresql.log.2021-09-28-0500 0 postgresql.log.2021-09-28-0600 0 postgresql.log.2021-09-28-0700 0 postgresql.log.2021-09-28-0800 0 postgresql.log.2021-09-28-0900 0 postgresql.log.2021-09-28-1000 0 postgresql.log.2021-09-28-1100 0 postgresql.log.2021-09-28-1200 0 postgresql.log.2021-09-28-1300 0 postgresql.log.2021-09-28-1400 0 postgresql.log.2021-09-28-...

Imagepicker 'XFile' is not a subtype of type 'File' in type cast and Firebase Storage image upload error

I am trying to select image from gallery with imagepicker and upload it to firebasestorage. When the application runs, it gives the error "Cannot open file, path = '' (OS Error: Bad address, errno = 14) and Unhandled Exception: type 'XFile' is not a subtype of type 'File' in type cast'. GestureDetector( onTap: () => pickPhotoFromGallery(), child: CircleAvatar( radius: 70, // ignore: unnecessary_null_comparison child: (_imageFile != null) ? Image.file(_imageFile) : Image.asset('assets/images/icon.png'), ), ), Future pickPhotoFromGallery() async { File imageFile = (await _imagePicker.pickImage(source: ImageSource.gallery)) as File; setState(() { _imageFile = imageFile; }); } When I click the save button, it says "Failed assertion: li...

Create docker service in manager node

Is there a way to force the creation of a docker service in a Docker Swarm in the manager node? I can not use the --constraint node.hostname=... because I don't know the specific hostname for each stage where I deploy my application from Recent Questions - Stack Overflow https://ift.tt/39Mcfuo https://ift.tt/eA8V8J

issues while sending email with xampp on localhost

I am working on a project in which I need to send email. My send mail function is: ini_set('sendmail_path', "\"C:\xampp\sendmail\sendmail.exe\" -t"); ini_set('smtp_server', 'smtp.gmail.com'); ini_set('smtp_port', 25); ini_set('smtp_ssl', 'auto'); ini_set('error_logfile', 'error.log'); ini_set('auth_username', 'myemailAddreds@gmail.com'); ini_set('auth_password', 'mygmail_password'); //sendmail_from('myemailAddreds@gmail.com'); $to = 'myemailAddreds@gmail.com'; $subject = 'Hello from XAMPP!'; $message = 'This is a test'; $headers = "From: your@email-address.com\r\n"; if (mail($to, $subject, $message, $headers)) { echo "SUCCESS"; } else { echo "ERROR"; } But I am getting following error Warning: mail(): Failed to connect to mailserver ...

Postgres Explain - how to optimize

Performance is growing increasingly poor. Using explain, I see that there is a sequential scan in a nested loop - which is likely the performance issue. What I do not know is: how do I improve this? Here is a link to the query and the explain output: https://explain.depesz.com/s/zmzp I'll include them here, too: Query: ''' SELECT "assets".* FROM "assets" INNER JOIN "devices" ON "devices"."asset_id" = "assets"."id" WHERE "assets"."archived_at" IS NULL AND "assets"."archive_number" IS NULL AND "assets"."assettype_id" = 3 AND ((assets.lastseendate >= NOW() - INTERVAL '30 days') AND ((devices.stop_time IS NULL) OR (devices.stop_time >= NOW() - INTERVAL '30 days') OR (devices.launch_time IS NOT NULL AND devices.launch_time > devices.stop_time))...

Write a program that adds together all the integers from `1` to `250` (inclusive) and `puts`es the total

How would I do this using ruby and only using a while loop with if, elsif and else only? from Recent Questions - Stack Overflow https://ift.tt/3B0IEcQ https://ift.tt/eA8V8J

Firebase push notification not delivered if device is idle for few minutes and no charging state

Firebase push notification is working fine for all three states of app: foreground, background, killed. But notification not delivered if device is idle for few minutes and no charging state. However on charging push notification is working no matter how long idle time is. I have tried with: disabling 'Power saving mode'. disabling 'Adaptive power saving mode'. battery optimization for app. added in manifest <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> removed [android:exported="false"] from <service android:name="firebase.MyFirebaseMessagingService" =>[android:exported="false"]> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> { "registration_ids": [ ...

How to make this program run 4 times without ending

I just started "Introduction to C++" this semester, and I'm stuck on an exercise that involves taking data from a table and writing a program that will let you input and display each item (line by line) showing the Item, Cost, and calculated Total Cost. The program I've written works perfectly for the first item, but I need it to repeat the same 3 questions (allowing user input of different items/costs/discounts each time it repeats the questions), while printing the calculated total after each question is answered. I'm assuming this will involve either a do-while loop or a for loop, but I can't figure out how to integrate what I've already written into a loop. #include <iostream> using namespace std; int main() { string Item; float Cost; float Discount; float TotalCost; cout << "What is the item? \n"; cin >> Item; cout << "What is the cost? \n"; cin >> Cost; cout...

node js upload image and upload to ftp: works for one but not two images

var ftpClient = new ftp(); var form = new formidable.IncomingForm(); form.parse(request, function(err, fields, files) { if (files.shoplogo.name) { var dimensions = sizeOf(files.shoplogo.path); console.log(dimensions.width + " x " + dimensions.height); if (dimensions.width > 255 || dimensions.height > 255 || dimensions.width < 145 || dimensions.height < 145) { response.send('<script>alert("Das Bild darf nicht größer 250x250 oder kleiner als 150x150 sein."); history.back(); </script>'); return; } if (files.shoplogo.size > 200000) { response.send('<script>alert("Das Bild darf nicht größer als 150 kb sein."); history.back(); </script>'); return; } else { var oldpath = files.shoplogo.path; ftpClient.on('ready', function() { ftpClient.put(oldpath, '/web/shopC...

How can I get #text child node as element with beautifulSoup? - Python

I want to get every part of inner text of parsed <p> tag as soup-element with beautifulSoup in Python. Im currently migrating the parser from php to python. Here is some code on php and my tryings of recreating functional in Python beautifulSoup: PHP (that working) foreach($pTagNode->childNodes as $innerNode){ if($innerNode->nodeName == "#text"){ # Editing and parahrasing text part of <p> tag... } else if($innerNode->nodeName == "a"){ # Do something with "a" tag, like removing blacklisted link or chaning text... } } PYTHON (that doesnt) node = soup.select("p")[0] # <a> tag for pnode in node.select("a"): print("link found: " + pnode.string"); # <#text> tag for pnode in node.select("#text"): print("text found: " + pnode.string) # This message doesnt shown :( HTML structure I want to parse: ... <body> <p>Some...

Can anyone pls explain me in detail how this number got swaped step by step (comma operator) [closed]

#include<stdio.h> int main(void) { int a=8,b=7,temp; printf(“a=%d, b=%d\n”,a,b); temp=a,a=b,b=temp; printf(“a=%d, b=%d\n”,a,b); return 0; } Can anyone pls explain me in detail how this number got swaped step by step (comma operator) from Recent Questions - Stack Overflow https://ift.tt/3ukViAy https://ift.tt/eA8V8J

SwiftUI - using ForEach with a Binding array that does not conform to identifiable / hashable

I have the a codable object as follows: struct IncidentResponse: Codable { let incident: IncidentDetails? } struct IncidentDetails: Codable, Identifiable { let id: String? let reason: IncidentReasonResponse? let message: String? let startedAt: String? let endedAt: String? } struct IncidentReasonResponse: Codable, Identifiable { let id: String? let name: String? let code: String? let inOp: Bool? } Here is an example of an incident response when called from the API: { "incident": { "id": "610aebad8c719475517e9736", "user": null, "reason": { "name": "No aircraft", "code": "no-aircraft", "inOp": true }, "message": "test this", "startedAt": "2021-08-04T19:34:05+0000", "endedAt": null } } In SwiftUI, I am trying to display a list of these. So I have ...

Error due to Maven, unable to build and install strongbox from code

I am looking to do some OSS work in order to get hands-on in Software Engineering. I want to contribute to the strongbox. Problem faced: I am not able to build strongbox with the build steps given here : git clone https://github.com/strongbox/strongbox cd strongbox mvn clean install Output: After running the command mvn clean install the output that I receive is: WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [INFO] Scanning for projects... [IN...

Can you run human pose estimation and object detection at same time in Detectron2

Is it possible to run human pose estimation and the object detection that identifies other objects such as cars, animals, etc? from Recent Questions - Stack Overflow https://ift.tt/3EYhFAX https://ift.tt/eA8V8J

Conditional Debit from Credits using SQL

Image
I have one table cryptotransactionledger in below structure where transactions are stored. TRANSACTION_TYPEID is foreign_key from TRANSACTIONTYPE table (master table). How can I write a query to implement below rules bitcoin-transferred should only be deducted from bitcoin-mined bitcoin-lost can be deducted from either bitcoin-received or bitcoin-mined in FIFO manner Below is the expected result and DB fiddle to above table transaction_name Remaining Amount bitcoin-received 0 bitcoin-mined 10 Logic for remaining balance: bitcoin-received = transaction_typeid 101 - 104 (i.e. 5 - 10. Since bitcoin-received amount is just 5, only 5 coins out of 10 bitcoin-lost will be deduced from here. Remaining 5 will be deducted from bitcoin-mined in FIFO manner) bitcoin-mined = transaction_typeid 102-103-104 (i.e. 20 - 5 - 5(balance after deduction from bitcoin-received (above line) )) http://sqlfiddle.com/#!4/0fd02/1 Thanks in advance from Recent Questions - Stack O...

How to set values in cell to write in Android Studio

I managed to set label for my Excel, but I want to set values to cells which is an array and I want to set values with For loop but with this code my for loop doesn't work and label 4 and 5 don't write in my Excel file. how can i set values to cells that those values change in every iteration? String sdCard = getExternalFilesDir("/").getAbsolutePath(); File directory = new File(sdCard + "/MyFolder/"); //create directory if not exist if(!directory.isDirectory()){ directory.mkdirs(); //Toast.makeText(getApplicationContext(),"dir",Toast.LENGTH_LONG).show(); } //file path File file = new File(directory, fileName); WorkbookSettings wbSettings = new WorkbookSettings(); //wbSettings.setLocale(new Locale("en", "EN")); WritableWorkbook workbook; try { int a = 1; workbook = Workbook.createWorkbook(file, wbSettings); //Toast.makeText(getApplicationContext(),"done4",Toast.LENGTH_LONG).show(); //Excel shee...

@EnableJpaRepositories annotation disables data.sql initialization script

My Spring Boot (v2.3.4) based application uses my custom library containing core entities and business logic. To use entities and repositories from this library I had to use @EnableJpaRepositories and @EntityScan annotations with proper packages provided. I also wanted to initialize database with some required data (let's say the configuration) during application startup. I found that Spring Boot allows to use data.sql or data-${platform}.sql files to achieve that. Long story short when using @EnableJpaRepositories annotation the data.sql script is not executed. I did some digging in the code and found that when @EnableJpaRepositories annotation is not used then entityManagerFactory bean is of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean type. This bean uses org.springframework.boot.autoconfigure.orm.jpa.DataSourceInitializedPublisher bean post processor, which fires org.springframework.boot.autoconfigure.jdbc.DataSourceSchemaCreatedEvent event i...

Why is meson interpreting my ccflags with the single quotes?

I'm editing a meson build file. a line that currently exists the the file is working perfectly. if cc.has_argument('-Wno-format-truncation') default_cflags += '-Wno-format-truncation' endif I've added a line because I want debug information: default_cflags += '-ggdb -O0' However, this is being interpreted with the single quotes, and breaking the make command. -Wno-missing-field-initializers -D_GNU_SOURCE -march=native '-ggdb -O0' -DALLOW_EXPERIMENTAL_API -MD -MQ Obviously, cc doesn't like this and is throwing an error. What is causing meson to interpret this output with the single quotes? I've tried double quotes and no quotes, but that throws other errors altogether. Edit This is a dpdk build file, so the compiler call is: executa...

How do I get ISO 3 Amount from given currency?

I am working with an API that expects currency to be multiplied by ISO 3 code. Given I have a table that gives me the values for ISO 4217 as follows:- CURRENCY, DECIMAL JOD 3 AED 2 and so on. and for example: If the amount value was 500 AED; according to ISO code 3, you should multiply the value with 100 (2 decimal points); so it will become 50000. Another example: If the amount value was 100 JOD; according to ISO code 3, you should multiply the value with 1000 (3 decimal points); so it will become 100000. Given I have the amount 500 and knowing the decimal for AED is 3 how do I get the 50000? My approach is as follows but don't think its right. decimal amount = 500m; int decValue = 3; var decimalAmount = (amount * decValue * 100); //50000 from Recent Questions - Stack Overflow https://ift.tt/3o7GzYV https://ift.tt/eA8V8J

How to replace any character in any position according to the pattern

I have a problem like the below: Given a string and a character and position need replace, for example as below: Input: string: str = ABCDEFGH, prefix = "_" and position = 3, Output: result = AB_CDE_FGH Input: string: str = 10000000, prefix = "_" and position = 3, Output: result = 10_000_000 Input: string: str = 10000000, prefix = "_" and position = 2, Output: result = 10_00_00_00 This is my code: fun convertNumberByCharacter(pattern:String,position: Int,characters: String):String{ val strBuilder = StringBuilder() val arr = pattern.toCharArray() return if (arr.size>position){ for (i in 0..arr.size-1){ if (i%position==0){ strBuilder.append(characters) } strBuilder.append(arr[i]) } strBuilder.toString() }else{ pattern } } Note: DecimalFormat and NumberFormat cannot be used in this problem. Please, Anyone could help me. Thank you. from Recen...

Add markers from json in php page with maps [duplicate]

I'm trying to plot markers in php page with Google Maps api controlled by radio buttons. All data markers are loading correctly (json) but the map does not render. Please see below the code that I'm trying to run. I rebuild all code, the service API returns [{"car":"16","bike":"20","skate":"63","lat":"19.79956153","lon":"42.51250001"},{"car":"23","bike":"21","skate":"65","lat":"19.79980055","lon":"42.51244114"},] Currently the error on console describes Uncaught ReferenceError: initialize is not defined at HTMLInputElement.onclick. <html> <head> <title>Google Maps</title> <meta name="author" content=""/> <meta name="keywords" content="phone"/> <script src="https://...

Using a new activity function creates -nan values in TensorFlow

I define a new activity function motivated by the reLU activation. However, it does not function correctly and I get -nan values after the first epoch. import numpy as np import tensorflow as tf from tensorflow import keras from tensorflow.python.ops import math_ops training_input= np.random.random ([200,5]) * 200 #input data training_input.astype(int) training_output = np.random.random ([200,1]) # output data def custom_act(alpha=0.0): #new activity function def new_act(x): neg = tf.cast(tf.math.greater_equal(0.0, x), dtype='float32') # less than zero pos = tf.cast(tf.math.greater_equal(x, 0.0), dtype='float32') # greater than zero # if <0, then x. if>0, then scale it with alpha and exponential return tf.cast( (neg*x) + (alpha*pos*(1-tf.math.exp(-x)) ) , tf.float32) return new_act model = tf.keras.Sequential([ tf.keras.layers.Input(shape=(5,)), tf.keras.layers.Dense(64, activation="relu...

STL generic algorithms - implicit conversion of the ranges element type to the predicates parameter type

Say I want to remove all punctuation characters within a std::string using the erase-remove idiom. However, let str be of type std::string , this call won't compile str.erase( std::remove_if(str.begin(), str.end(), std::ispunct), str.end() ); Now I guess, strictly speaking the std::ispunct callables parameter type is int and therefore doesn't match the ranges element type char . However, as a char is a numeric type it should be convertible to int . I'm working with Lippman's C++ Primer book which states The algorithms that take predicates call the predicate on the elements in the input range. [...] it must be possible to convert the element type to the parameter type in the input range. which imo is given in the above statement. Also std::ispunct returns an int , and thus should be usable as a condition. So why does the compiler complain no matching function for call to 'remove_if' ? ( clang++ -std=c++11 -o main main.cc ) A fix would be to use a l...

Google Sheets query function needing to provide 0 value for no value found

The query function looks at a separate sheet with orders entered by a dealer. In some months the dealer may not have a order. The B:B column in current sheet is all the dealers in Ascending order. Then I have separate columns for by month view with 3 columns per month. Number of contracts, amount then average. My query calculates correctly, but if a dealer doesn't have a contract then it skips. So my list is out of order. I'm needing it to place a 0 if no value found. I have 2 versions of the query. J = amount, H = Dealer name, A = Date, the B = is the dealer list in current sheet. This query populates but out of order due to skipping NUll or NA. =QUERY('2021ContractsData'!A:V,"Select COUNT(J),SUM(J),AVG(J) WHERE MONTH(A)+1=1 Group By H LABEL COUNT(J) 'Contracts',SUM(J) 'Amount',AVG(J) 'Average'") This query populates nothing, it shows the Header names but no values in rows. =QUERY('2021ContractsData'!A:V,"Select COUNT(J),S...

Is dotnet restore broken on macos?

This has recently just started happening. dotnet --version 5.0.104 macOS Big Sur version 11.6 when I run dotnet restore Determining projects to restore... /Users/xxx/Work/mvc/mvc.csproj : warning NU3028: Package 'System.Security.Cryptography.ProtectedData 5.0.0' from source 'https://api.nuget.org/v3/index.json': The author primary signature's timestamp found a chain building issue: ExplicitDistrust: The trust setting for this policy was set to Deny. /Users/xxx/Work/mvc/mvc.csproj : warning NU3028: Package 'System.Windows.Extensions 5.0.0' from source 'https://api.nuget.org/v3/index.json': The author primary signature's timestamp found a chain building issue: ExplicitDistrust: The trust setting for this policy was set to Deny. /Users/xxx/Work/mvc/mvc.csproj : warning NU3028: Package 'System.Security.Principal.Windows 5.0.0' from source 'https://api.nuget.org/v3/index.json': The author primary signature's timestamp found a...

Hosting on netlify

My pg is running locally and with lsof -i :5432 my pg is running on my account just fine. But when I try to host on netlify I get In Gemfile: pg Error during gem install when trying to deploy the site full log below I have also tried deploying to heroku as well but react routers for some reason is not working with it. It displays my homepage but my routes display nothing (works locally tho). 12:03:04 PM: Build ready to start 12:03:06 PM: build-image version: 081db65c3e4ce8423fedb40e7689a87de6f84667 12:03:06 PM: build-image tag: v4.3.1 12:03:06 PM: buildbot version: f650485c830eb31597911322420b99299a4303b8 12:03:06 PM: Building without cache 12:03:06 PM: Starting to prepare the repo for build 12:03:06 PM: No cached dependencies found. Cloning fresh repo 12:03:06 PM: git clone https://github.com/IvanWiesner/prison-joe-fixed 12:03:07 PM: Preparing Git Reference refs/heads/main 12:03:08 PM: Parsing package.json dependencies 12:03:08 PM: Different publish path detected, going to use the...

C - Exposing 3rd party data structures in a library's public header file

I'm writing a library that wraps around a REST API and representing some of the data requires use of data structures like hash maps that are not available in the C standard library so internally I'm using 3rd party libraries for their implementations. Now I'd like to expose them in a response struct, I've come up with a couple of solutions: Just expose the type as it is and add a dependency on the 3rd party lib and make the user call the appropriate API functions (Eg hashmap_lib_get(users, "key") to get a value): // header.h (Include guards excluded) #include <hashmap_lib.h> struct api_response { int field1; char *field2; HASHMAP_LIB_HM *users; // Map of users to their email. (example) }; Issue: Requires extra user intervention, even more problematic in case the library is implemented using generic macros. Expose the type as a void pointer inside the struct and write duplicated wrappers for all appropriate functions: // header.h st...

In C#, what is wrong with my negative test of TryAsync?

I have the following method: public TryAsync<bool> TryRelay( MontageUploadConfig montageData, File sourceFile, CancellationToken cancellationToken ) => new(async () => { byte[] fileContent = await _httpClient.GetByteArrayAsync(sourceFile.Url, cancellationToken); return await _attachmentController.TryUploadAttachment(montageData.EventId, fileContent, sourceFile.Name); }); I created a couple tests to prove it works as expected. My test for a negative case is failing. This is the test: [Fact] public static async Task TestRelayShouldCatchErrorsGettingFile() { // Arrange Mock<IAttachmentControllerV6> mockAttachmentController = new(); Mock<HttpMessageHandler> mockHttpMessageHandler = new(); MontageUploadTaskProcessor mockProcessorUnderTest = CreateProcessor(mockAttachmentController, mockHttpMessageHandler); MontageUploadConfig montageData = new() { EventId = "Test001" }; File sourceFile = new()...

Usage of SIM card GlobalPlatform keys in field

Question 1 . When a SIM manufacture personalizes a SIM card and then the mobile operator hand it over to an end user, are there any usage for GlobalPlatform (GP) keys (ENC,MAC,KEK,...)? As long as I know the SIM file structure or its applets are accessible by (KID/KIC/KIK) over OTA RFM and RAM. So there is no need to have GP keys when SIM is in hands of customers. Are there anywhere special (e.g. during OTA interactions that we require GP keys or not)? As I understood correctly, GP keys are usable when we physically can access a SIM card and we can directly send APDUs to the SIM. Am I right? Question 2 . Is it possible to access SIM/USIM file structure using global platform commands (e.g. is it possible to read record, read binary) using GP keys and access which ISD has? Typically file structure is accessible based on access conditions defined in 3GPP TS 51.011/ETSI TS 151 011 using PIN and ADM keys. But is it possible using GP keys and access which ISD has? from Recent Questions...

How to use caret functions to achieve the same results as this for loop? Classification Random Forest caret

I want to run monte carlo cv 100 times on my data, my data is 2 class classification I want to use the caret package to achieve the same thing, mainly I'm confused about how to average the results of accuracy for example using caret? # Initialize data for Binary classification dataset$ID <- factor(dataset$ID) # Initialize number of iterations num_iter=100 # Vectors to store results acc_vec<-c() # Function with for loop rf <- function(dataset) { for (i in 1:num_iter) { trainIndex <-createDataPartition(dataset$ID, p=0.8,list=FALSE) dataset_train <-dataset[trainIndex, ] dataset_test <-dataset[-trainIndex, ] rf <- randomForest(ID~., data=dataset_train, importance=TRUE) x_test <- dataset_test[, -1] y_test <- dataset_test$ID predictions <- predict(rf, x_test) acc_vec <- append(acc_vec, accuracy(actual= y_test, predicted= predictions)) } print(mean(ac...