I have a Date/Time column in format "13.10.2020 06:08:43" and I need to calculate the "age" from current time. Output should be like from given example: "4h" since its 10:08 atm - Date/Time column was 4h ago. I need this to be in M language to use in visual studio 2019. I used: let Source = Sql.Database("xxxx", "xxxxx", [Query="SELECT#(lf)#(tab)storeid as 'Shop'#(lf)#(tab), concat('SCO', posnr) as POS#(lf)#(tab), concat(datediff(hour,[LastTransactionDate]#(lf)#(tab), CURRENT_TIMESTAMP),' h') as 'Age'#(lf)#(tab), POSIPaddress as 'IP'#(lf)#(tab),[PosNr]#(lf) ,[AdapterPosOrGroupId]#(lf) ,[Updated
How does one plot a pie for value_counts() using plotly express for the following series: import pandas as pd import string, random s = pd.Series(random.choice(string.ascii_uppercase) for _ in range(100)) I can see that it can be done through go using: import plotly.graph_objects as go go.Figure(data=[go.Pie(labels=s.value_counts().index, values=s.value_counts().values)])
I have a server remote console webstart application - jnlp file which needs to connect via a SOCKS proxy. The challenge I have is that I do not want to change the IE proxy or common Java network settings to use the jnlp file as it's 1) tedious to change it every time, 2) interferes with other java applications parallelly running connecting to intranet/internet I would like to know if its possible to set the proxy like below. This will help me to run the jnlp file using a batch file and the proxy settings will be confined to this instance of the jvm. javaws -JsocksProxyHost=127.0.0.1 -JsocksPro
In JavaScript, if I'm not sure whether every element of the chain exists/is not undefined, I can do foo?.bar, and if bar does not exist on foo, the interpreter will silently short circuit it and not throw an error. Is there anything similar in Python? For now, I've been doing it like this: if foo and foo.bar and foo.bar.baz: # do something My intuition tells me that this isn't the best way to check whether every element of the chain exists. Is there a more elegant/Pythonic way to do this?
I have found some issues opened about this error but I cannot find a solution that works for me. I am getting errors related to proj.db when running an executable file I have created using pyinstaller. I have Windows 10, Python 3.5 and I have in my environment pyproj 2.4.2 and gdal 3.0.4 I am using GDAL in a python script and I have an environment that it is working fine for me when I test the script using Pycharm. So my pycharm interpreter is pointing to that environment with python 3.5, pyproj 2.4.2 and gdal 3.0.4 and the script runs with no issues. However, when I build a standalone script
Estoy usando una base de datos en phpmyadmin para realizar un ejercicio de clase, en el que tengo que crear una clase para insertar contenido de un formulario y se crearía el post, yo consigo guardar en la base de datos el contenido del formulario, pero la imagen que inserto, se guarda solo como el nombre de la imagen en la base de datos, por lo tanto necesito que al guardar en nombre en la base de datos también guarde el archivo de la imagen en una carpeta llamada blog, situada donde tengo mi proyecto, he estado buscando tutoriales pero no logro saber que estoy haciendo mal, dejo por aquí mi
IntelliJ shows the number of characters and linebreak at the right bottom corner of the screen when we select a text. I'm trying to figure out if there's a way to count number of words in a text selection.
I'm using React SPA. When I use gtag to track users in Google Analytics, I am confused about the data that I see in Real-Time Google Analytics. When the app starts or the user is routed to a new react route, I fired an event like this to set the correct page and log pageView: window.gtag('config', UA-123456789-1, { groups: 'MYGROUP', page_path: '/contacts', }) When the user clicks on the button or makes some interesting action I fire an event like this: window.gtag('event', 'Some button click', { sendTo: 'MYGROUP', event_category: 'buttons on main page', }) Many events are button clicks on pag
I am new to AWS ec2 instance, I have tried to host my server code on ec2 I have done my instance setup successfully based on the following reference from "https://ourcodeworld.com/articles/read/977/how-to-deploy-a-node-js-application-on-aws-ec2-server". On the ec2 ubuntu server, I am getting "npm ERR! [email protected] install: node-gyp rebuild" error when I install node-modules using npm I cmd. I have tried many examples from StackOverflow no one solved my issue. The error message is following below npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] install: `node-gyp rebuil
How to auto focus on textfield in jetpack compose. When i click on textfield and start typing on it. Meantime when i click back button,then when i'm try to click on textfield, nothing happens. val textState = remember { mutableStateOf(TextFieldValue()) } TextField( modifier = Modifier.fillMaxWidth(), value = textState.value, onValueChange = { value : TextFieldValue -> textState.value = value } )
How do I create a function to search on a database and return just the ID of a type? Actually, I have a database, where I can search for a pair. The pair is a Type, in F#: module Types = [<CLIMutable>] type Pair = { Id :int64 PairName : string } My objective is to create a function, that return just the value of the ID (int) given a PairName. I Already have a function that returns a Pair, given this name. module Query = let GetSingleByName name = querySingleAsync<Types.Bird> { script "SELECT * FROM Pair WHERE PairName = @Name LIMIT 1" parameters (dict ["Name", box name]) } How can I return jus
I have two questions about FAT32: The first: If I want to format a partition with FAT32 using a 32 KB block size, I think the maximum partition size I can get is: 2^28 * 32 = 8 TB But why do I see them list it as the maximum partition size is 2 TB in every reference, and Windows limits it to 32 GB only?! The second question: If I want to know the size of the FAT Table in memory (to know memory consumption) assuming I'm use a 32 GB partition size with a 32 KB block size, how to calculate that?! This is what I know, but not sure about it: First, I have to know the number of entries which is 32 G
I'm trying to start up my application on k8s using the image Linux 4.14.165-133.209.amzn2.x86_64 and using openjdk 11 with maven, but the application does not start because of the following error java.sql.SQLRecoverableException: IO Error: Connection reset by peer, Authentication lapse 0 ms. at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:874) ~[ojdbc8-19.3.0.0.jar!/:19.3.0.0.0] at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:793) ~[ojdbc8-19.3.0.0.jar!/:19.3.0.0.0] at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:57) ~[ojdbc8
I'm trying to add a new Livewire component to Laravel 8 Jetstream but looks I'm doing something wrong and getting the following error. Error: Livewire\Exceptions\RootTagMissingFromViewException Livewire encountered a missing root tag when trying to render a component. When rendering a Blade view, make sure it contains a root HTML tag Route: // web.php Route::middleware('auth')->group(function() { Route::get('/newEmployee', NewEmployee::class); }); Controller: // app/Http/Livewire/NewEmployee.php namespace App\Http\Livewire; use Livewire\Component; class NewEmployee extends Component { public f
I've just made an "app" that uploads videos in a given folder, the program works, however whenever I upload a video through my program, it makes the video private (locked). I then get a mail saying that my program has not yet been approved. I have tried setting status.privacyStatus to both unlisted and public, without succes. Any idea on how to get my application approved so I can upload public videos? I suspect it might have to do with Oauth, however I am not sure where I went wrong
I'm trying to get OAuth to work in a Node.js app with Express and Google APIs. The application throws TypeError in the UUID dependency which is included with the googleapis-common module: Exception has occurred: TypeError: Cannot assign to read only property 'name' of function 'function generateUUID(value, namespace, buf, offset) { if (typeof value === 'string') { value = strin...<omitted>... }' at _default (C:\Users\ficar\OneDrive\Desktop\Frontend\node_modules\googleapis-common\node_modules\uuid\dist\v35.js:71:23) at Object.<anonymous> (C:\Users\ficar\OneDrive\Desktop\Frontend\node_modules\go
Getting refusing to allow an OAuth App to create or update workflow .github/workflows/cd.yml without workflow scope" on git push. How to grant workflow scope?
I would like to cluster a huge dataset into clusters based on similarity. How can I approach this problem? I have tried MinBatchK means and DBSCAN, but I am not getting great results. The problem I am facing with MinBatchKMeans is I have to specify the number of clusters beforehand and with DBSCAN most are classified as noise. Can someone please guide me on how to approach this problem? I am using TFIDF to convert text into vectors. For example, when I am using a dataset of 80,000 records, it takes around 2-3 hours to form a cluster of size 500. This makes it very difficult to find optimal num
I was trying to create a GORM model for a postgres database, containing a type with a custom Scanner and Valuer that converts a string slice to and from a string, to be saved as a single database column. If the slice is either empty or nil, I want the database column to also be nil (as opposed to an empty string). type MultiString []string func (s *MultiString) Scan(src interface{}) error { str, ok := src.(string) if !ok { return errors.New("failed to scan multistring field - source is not a string") } *s = strings.Split(str, ",") return nil } func (s MultiString) Value() (driver.Value, error)
I'm trying to get my result dictonary from sqlalchemy automatically to the Pydantic output for Fastapi to maps using the from_orm method, but I always get a validation error. File "pydantic\main.py", line 508, in pydantic.main.BaseModel.from_orm pydantic.error_wrappers.ValidationError: 2 validation errors for Category name field required (type=value_error.missing) id field required (type=value_error.missing) If I create the objects with the Pydantic schema myself and add them to the list, the method works. What would I have to change for from_orm to work? Did I possibly miss something in the d
My WordPress web site is currently very slow as it has a lot of unused files and because people have worked on it for four years. I there a way I could check if a particular CSS or js file is being used anywhere in my web site so that I could delete if not being used and make my web site faster?
My company uses Power BI and we are trying to get incidents data from PagerDuty API. I have been struggling to find a way to get all the data but I am not knowledgeable about PowerBI, PowerQuery, or dealing with APIs. I am in a database role. I used Get Data option in Power BI and selected Web as data source. Entered My API link, and passed the headers. The result I get is limited to 25 by default, I can change it to up to 100 but my main issue is with not being able to get next set of results. I need to have some kind of loop to increase the offset parameter and refresh the query. My current
I want to insert a document into a MongoDB in an idempotent way. The explanation provided by the MongoDB documentation, and also here on SO, is to use the upsert=True modifier. However, to my understanding, this does not guarantee idempotence, because an already existing document could be modified. The operation I am looking for is as follows: If the document, identified by some key, does not exist, insert it. If a document with the given key already exists, there are two things that might happen: The existing document and the provided document are exactly the same. Then, return the same resul
My Lambda function has limit 15 minutes which was 5 minutes ealier.Lambda process is automatically terminated after 15 minutes but my process takes more than 15 minutes. How I can manage ?
I am developing an iOS app and it works well on Xcode 11.7, but when I run the same code in Xcode 12 and when I enter a UIPageViewController, the app runs into an infinite loop and the cpu usage shows 99%. Here is a screenshot I made after pause the app in debugger. It shows Application violated contract by causing UIApplicationMain() to return. This incident will be reported.
How do I use SVG image as the base map for mapbox GL JS ? I know, that OpenLayers and Leaflet provide such opportunity for developers. Leaflet: var svgUrl = 'image.svg', imageBounds = [[0, 0], [100, 100]]; L.imageOverlay(svgUrl , imageBounds).addTo(map); OpenLayers: var svgUrl = 'image.svg', var imgLayer = new ImageLayer({ source: new Static({ url: svgUrl, projection: projection, imageExtent: extent, imageLoadFunction: function (image, src) { image.getImage().src = src; image.getImage().width = olExtent.getWidth(extent); image.getImage().height = olExtent.getHeight(extent); }, }), }); map.addL
I am trying to download the XBRL data from the SEC site, using the finstr package in R. The vignette references Apple financial statements from 2013-14. I am going after Abbott (CIK 1800) for mine. I've looked through the data records on the SEC site and the submission is in this folder: https://www.sec.gov/Archives/edgar/data/1800/000110465920023904 The Apple xml file is named aapl-20140927.xml (the CIK followed by the submission date). I've gone into the file through a browser and identified the relevant data. The Abbott xml file that has the same info is named abt-20191231x10k59d41b_htm.xml
I'm using React and have a file tree like this: src/ common/ common-comp1/ common-comp1.js common-comp1.test.js index.js common-comp2/ common-comp2.js common-comp2.test.js index.js index.js app/ app-comp1/ app-comp1.js app-comp1.test.js index.js app-comp2/ app-comp2.js app-comp2.test.js index.js index.js All of the index.js files are barrel files that export * from '...';. I have path aliases set up so that I can import CommonComp1 from 'common'; in src/app/app-comp1/app-comp1.js. Unfortunately, this loads/transforms the code from src/common/common-comp2/* as well, even though app-comp1.js doe
I performed a PCA on my data, and I have four principal components. However, it is very difficult to interpret my results with principal components. Therefore, I was wondering can I do a post hoc, by taking the variable with the highest variance in PC1 (say X1) and the variable with the highest variances in PC2 (say X2) and perform a regression analysis, with an outcome variable y, to test their association? (i.e., lm(Y~X1+X2)) Here's an example: I have four independent variables: memory test, cognition test, attention test, and processing speed test. I have one dependent variable, brain conne
My application runs on .NET framework 4.7 and I'm using Entity Framework 6.1.3. Currently, my code uses some classes from the namespace System.Data.SqlClient such as SqlParameter. I want to switch to Microsoft.Data.SqlClient. However, I'm not sure if EF6 is compatible with Microsoft.Data.SqlClient. This is an old article from Microsoft, it says that EF Core, EF 6 etc. haven’t yet made the transition to the new provider Microsoft.Data.SqlClient. So, I'm a bit confused. Everything has been working well with System.Data.SqlClient for the below code public async Task<ICollection<int>> GetChildCust