instruction stringlengths 0 30k ⌀ |
|---|
|sql-server|sql-server-agent| |
I am trying to write a function for a given user to return a count of all online users and offline users for each chatroom the given user is a part of.
The methods listed below achieve what I want but it writes multiple queries to postgres and I want to be able to do it in one query.
```
class Users(Base):
... |
For others, this works:
// If you get 'dllimport unknown'-, then add 'using System.Runtime.InteropServices;'
[DllImport("gdi32.dll", EntryPoint = "DeleteObject")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DeleteObject([In] IntPtr hObject);
public ImageSource ImageSou... |
A powerful option – and one which also boosts creativity – is designing your own characters using [box drawing characters](http://jrgraphix.net/r/Unicode/2500-257F).
Want a down pointing "caret"? Here's one: ╲╱
I've recently discovered them — and I take great pleasure at using such custom designed characters for ... |
I am programming a iOS and Android app with Firebase. Now I want to implement Push Notifications. That works fine so far. I want that when a user interacts with another in a certain action one user is getting notified via a push notification.
Now my question is how can I achieve this, I am saving the FCM token in my... |
When i click the burger_btn it's getting converted to cross_btn but the list menu is not showing i tried debugging by putting console.log() statements at the start and end of both the functions but the console.log() statements where printing on the console correctly without any error...
<!-- begin snippet: js hide: ... |
null |
When I click the `burger_btn` it's getting converted to `cross_btn` but the list menu is not showing i tried debugging by putting `console.log()` statements at the start and end of both the functions but the `console.log()` statements where printing on the console correctly without any error...
<!-- begin snippet: j... |
I tried to run a SQL Container using volumes but I get an error.
I'm using Windows 11 Home edition, with docker desktop.
I ran the following commands after installed docker desktop:
```
docker pull mcr.microsoft.com/mssql/server:latest
docker volume create sql_data
docker run -e 'ACCEPT_EULA=Y' -e 'SA_P... |
Docker cannot run SQL Server container with volume |
|sql-server|docker| |
null |
They behave differently because the primary use cases for `!` and `Boolean()` are different. TypeScript lacks human intelligence and cannot simply look at two different pieces of code like `!!x` and `Boolean(x)` and say "these do the same thing" unless someone explicitly programs that into the compiler. That has not be... |
[![ParentChild][1]][1]
Hi All.
I've created VBA Macro in Excel to provide the Indent value in col B (from Alignment tab of the Format Cell screen) and trying to establish Parent/Child in Col C. The output should match Col D, but having a hard time getting the logic in. It has to look at Col B to build Paren... |
Usage of merge in linux sort utility |
|linux|sorting|merge|big-o|mergesort| |
null |
I wanna make function defines with macro, if the arg is pointer type, i will use its pointed type name, else if the arg is pure type, i will use its orignial type name.
So the question is how to remove the "*" automatically in c++ macro args?
I have tried some methods like use __VA_ARGS__ or macro combinations, b... |
Could not build idl using anchor |
|rust|solana| |
I updated my code from last posting. You do not need to cast to string in foreach because all items are already string.
<!-- begin snippet: js hide: false console: true babel: false -->
using System;
using System.Linq;
using System.Collections.Generic;
using System.Data;
using System.Xml;... |
Today, I'm seeing something new and strange in Visual Studio 2022 17.9.5. When typing an html comment in a .cshtml file an intellisense like context menu appears with what look like html tags. It's not helpful given since I'm typing a comment :-) It's a distraction I'd like to eliminate.
[ running in your terminal has [state](https://en.wikipedia.org/wiki/State_(computer_science)#Program_state). If you only rerun the print line after changing the lines that set the variables to different values, you haven't told the interpreter... |
|biological-neural-network|neuron-simulator|neuroml|lems| |
```
import React, { useState } from 'react';
import { Theme } from '@/styles';
import Select, { components, DropdownIndicatorProps, PropsValue } from 'react-select';
import { TbCaretUpDownFilled } from 'react-icons/tb';
const DropdownIndicator = (props: DropdownIndicatorProps<true>) => (
<components.DropdownI... |
I was trying to upgrade my pip version but this error keep coming after vary efforts I used " python.exe -m pip install --upgrade pip" to upgrade my pip and tried to use --user option but it seems to require a permission and which I am unable to resolve.
I tried to go to my C drive and then Python installation... |
OSError: [WinError 5] Access is denied: 'c:\\python311\\scripts\\pip.exe' Consider using the `--user` option |
|python|authentication|installation|pip|version| |
null |
**Website is a simple Laravel Login, Signup, Dashboard etc.**
Website is based on **Laravel**, **Tailwind** and **Bootcamp**,
On **localhost** website looks eye appealing but the second i push it to repository which uploads it to web server, the design is non-existing, everything is white.
**P.S**
I tried to incl... |
Web server doesnt output the website like in the project on localhost |
|laravel|tailwind-css|webserver|laravel-blade|laravel-breeze| |
null |
The detailed analysis of the issues with your code is given in the answer by *trincot*, but the core of the issue you are facing is not clearly described there, hence this supplementary response:
**The actual root of the issue you describe is to expect that the initial call of the traverse function will return you ... |
|r|numerical-integration|integral|wolframalpha| |
I had the same issue and traced it to a bug in amplify related to a aws-sdk v2 => v3 breaking change. The open issue is here:
https://github.com/aws-amplify/amplify-js/issues/13192
The basic problem is that in
core/src/clients/middleware/retry/defaultRetryDecider.ts#L19
const errorCode = parsedError?.code... |
|r|numerical-integration|integral| |
I am using Laravel 10.47 and PostgreSql 14.2.
I an using the following piece of code in the migrations that creates the timestamps fields:
$table->timestamp('email_verified_at')->nullable()->useCurrentOnUpdate();
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->nullabl... |
When you refresh your page your entire app and so your context are re-initialized, so all the stored data and states you have manipulated until the refresh is lost. If you want to persist data you should consider one of this two options: localStorage or sessionStorage (you can google them on MDN docs).
But your choi... |
- Changed lines are marked with `**`
```vb
With sht.Cells(LastRow, COL_KEY)
If Len(.Value) > 0 Or (Not .ListObject Is Nothing) Then
LastRow = LastRow + 1
End If
If LastRow < FIRST_ROW Then LastRow = 5
End With
sht.Cells(LastRow, COL_KEY) = Y ' **
Dim tabRng... |
EDIT: This answer is old and based on sqlalchemy 1.x.
I used it with sessions, but an alternate way where you can access the relationship field directly is
db_session.query(Patient).join(Patient.mother) \
.filter(Patient.mother.property.mapper.class_.phenoscore==10)
I have not tested it, but I gue... |
|r|r-markdown|flexdashboard|ggplotly|geom-vline| |
I'm trying to create a table using MySQL workbench, but the Apply and revert buttons are not showing. I also can't type in a name for the table.
[![mysql-workbenc-for-mac-not-showing-apply-and-revert-buttons-while-creating-a-table][1]][1]
[1]: https://i.stack.imgur.com/sBlNU.png |
MySQL Workbench not showing Apply and Revert buttons while creating a table |
|sql|mysql|database|relational-database| |
I've found a way to solve this. I've sign the app and now I can install it without any issue.
No Idea why I was able to install it before~ |
I have a large json file containing +8 million lines. Due to memory restriction i'm trying to find how to only read a specific line from the file without load the whole file into memory.
What i'm looking for is function that basically behaves like this:
```
def read_line(file_name, line_number)
return the li... |
Read only a specific line from a json file |
|python|json|file| |
null |
I've stumbled across an oddity in MSVCs codegen, regarding structures that are used as return-values. Consider the following code ([live demo here][1]):
struct Result
{
uint64_t value;
};
Result makeResult(uint64_t value)
{
return { value };
}
struct ResultFa... |
This probably is happening because your commandline command is too long. I assume IntelliJ suggested you to use @argfile to shorten the command. Then when you ran it you encountered this exception. I had the same problem on Windows.
In my situation using JAR Manifest command shortener did not help. I solved it by mo... |
Published applications do not rely on the environment variable.
When running your application, you have the option to specify the ASPNETCORE_ENVIRONMENT environment variable on your server to access the corresponding configuration. Just as you added it to Visual Studio launch settings, you can configure it within yo... |
{"Voters":[{"Id":1127428,"DisplayName":"Dale K"},{"Id":3711162,"DisplayName":"Dan Guzman"},{"Id":2029983,"DisplayName":"Thom A"}],"SiteSpecificCloseReasonIds":[16]} |
Well, I found an answer. In c++ don´t need rise an exception like in Python. I propoust this solution, is not perfect, but is close. I say close, because if you input 2,35 ( not 2.35) the output is 2, and it isn't ok.
#include <iostream>
#define max_size 50 // tamanio maximo de caracteres basura
... |
|sql|sql-server|sql-server-2019| |
{"Voters":[{"Id":5625547,"DisplayName":"0stone0"},{"Id":550094,"DisplayName":"Thierry Lathuille"},{"Id":9214357,"DisplayName":"Zephyr"}]} |
I'm trying to use a Table-value function (TVF) to execute one of 2 queries based on the value passed in. If the value passed in is NULL, I want to return all rows. If the value is specified, I want only those rows where the parameter equals the value specified.
CREATE FUNCTION [dbo].[search_test]
(
... |
I'm using a table where I have to do this operation where I group_by, and mutate by n_distinct, and this is necessary for me to carry out my next step, I'm just showing casing mtcars here because I want to learn how to do this on my dataset
tbl_mtcars <- copy_to(sc, mtcars, "spark_mtcars")
tbl_mtcars%>%
... |
How to resolve react-select TypeScript error? |
|reactjs|typescript|react-select| |
You need to call the `update()` function from within your controller when the changes that required a UI representation are made.
The follow function would be within your controller and be called from your `onTap()` within each listItem, passing the index of the the list item
addItemsToSelectedList(int inde... |
This is a bug in pysqlite, see [the pysql issue tracker][1] and [the python issue tracker][2].
[1]: http://code.google.com/p/pysqlite/issues/detail?id=24
[2]: https://github.com/python/cpython/issues/54949 |
The implementations of `script` I have checked ([util-linux](https://github.com/util-linux/util-linux/blob/6ff6f5b6ffd9323cc568def2169225dd84bc3a0c/term-utils/script.c#L960) and [freebsd](https://cgit.freebsd.org/src/tree/usr.bin/script/script.c#n235)), both call [cfmakeraw(3)]() if their stdin is a terminal.
On lin... |
Probably I have a config issue I just can't find out where exactly. The error message is when I run my test:
TypeError: Cannot read properties of undefined (reading 'Brand')
14 | className='bg-body-tertiary shadow-lg'>
15 | <Container>
> 16 | ... |
Config issue when configuring Jest - TypeScript |
I have this code that works. I was wondering how to implement using
np.lib.stride_tricks.as_strided or avoid loops.
import yfinance as yf
import pandas as pd
import numpy as np
# Fetch Apple stock data
apple_data = yf.download('AAPL', start='2024-01-01', end='2024-03-31')
... |
I need the bot to understand that they left a reaction in the post and display in the console what type of reaction they gave, for example, heart, like, dislike, and I need this to work through the telebot library in python, please help, I don’t understand at all how this can be done.
I tried to read data from a mes... |
How can a bot find out that a reaction emoji was left in a Telegram channel post? telebot python |
|python|telegram|telegram-bot|telebot| |
null |
{"Voters":[{"Id":2887218,"DisplayName":"jcalz"}]} |
> **Possible Duplicates:**
> [call a function named in a string variable in c](https://stackoverflow.com/questions/1118705/call-a-function-named-in-a-string-variable-in-c)
I have certain functions.. say,
double fA1B1C1( .. ) {
...
}
double fA2B2C3( .. ) {
.... |
null |
Building VPN App using react native framework |
null |
Per the comment from Ivan Stoev, the solution was to use a LINQ "Select":
var myList = _context.MyTable.Select(e => e.MyColumn).Distinct().ToList();
This worked well, and it does not require any external dependencies. |
I'm student in practicing PintOS Project.
In Programming Project 3(Virtual Memory), I got ploblems about "preprocess in compiling" (C program).
I had tried all attempt that do my best, but I'm absolutely lost at this point on how to fix it.
Finally i come to here, had to ask you about this issue.
**error**
T... |
|javascript|php|jquery|ajax| |
You can create a custom webpack configuration for Ionic 4/Angular as follows.
Create a custom Webpack configuration file in the root of your project:
$ touch custom.webpack.config.js
Open the `custom.webpack.config.js` file and add the following code:
```ts
const webpack = require('webpack');
console... |
Why is time complexity of Generate Parentheses O(4^n ( sqr root( n))) |
|algorithm|time-complexity|parentheses|catalan| |
null |
I have the `TextFile1.txt` with _Hello, World!_ text in my C# project. The file is saved in `UTF-8` encoding. It's file `Build action` property is `Resource` (not the `Embedded resource`).
I try to get it's content:
```csharp
var asm = GetType().Assembly;
var name = $"{asm.GetName().Name}.g.resources";
using... |
Why the string of Resource is not the same as I expected and how to fix it? |
|c#|resources| |
So I am practicing on the android constraint layout, I have a project on android its more of dictionary. Word can have one or more meanings. When there are more words, they overlap. I have tried changing till gave up. Need your help guys.
Here is the xml.
```
<androidx.constraintlayout.widget.ConstraintLayout xmln... |
I want to print on page instead of alert
```
<div id="menu">
<img class="thm" src="images/test1.png" />
<img class="thm" src="images/test2.png" />
<img class="thm" src="images/test3.png" />
</div>
<div id="content">
<img id="main" />
</div>
<script>
var img = document.getElementById('i');
... |
I have a table with a cube column, but restoring the database from pg_dump stopped working from postgres 15.6 (also a problem on postgres 16.3). The error I get is on the function ```ll_to_earth``` in the```earthdistance``` extension.
```pg_dump``` always set the searchpath to empty:
```SELECT pg_catalog.set_confi... |
I am using Spring Boot 2.7.0, and I used the Log4JDBC dependency to log queries with its parameters.
I added the dependency to build.gradle
implementation 'ru.vasiand:spring-boot-starter-log4jdbc:1.1.0'
I added the configuration in application.yaml
log4jdbc:
auto:
load:
popular:
drivers... |
Use `sudo pwsh -c`:
```
PS> (sudo pwsh { gci -r /opt/tomcat/*.sh | ? name -like 'startup*' }).fullname
/opt/tomcat/bin/startup.sh
```
Or from bash
```
$ echo "Secret content" | sudo tee /root/secretfile.txt > /dev/null
$ sudo chmod 600 /root/secretfile.txt
$ sudo pwsh -Command "Get-Content /root/secretfile... |
The constructor is not where you register your custom element: you register it "immediately" with your class declaration, and then if you want your code to start running only after the browser has finished loading that in, wait for it.
And note that, because we can call `customElements.define` statically inside a cl... |
sparklyr group by mutate with n_distinct |
|sparklyr| |