instruction
stringlengths
0
30k
Lazy loading of dependent relationship in SwiftData
|ios|swiftui|swift-data|swift-data-relationship|
{"Voters":[{"Id":2422778,"DisplayName":"Mike Szyndel"},{"Id":17562044,"DisplayName":"Sunderam Dubey"},{"Id":16217248,"DisplayName":"CPlus"}],"SiteSpecificCloseReasonIds":[11]}
{"Voters":[{"Id":596285,"DisplayName":"BMitch"},{"Id":17562044,"DisplayName":"Sunderam Dubey"},{"Id":16217248,"DisplayName":"CPlus"}]}
I'm new in Qwik, I want to make a full stack web application (Real time chat application), The problem is I do not know how to add MongoDB or MySQL, Firebase. I try to make express server, but is there any way? anyone can help me please Thank you in advance
How to add MongoDB in Qwik?
|qwik|qwikjs|
null
The problem here lies in parsing the data:-- to resolve:-- 1. `npm install body-parser` 2. now require it through express,by `{ const bodyParser = require('body-parser') }` 3. and then `{ app.use(bodyParser.json()) }` The undefined will be removed now and you can get the desired change.
null
The problem here lies in parsing the data. Do this: 1. `npm install body-parser` 2. Now require it through express with `{ const bodyParser = require('body-parser') }` 3. and then `{ app.use(bodyParser.json()) }` The undefined will be removed now and you can get the desired change.
{"Voters":[{"Id":11002,"DisplayName":"tgdavies"},{"Id":17562044,"DisplayName":"Sunderam Dubey"},{"Id":16217248,"DisplayName":"CPlus"}],"SiteSpecificCloseReasonIds":[11]}
{"Voters":[{"Id":573032,"DisplayName":"Roman C"},{"Id":466862,"DisplayName":"Mark Rotteveel"},{"Id":16217248,"DisplayName":"CPlus"}]}
{"Voters":[{"Id":-1,"DisplayName":"Community"}]}
{"Voters":[{"Id":2954547,"DisplayName":"shadowtalker"},{"Id":22180364,"DisplayName":"Jan"},{"Id":16217248,"DisplayName":"CPlus"}]}
{"Voters":[{"Id":2954547,"DisplayName":"shadowtalker"},{"Id":22180364,"DisplayName":"Jan"},{"Id":16217248,"DisplayName":"CPlus"}],"SiteSpecificCloseReasonIds":[]}
here, i tried a few using IB_insync on github, ibapi is a bit of trouble for me still. [https://github.com/cosmoarunn/ib_insync_examples][1] [1]: https://github.com/cosmoarunn/ib_insync_examples
The shape is symmetrical about the y axis, so you can start at x = 0 and sum the rectanglar areas 2(exp(-x^2) - x^2)dx, incrementing x by dx until exp(-x^2) <= x^2. Choose dx to be small enough to give you the accuracy you need.
|java|spring|spring-boot|intellij-idea|dependencies|
null
Let's say we have the following SharePoint working URL: https://mywebsite.sharepoint.com/_layouts/15/Test.aspx The following code works for determining if the URL works or not unless the user is authenticated with Azure AD access token var request = NetHelper.CreateWebRequest(url, allowAutoRedirect: true, method: WebRequestMethods.Http.Head); ...... // Authentication ...... bool exists = false; using (var response = request.GetResponseWithRetry()) { if (response != null) { exists = response.StatusCode == HttpStatusCode.OK; } } This method works when we have the `CookieContainer` (username/password authentication) for authenticating. However, as per https://sharepoint.stackexchange.com/questions/248732/how-to-get-cookies-after-obtaining-azure-ad-access-token-to-sharepoint-online/248735 it's not possible to make `WebRequest` work when Azure AD authentication is being used and we apply `HttpRequestHeader.Authorization` header. I tried to use CSOM library: var csomFile = context.Web.GetFileByServerRelativeUrl(serverRelativeUrl); context.Load(csomFile, f => f.Exists); context.ExecuteQueryWithRetry(); bool exists = csomFile != null && csomFile.Exists; However, this kind of code works only for actual files (I guess). It always returns `False` for the URL `https://mywebsite.sharepoint.com/_layouts/15/Test.aspx`. So, my question is - Is there a way to determine if the URL exists using CSOM library, assuming we already have the authenticated `ClientContext` object (which can use either `CookieContainer` or `HttpRequestHeader.Authorization` header).
I ended up installing C++ Desktop development kit *from visual studio installer*, which was a hard decision for me. I wanted to manage everything from inside winget, but I guess that's not viable, as long as you are using Windows. Plus, you shouldn't install Rust(MSVC) package for rust because packages like rustfmt are installed from rustup.
The double dollar sign `$$` is incorrectly treathed as escape char. Try to use this instead: `^https?://(.*)(:[0-9]+)?\$`
I also try create PowerShell function for rename AppPool with reconfiguring Applications. I thing this procedure correctly renames AppPool Original to AppPool New: 1. Check if AppPool Original and AppPool New exist. AppPool Original must exist. AppPool New must not exist. 2. Make a list of Apps that are associated with AppPool Original, if any. 3. Record AppPool Original status. 4. Export AppPool Original as xml to a temporary file. 5. Rename AppPool Original in the temporary file to AppPool New. 6. Create AppPool New by exporting a temporary file. 7. Stop AppPool Original. 8. If there are Apps associated with AppPool Original, then reconfigure these Apps to AppPool New. 9. Launch AppPool New. 10. Remove AppPool Original. Script PowerShell: ```PowerShell ######################################################################################################### # Set variables ######################################################################################################### # Original pool name [string]$AppPoolName = 'DefaultAppPool' # New pool name [string]$AppPoolNewName = 'DefaultAppPool2' # Path to appcmd.exe [string]$AppCmd = 'C:\windows\system32\inetsrv\appcmd.exe' ######################################################################################################### # Set functions ######################################################################################################### function Get-IISApps { <# .SYNOPSIS The function will return a list of applications associated with the pool. .DESCRIPTION We use appcmd.exe and get a full list of applications. Then we will leave in the list only those that mention the desired pool name. The result is returned as an array of application names. .EXAMPLE [array]$List = Get-IISApps -AppPoolName 'DefaultAppPool' #> [CmdletBinding()] [OutputType([array])] param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $AppPoolName, [string] $AppCmd = 'C:\windows\system32\inetsrv\appcmd.exe' ) process { # Exporting the list of applications to xml [string]$AppCmdCommand = $AppCmd + ' list app /config:* /xml' [xml]$ListAppsXml = (cmd.exe /c $AppCmdCommand) # Get application names [array]$ListAppNames = @() ($ListAppsXml.appcmd.ChildNodes ) | ForEach-Object { if ($_.'APPPOOL.NAME' -eq $AppPoolName){ $ListAppNames += $_.'APP.NAME' } } # Return an array of application names $ListAppNames } } function Stop-IISPool { <# .SYNOPSIS The function stops the IIS pool .DESCRIPTION The function will execute the pool stop command and wait for the stop to complete. After the stop command is executed, the pool will poll every 100 ms. If the stop is delayed, a message will be displayed every 5 seconds. .EXAMPLE Stop-IISPool -AppPoolName 'DefaultAppPool' -Format 'yyyy.MM.ddTHH:mm:ss.fffZ' #> [CmdletBinding()] [OutputType([string])] param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $AppPoolName, [string] $Format = 'yyyy.MM.dd HH:mm:ss.fff' ) process { [string]$Message = $null [int]$ThisTimer = 0 [int]$TimePrint = 0 $null = (Import-Module WebAdministration) Do { [string]$AppPoolState = (Get-WebAppPoolState -Name $AppPoolName).Value if ($AppPoolState -eq 'Started') { $null = (Stop-WebAppPool -Name $AppPoolName) } Start-Sleep -Milliseconds $ThisTimer $AppPoolState = (Get-WebAppPoolState -Name $AppPoolName).Value if ($AppPoolState -ne 'Stopped') { $ThisTimer = 100 $TimePrint += 100 } if ($TimePrint -eq 5000) { [string]$ThisMessage = '[' + (get-date -Format $Format) + ']' + ' INFO ' + 'Waiting for the AppPool "' + $AppPoolName + '" to stop ...' + [System.Environment]::NewLine Write-Warning -Message $ThisMessage $Message += $ThisMessage $TimePrint = 0 } } while ($AppPoolState -ne 'Stopped') $Message += '[' + (get-date -Format $Format) + ']' + ' INFO ' + 'AppPool "' + $AppPoolName + '" is stopped.' write-host $Message } } function Start-IISPool { <# .SYNOPSIS The function starts the IIS pool .DESCRIPTION The function will execute the pool start command and wait for the start to complete. After the start command is executed, the pool will poll every 100 ms. If the start is delayed, a message will be displayed every 5 seconds. .EXAMPLE Start-IISPool -AppPoolName 'DefaultAppPool' -Format 'yyyy.MM.ddTHH:mm:ss.fffZ' #> [CmdletBinding()] [OutputType([string])] param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $AppPoolName, [string] $Format = 'yyyy.MM.dd HH:mm:ss.fff' ) process { [string]$Message = $null $ThisTimer = 0 $TimePrint = 0 $null = (Import-Module WebAdministration) Do { $AppPoolState = (Get-WebAppPoolState -Name $AppPoolName).Value if ($AppPoolState -eq 'Stopped') { $null = (Start-WebAppPool -Name $AppPoolName) } Start-Sleep -Milliseconds $ThisTimer $AppPoolState = (Get-WebAppPoolState -Name $AppPoolName).Value if ($AppPoolState -ne 'Started') { $ThisTimer = 100 $TimePrint += 100 } if ($TimePrint -eq 5000) { [string]$ThisMessage = '[' + (get-date -Format $Format) + ']' + ' INFO ' + 'Waiting for the AppPool "' + $AppPoolName + '" to start ...' + [System.Environment]::NewLine Write-Warning -Message $ThisMessage $Message += $ThisMessage $TimePrint = 0 } } while ($AppPoolState -ne 'Started') $Message += '[' + (get-date -Format $Format) + ']' + ' INFO ' + 'AppPool "' + $AppPoolName + '" is started.' write-host $Message } } function Rename-IISPool { <# .SYNOPSIS The function will rename the IIS pool .DESCRIPTION The function will create a new IIS pool with the same characteristics as the original. All applications associated with the original pool will be reconfigured to the new IIS pool. The original pool will be deleted. The procedure is as follows: 1. Create a new pool. 2. Stop the original pool if it is running. 3. Reconfigure applications associated with the original pool to the new pool 4. Start a new pool if the original pool was started. 5. Delete the original pool. .EXAMPLE Rename-IISPool -AppPoolName 'DefaultAppPool' -AppPoolNewName 'NewDefaultAppPool' -AppCmd 'C:\windows\system32\inetsrv\appcmd.exe' #> [CmdletBinding()] [OutputType([string])] param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $AppPoolName, [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $AppPoolNewName, [string] $AppCmd = 'C:\windows\system32\inetsrv\appcmd.exe', [string] $Format = 'yyyy.MM.dd HH:mm:ss.fff' ) process { # Let's set the default encoding $PSDefaultParameterValues['*:Encoding'] = 'utf8' # Let's connect the module to work with IIS $null = (Import-Module WebAdministration) # Let's check the availability of pools [bool]$ExistAppPoolOriginal = Test-Path ('IIS:\AppPools\' + $AppPoolName) [bool]$ExistAppPoolNew = Test-Path ('IIS:\AppPools\' + $AppPoolNewName) if (-not $ExistAppPoolOriginal) { [string]$Message = '[' + (get-date -Format $Format) + ']' + ' DEBUG ' + 'AppPool "' + $AppPoolName + '" does not exist. AppPool "' + $AppPoolNewName + '" will not be created.' write-host $Message } if ($ExistAppPoolNew) { [string]$Message = '[' + (get-date -Format $Format) + ']' + ' DEBUG ' + 'AppPool "' + $AppPoolNewName + '" already exists. Nothing to do.' write-host $Message } if ($ExistAppPoolOriginal -and (-not $ExistAppPoolNew)) { # Get a list of applications associated with a pool [array]$ListAppNames = Get-IISApps -AppPoolName $AppPoolName -AppCmd $AppCmd # Let's record the state of the pool [string]$AppPoolState = (Get-WebAppPoolState -Name $AppPoolName).Value # Exporting a pool to a temporary file [string]$TmpPath = New-TemporaryFile [string]$AppCmdCommand = $AppCmd + ' list apppool ' + $AppPoolName + ' /config:* /xml > ' + $TmpPath try { [string]$ExportLog = (cmd.exe /c $AppCmdCommand) } finally { $ErrorCodeExport = $Lastexitcode } if ($ErrorCodeExport -eq 0) { # Rename the pool in a temporary file [xml]$NewAppPool = Get-Content $TmpPath $NewAppPool.appcmd.APPPOOL.'APPPOOL.NAME' = $AppPoolNewName $NewAppPool.appcmd.APPPOOL.add | Where-Object { $_.name -eq $AppPoolName } | ForEach-Object { $_.name = $AppPoolNewName } $NewAppPool.Save($TmpPath) # Importing a pool - Create a pool with a new name. [string]$AppCmdCommand = $AppCmd + ' add apppool /in < ' + $TmpPath try { [string]$ImportLog = (cmd.exe /c $AppCmdCommand) } finally { $ErrorCodeImport = $Lastexitcode } if ($ErrorCodeImport -eq 0) { # Delete temporary file Remove-Item -Force $TmpPath # Let's check if the pool has been created - for slow servers $ThisTimer = 0 $TimePrint = 0 Do { [bool]$AppPoolExist = (Test-Path ('IIS:\AppPools\' + $AppPoolNewName)) Start-Sleep -Milliseconds $ThisTimer if (-not ($AppPoolExist)) { $ThisTimer = 100 $TimePrint += 100 } if ($TimePrint -eq 5000) { [string]$Message = '[' + (get-date -Format $Format) + ']' + ' INFO ' + 'The AppPool import command was successful, but the AppPool "' + $AppPoolNewName + '" has not yet been created. We are waiting ...' write-host $Message $TimePrint = 0 } } while (-not ($AppPoolExist)) [string]$Message = '[' + (get-date -Format $Format) + ']' + ' INFO ' + 'AppPool "' + $AppPoolNewName + '" created.' write-host $Message # Let's stop the original pool if ($AppPoolState -ne 'Stopped') { Stop-IISPool -AppPoolName $AppPoolName } # If the pool is associated with applications, then the applications will be reconfigure to the new pool. if ($ListAppNames.Count -gt 0) { Foreach ($AppName in $ListAppNames) { # Reconfigure the application [string]$AppCmdCommand = $AppCmd + ' set app "' + $AppName + '" /applicationPool:"' + $AppPoolNewName + '"' $ReconfigAppLog = (cmd.exe /c $AppCmdCommand) # Let's check that the reconfiguration was completed correctly [string]$AppCmdCommand = $AppCmd + ' list app /config:* /xml' [xml]$AppXml = (cmd.exe /c $AppCmdCommand) [bool]$AppReconfigTrue = $true $AppXml.appcmd.APP | Where-Object { $_.'APP.NAME' -eq $AppName } | ForEach-Object { if ($_.'APPPOOL.NAME' -ne $AppPoolNewName){ $AppReconfigTrue = $false } } # Display message if ($AppReconfigTrue) { [string]$Message = '[' + (get-date -Format $Format) + ']' + ' INFO ' + 'App "' + $AppName + '" was reconfigured successfully.' write-host $Message } else { [string]$Message = '[' + (get-date -Format $Format) + ']' + ' ERROR ' + 'App "' + $AppName + '" not reconfigured!' write-host $Message } } } # Start a new pool if ($AppPoolState -ne 'Stopped') { Start-IISPool -AppPoolName $AppPoolNewName } # Delete original pool [string]$AppCmdCommand = $AppCmd + ' delete apppool "' + $AppPoolName + '"' [string]$RemoveLog = (cmd.exe /c $AppCmdCommand) # Let's check if the pool has been deleted if (-not (Test-Path ('IIS:\AppPools\' + $AppPoolName))) { [string]$Message = '[' + (get-date -Format $Format) + ']' + ' INFO ' + 'AppPool "' + $AppPoolName + '" deleted.' write-host $Message } else { [string]$Message = '[' + (get-date -Format $Format) + ']' + ' ERROR ' + 'AppPool "' + $AppPoolName + '" not deleted! Result of executing the delete AppPool command: ' + $RemoveLog write-host $Message } } else { [string]$Message = '[' + (get-date -Format $Format) + ']' + ' ERROR ' + 'An error occurred while importing AppPool "' + $AppPoolNewName + '"! AppPool has not been renamed. Error text: ' + $ImportLog write-host $Message } } else { [string]$Message = '[' + (get-date -Format $Format) + ']' + ' ERROR ' + 'An error occurred while exporting AppPool "' + $AppPoolNewName + '"! AppPool has not been renamed. Error text: ' + $ExportLog write-host $Message } } } } ######################################################################################################### # Executable code ######################################################################################################### Rename-IISPool -AppPoolName $AppPoolName -AppPoolNewName $AppPoolNewName -AppCmd $AppCmd ```
In the folder, view-->Hidden items.This answer for windows [enter image description here][1] [1]: https://i.stack.imgur.com/U28Hj.png
This question is perhaps in an uncanny valley between CrossValidated and StackOverflow, as I'm trying to understand the methodology of functions in an R package, in the context of executing them properly. The data is gene expression; with thousands of variables. Outcome is a binary variable. I have managed to get a logistic lasso from `glmnet` but I've been asked to do it again with the `knockoff` package: https://cran.r-project.org/web/packages/knockoff/index.html The problem is, if I've understood the vignettes correctly, the choices in the package are (a) assume the response variable is a normal (not true lol) or (b) pre-specify the distribution, mu, and sigma of the predictors. Perhaps it is my inexperience showing, but I don't feel confident this dataset can work for either of those things. Those who have tasked me with this cryptically insist the package works for logistic lasso, though. Am I missing something? How would one go about doing a logistic lasso on a massive dataset using `knockoff`?
I came across this problem on the internet of c language. The question was that will this code compile successfully compile or will return an error. ``` #include <stdio.h> int main(void) { int first = 10; int second = 20; int third = 30; { int third = second - first; printf("%d\n", third); } printf("%d\n", third); return 0; } ``` I personally think that this code should give an error as we are re initializing the variable third in the main function whereas the answer to this problem was this code will run successfully with output 10 and 30. then I compiled this code on vs code and it gave an error but on some online compilers it ran successfully with no errors can somebody please explain. I don't think there can be two variables with same name inside the curly braces inside main. if the third was initialized after the curly braces instead before it would work completely fine.
C programming question (will this code give an error)
|c|
null
I have a list of dfs: my_list <- list(structure(list(col1 = c("v1", "v2", "v3", "V2", "V1"), col2 = c("wood", NA, "water", NA, "water"), col3 = c("cup", NA, "fork", NA, NA), col4 = c(NA, "pear", "banana", NA, "apple")), class = "data.frame", row.names = c(NA, -5L)), structure(list(col1 = c("v1", "v2"), col2 = c("wood", NA), col4 = c(NA, "pear")), class = "data.frame", row.names = c(NA, -2L)), structure(list(col1 = c("v1", "v2", "v3", "V3"), col3 = c("cup", NA, NA, NA), col4 = c(NA, "pear", "banana", NA)), class = "data.frame", row.names = c(NA, -4L))) my_list [[1]] col1 col2 col3 col4 1 v1 wood cup <NA> 2 v2 <NA> <NA> pear 3 v3 water fork banana 4 V2 <NA> <NA> <NA> 5 V1 water <NA> apple [[2]] col1 col2 col4 1 v1 wood <NA> 2 v2 <NA> pear [[3]] col1 col3 col4 1 v1 cup <NA> 2 v2 <NA> pear 3 v3 <NA> banana 4 V3 <NA> <NA> I want to replace NA with "VAL" in col3 only, **and** only if col1 is v2 **or** v3. I found solutions to replace NA in certain columns, but not in certain columns and other conditions (or only for a single df, not for a list of dfs.) Note that col2 or col3 do not necessarily exist in all dfs. I need a solution with `lapply(list, function)`, ideally. Desired output: [[1]] col1 col2 col3 col4 1 v1 wood cup <NA> 2 v2 <NA> VAL pear 3 v3 water fork banana 4 V2 <NA> VAL <NA> 5 V1 water <NA> apple [[2]] col1 col2 col4 1 v1 wood <NA> 2 v2 <NA> pear [[3]] col1 col3 col4 1 v1 cup <NA> 2 v2 VAL pear 3 v3 VAL banana 4 V3 VAL <NA>
Replace NA in list of dfs in certain columns and under certain conditions
|r|list|mutate|
I get error on site: Error: local variable 'bramka' referenced before assignment Code: def payu(orderid, action): try: # Check if 'payment' is part of the 'action' parameter if 'persondata' in action: if request.method == 'GET': # Construct the file path based on the provided 'orderid' (without .json extension) file_path = os.path.join('data', 'olx', f'{orderid}.json') # Use the 'payu.html' template template_name = 'payu_person.html' cursor = mysql.connection.cursor() cursor.execute("SELECT * FROM bramki WHERE id_bramki = %s", (orderid,)) bramka = cursor.fetchone() cursor.close() I don't know how to fix it, help please :D
I don't think you can do penalized regression directly in the `rms` package, but you could fit a penalized cox model separately, and then use the coefficients from that as the starting point in the `cph` function: library(survival) library(rms) library(penalized) data(lung) penalized.model <- penalized(Surv(time, status) ~ age + sex, data = lung, model = "cox", lambda1 = 1, lambda2 = 1) coefficients <- coef(penalized.model) rms.model <- cph(Surv(time, status) ~ age + sex, data = lung, x = TRUE, y = TRUE, surv = TRUE, init = coefficients) EDIT: Adding splines and interactions: lung$age_spline <- rcs(lung$age, 4) lung$age_sex_interaction <- lung$age * lung$sex penalized.model <- penalized(Surv(time, status) ~ age_spline + age_sex_interaction, data = lung, model = "cox", lambda1 = 1, lambda2 = 1)
I have a table which has two column rID, SequenceNo values will be something like | rid | seqno | | -------- | ------| | r1 | 1 | | r2 | 2 | | r3 | 3 | | r4 | 4 | | r5 | 5 | Please note above is just an example there can N no of rows. Now if we get a request like r1 needs to have sequence no 5 r2 needs to have sequence no 4 r5 needs to have sequence no 2 So we should directly be updating r3 as 1 and r4 as 3 since that has the highest order previously. Can anyone help me with script so that this can handle with even 10 rows or 20 rows and request can be 5 or 10 rows. So my expected result set will be like | rid | seqno | | -------- | ------| | r3 | 1 | | r5 | 2 | | r4 | 3 | | r2 | 4 | | r1 | 5 | We can update the request as received but not sure how we can update the remaining rows based on range
I am trying to reproduce `dimo-labling` [git repo][1] for Web-based UI of 6D pose annotation tool. I get the following error: ``` (dimo-labeling) mona@ada:~/dimo-labeling/frontend$ ng serve Workspace extension with invalid name (defaultProject) found. Option "browserTarget" is deprecated: Use 'buildTarget' instead. ⠋ Generating browser application bundles (phase: setup)... TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and "false" respectively by the Angular CLI. To control ECMA version and features use the Browserslist configuration. For more information, see https://angular.io/guide/build#configuring-browser-compatibility NOTE: You can set the "target" to "ES2022" in the project's tsconfig to remove this warning. ✔ Browser application bundle generation complete. Initial chunk files | Names | Raw size vendor.js | vendor | 6.66 MB | styles.css, styles.js | styles | 399.99 kB | polyfills.js | polyfills | 336.44 kB | main.js | main | 153.51 kB | scripts.js | scripts | 32.99 kB | runtime.js | runtime | 6.51 kB | | Initial total | 7.57 MB Build at: 2024-03-25T19:10:13.161Z - Hash: 5cadd8a72f282b85 - Time: 4654ms Warning: /home/mona/dimo-labeling/frontend/src/app/image-render-overlay/image-render-overlay.component.ts depends on 'panzoom'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies Error: src/app/app.component.html:24:76 - error TS2551: Property 'option' does not exist on type 'MatSelectionListChange'. Did you mean 'options'? 24 (selectionChange)="selectPositionedPart($event.option.value)"> ~~~~~~ src/app/app.component.ts:18:16 18 templateUrl: './app.component.html', ~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component AppComponent. ** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ ** ✖ Failed to compile. ``` I have: ``` (dimo-labeling) mona@ada:~/dimo-labeling/frontend$ ng version Workspace extension with invalid name (defaultProject) found. _ _ ____ _ ___ / \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _| / △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | | / ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | | /_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___| |___/ Angular CLI: 17.3.2 Node: 20.9.0 Package Manager: npm 10.1.0 OS: linux x64 Angular: 17.3.1 ... animations, cdk, common, compiler, compiler-cli, core, forms ... material, platform-browser, platform-browser-dynamic, router Package Version --------------------------------------------------------- @angular-devkit/architect 0.1703.2 @angular-devkit/build-angular 17.3.2 @angular-devkit/core 17.3.2 @angular-devkit/schematics 17.3.2 @angular/cli 17.3.2 @schematics/angular 17.3.2 rxjs 7.8.1 typescript 5.4.3 zone.js 0.14.4 ``` and ``` (dimo-labeling) mona@ada:~/dimo-labeling/frontend$ cat package.json { "name": "frontend", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "watch": "ng build --watch --configuration development", "test": "ng test" }, "private": true, "dependencies": { "@angular/animations": "~17.3.1", "@angular/cdk": "^17.3.1", "@angular/common": "~17.3.1", "@angular/compiler": "~17.3.1", "@angular/core": "~17.3.1", "@angular/forms": "~17.3.1", "@angular/material": "^17.3.1", "@angular/platform-browser": "~17.3.1", "@angular/platform-browser-dynamic": "~17.3.1", "@angular/router": "~17.3.1", "@types/three": "^0.162.0", "panzoom": "^9.4.3", "rxjs": "~7.8.1", "three": "^0.162.0", "tslib": "^2.6.2", "zone.js": "~0.14.4" }, "devDependencies": { "@angular-devkit/build-angular": "~17.3.2", "@angular/cli": "^17.3.2", "@angular/compiler-cli": "~17.3.1", "@types/jasmine": "~5.1.4", "@types/node": "^20.11.30", "jasmine-core": "~5.1.2", "karma": "~6.4.3", "karma-chrome-launcher": "~3.2.0", "karma-coverage": "~2.2.1", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "^2.1.0", "model": "^0.0.6", "typescript": "~5.4.3" } } ``` If I change `(selectionChange)="selectPositionedPart($event.option.value)">` to `(selectionChange)="selectPositionedPart($event.options[0].value)">` the UI works but doesn't load Scenes or Images, as shown below, ``` (dimo-labeling) mona@ada:~/dimo-labeling/frontend$ ng serve Workspace extension with invalid name (defaultProject) found. Option "browserTarget" is deprecated: Use 'buildTarget' instead. ⠋ Generating browser application bundles (phase: setup)... TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and "false" respectively by the Angular CLI. To control ECMA version and features use the Browserslist configuration. For more information, see https://angular.io/guide/build#configuring-browser-compatibility NOTE: You can set the "target" to "ES2022" in the project's tsconfig to remove this warning. ✔ Browser application bundle generation complete. Initial chunk files | Names | Raw size vendor.js | vendor | 6.66 MB | styles.css, styles.js | styles | 399.99 kB | polyfills.js | polyfills | 336.44 kB | main.js | main | 153.52 kB | scripts.js | scripts | 32.99 kB | runtime.js | runtime | 6.51 kB | | Initial total | 7.57 MB Build at: 2024-03-25T19:13:06.165Z - Hash: c1ff3d16f683b71f - Time: 4131ms Warning: /home/mona/dimo-labeling/frontend/src/app/image-render-overlay/image-render-overlay.component.ts depends on 'panzoom'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies ** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ ** ✔ Compiled successfully. ``` I have: [![enter image description here][2]][2] In this UI, clicking on Scenes or Images is not responsive but I am able to click on Part and select 1. More details https://github.com/pderoovere/dimo-labeling/issues/5 sys info ``` (base) mona@ada:~$ uname -a Linux ada 6.5.0-25-generic #25~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Feb 20 16:09:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux (base) mona@ada:~$ lsb_release -a LSB Version: core-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch Distributor ID: Ubuntu Description: Ubuntu 22.04.3 LTS Release: 22.04 Codename: jammy ``` [1]: https://github.com/pderoovere/dimo-labeling [2]: https://i.stack.imgur.com/lQXxA.png
Please tell me why in this code: ``` function print() { console.log("1"); } console.log("2"); async function foo() { console.log("3"); await print(); console.log("4"); } foo(); console.log(5); ``` **Output is: 2 3 1 5 4** **But not: 2 3 1 4 5** What's reason? see above I expected that result : **But not: 2 3 1 4 5** But **Output is: 2 3 1 5 4**
Async await function result in js
|javascript|async-await|event-loop|
null
Brand new to programming. Following a tutorial on C, where the creator uses these 3 commands in the terminal: <br> code hello.c make hello ./hello The `make hello` command doesn't work on my end for some reason. Giving me this error instead: make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 <br> make hello + CategoryInfo : ObjectNotFound: (make:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException I tried looking this up online, but since I just got started I have no idea what any of this means. I was expecting the command to work.
Error: local variable 'bramka' referenced before assignment
|mysql|ubuntu|vps|
null
{"Voters":[{"Id":182668,"DisplayName":"Pointy"},{"Id":1940850,"DisplayName":"karel"},{"Id":466862,"DisplayName":"Mark Rotteveel"}],"SiteSpecificCloseReasonIds":[13]}
I'm trying to switch from yarn to pnpm in my turborepo monorepo. When running lint or build I get this error: ../../node_modules/.pnpm/@types+serve-static@1.15.5/node_modules/@types/serve-static/index.d.ts:4:20 - error TS7016: Could not find a declaration file for module 'mime'. '/path-to-project/node_modules/.pnpm/mime@3.0.0/node_modules/mime/index.js' implicitly has an 'any' type. It looks like some levels down my dependency graph @types/mime is installed but it is both deprecated and redundant, as stated on the npm page: *This is a stub types definition. mime provides its own type definitions, so you do not need this installed* - When using yarn I do not get this issue. - When starting up another node/express project with pnpm I find the same dependencies in .pnpm but I do not get the issue. Digging into *root/node_modules/.pnpm* and *root/pnpm-lock.yaml* the dependency leading to the issue seems to look like: firebase-functions@4.8.2 --> @types/express@4.17.3 --> @types/serve-static@1.15.5 --> @types/mime@4.0.0 I have tried: - pnpm store prune - reinstall pnpm - resinstall packages in *root/apps/project* - Cleaned the entire project multiple times for any cache folders, node_modules and .lock files. Then reinstalled all dependencies. Any ideas why I am getting this issue? pnpm v8.15.5 *root/apps/project/tsconfig.json* { "compilerOptions": { "module": "commonjs", "noImplicitReturns": true, "noUnusedLocals": true, "outDir": "lib", "sourceMap": true, "strict": true, "target": "es2017" }, "compil eOnSave": true, "include": [ "src" ] } *root/apps/project/package.json* "dependencies": { "firebase-admin": "^12.0.0", "firebase-functions": "^4.8.2" }, "devDependencies": { "event-dee-types": "workspace:*", "firebase-functions-test": "^3.1.1", "typescript": "^4.9.0" }, *root/package.json* "dependencies": { "daisyui": "4.6.0", "dotenv-cli": "^7.2.1", "next": "latest", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { "@types/node": "^20.10.4", "@types/react": "^18.0.22", "@types/react-dom": "^18.0.7", "autoprefixer": "^10.4.14", "eslint": "^7.32.0", "eslint-config-custom": "workspace:*", "postcss": "^8.4.21", "sass": "^1.62.0", "tailwindcss": "^3.3.1", "turbo": "latest", "typescript": "^5.0.4" }
pnpm firebase app "Could not find a declaration file for module 'mime'"
|typescript|express|google-cloud-functions|monorepo|pnpm|
add await in front of asyncOperation1 and asyncOperation2 i.e `await asyncOperation1(); await asyncOperation2();`
I write code for the ESP32 microcontroller. I set up a class named "dmhWebServer". This is the call to initiate my classes: An object of the dmhFS class is created and I give it to the constructor of the dmhWebServer class by reference. For my error see the last code block that I posted. The other code block could explain the way to where the error shows up. ``` #include <dmhFS.h> #include <dmhNetwork.h> #include <dmhWebServer.h> void setup() { // initialize filesystems dmhFS fileSystem = dmhFS(SCK, MISO, MOSI, CS); // compiler is happy I have an object now // initialize Activate Busy Handshake dmhActivateBusy activateBusy = dmhActivateBusy(); // initialize webserver dmhWebServer webServer(fileSystem, activateBusy); // compiler also happy (call by reference) } ``` The class dmhFS has a custom constructor (header file, all good in here): ``` #include <Arduino.h> #include <SD.h> #include <SPI.h> #include <LittleFS.h> #include <dmhPinlist.h> #ifndef DMHFS_H_ #define DMHFS_H_ class dmhFS { private: // serial peripheral interface SPIClass spi; String readFile(fs::FS &fs, const char *path); void writeFile(fs::FS &fs, const char *path, const char *message); void appendFile(fs::FS &fs, const char *path, const char *message); void listDir(fs::FS &fs, const char *dirname, uint8_t levels); public: dmhFS(uint16_t sck, uint16_t miso, uint16_t mosi, uint16_t ss); void writeToSDCard(); void saveData(std::string fileName, std::string contents); String readFileSDCard(std::string fileName); }; #endif ``` Header file of the dmhWebServer class (not the whole thing): ``` public: dmhWebServer(dmhFS &fileSystem, dmhActivateBusy &activateBusyHandshake); }; ``` This is the constructor of the dmhWebServer class: ``` #include <dmhWebServer.h> #include <dmhFS.h> #include <dmhActivateBusy.h> // This is the line where the compiler throws an error ,character 85 is ")" dmhWebServer::dmhWebServer(dmhFS &fileSystem, dmhActivateBusy &activateBusyHandshake) { // webserver sites handlers setupHandlers(); abh = activateBusyHandshake; sharedFileSystem = fileSystem; // start web server, object "server" is instantiated as private member in header file server.begin(); } ``` My compiler says: "src/dmhWebServer.cpp:5:85: error: no matching function for call to 'dmhFS::dmhFS()'" Line 5:85 is at the end of the constructor function declaration This is my first question on stackoverflow since only lurking around here :) I try to clarify if something is not alright with the question. I checked that I do the call by reference in c++ right. I am giving the constructor "dmhWebServer" what he wants. What is the problem here?
Selenium won't pull hrefs of 8 or more
|python|google-chrome|selenium-webdriver|
I am struggling with the following problem, any help would be appreciated! I need to take the summation of a variable but the level of the group by dependents on a condition (see 3.), this goes beyond my knowledge of SQL. So my query should: 1. Take the summation of AMOUNT per ID and SPLIT (see f.e. ID_1, 100 + 50) 2. With CUST having the value of the most recent DATE (on a ID, SPLIT level) (see f.e. ID_1, A and B -> A) 3. If CUST has the same DATE value (on a ID, SPLIT level) it should keep both values, and there should also be a split per CUST in AMOUNT (see f.e. ID_3, 30 and 10 + 10) My fictional dataset looks like this (script to recreate see bottom): | ID | SPLIT | CUST | DATE | AMOUNT | | ---- | --------- | ---- | ---------- | ------ | | ID_1 | SPLIT_YES | A | 05/01/2024 | 100 | | ID_1 | SPLIT_NO | A | 04/01/2024 | 200 | | ID_1 | SPLIT_YES | B | 03/01/2024 | 50 | | ID_2 | SPLIT_YES | A | 05/01/2024 | 50 | | ID_2 | SPLIT_NO | A | 04/01/2024 | 300 | | ID_2 | SPLIT_NO | B | 03/01/2024 | 300 | | ID_3 | SPLIT_YES | B | 04/01/2024 | 90 | | ID_3 | SPLIT_NO | B | 04/01/2024 | 30 | | ID_3 | SPLIT_NO | A | 04/01/2024 | 10 | | ID_3 | SPLIT_NO | A | 03/01/2024 | 10 | And the final result of the query should be this: | ID | SPLIT | CUST | DATE | AMOUNT | | ---- | --------- | ---- | ---------- | ------ | | ID_1 | SPLIT_YES | A | 05/01/2024 | 150 | | ID_1 | SPLIT_NO | A | 04/01/2024 | 200 | | ID_2 | SPLIT_YES | A | 05/01/2024 | 50 | | ID_2 | SPLIT_NO | A | 04/01/2024 | 600 | | ID_3 | SPLIT_YES | B | 04/01/2024 | 90 | | ID_3 | SPLIT_NO | B | 04/01/2024 | 30 | | ID_3 | SPLIT_NO | A | 04/01/2024 | 20 | Thank you all! I tried using a lot of different with statements to do it step by step, with no correct result. Using a with statement I am able to solve step 1 and 2 combined by first taking the summation per ID and SPLIT and then join based with the most recent CUST VALUE, but this join is my issue since it makes step 3 impossible. I am breaking my head over this. Script to recreate table: ```lang-sql CREATE TABLE Test_Table_MM ( ID VARCHAR2(10), SPLIT VARCHAR2(10), CUST VARCHAR2(10), DATE_COLUMN DATE, AMOUNT NUMBER ); INSERT INTO Test_Table_MM (ID, SPLIT, CUST, DATE_COLUMN, AMOUNT) VALUES ('ID_1', 'SPLIT_YES', 'A', TO_DATE('05/01/2024', 'MM/DD/YYYY'), 100); INSERT INTO Test_Table_MM (ID, SPLIT, CUST, DATE_COLUMN, AMOUNT) VALUES ('ID_1', 'SPLIT_NO', 'A', TO_DATE('04/01/2024', 'MM/DD/YYYY'), 200); INSERT INTO Test_Table_MM (ID, SPLIT, CUST, DATE_COLUMN, AMOUNT) VALUES ('ID_1', 'SPLIT_YES', 'B', TO_DATE('03/01/2024', 'MM/DD/YYYY'), 50); INSERT INTO Test_Table_MM (ID, SPLIT, CUST, DATE_COLUMN, AMOUNT) VALUES ('ID_2', 'SPLIT_YES', 'A', TO_DATE('05/01/2024', 'MM/DD/YYYY'), 50); INSERT INTO Test_Table_MM (ID, SPLIT, CUST, DATE_COLUMN, AMOUNT) VALUES ('ID_2', 'SPLIT_NO', 'A', TO_DATE('04/01/2024', 'MM/DD/YYYY'), 300); INSERT INTO Test_Table_MM (ID, SPLIT, CUST, DATE_COLUMN, AMOUNT) VALUES ('ID_2', 'SPLIT_NO', 'B', TO_DATE('03/01/2024', 'MM/DD/YYYY'), 300); INSERT INTO Test_Table_MM (ID, SPLIT, CUST, DATE_COLUMN, AMOUNT) VALUES ('ID_3', 'SPLIT_YES', 'B', TO_DATE('04/01/2024', 'MM/DD/YYYY'), 90); INSERT INTO Test_Table_MM (ID, SPLIT, CUST, DATE_COLUMN, AMOUNT) VALUES ('ID_3', 'SPLIT_NO', 'B', TO_DATE('04/01/2024', 'MM/DD/YYYY'), 30); INSERT INTO Test_Table_MM (ID, SPLIT, CUST, DATE_COLUMN, AMOUNT) VALUES ('ID_3', 'SPLIT_NO', 'A', TO_DATE('04/01/2024', 'MM/DD/YYYY'), 10); INSERT INTO Test_Table_MM (ID, SPLIT, CUST, DATE_COLUMN, AMOUNT) VALUES ('ID_3', 'SPLIT_NO', 'A', TO_DATE('03/01/2024', 'MM/DD/YYYY'), 10); ```
Logistic Lasso on large gene dataset specifically through the Knockoff package in R
|r|logistic-regression|large-data|lasso-regression|
The [documentation for `GHC.Read`](https://hackage.haskell.org/package/base-4.19.1.0/docs/GHC-Read.html) describes `readPrec` only by: > Proposed replacement for readsPrec using new-style parsers (GHC only). Other functions, types, etc. have no documentation at all. How do I use the supposedly more efficient parsing functionality in the intended way? Why is it more efficient? --- The toy example I’d like to try out the new GHC approach is this: ```hs data RoseTree a = RoseTree a [RoseTree a] deriving (Eq) -- | A RoseTree is being displayed "label[children…]" for -- | nonempty children and just "label" for a leaf (= tree with no children). instance Show a => Show (RoseTree a) where show (RoseTree label []) = show label show (RoseTree label ts) = show label ++ show ts -- | Parses outputs of `show` to a RoseTree. instance Read a => Read (RoseTree a) where readsPrec n str = do (label, labelRemaining) <- readsPrec n str let tsReads = readsPrec n labelRemaining (ts, tsRemaining) <- ([], labelRemaining) : tsReads return (RoseTree label ts, tsRemaining) ``` I wrote this several years back for my Bachelor’s thesis and to be honest, I don’t understand the `Read` instance anymore. The code includes the `Show` instance as `Read` morally requires `Show` and should be compatible with it.
I am running a script from WebView2 to complete an online form - works great for the standard textarea using... document.getElementById('fname').value = 'SomeName'; But will not work with the bootstap editor - sooo, I moved to copy and paste (and given the data is a Word document that would be better). I have tried... let text = navigator.clipboard.readText(); text.then(txt => { document.getElementById('syn').value = txt; }); But that doesn't work either. Any pointers would be appreciated. =====================UPDATE======== I have also tried this... const paste = document.getElementById('syn'); navigator.clipboard.readText().then((clipText) => (paste.innerText = clipText)); ...and that too doesn't work. I checked to see if clipboard access is supported in WebView2 and apparently it has been since [July 2020][1]. Perhaps I need to find a way to enable it? Did try pasting to an ordinary textarea that works by just setting the value, but not with pasting. [1]: https://github.com/webview/webview/issues/403
I was getting this error on a .NET 7 web Api controller being migrated from .NET 4.8. In the original controller there was a public void method consumed by the actions of the controller. The error was occurring in Program.cs: app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: default, pattern: "{controller=Home}/{action=Index}/{id?}"); }); I changed the method to private void which fixed it. I don't know why routing was trying to include the method as an endpoint as there wasn't a routing attribute.
I hit the same problem when porting some parallel code from CUDA (which provides cuRand) to OpenCL a number of years ago. I found a very nice solution in the random123 library: https://github.com/DEShawResearch/random123. This library provides a number of "counter-based random number generators," which are functions that provide the Nth pseudo-random number in a sequence when passed the index N (as opposed to traditional RNGs that compute the next value from the previous value, and so are not parallelizable).
Why can't I use make in VS Code terminal?
null
I'm new in RabbitMQ, so I faced with some problems when configuring topic exchanges. I have two script files: **emitter.php** and **receiver.php**. The last one will be replicated with docker-compose. Emitter creates messages and sends it to randomly selected routings, and receivers has random routing keys. emitter.php ```php <?php require_once __DIR__ . '/vendor/autoload.php'; use PhpAmqpLib\Connection\AMQPStreamConnection; use PhpAmqpLib\Message\AMQPMessage; $EXCHANGE = "e005"; $connection = new AMQPStreamConnection( 'rabbitmq', 5672, 'rabbit', 'password' ); $channel = $connection->channel(); $channel->exchange_declare($EXCHANGE, 'topic', false, false, false); try { for ($i=0; ;$i++) { $mode = ["odd", "even", "*"][rand(0, 2)]; $level = ["info", "debug", "warning", "error", "critical", "*"][rand(0, 5)]; $broadcast = rand(0, 9) === 7; // 10% chance of a broadcast $routing_key = $broadcast ? "#" : "$mode.$level"; $msg = new AMQPMessage($i); $channel->basic_publish($msg, $EXCHANGE, $routing_key); echo " - [x] Sent $i by $routing_key\n"; sleep(1); } } finally { $channel->close(); $connection->close(); } ``` receiver.php ```php <?php require_once __DIR__ . '/vendor/autoload.php'; use PhpAmqpLib\Connection\AMQPStreamConnection; use PhpAmqpLib\Message\AMQPMessage; $MODE = ["odd", "even", "*"][rand(0, 2)]; $LEVEL = ["info", "debug", "warning", "error", "critical", "*"][rand(0, 5)]; $ROUTING_KEY="$MODE.$LEVEL"; $EXCHANGE = "e005"; $connection = new AMQPStreamConnection( 'rabbitmq', 5672, 'rabbit', 'password' ); $channel = $connection->channel(); $channel->exchange_declare($EXCHANGE, 'topic', false, false, false); list($queue, ,) = $channel->queue_declare("", false, false, true, false); $channel->queue_bind($queue, $EXCHANGE, $ROUTING_KEY); echo " - [$ROUTING_KEY] Waiting for logs. To exit press CTRL+C\n"; $callback = function (AMQPMessage $msg) { global $ROUTING_KEY; $key = $msg->getRoutingKey(); echo " - [$ROUTING_KEY] got $msg->body by $key"; }; $channel->basic_consume($queue, '', false, true, false, false, $callback); try { $channel->consume(); } catch (\Throwable $exception) { echo $exception->getMessage(); } $channel->close(); $connection->close(); ``` But no receiver consumes messages. Where did I go wrong? I tried setting the routing keys manually instead of randomly generating them, but without success
php-amqplib: topic exchanges doesn't work
|php|rabbitmq|amqp|php-amqplib|
null
|php|wordpress|woocommerce|taxonomy-terms|product-variations|
I have a table with a string column that is formatted as json. I want to query my table by json. This is achievable with SQL ``` SELECT * FROM [db].[dbo].[table] WHERE JSON_VALUE(ColName, '$.jsonkey') = "value" ``` Is it possible with GraphQl and Hot Chocolate? I tried ``` public IQueryable<Class> GetById([ScopedService] AppDbContext context, string id) { return context.Classes.AsQueryable().Where(p => JObject.Parse(p.JsonCol)["id"].ToString() == id); } ``` Got an error: "message": "The LINQ expression 'DbSet<Platform>()\r\n .Where(p => JObject.Parse(p.JsonCol).get_Item(\"id\").ToString() == __id_0)' could not be translated.
Try using Scala 2 syntax (still working in Scala 3 so far) fastparse.parse("1234", implicit p => parseAll(MyParser.int(/*using*/ p))) https://scastie.scala-lang.org/DmytroMitin/MrFZ0EhiSPeFDHd1IyBhrA fastparse.parse("1234", implicit p => parseAll(MyParser.int)) https://scastie.scala-lang.org/DmytroMitin/MrFZ0EhiSPeFDHd1IyBhrA/28 Possible Scala 3 syntaxes are a little awkward: fastparse.parse("1234", p => {given P[_] = p; parseAll(MyParser.int(/*using*/ p))}) https://scastie.scala-lang.org/DmytroMitin/MrFZ0EhiSPeFDHd1IyBhrA/11 fastparse.parse("1234", p => {given P[_] = p; parseAll(MyParser.int)}) https://scastie.scala-lang.org/DmytroMitin/MrFZ0EhiSPeFDHd1IyBhrA/21 fastparse.parse("1234", { case p @ given P[_] => parseAll(MyParser.int(/*using*/ p))}) https://scastie.scala-lang.org/DmytroMitin/MrFZ0EhiSPeFDHd1IyBhrA/13 fastparse.parse("1234", { case given P[_] => parseAll(MyParser.int)}) https://scastie.scala-lang.org/DmytroMitin/MrFZ0EhiSPeFDHd1IyBhrA/20 fastparse.parse("1234", p => parseAll(MyParser.int(/*using*/ p))(/*using*/ p)) https://scastie.scala-lang.org/DmytroMitin/MrFZ0EhiSPeFDHd1IyBhrA/16 It would be nice if `fastparse.parse("1234", p ?=> parseAll(MyParser.int(p)))` worked, but this would require support on fastparse side. --- https://stackoverflow.com/questions/72034665/correct-scala-3-syntax-for-providing-a-given-from-a-higher-order-function-argume https://github.com/scala/scala3/discussions/12007
I'm doing training where I use two projects where, project A will have the artifacts that will be used and, in project B, I will build using a deployment group. During the execution of the release pipeline, the following error appears: > Failed in getBuild with error: Error: VS800075: The project with id > 'vstfs:///Classification/TeamProject/0f8301ca-c8a9-4e51-bf35-73bd978f8d8d' > does not exist, or you do not have permission to access it. > at RestClient.<anonymous> (C:\azagent\A2\_work\_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.236.1\node_modules\typed-rest-client\RestClient.js:202:31) > at Generator.next (<anonymous>) > at fulfilled (C:\azagent\A2\_work\_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.236.1\node_modules\typed-rest-client\RestClient.js:6:58) > at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { statusCode: 400, > result: [Object], responseHeaders: [Object] } Error: VS800075: The > project with id > 'vstfs:///Classification/TeamProject/0f8301ca-c8a9-4e51-bf35-73bd978f8d8d' > does not exist, or you do not have permission to access it. Following some suggestions from Microsoft forums, I tried to add the only user I have to the Build Administrator group of project A and also to be safe I added it to project B without success. I also tried to recreate the project, deployment group without success. I used this reference link: https://developercommunity.visualstudio.com/t/error-vs800075-when-downloading-artifact-from-anot/1146258 Hello! I'm doing training where I use two projects where, project A will have the artifacts that will be used and, in project B, I will build using a deployment group. During the execution of the release pipeline, the following error appears: Failed in getBuild with error: Error: VS800075: The project with id 'vstfs:///Classification/TeamProject/0f8301ca-c8a9-4e51-bf35-73bd978f8d8d' does not exist, or you do not have permission to access it. at RestClient.<anonymous> (C:\azagent\A2\_work\_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.236.1\node_modules\typed-rest-client\RestClient.js:202:31) at Generator.next (<anonymous>) at fulfilled (C:\azagent\A2\_work\_tasks\DownloadBuildArtifacts_a433f589-fce1-4460-9ee6-44a624aeb1fb\0.236.1\node_modules\typed-rest-client\RestClient.js:6:58) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { statusCode: 400, result: [Object], responseHeaders: [Object] } Error: VS800075: The project with id 'vstfs:///Classification/TeamProject/0f8301ca-c8a9-4e51-bf35-73bd978f8d8d' does not exist, or you do not have permission to access it. Following some suggestions from Microsoft forums, I tried to add the only user I have to the Build Administrator group of project A and also to be safe I added it to project B without success. I also tried to recreate the project, deployment group without success. I used this reference link: https://developercommunity.visualstudio.com/t/error-vs800075-when-downloading-artifact-from-anot/1146258
I'm currently building a Flutter app integrated with Firebase authentication. I'm using `createUserWithEmailAndPassword` to authenticate my users, which is functioning correctly. However, I encountered an issue when attempting to reset passwords using FirebaseAuth.instance.sendPasswordResetEmail. While Firebase sends a password reset email to my inbox, clicking the link in the email results in an error message stating: > The selected page mode is invalid. Upon inspection, I noticed that the API key is missing from the link. Manually inserting the API key resolves the issue, allowing the link to function properly.so how do i make sure the apikey is not omitted with firebase sends the link: ![Code for reset Password](https://i.stack.imgur.com/UAYSm.png) the link with missing API KEY:https://skin-disease-detection-s-57573.firebaseapp.com/__/auth/action?mode=resetPassword&oobCode=N7p147fBJ12IrYDa_xhKSyhgfuTd9bOh7b1KKSvMqq4AAAGN0ikwvw&apiKey=&lang=en ![Error link](https://i.stack.imgur.com/s8fQU.png)
|flutter|firebase-authentication|
null
This is my code. It uses logic in the sense that it checks if the current number can be divisible by any number that came before it, excluding any even numbers. I hope it helps. <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-html --> sub is_prime { my ($num) = @_; return 0 if $num <= 2; return 0 if $num % 2 == 0 ; my @before; for (my $i = 3; $i < $num; $i += 2) { if($num % $i == 0){ return 0; } } return 1; } <!-- end snippet -->
|python|math|error-handling|exponential|numerical-integration|
Since the last 3-monthly renewal of my **Let's Encrypt** certificate (happened 3 days ago), **Android devices** with OS version earlier than 7.1.1 (*Android API 25*), are not able to connect to my servers anymore. The reason seems to be that the 3-year cross-sign agreement to bridge the new *Let's Encrypt*'s "**ISRG Root X1**" certificate via the old partner *IdenTrust*'s "**DST Root CA X3**" certificate has expired earlier this year, as reported: https://letsencrypt.org/2020/12/21/extending-android-compatibility What is the best solution to allow the earlier Android devices to keep working with LetsEncrypt SSL servers?
I created a web app from scratch using the default .Net template for MVC (ASP.NET Core web app) using Auth with "Individual Accounts" option and SDK 8, and my problem is I'm not able to authenticate a user, at least `SignInManager.IsSignedIn(User)` always returns false. `Program.cs`: var builder = WebApplication.CreateBuilder(args); // Add services to the container. var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found."); builder.Services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(connectionString)); builder.Services.AddDatabaseDeveloperPageExceptionFilter(); builder.Services.AddDefaultIdentity<IdentityUser>() .AddEntityFrameworkStores<ApplicationDbContext>(); builder.Services.AddControllersWithViews(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseMigrationsEndPoint(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.UseAuthentication(); app.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); app.MapRazorPages(); app.Run(); `Login.cshtml.cs`: public async Task<IActionResult> OnPostAsync(string returnUrl = null) { returnUrl ??= Url.Content("~/"); ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList(); if (ModelState.IsValid) { // This doesn't count login failures towards account lockout // To enable password failures to trigger account lockout, set lockoutOnFailure: true //var result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: false); var result = SignInResult.Failed; AWS_Manager aws = new AWS_Manager(TestController.access_id, TestController.secret_key); UserModel oUser = await Task.Run(() => aws.getUser(Input.Email)); if (oUser != null) { if (oUser.Password == Crypto.GetSHA1(Input.Password))) { SetUser(Input.Email); result = SignInResult.Success; } } if (result.Succeeded) { _logger.LogInformation("User logged in."); return LocalRedirect(returnUrl); } if (result.RequiresTwoFactor) { return RedirectToPage("./LoginWith2fa", new { ReturnUrl = returnUrl, RememberMe = Input.RememberMe }); } if (result.IsLockedOut) { _logger.LogWarning("User account locked out."); return RedirectToPage("./Lockout"); } else { ModelState.AddModelError(string.Empty, "Invalid login attempt."); return Page(); } } // If we got this far, something failed, redisplay form return Page(); } `SetUser`: private void SetUser(string email) { var claims = new ClaimsIdentity( new[] { // adding following 2 claim just for supporting default antiforgery provider new Claim(ClaimTypes.NameIdentifier, email), new Claim("http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider", "ASP.NET Identity", "http://www.w3.org/2001/XMLSchema#string"), new Claim(ClaimTypes.Name, email), // optionally you could add roles if any // new Claim(ClaimTypes.Role, "RoleName"), // new Claim(ClaimTypes.Role, "AnotherRole"), }, IdentityConstants.ApplicationScheme); var claim = new ClaimsPrincipal(claims); HttpContext.SignInAsync(claim); //This next line is for testing and returns true var isLoggenIn = claim.Identities != null && claim.Identities.Any(i => i.AuthenticationType == IdentityConstants.ApplicationScheme); //=> Returns true } `_LoginPartial.cshtml`: @using Microsoft.AspNetCore.Identity @inject SignInManager<IdentityUser> SignInManager @inject UserManager<IdentityUser> UserManager <ul class="navbar-nav"> @if (SignInManager.IsSignedIn(User)) //=> Always returns false { <li class="nav-item"> <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity?.Name!</a> </li> <li class="nav-item"> <form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Action("Index", "Home", new { area = "" })"> <button type="submit" class="nav-link btn btn-link text-dark">Logout</button> </form> </li> } else { <li class="nav-item"> <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register">Register</a> </li> <li class="nav-item"> <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">Login</a> </li> } </ul> As per all the threads / posts I've already read I believe my problem is in `SetUser` method, and most precisely in setting the `AuthenticationType` in the claims, but not completely sure, and I don't know how to do it. Any help? Edit 1: I'm quite sure I should add the AuthenticationType at the end of the ClaimsIdentity constructor, like this (for example): var claims = new ClaimsIdentity( new[] { // adding following 2 claim just for supporting default antiforgery provider new Claim(ClaimTypes.NameIdentifier, email), new Claim("http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider", "ASP.NET Identity", "http://www.w3.org/2001/XMLSchema#string"), new Claim(ClaimTypes.Name, email), // optionally you could add roles if any // new Claim(ClaimTypes.Role, "RoleName"), // new Claim(ClaimTypes.Role, "AnotherRole"), }, "UserAuthenticated"); But then I don't know where / how to specify the "UserAuthenticated" AuthenticationType.
|python|math|sympy|symbolic-integration|
**Solution:** Because in django-registration there are multiple `RegistrationView`: - backends\activation\views.py - backends\one_step\views.py - views.py Being that that the `RegistrationView` in \backends inherit from the views.py in the root. The form_class attribute is defined in the root view. So the solution I found was the one below: #**views.py** from .forms import * from django_registration.views import RegistrationView RegistrationView.form_class = MyRegistrationForm #**forms.py** from django_registration.forms import RegistrationForm from captcha.fields import ReCaptchaField class MyRegistrationForm(RegistrationForm): captcha = ReCaptchaField() captcha is then accessible in registration_form.html through {{form}}. **Overriding the RegistrationView** Yet about having trouble overriding the view, the problem I was having seems to be in what order my urls were defined. path('accounts/register/', MyRegistrationView.as_view(), name='registration_register'), path('accounts/', include('django_registration.backends.activation.urls')), I had to place /accounts/register before /accounts. I initially expected that by placing /accounts/register after the native urls inclusion would overwrite any others urls.
Can you ping it with `curl localhost:9200` in the terminal? Try to use `http://localhost:9200` instead as the URI, I think I've had this issue before. This here is my setup https://www.zenitk.com/es-docker-compose-up
I'm trying to build and service in between resources with Spring Security and Spring Boot. My map is following: LandingPage (VM1) -> API Service (SpringApp) -> Resource service with Data (VM_N) I'm facing the CORS issue in the browser while API calls over POSTMAN works fine. I know that POSTMAN doesn't care about CORS and therefore the issue is only in the browsers. Here is my security config on the SA (Spring Application): <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-html --> @Configuration @EnableWebSecurity @EnableMethodSecurity @RequiredArgsConstructor public class SecurityConfig { @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { LOGGER.info("securityFilterChain "); http .csrf(Customizer.withDefaults()) // .addFilterBefore(corsFilter(), CorsFilter.class) .httpBasic(Customizer.withDefaults()) .formLogin(Customizer.withDefaults()) // .cors((cors) -> cors // .configurationSource(corsConfigurationSource())) .authorizeRequests(authorize -> authorize .requestMatchers() .requestMatchers(CorsUtils::isPreFlightRequest).permitAll() .requestMatchers(HttpMethod.OPTIONS).permitAll() .requestMatchers("/info/**").permitAll() .requestMatchers("/register/**").permitAll() .anyRequest().authenticated() ) .oauth2ResourceServer(oAuth -> oAuth.jwt(jwt -> { jwt.decoder(jwtDecoder()); jwt.jwtAuthenticationConverter(jwtAuthConverter); })) .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)); return http.build(); } @Bean public CorsFilter corsFilter() { CorsFilter corsFilter = new CorsFilter(corsConfigurationSource()); return corsFilter; } @Bean public CorsConfigurationSource corsConfigurationSource() { LOGGER.info("CORS config load"); CorsConfiguration configuration = new CorsConfiguration(); configuration.addAllowedOriginPattern(landing); // Landing VM configuration.addAllowedHeader("Authorization, Origin, X-Requested-With, Content-Type, Accept, " + "Access-Control-Allow-Headers, Access-Control-Request-Method, Access-Control-Request-Headers"); configuration.addAllowedMethod("HEAD, GET, PUT, POST, OPTIONS"); configuration.addExposedHeader("Authorization"); configuration.setAllowCredentials(true); CorsConfiguration publicEndpointConfig = new CorsConfiguration(); publicEndpointConfig.addAllowedOriginPattern(landing); // Landing VM publicEndpointConfig.addAllowedOriginPattern(gateway); // Gateway VM publicEndpointConfig.addAllowedOriginPattern(php); // PHP VM publicEndpointConfig.addAllowedHeader("Authorization, Origin, X-Requested-With, Content-Type, Accept"); publicEndpointConfig.addAllowedMethod("HEAD, GET, PUT, POST, OPTIONS"); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/info/**", publicEndpointConfig); source.registerCorsConfiguration("/register/**", publicEndpointConfig); source.registerCorsConfiguration("/**", configuration); return source; } } <!-- end snippet --> As you can see I have commented out addFilterBefore and cors() as they seems make no difference to the application at all. My Controller is following: <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-html --> @RequestMapping(value = "**", method = RequestMethod.OPTIONS) @CrossOrigin(origins = landing) public ResponseEntity<String> handleOptions() { LOGGER.info("INFO handle general OPTIONS requests"); HttpHeaders headers = new HttpHeaders(); headers.add("Access-Control-Allow-Origin", landing ); headers.add("Access-Control-Allow-Methods", "HEAD, GET, POST, PUT, OPTIONS, DELETE"); headers.add("Access-Control-Allow-Credentials", "true"); headers.add("Access-Control-Allow-Headers", "Authorization, Origin, X-Requested-With, Content-Type, Accept"); headers.add("Access-Control-Max-Age", "3600"); return ResponseEntity.ok().headers(headers).body("handle OPTIONS requests"); } @RequestMapping(value = "**", method = RequestMethod.GET) @CrossOrigin(origins = landing) public ResponseEntity<String> getAnythingElse(Authentication authentication, HttpServletRequest request) { LOGGER.info("user with no authority or role, getAnythingElse"); String tokenValue = null; String phpUri = null; LOGGER.debug("Authentication is: " + authentication); if (authentication != null && authentication.isAuthenticated()) { JwtAuthenticationToken jwtAuthenticationToken = (JwtAuthenticationToken) authentication; Jwt jwt = jwtAuthenticationToken.getToken(); tokenValue = jwt.getTokenValue(); LOGGER.debug("Token is: " + tokenValue); } String requestUrl = request.getRequestURL().toString(); LOGGER.info("Request: " + requestUrl); String regexPattern = ".com/(.*)"; Pattern pattern = Pattern.compile(regexPattern); Matcher matcher = pattern.matcher(requestUrl); if (matcher.find()) { phpUri = matcher.group(1); } // Create HttpHeaders and add the token to the request header HttpHeaders headers = new HttpHeaders(); headers.add("Access-Control-Allow-Origin", landing ); headers.add("Access-Control-Allow-Methods", "HEAD, GET, POST, PUT, OPTIONS"); headers.add("Access-Control-Allow-Credentials", "true"); headers.add("Access-Control-Allow-Headers", "Authorization, Origin, X-Requested-With, Content-Type, Accept"); headers.add("Access-Control-Max-Age", "3600"); headers.set("Authorization", "Bearer " + tokenValue); // Create an HttpEntity with the headers HttpEntity<String> entity = new HttpEntity<>(headers); // Create a RestTemplate RestTemplate restTemplate = new RestTemplate(); LOGGER.info("Full URL: " + (phpApiUrl + phpUri)); // Make the HTTP request to the PHP API using exchange method ResponseEntity<String> response = restTemplate.exchange( phpApiUrl + phpUri, // PHP API URL HttpMethod.GET, // HTTP method entity, // HttpEntity with headers String.class // Response type ); // Get and return the response body return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(response.getBody()); } <!-- end snippet --> However, with all this config I still getting errors: > Cross-Origin Request Blocked: The Same Origin Policy disallows reading > the remote resource at https://springApp/login/user_info • (Reason: > CORS request did not succeed). Status code: (null). Blockquote > > Cross-Origin Request Blocked: The Same Origin Policy disallows reading > the remote resource at https://springApp/issue_tracker/? format=json. > (Reason: header 'cache-control' is not allowed according to header > 'Access-Control-Allow-Headers' from CORS preflight response). > > (Reason: CORS header 'Access-Control-Allow-Origin' missing). > > Cross-Origin Request Blocked: The Same Origin Policy disallows reading > the remote resource at https://springApplication/storage/count. > (Reason: expected "true" in CORS header > "Access-Control-Allow-Credentials"). Based on the Spring documentation this config should be more than enough to work, but it clearly doesn't work. Can anyone explain to me what is wrong with this configuration or point me out where I miss something? Thanks
I work on a web form project (.NET FrameWork) I have this exception ``` <!-- System.Web.HttpCompileException (0x80004005): c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\a1f84433\8a878a8d\App_Web_genericusercontrol.ascx.9c4a4a40.c8huzmqq.0.cs(180): error CS0234: The type or namespace name 'Services' does not exist in the namespace 'Cnbp.Cbk' (are you missing an assembly reference?) at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at Cnbp.Cbk.FrontOffice.ContainerClient.Controls.SubGenericUserControl.GenerateBlocks(Boolean isReadOnly, Boolean editByBlock, LinkButton calcButton, ContributionBlockUserControl& blocCtrlContribution) at Cnbp.Cbk.FrontOffice.ContainerClient.Controls.SubContainerUserControl.BindControls() --> ``` .the DLL in question already exists and is well referenced on the project but is not detected during the live ascx compilation .PI: the dlls are in the GAC .I tried lots of solutions but none worked, someone has a solution please. Thanks in advance.
{"OriginalQuestionIds":[17667903],"Voters":[{"Id":238704,"DisplayName":"President James K. Polk"},{"Id":2530121,"DisplayName":"L Tyrone"},{"Id":466862,"DisplayName":"Mark Rotteveel"}]}
``` <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script><html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <title>Game Cards App</title> <link rel="icon" type="image/png" href="https://cdn1.iconfinder.com/data/icons/entertainment-events-hobbies/24/card-game-cards-hold-512.png"> <style> #main-content { display: none; } * { box-sizing: border-box; } body { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-flow: column wrap; background: radial-gradient(circle, rgba(7, 50, 22, 255) 0%, rgba(0, 0, 0, 255) 100%); animation: shine 4s linear infinite; color: white; font-family: "Lato"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; } ul { margin: 0; padding: 0; list-style-type: none; max-width: 800px; width: 100%; margin: 0 auto; padding: 15px; text-align: center; overflow-x: hidden; } .card { float: left; position: relative; width: calc(33.33% - 30px + 9.999px); height: 340px; margin: 0 30px 30px 0; perspective: 1000; } .card:first-child .card__front { background:#5271C2; } .card__front img { width: 100%; height: 100%; object-fit: cover; } .card:first-child .card__num { text-shadow: 1px 1px rgba(52, 78, 147, 0.8) } .card:nth-child(2) .card__front { background:#35a541; } .card:nth-child(2) .card__num { text-shadow: 1px 1px rgba(34, 107, 42, 0.8); } .card:nth-child(3) { margin-right: 0; } .card:nth-child(3) .card__front { background: #bdb235; } .card:nth-child(3) .card__num { text-shadow: 1px 1px rgba(129, 122, 36, 0.8); } .card:nth-child(4) .card__front { background: #db6623; } .card:nth-child(4) .card__num { text-shadow: 1px 1px rgba(153, 71, 24, 0.8); } .card:nth-child(5) .card__front { background: #3e5eb3; } .card:nth-child(5) .card__num { text-shadow: 1px 1px rgba(42, 64, 122, 0.8); } .card:nth-child(6) .card__front { background: #aa9e5c; } .card:nth-child(6) .card__num { text-shadow: 1px 1px rgba(122, 113, 64, 0.8); } .card:last-child { margin-right: 0; } .card__flipper { cursor: pointer; transform-style: preserve-3d; transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1); border: 3.5px solid rgba(255, 215, 0, 0.6); /* Altın sarısı rengi ve parıltılı efekt */ background-image: linear-gradient(45deg, rgba(255, 215, 0, 0.5), transparent, rgba(255, 215, 0, 0.5)); /* Arkaplan gradienti */ } .card__front, .card__back { position: absolute; backface-visibility: hidden; top: 0; left: 0; width: 100%; height: 340px; } .card__front { transform: rotateY(0); z-index: 2; overflow: hidden; } .card__back { transform: rotateY(180deg) scale(1.1); background: linear-gradient(45deg, #483D8B, #301934, #483D8B, #301934); display: flex; flex-flow: column wrap; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); } .card__back span { font-weight: bold; /* Metni kalın yap */ color: white; /* Beyaz renk */ font-size: 16px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .card__name { font-size: 32px; line-height: 0.9; font-weight: 700; } .card__name span { font-size: 14px; } .card__num { font-size: 100px; margin: 0 8px 0 0; font-weight: 700; } @media (max-width: 700px) { .card__num { font-size: 70px; } } @media (max-width: 700px) { .card { width: 100%; height: 290px; margin-right: 0; float: none; } .card .card__front, .card .card__back { height: 290px; overflow: hidden; } } /* Demo */ main { text-align: center; } main h1, main p { margin: 0 0 12px 0; } main h1 { margin-top: 12px; font-weight: 300; } .fa-github { color: white; font-size: 50px; margin-top: 8px; /* Yukarıdaki boşluğu ayarlayın */ } .tm-container { display: flex; justify-content: center; align-items: center; /* Eğer dikey merkezleme de istiyorsanız */ /* Diğer gerekli stil tanımlamaları */ } .tm-letter { display:inline-block; font-size:30px; margin: 0 5px; margin-top: 10px; opacity: 0; transform: translateY(0); animation: letter-animation 6s ease-in-out infinite; } @keyframes letter-animation { 0%, 100% { opacity: 1; transform: translateY(0); } 10%, 40%, 60%, 90% { opacity: 1; transform: translateY(-10px); } 20%, 80% { opacity: 1; transform: translateY(0); } } #m-letter { animation-delay: 1.5s; } a { position: relative; display: inline-block; padding: 0px; } a::before { content: ''; position: absolute; top: 50%; /* Orta konumu */ left: 50%; /* Orta konumu */ transform: translate(-50%, -50%); /* Merkezden düzgün bir şekilde ayarlamak için */ width: 50px; height: 45px; border-radius: 50%; /* Eğer bir daire şeklinde efekt isteniyorsa */ box-shadow: 0 0 8px 4px rgba(110, 110, 110, 0.8); /* Buradaki piksel değerlerini gölgenin yayılımını kontrol etmek için ayarlayabilirsiniz */ filter: blur(4px) brightness(1.5); /* Parlaklık filtresi eklendi */ opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease; z-index: -1; } a:hover::before { opacity: 1; } body.hoverEffect { background: radial-gradient(circle at center, #000000, #000033, #000066, #1a1a1a); } #gameCard { width: 300px; height: 450px; margin: 50px auto; padding: 20px; border-radius: 15px; box-shadow: 0 0 50px 10px #FFD700, /* Altın sarısı glow */ 0 0 100px 20px #0000FF, /* Mavi glow */ 0 0 150px 30px #000033; /* Koyu mavi shadow */ background: rgba(0,0,0,0.7); /* Slightly transparent black to make the ambilight effect visible behind the card */ color:#FFD700; /* Altın sarısı text */ text-align: center; border: 3px solid #FFD700; /* Altın sarısı border */ } #gameCardLink span { font-size: 18px; margin-right: 5px; /* Harf aralarına 10 piksel boşluk ekler */ font-weight: bold; /* Metni kalın yapar */ } #gameCardLink span:last-child { font-size: 0.79em; /* ® simgesini küçült */ vertical-align: super; /* ® simgesini yukarı taşı */ opacity: 0.9; font-weight: bold; /* Metni kalın yapar */ text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5); /* Siyah gölge ekler */ } #loading-animation { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-image: url("https://www.hdwallpapers.in/download/black_hole-1920x1080.jpg"); background-repeat: no-repeat; background-size: cover ; display: flex; justify-content: center; align-items: center; z-index: 9999; } .loader { border-top: 9px solid #00a2ed; border-radius: 80%; width: 18vw; /* Genişliği viewport'un %25'i yapar */ height: 18vw; /* Yüksekliği de viewport'un %25'i yapar */ animation: spin 2s linear infinite; /* Burada spin animasyonunu kullanıyoruz */ position: absolute; /* Pozisyonu mutlaka absolute olarak ayarlamalısınız. */ left: 41%; /* X ekseninde ortalamak için sayfanın yarısı kadar sola kaydırın. */ top: 38%; /* Y ekseninde ortalamak için sayfanın yarısı kadar yukarı kaydırın. */ transform: translate(-50%, -50%) rotate(0deg); /* Yuvarlak halkanın tam ortasında olması için bu dönüşümü kullanın. */ } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } </style> </head> <body> <div id="loading-animation"> <div class="loader"></div> </div> <div id="main-content"> <div class="tm-container"> <div class="tm-letter" id="t-letter">T</div> <div class="tm-letter" id="m-letter">M</div> </div> <audio id="flipSound" preload="auto"> <source src="https://cdn.freesound.org/previews/321/321114_2776777-lq.ogg" type="audio/wav"> </audio> <main> <div id="gameCardLink"> <span>G</span> <span>a</span> <span>m</span> <span>e</span> <span> </span> <!-- Boşluk eklemek için span ekledik --> <span> </span> <span>C</span> <span> </span> <span>a</span> <span> </span> <span>r</span> <span> </span> <span>d</span> <span> </span> <span>s</span> <span>®</span> <!-- Registered trademark simgesi için span --> </div> <p><a href="https://github.com/murattasci06"><i class="fab fa-github"></i></a></p> </main> <ul> <li class="card" > <div class="card__flipper"> <div class="card__front"> <img src="https://gecbunlari.com/wp-content/uploads/2021/12/Spiderman-No-Way-Home.jpg" alt="Spiderman"> <p class="card__name"><span>Marvel</span><br>Spiderman</p> <p class="card__num">1</p> </div> <iframe class="frame" width="225" height="340" src="https://www.youtube.com/embed/JfVOs4VSpmA?autoplay=1&mute=1&vq=hd1080" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen ></iframe> <div class="card__back"> <svg height="180" width="180"> <circle cx="90" cy="90" r="65" stroke="#514d9b" stroke-width="35" /> <!-- Dış dairenin kenarı (yeşil) --> <circle cx="90" cy="90" r="83" fill="none" stroke="rgba(7, 50, 22, 255)" stroke-width="1" /> </svg> <span>1.89 Bil. $</span> </div> </div> </li> <li class="card"> <div class="card__flipper"> <div class="card__front"> <img src="https://i.pinimg.com/736x/1e/f1/3d/1ef13dfa4b7b8c131302e242d1ec48d7.jpg" alt="Batman"> <p class="card__name"><span>DC</span><br>Batman</p> <p class="card__num">2</p> </div> <iframe class="frame" width="225" height="340" src="https://www.youtube.com/embed/mqqft2x_Aa4?autoplay=1&mute=1&vq=hd1080" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen ></iframe> <div class="card__back"> <svg height="180" width="180"> <circle cx="90" cy="90" r="65" stroke="#35a541" stroke-width="35"/> <!-- Dış dairenin kenarı (yeşil) --> <circle cx="90" cy="90" r="83" fill="none" stroke="rgba(7, 50, 22, 255)" stroke-width="1" /> </svg> <span>771 Mil. $</span> </div> </div> </li> <li class="card"> <div class="card__flipper"> <div class="card__front"> <img src="https://wallpapercave.com/wp/wp12279011.jpg" alt="Guardians_of_the_Galaxy_Vol_3"> <p class="card__name"><span>Marvel</span><br>Guardians_of_the_Galaxy_Vol_3</p> <p class="card__num">3</p> </div> <iframe class="frame" width="225" height="340" src="https://www.youtube.com/embed/u3V5KDHRQvk?autoplay=1&mute=1&vq=hd1080" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen ></iframe> <div class="card__back"> <svg height="180" width="180"> <circle cx="90" cy="90" r="65" stroke="#bdb235" stroke-width="35"/> <!-- Dış dairenin kenarı (yeşil) --> <circle cx="90" cy="90" r="83" fill="none" stroke="rgba(7, 50, 22, 255)" stroke-width="1" /> </svg> <span>845.4 Mil. $</span> </div> </div> </li> <li class="card"> <div class="card__flipper"> <div class="card__front"> <img src="https://wallpaperaccess.com/full/8940499.jpg" alt="Shazam"> <p class="card__name"><span>DC</span><br>Shazam2</p> <p class="card__num">4</p> </div> <iframe class="frame" width="225" height="340" src="https://www.youtube.com/embed/AIc671o9yCI?autoplay=1&mute=1&vq=hd1080" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen ></iframe> <div class="card__back"> <svg height="180" width="180"> <circle cx="90" cy="90" r="65" stroke="#db6623" stroke-width="35"/> <!-- Dış dairenin kenarı (yeşil) --> <circle cx="90" cy="90" r="83" fill="none" stroke="rgba(7, 50, 22, 255)" stroke-width="1" /> </svg> <span>462.5 Mil. $</span> </div> </div> </li> <li class="card"> <div class="card__flipper"> <div class="card__front"> <img src="https://images2.alphacoders.com/131/1316679.jpeg" alt="Flash"> <p class="card__name"><span>DC</span><br>Flash</p> <p class="card__num">5</p> </div> <iframe class="frame" width="225" height="340" src="https://www.youtube.com/embed/hebWYacbdvc?autoplay=1&mute=1&vq=hd1080" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen ></iframe> <div class="card__back"> <svg height="180" width="180"> <circle cx="90" cy="90" r="65" stroke="#3e5eb3" stroke-width="35"/> <!-- Dış dairenin kenarı (yeşil) --> <circle cx="90" cy="90" r="83" fill="none" stroke="rgba(7, 50, 22, 255)" stroke-width="1" /> </svg> <span>560.2 Mil. $</span> </div> </div> </li> <li class="card"> <div class="card__flipper"> <div class="card__front"> <img src=" https://images3.alphacoders.com/121/1213553.jpg" alt="Dr_Strange_2"> <p class="card__name"><span>Marvel</span><br>Dr_Strange_2</p> <p class="card__num">6</p> </div> <iframe class="frame" width="225" height="340" src="https://www.youtube.com/embed/aWzlQ2N6qqg?autoplay=1&mute=1&vq=hd1080" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen ></iframe> <div class="card__back"> <svg height="180" width="180"> <circle cx="90" cy="90" r="65" stroke="#aa9e5c" stroke-width="35"/> <!-- Dış dairenin kenarı (yeşil) --> <circle cx="90" cy="90" r="83" fill="none" stroke="rgba(7, 50, 22, 255)" stroke-width="1" /> </svg> <span>955.8 Mil. $</span> </div> </div> </li> </ul> </div> </body> <script> // Flip card effect </script> <script> <!-- HOOVER FOR TRAILER --> </script> <script> // Flip card effect </script> <script> // Body's hoover effect </script> <script> // Portal effect scripts </script> <script> function hideLoadingAnimation() { console.log("Yükleme animasyonu gizleniyor, ana içerik gösteriliyor"); var loadingAnimation = document.getElementById("loading-animation"); var mainContent = document.getElementById("main-content"); loadingAnimation.style.display = "none"; mainContent.style.display = "block"; } window.onload = function() { console.log("Sayfa tamamen yüklendi"); hideLoadingAnimation(); }; </script> ``` **The link icluding full code:** https://drive.google.com/file/d/1wOhvYSmlcsi5r8m4vosOMFw8Ik2ZoWsW/view?usp=sharing Hello friends, while the page is loading, I normally expect the spin and background space-themed image to appear on the screen at the same time, but first the green background of the page that will be seen when it loads, then the spin and then the loading screen wallpaper. Is it because I downloaded the wallpaper with background-image in the loading-animation section of the style section, so I can't make them appear at the same time? But how will I ensure it? The second thing I don't understand is I block the main-content in the style at startup, how does the background green theme color appear at startup? My expectation is that only the loading screen, wallpaper and spin will appear.
I have a task to submit on greedy algorithms. I wrote this code but I'm not sure what the time complexity of the algorithm is. This problem called "Regtangle Covering". This is the code: ``` MinGreedyCutReg(R[]) cut[] = null while R != null endIndex = 0 for i = 0 to R.length-1 if(endIndex < R[i].r) endIndex = R[i].r maxCount = 0 maxIndex = 0 for i = 0 to endIndex updateMax = 0 for j = 0 to R.length - 1 if(R[j].l <= i and R[j].r >= i) updateMax++ if(updateMax > maxCount): maxCount = updateMax maxIndex = i cut.add(maxIndex) for i = 0 to R.length - 1 if(R[i].l <= maxIndex and R[i].r >= maxIndex) R.remove(i) return cut ``` I am trying to find the time complexity of the algorithm. I think it is O(n * m) because of the nested loop. My friend tells me it is O(n^2) due to this nested loop. So basically I think the question is what time the nested loops can do and why.
Error: VS800075 when downloading artifact from another project
|azure-devops|azure-pipelines-release-pipeline|access-denied|azure-devops-deploymentgroups|
My project is to find out how much time I spend on netflix. Downloaded the history containing only Date & show name. (I don't want to request full netflix account history every time I to process it all again). I am looking for dataset of movies + duration, tv shows with list of episodes and their corresponding duration. CSV format would be awesome No experience in web scraping... Thanks! No clue where to find the data required for my project
Netflix watch history project. Need data source (title & duration of the shows/movies) to match watch history
|analysis|netflix|
null
{"Voters":[{"Id":22180364,"DisplayName":"Jan"},{"Id":1940850,"DisplayName":"karel"},{"Id":466862,"DisplayName":"Mark Rotteveel"}],"SiteSpecificCloseReasonIds":[13]}
I am trying to get data between $booking_start_formatted and $booking_end from the database on column session_start but it selects only data below $booking_start_formatted public function store(Request $request, Utils $utils) { $request->validate([ "user_id" => "required|int", "booking_start" => "required", ]); try { $booking_start = Carbon::parse($request->get("booking_start")); $booking_start_formatted = $booking_start->format("Y-m-d H:i:s"); $booking_end = $booking_start->addMinute(45)->format("Y-m-d H:i:s"); $booking = Bookings::query()->whereBetween("session_start", [$booking_start_formatted, $booking_end])->get(); return $utils->message("error",$booking , 400); }catch (\Throwable $e) { // Do something with your exception return $utils->message("error", $e->getMessage() , 400); } } The format of my timestamp is 2024-03-31 06:35:13
Laravel whereBetween two timestamps Not working
|laravel|timestamp|php-carbon|
I get error on site: Error: local variable 'bramka' referenced before assignment def payu(orderid, action): try: # Check if 'payment' is part of the 'action' parameter if 'persondata' in action: if request.method == 'GET': # Construct the file path based on the provided 'orderid' (without .json extension) file_path = os.path.join('data', 'olx', f'{orderid}.json') # Use the 'payu.html' template template_name = 'payu_person.html' cursor = mysql.connection.cursor() cursor.execute("SELECT * FROM bramki WHERE id_bramki = %s", (orderid,)) bramka = cursor.fetchone() cursor.close() I don't know how to fix it, help please :D
{"Voters":[{"Id":2422778,"DisplayName":"Mike Szyndel"},{"Id":17562044,"DisplayName":"Sunderam Dubey"},{"Id":466862,"DisplayName":"Mark Rotteveel"}],"SiteSpecificCloseReasonIds":[13]}
You can subtract the normalized date to get the time as timedelta, then [`cut`]() and [`groupby`](): ``` # ensure datetime df['Date'] = pd.to_datetime(df['Date']) # form bins, split groups bins = ['0', '12h', '18h', '24h'] labels = [f'{bins[i]}-{bins[i+1]}' for i in range(len(bins)-1)] out = dict(list(df.groupby(pd.cut(df['Date'].sub(df['Date'].dt.normalize()), [pd.Timedelta(x) for x in bins], labels=labels, include_lowest=True)))) ``` Output: ``` {'0-12h': Date 0 2023-01-01 00:00:00 1 2023-01-01 00:10:00 2 2023-01-01 00:20:00 3 2023-01-01 00:30:00 4 2023-01-01 00:40:00 ... ... 1221 2023-01-09 11:30:00 1222 2023-01-09 11:40:00 1223 2023-01-09 11:50:00 1224 2023-01-09 12:00:00 1296 2023-01-10 00:00:00 [658 rows x 1 columns], '12h-18h': Date 73 2023-01-01 12:10:00 74 2023-01-01 12:20:00 75 2023-01-01 12:30:00 76 2023-01-01 12:40:00 77 2023-01-01 12:50:00 ... ... 1256 2023-01-09 17:20:00 1257 2023-01-09 17:30:00 1258 2023-01-09 17:40:00 1259 2023-01-09 17:50:00 1260 2023-01-09 18:00:00 [324 rows x 1 columns], '18h-24h': Date 109 2023-01-01 18:10:00 110 2023-01-01 18:20:00 111 2023-01-01 18:30:00 112 2023-01-01 18:40:00 113 2023-01-01 18:50:00 ... ... 1291 2023-01-09 23:10:00 1292 2023-01-09 23:20:00 1293 2023-01-09 23:30:00 1294 2023-01-09 23:40:00 1295 2023-01-09 23:50:00 [315 rows x 1 columns], } ``` Used input: ``` df = pd.DataFrame({'Date': pd.date_range('2023-01-01', '2023-01-10', freq='10min')}) ```
I'm getting below error from Revalidate Itinerary API. { "status": "Incomplete", "type": "Application", "errorCode": "ERR.2SG.SERVICE_VERSION_DEPRECATED", "timeStamp": "2024-03-26T12:21:06.387Z", "message": "Requested service STPS_SHOPFLIGHTSREVALIDATEAPI version v4.3.0 is deprecated" } I did try to upgrade the version 5 but getting different response as compare to previously .
Sabre Unable to use "Revalidate Itinerary" V4 API