instruction
stringlengths
0
30k
I am trying to get job by job_id via firebase rest api. I am getting this JSON result below. How i can rid of the 0 and get the object? And Is there better way to get the job via firebase rest api? This is my code: { "0": { "category_id": 0, "created_on": "Mar 29, 2024", "descript...
I need to change the size of the terminal panels of the nodes that are as barplot in a ctree, because I can't see the 13 species (response variable) and also the size of the letter is very small in the whole tree. I have tried several ways but I have not been able to do it. > dataasfactor=CART_monitoring_no_loc_mont...
Change size of terminal_panel = node_barplot in ctree
|plot|nodes|font-size|ctree|cptbarplot|
null
I am writing a UDP based client server and have got pretty much the code, but I am confused about how UDP server sends the response back to UDP client, this is my understanding till now: - Suppose a UDP client wants to communicate with a UDP server, so it will send a request to the UDP server (using the UDP socket ...
How does a UDP server send the response back to a UDP client?
|azure|azure-devops|migration|devops|pipeline|
`SpecPage` in spec unit tests limits you to the HTML interface. You can only test what exists in the rendered DOM, not any other properties of a component. So if the component's `Prop` is not reflected as an attribute, you can't access it using `SpecPage`. You can force a `Prop` to be reflected - if it is a string, num...
{"Voters":[{"Id":573032,"DisplayName":"Roman C"},{"Id":5389127,"DisplayName":"Gaël J"},{"Id":18157,"DisplayName":"Jim Garrison"}],"SiteSpecificCloseReasonIds":[16]}
Dev tool for Next.js cache on the client?
how to create an array of multiples of 5 and display it in reverse
You can save the event and use it later multiple times. It's explained [here][1]. I use React and [zustand][2] as state manager. I save the event into a store ```typescript /* Saves PWA install prompt for future usage */ window.addEventListener('beforeinstallprompt', (event) => { event.preventDefault(); use...
Whenever I make an executable on visual studio I run into the same problems: 1. There are multiple files that the user needs to run the program (not just 1). Even if I go into the publish settings and select to produce a single executable, usually it will still include more than one file sometimes and I don't know w...
How to make one executable visual studio, that users can run?
|c#|visual-studio|
null
I am developping web application to manage artwork (Oeuvre) with Symfony 6.4.5 and EasyAdmin 4.8 and I have created custom field based on natif EA CollectionField with custom type based on CollectionType with the same options like allowAdd, allowDelete... In the custom field, I can get anywhere options values set on...
Symfony form type option issues
|symfony|easyadmin|
null
You only need one instance of a MultiUSRP and one instance of the streamer. You can leave the subdev spec to default. If you want to modify [here][1] are some examples. You need to tell the streamer which channels you want to receive (for a B210 0,1 or both). See this [example][2] on how to set receive channels on stre...
Dropdown list showing SQLServer2005SQLBrowserUser$DONSERVER instead of active directory group name asp.net MVC c#
|c#|asp.net|active-directory|
null
[**Plunker example**](https://plnkr.co/edit/f9X2UfWdExhCh6oAX9hc?p=preview) @Directive({ selector : '[animate-box]', host : { '[style.background-color]' : "'transparent'" }, exportAs : 'ab' }) class AnimateBox { constructor(private _ab: AnimationBuilder, pri...
'react-pdf' adds html at after each page instead of just rendering the pages of the pdf file
<!-- language-all: lang-ts --> I'm trying to accomplish a simple Angular2 animation using the Animate modules. Here is what I managed to do so far: https://plnkr.co/edit/o0ukvWEB4THB0EQmv0Zu Everything is as I'm expecting it, the red cross progressively disappears in a motion to the top. My problem is that ...
``` import pygame, sys from settings import * #initialize pygame pygame.init() #variables screen = pygame.display.set_mode((screen_width, screen_height)) run = True clock = pygame.time.Clock() #game loop while run == True: #event handler for event in pygame.event.get(): if event.type ==...
Why am I getting a nameerror from a variable that's in a file I imported?
|python|import|nameerror|
null
In which language are you programming? but if you are talking about QUERY , this can help you to extract all logs with Error Status and logs with other status, but contain the word "error" on its message ```SELECT * FROM logs WHERE status = 'Error' OR message LIKE '%ERROR%' LIMIT 20 ``` for ot...
{"Voters":[{"Id":1883316,"DisplayName":"Tim Roberts"},{"Id":987358,"DisplayName":"Michael Butscher"},{"Id":12265927,"DisplayName":"Puteri"}]}
You do not need python for simple cases just use the systems own tools. The Unix Philosophy (DOS was too, but Windows CMD.exe is better). Is to write reusable blocks of commands to adapt to a specific case. Thus all we need is HTML "get and edit" which can be Write Once Re-Use Many (WORM). Here I have paused a...
How to get the json object with Typescript?
|angular|firebase|api|rest|
null
Often, you can use [default][1] for this job. {{ foo|default('bar') }} Which is equivalent to: <?php echo isset($foo) ? $foo : $bar; ?> Maybe not exactly what OP wanted, but I think it will come in handy with a closely similar need for others. [1]: https://twig.symfony.com/doc/3.x/filters/de...
1ST CODE VARIANT: ``` let getLastDayOfMonth = function(year, month) { let date = new Date(); date.setFullYear(year, month, 28); while (date.getMonth() === month){ date.setDate(date.getDate() + 1); } date.setDate(date.getDate() - 1); return date.ge...
you can use this code instead of `this::class`. In your example bar::reference properties // here you will get for more reference [Reflection][1] [1]: https://kotlinlang.org/docs/reflection.html#bound-constructor-references
I have an iPhone and iPad with Maps.ME. The software works fine, but I am no longer able to get new maps because my hardware is rather old. I tried to manually compile and run the maps generator from GitHub [mapsme omim](https://github.com/mapsme/omim/tree/master). It seems to be generating some maps files in WMW. When...
Maps.ME generate updated maps
|ios|maps|
null
I have setup a postgres:13.3 docker container and scram-sha-256 authentication. Postgres.conf: ``` password_encryption = scram-sha-256 ``` pg_hba.conf: ``` hostnossl all all 0.0.0.0/0 scram-sha-256 local all all scram-sha-256 ``` After above done and restarted container, I created a new fbp2 user and ap...
I've been moving development of my website over to using Docker. I recently adjusted the location of media files when I was presented with this error: [Errno 2] No such file or directory: '/tmp/tmp1d93dhp7.upload.mp4' in Django. So far I've checked for typos in my file location code in my settings, views and models. ...
I had an issue with a system that I didn't run `subscription-manager` for a long time on. Also actually it was a cloned install on another computer to begin with, so idk if client certificates are bound to machine information. Anyway, I was getting ``` Unknown server reply (HTTP error code 400: Bad Request): <htm...
I am trying to fix a UI behaviour where when the text field is tapped and the keyboard comes up, the views are pushed up. .ignoresSafeArea(.keyboard) fixes it when I don't include BackgroundView() However, when BackgroundView() is in the code, .ignoresSafeArea(.keyboard) is not effective. Here is my code: ```...
I have files named File 2024 US adj.csv. I have a wild card path in a copy activity which ingests all files in an ADLS location and passes the year as a wild card. I'm trying to create two new columns in the files for year and country but don't know how to write the dynamic content to be able to extract these values fr...
Synapse pipeline - extract year and country from a filename in a wildcard path
|azure-data-factory|wildcard|azure-synapse|dynamic-content|
I would not go with this approach, but will post for educational purposes. as mentioned in comments it would be simpler to serialize to class and map to another one. this example is showing Custom Json Converter . P.S. i wrote in a way, than you can put multiple Values3,4 etc. (still stiff code) ```C# void Main...
i've been trying to run this code, but i receive the error: non-numeric argument to binary operator. i've tried stacking and then iterating through them to perform a calculation. it, unfortunately, doesn't work right. it messes with the raster band metadata and appears to condense all the bands into one image rather th...
looping through raster bands to perform calculation
|r|function|for-loop|matrix|raster|
null
``` import pygame, sys from settings import * #initialize pygame pygame.init() #variables screen = pygame.display.set_mode((screen_width, screen_height)) run = True clock = pygame.time.Clock() #game loop while run == True: #event handler for event in pygame.event.get(): if event.type ==...
I don't know how to do it in more elegant way. I have the menu in a layout file with <a> tags with the classes "menu__item" and I want to add the class "menu__item--active" to the current link. I did it that way: web.php ``` Route::get('/page/foo', [TestController::class, 'foo'])->name('foo'); Route::...
The bit you're missing is that `str(float)` and `repr(float)` return the shortest string that reproduces the original value when passed to `float()`. So, e.g., despite that there is no representable float exactly equal to one tenth, ```python >>> 0.1 0.1 ``` Doesn't mean it _is_ one tenth (and it isn't!), b...
If I have a Button in SwiftUI, what is the best wa toy add additional actions to that button using a view modifier? For example, let's say I have the following: ```swift Button("Tap me") { print("tapped") } ``` and I want to write a modifier that we can add to any button, so that when the button is tapped, ...
How to add additional actions to a button via a modifier
|ios|swift|swiftui|
I think one of the simplest responses is to just create a random graph and then sequentially connect node n to node n+1. G = nx.dense_gnm_random_graph(15, 5) prev_node = None for node in nx.nodes(G): if prev_node != None: # we need to compare with None because when prev_node is zero the ...
I'm developing a Flask web application and I want to implement a loading page that appears while the content of each page is being loaded. This loading page should be displayed for all routes, including error pages like 404 errors. I've created a loading page template (loading.html) with a simple loading animation, ...
How to Implement a Loading Page for All Routes in Flask?
|python|html|flask|
null
I am creating a simple Terraform state file in S3, following is the code that I am using terraform { backend "s3" { bucket = "terraform-state-bucket" key = "global/s3/terraform.state" region = "us-east-1" dynamodb_table = "dynamodb_state" encrypt = tr...
Terraform/AWS - Error while acquiring state lock
|amazon-dynamodb|terraform-provider-aws|
{"Voters":[{"Id":4108803,"DisplayName":"blackgreen"}],"SiteSpecificCloseReasonIds":[18]}
Your current setup limits the size of your row (which is a grid) to give the cookie a particular size. You should change the individual widths of the elements you don't want stretching to the full bounds of a row. For the row to cover the whole screen I recommend having the row cover the entirety of the width (setti...
`BasePresentation` is a composable. You try to store that in a list and retrieve it later on to display at that location. That's not how Compose works though. The declarative nature of Compose expects the composable to be placed where it should be displayed. It has to remain inside `HorizontalPager`. What you can do...
FATAL: password authentication failed for user with Postgres13.3 and SCRAM authentication
|java|postgresql|hikaricp|
For the moment we are migrating from an old system using javascript for both backend and frontend code that is stored in a database and that code is interpreted by an external hidden api so we don't know the engine that executes it. Since the new stack is based on java we thought about transpiling those javascript s...
Javascript to Java
|javascript|java|compilation|abstract-syntax-tree|transpiler|
null
|r|plot|
[Screenshot][1] app theme: Theme.Material3.DayNight.NoActionBar this id this is the manifest: <activity android:name=".ui.activities.BaseActivity" android:exported="false" android:label="@string/title_activity_base" android:theme="@style/AppThe...
That is not how [data loading][1] works. The object returned is always passed to a property called `data`, there is no `props`. ```js return { articles }; ``` ```js export let data; // data.articles ``` [1]: https://kit.svelte.dev/docs/load#page-data
|javascript|puppeteer|
I am trying to make a decission tree using rpart function in r. I have the y variable "outcome" and 4 variables as x. All of them are factors. Every tree I tried to make returns when i plot it only the first node. Do you have to suggest any solutions or another function that could help me? Here is the code: ``` ...
Decission tree in r using rpart for factor returns only the first node
|classification|decision-tree|rpart|
null
For those wanting to query a GraphQL service WITHOUT a third party library, I basically took Brian's code and tested against a GraphCMS service I had already written Node.js code for. So I knew the url, authorization token, and query all worked. <?php $endpoint = "https://api-euwest.graphcms.com/v1/[[your i...
I have a contrast using lrm in the rms package. How can I recreate this in emmeans? # example from rms package library("rms") set.seed(1) age <- rnorm(200,40,12) sex <- factor(sample(c('female','male'),200,TRUE)) logit <- (sex=='male') + (age-40)/5 y <- ifelse(runif(200) <= ...
With sprint boot 3.1.5 in two microservices, one using FeignClient to request to the other microservice , I have this properties configuration in both microservices: management: tracing: propagation: produce: b3 consume: b3 brave: span-joining-suppo...
I want to make a sample of two variables, according to a specific probability distribution. I thought of making a matrix that expresses the probability distribution but my code results in `p is not defined`. ``` p = matrix(c(0.04,0.1,0,0.06,0.05,0.3,0,0.05,0.14,0.1,0.06,0.1), nrow=3, ncol=4, byrow = TRUE) sample_1...
null
Dynamically size UIStackView when one of its items gets larger
For some reason, if you highlight the Text Area text the background turns black and therefore makes the text unreadable, also when I select the radio buttons at the bottom (see attached pictures), the whole text area then goes black, again making the text unreadable! Anyone know why it is doing this? Here's the code...
Good practices for variables in Laravel's layout files
|laravel|variables|menu|laravel-blade|
I have a hosted zone for my apex domain `yzpaul.com`. I requested a certificate through AWS Certificate Manager for `yzpaul.com` and `www.yzpaul.com`. The `yzpaul.com` was approved almost instantly. I confirmed both CNAME records showed in the hosted zone. 24 hours later `www.yzpaul.com` still says pending. What am I m...
requesting AWS Certificate Manager cert for root domain works, but not www subdomain
|ssl-certificate|aws-certificate-manager|