instruction stringlengths 0 30k β |
|---|
I have a folder containing `delta` files. I try to create an external table as follows:
spark.sql("""
CREATE TABLE IF NOT EXISTS my_table
(
id INT,
name STRING
)
USING DELTA
LOCATION 'abfss://xxx@... |
Schema Modification when creating External Tables |
|databricks-unity-catalog| |
The code:
```lua
function randomNumbers (str)
local matches = {}
for match in str:gmatch("#") do
table.insert(matches, match)
end
for i = #matches, 1, -1 do
local n = tostring(math.random(0, 9))
str = string.gsub(str, "#", n, 1)
end
return str
end
```
Examples:
```lua
print(randomNum... |
Upon executing the commands `composer require laravel/ui` and `php artisan ui vue --auth`, Laravel throws an error. I have been searching for a solution but have yet to find one.
> Call to undefined method
> App\Http\Controllers\Auth\LoginController::middleware()
|
Laravel 11 login system error: undefined method |
|php|laravel|authentication|laravel-11| |
|amazon-web-services|amazon-sqs|message-bus| |
null |
This is how WebView2 sample lets us get the user data folder:
auto environment7 = m_webViewEnvironment.try_query<ICoreWebView2Environment7>();
CHECK_FEATURE_RETURN(environment7);
wil::unique_cotaskmem_string userDataFolder;
environment7->get_UserDataFolder(&userDataFolder);
But, is it possible ... |
I am learning Spark, so as a task we had to create a wheel locally and later install it in Databricks (I am using Azure Databricks), and test it by running it from a Databrick Notebook. This program involves reading a CSV file (timezones.csv) included inside the wheel file. The file *is* inside the wheel (I checked it)... |
I am trying to have duplicate repository of my source but duplicate has certain modifications that the source repo won't have. I make these modifications using clean/smudge filters. I want my smudge filter to run once per commit, i.e. if a pull contains four commits then I want the smudge filter to run four times (per ... |
Unlike imported modules/packages `get_a` is an ordinary identifier that points to the function that you want to patch without looking it up in `mypackage.mymodule`, as this is already done during the import. So in this case you have to patch it directly via `f"{__name__}.get_a"` like in your first test. This is not a s... |
**1st solution** - automatic.
The PyCharm plugin **"PyCharm Help"** allows you to automatically download web help for offline use: when help is invoked, pages are delivered via a built-in Web server.
This solution has drawbacks - for me, it downloaded help only for one version of Python, but not for newer versions ... |
Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps |
|java|maven|variables|azure-devops|azure-pipelines| |
null |
I spent a while stuck on this question. Let me explain why an incorrect answer doesn't work, then give the solution.
I first tried to solve this problem "imperatively." I tried to sketch a solution that said, "if the first element is TRUE, use the list (and we're done), otherwise call itself with skip-the-first-elem... |
Basically I have an authentication application, where I have an authentication page where my user is sent every time the system does not recognize that he is authenticated, authentication occurs when he has a valid token registered in his localstorage with "authorization", so through "requireAuth" I created a mechanism... |
{"Voters":[{"Id":3001761,"DisplayName":"jonrsharpe"},{"Id":10867454,"DisplayName":"A Haworth"},{"Id":2802040,"DisplayName":"Paulie_D"}]} |
|html|css| |
I use storybook 7.6.7 for my project. I want to be able to use `*.module.scss` and `*.jpeg` files in my stories. however, when I import a module.scss file, I get this error.
Cannot find module './*.module.scss' or its corresponding type declarations.ts(2307)
this is just a typescript error and the styles work... |
null |
You can use a guard to prevent recursive calls
``` vb
Private m_updating As Boolean
```
Then in the TextChanged event handlers check, set and reset the guard. Here
`HEX_TextChanged` as an example
``` vb
Private Sub HEX_TextChanged(sender As Object, e As EventArgs) Handles HEX.TextChanged
If Not m_updati... |
I have a ViewPager 2 inside a plannerFragment, which calls 2 fragments: one (localeChoosingFragment) contains a recyclerview for the user to choose a locale, and another to choose places within that locale (localeExploringFragment). A ViewModel (japanGuideViewModel) stores the data (as MutableLiveData), including the i... |
When doing data wrangling, How to deal with missing values of categorical columns.
I am a newbie in python and want to learn more and more. I want to clean and tidy up the 'deck' column in "Titanic" dataset, which contain a lot of NaN values. |
dealing with missing values of categorical columns in Python |
|python|statistics|data-science|data-wrangling| |
null |
|docker|dockerfile| |
I'm trying to downgrade libffi=3.3 because I have read that the current version may be the reason for a bug im encountering.
conda install libffi==3.3 -n mismatch
Channels:
- defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: \ warning li... |
Unknown dependency "pin-1" prevents conda installation |
|python|anaconda|libffi| |
A quick aside, we can cast to-and-fro from one table type to another, with restrictions:
/** create a TYPE by using a temp table**/
CREATE TABLE tyNewNames AS SELECT 0 a, 0 b , 0 c ;
SELECT
/** note: order, type & # of columns must match exactly**/
ROW((rec).*)::tyNewNames AS "re... |
|javascript|reactjs|json|remix.run| |
I'm deleting your post because this seems like a question, rather than a conversation starter. However, this question is not on topic for Stack Overflow, but it may be on topic on some other site in the network https://stackexchange.com/sites
Please read the site's help center before posting to find whether your quest... |
null |
You could try using the following formulas, this assumes there is no `Excel Constraints` as per the tags posted:
[![enter image description here][1]][1]
----------
=TEXT(MAX(--TEXTAFTER(B$2:B$7,"VUAM")*($A2=A$2:A$7)),"V\U\A\M\00000")
----------
Or, using the following:
=TEXT(MAX((--RIGHT(B$2:B... |
In my Android app, I want to create files preserved in case of app uninstallation.
I can create hidden file in
```
File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), ".SecretFolder")
```
My goal is to change read and write permission for this file.
I tried to uninstall my a... |
You can use PyInstaller. It generates a build dist so you can execute it as a single "binary" file.
http://pythonhosted.org/PyInstaller/#using-pyinstaller
Python 3 has the native option of create a build dist also:
https://docs.python.org/3.10/library/distutils.html |
Will the following work? And if so, will it provide a significant performance improvement.
My AppUser object includes:
public class AppUser
{
public int Id { get; private set; }
// lots of other properties
public List<Tag>? Tags { get; set; }
}
The total number of tags is prese... |
Can I share a List<T> property across multiple queries via a tracking DbContext? |
Thanks to hints in the comments, I came up with this solution:
``` rust
trait ReadAndSeek: Read+Seek {}
impl <R: Read+Seek> ReadAndSeek for R {}
fn open_file<P: AsRef<Path> + Debug>(path: P) -> Result<Reader<Box<dyn ReadAndSeek>>>
{
if path.as_ref().extension().unwrap_or_default() == "gz"
{
... |
{"Voters":[{"Id":724039,"DisplayName":"Luuk"},{"Id":1191247,"DisplayName":"user1191247"},{"Id":10138734,"DisplayName":"Akina"}],"SiteSpecificCloseReasonIds":[11]} |
storybook 7 does not recognize module declarations |
|typescript|webpack|storybook|tsconfig| |
I am trying to write a little program, which is resistant against buffer overflow and similar vulnerabilities.
Since we cannot trust the user input, I thought it would be a good idea to concatenate all the strings that are inputted into one string and then pass it to a static path, which is a bash script in the same... |
User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script |
|arrays|c|string|strcpy|strlen| |
I'm attempting to implement the case change feature available in Microsoft Word with Shift + F3 into a TinyMCE React editor. The problem I'm running into is the last part where it should keep the same text selected/highlighted. The below works fine, as long as I haven't highlighted the last word of a node. If I have se... |
How to re-select the same text after modifying it in TinyMCE React |
|tinymce|selection|tinymce-react| |
Here the base class creates the `node` object that it later returns:
node = new BSTree(value);
This object is *always* of the type `BSTree`, so can never be downcast to an inherited type.
If you want to make this variable, you could consider making use of the [Factory Method pattern][1]. Something like thi... |
I'm trying to populate a 2D array of objects and get a result like this example:
```
Guid guid = Guid.NewGuid();
var data = new[] {
new object[] { 22, "cust1_fname","cust1_lname",guid },
new object[] { 23, "cust2_fname","cust2_lname",guid },
... |
When openning a folder using remote ssh in Visual Studio code with Python extension of Microsoft, the "discovering python interpreters" goes on forever. On the remote (ubuntu), it can be observed that vscode-server is taking 100% of the CPU. Also, the Python extension functionality is not available.
This is the prob... |
Visual Studio Code keeps discovering python interpreters forever and vscode-server on remote is busy 100% |
|visual-studio-code|vscode-extensions| |
{"Voters":[{"Id":341994,"DisplayName":"matt"},{"Id":7325599,"DisplayName":"Fedor"},{"Id":11841571,"DisplayName":"Lamanus"}],"SiteSpecificCloseReasonIds":[18]} |
i am trying to incorporate a 3D model in my project, but for some reason, the canvas renders two 3D models instead of one. If someone could point me in the right direction, fairly beginner in three.js, I have tried removing the scene, altering canvas, camera details. but doesn't seem to work.
as you can see in the i... |
Change file permsission on Android app programmatically |
|android|file-permissions| |
null |
`=VLOOKUP(A1:A6,SORT(A1:B6,2,-1),2,0)`
Or if already sorted as in example:
`=XLOOKUP(A1:A6,A1:A6,B1:B6,,,-1)` |
```
#first block: calculating last purchase date
from datetime import timedelta
last_purchase_date = (sales_data['TRANSAC_DATE'].max()) + timedelta(days=1)
print("Last purchase Date: ", sales_data['TRANSAC_DATE'].max())
print("Recency/Last purchase Date: ", last_purchase_date)
#Second block: calculati... |
How can i add/substract integers and integer-arrays with Timestamp |
Use this code instead of your code:
```js
import type { LinksFunction } from "@remix-run/node";
import stylesheet from "~/styles/tailwind.css?url";
export const links: LinksFunction = () => [
{ rel: "stylesheet", href: stylesheet },
];
``` |
We used to not be able to access all properties at once from a union in TypeScript? |
I would like to convert a `flax.linen.Module`, taken from [here](https://colab.research.google.com/drive/1SeXMpILhkJPjXUaesvzEhc3Ke6Zl_zxJ?usp=sharing) and replicated below this post, to a `torch.nn.Module`.
However, I find it extremely hard to figure out how I need to replace
1. The `flax.linen.Dense` calls;
... |
How can I convert a flax.linen.Module to a torch.nn.Module? |
|python|machine-learning|pytorch|neural-network|flax| |
My aim is to make an interactive bar chart. The reader sees summary statistics of a variable, and can then choose to see the distribution of that variable conditioned on other variables. For example, they see the average total_bill for restaurant guests at lunch and dinner time. They can then choose to see how that var... |
How to populate two dimensional array |
|c#|arrays|multidimensional-array| |
null |
Foreign keys of the join table are linked incorrectly - `TagId` to `Articles.ArticleId` and `ArticleId` to `Tags.TagId`. It can also be seen in the error message or the generated migration. And of course in the model in case you look carefully - one reason I don't like `ForeignKey` attribute is its multipurpose and dif... |
Recently I met an issue with CUDA programming.
I have an array *a, and I want to do the inter-element subtraction, like a[0]-a[2], a[1]-a[3], ..., and so on. Later, I need to multiply these results, or in other words, like this: (a[0]-a[2])*(a[1]-a[3]), (a[4]-a[6])*(a[5]-a[7]),... and so on. All above instructions s... |
Subtraction and multiplication of an array with compute-bound in CUDA C program |
|c|cuda| |
null |
I'm fairly new to .NET Core and I'm working on a miniproject, an apartment booking website.
I've already made my data models and data tables for the site. When I scaffold a new Controller with Razor Views, the create form just does'nt work when there is a foreign key in the table. The basic create for simple tables wo... |
coded one, but renderer renders two 3D models in three.js |
|javascript|next.js|three.js|3d| |
I would personally add `://` after `http` and also add an optional `s`
for the SSL URLs. This way, you won't match "*httpd is Apache daemon*"
and only match URLs.
Instead of using `.*?`, you can match any char which isn't a comma, but
normally, they are allowed in URLs, at specific places (typically not in
the d... |
For elevation you'd need some data source / provider. `elevatr` package potentially can provide you values for point locations, for example through *Amazon Web Service Terrain Tiles*, but you'd probably need to evaluate those results and work out acceptable resolution / zoom levels.
Here I'm assuming that "relative... |
Trying to add an AD user account to a AD group using python with ldap3 using the following script:
```
# Import necessary modules and libraries
import requests
from flask import json
from ldap3 import Server, Connection, ALL_ATTRIBUTES, SUBTREE, NTLM
from ldap3.extend.microsoft.addMembersToGroups import ad_ad... |
> Or some kind of **direct indexing** and have a map with possibly **many empty entries** in it?
After researching the topic - this seems to have been the case before the new **Virtual Stub Dispatch** mechanism was introduced ([BookOftheRuntime link][1])
One of the reasons mentioned -> [Working Set Reduction][2]
... |
Set `allowUnreachableCode: true` in `tsconfig.json`. |
I need to replace .env variables in the Azure DevOps release pipeline. I have used 'Replace tokens' task for the same. I have verified that the task is able to replace my variables from the variable group, but still, the application is not able to read the deployed variables.
Adding screenshots below for more understa... |
Hi im kinda new in php may i ask why i didnt show any records from my database
i hope someone can help me how to show the records of my database in html page
i double check everything cant still find the error
how can i fix this?
heres my source code of my work
```
<table class="table">
... |
Records not showing php |
|php|mysqli| |
null |
I figured it out by messing around settings.
1. Open Edge file location.
2. Open properties -> compatibility. Click change settings for all users
3. Check 'Run this program as an Administrator'.
4. Apply. Ok
Now, if we open Edge it opens with Elevated Status 'Yes'.
If its still opening with Status 'N... |
I'm interested in integrating phone call communication between my app users. I'm trying to gather information on implementation solutions and guidelines.
From what I've gathered there is an option to use in-app call services where the application would handle the communication using VOIP while potentially masking t... |
Pyhton ldap3 NTLM unable to return json.loads data |
|python|ntlm|ldap3| |
null |
{"Voters":[{"Id":721855,"DisplayName":"aled"},{"Id":230513,"DisplayName":"trashgod"},{"Id":10871900,"DisplayName":"dan1st might be happy again"}],"SiteSpecificCloseReasonIds":[13]} |
I am trying to add overlay text to images using the GD library in php, while it works perfectly for characters in english, I am having rendering issues when the text is in hindi, while the font used supports hindi font. The text is read correctly from the database but upon transoformation and rendering on the image usi... |