input_text_instruct stringlengths 288 45.8k | output_text stringlengths 37 33.2k |
|---|---|
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Refactoring an algorithm to avoid inefficient slicing of a large Numpy array<p>I have a working algorithm to analyse experimental datasets. This algorithm is... | <p>An easy optimization is to swap the last two axes, which shouldn't change the speed of function 1 (assuming the out-of-order memory accesses from the transpose are negligible compared to disk access) but should make function 2 run faster, for the same reasons discussed in the question you linked:</p>
<pre class="lan... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NodeJs Prisma double include property<p>I have 3 model schemas in my project:</p>
<ol>
<li><p>Vendors: id + name</p>
</li>
<li><p>Items: id + name + vendorId... | <p>You can get the <code>vendors</code> along with <code>items</code> while fetching category through this query.</p>
<pre class="lang-js prettyprint-override"><code> let items = await prisma.category.findMany({
include: {
item: {
include: {
vendor: true,
},
},
},
});
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Intermodal routing for trucks and traffic<p>Does intermodal routing work for Trucks? The "mode" parameter used in intermodal routing is different for the "mo... | <p>The Intermodal Routing API currently does not work with trucks. It has different parameters because it is an extension of the Public Transit API.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Thymeleaf - Click able URL (Web link) in Table<p>(I have looked on google, here.. and havent been able to find the answer that could help me).</p>
<p>Goal :... | <p>You can use any type of tag with Thymeleaf. Is this what you want?</p>
<pre><code><td>
<a th:href="${sps.website}" th:text="${sps.website}" target="_blank" />
</td>
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
c++, pointer to function + function templates<p>There is a slightly "complicated" code, where the class A stores a pointer to the function (initialized as F1... | <p>Change to:</p>
<pre><code>template <typename T>
T F1(const T a, const T b) { return F2(F3<T>, a, b);}
^^^^^
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Inserting data into SQL Server database with potentially duplicate data<p>I have two databases on different servers, which have tables called <code>dbo.A</co... | <p>Add the server as your linked server and use the following statement. </p>
<p>To add rows in TableA from say Serve B's Table A. </p>
<pre><code>INSERT INTO dbo.A (Col1 , Col2 , Col3 , ....)
SELECT Col1 , Col2 , Col3 , ....
FROM [LinkedServerB].[DBName].[dbo].[A] A
WHERE NOT EXISTS ( SELECT 1 FROM dbo.A
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python convert single json column to multiple columns<p>I have a data frame with one json column and I want to split them into multiple columns.</p>
<p>Here ... | <p>One way using <code>pandas.DataFrame.explode</code>:</p>
<pre><code>new_df = df.explode("check", ignore_index=True).T
print(new_df)
</code></pre>
<p>Output:</p>
<pre><code> 0 1 2 \
check [9.14, -79.76] [36.96, -76.42] 2021-01-05 06:45:00
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get response time from command PING without unit ms?<p>I wanted to know if it's possible to get the ping in a variable without "ms" at the end and be ... | <p>Add <code>ms</code> to your delims, <code>FOR /F "tokens=4 delims==ms" ...</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Inheriting from std::true_type vs static constexpr const bool member<p>I know this is not a very pointed question. Is there an advantage (compile time, depe... | <p>Inheriting from <code>true_type</code>/<code>false_type</code> will already provide you with corresponding <code>value</code> member, function call operator and implicit conversion to bool. In addition, if you will use inheritance, your type would be eligible for tag dispatch, which is often clearer and easier than ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do i access d3 element dom data?<p>I have a page that has these elements:</p>
<pre><code><svg version="1.1" class="chart avg@i" data-href='[{"name":... | <p>As per my understanding, you want to collect data-href attribute from each SVG and create charts inside that SVG using the same data. </p>
<p>Hope this code snippet helps.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="sni... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Too many queries in production environment<p>In dev environment there are 16 database queries (using doctrine 2.6 & only dql queries in my repositories).... | <p>Solved it – the root cause was apcu. When I switched from:</p>
<pre><code>doctrine:
orm:
metadata_cache_driver: apcu
query_cache_driver: apcu
result_cache_driver: apcu
</code></pre>
<p>to </p>
<pre><code>doctrine:
orm:
metadata_cache_driver: apc
query_cache_driver... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to display loaded posts with React and Redux<p>I'm new to React and Redux, and im trying to load posts from the WordPress REST API, and display them in m... | <p>I have no idea about the structure of your Post object. But it should be something like this.</p>
<pre><code>renderPosts() {
return _.map(this.props.posts, post => {
return (
<li className="list-group-item" key={post.id}>
{post.title}
</li>
);
});
}
</code></pre>
<p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel query building<p>I have this query with left join which is return data in phpmyadmin</p>
<pre><code>SELECT * FROM `items`
LEFT JOIN countries ON ite... | <p>The problem is you are trying to access to a object variable on a collection, in case you want only to get one register you can swap <code>get()</code> for <code>first()</code>:</p>
<pre><code> $defaultCountry = DB::table('items')
->leftJoin('countries', 'countries.id', '=', 'items.country_id')... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I parse an ISO date string in d3.js v4?<p>Given a string <code>"2001-01-30"</code>, how can I parse it and obtain a JavaScript Date object, ideally us... | <p>To parse an <a href="https://en.wikipedia.org/wiki/ISO_8601" rel="nofollow noreferrer">ISO-8601</a>-formatted date string, use the d3.js v4 method <a href="https://github.com/d3/d3-time-format/blob/master/README.md#isoParse" rel="nofollow noreferrer"><code>d3.isoParse</code></a>.</p>
<p>For example, in my location ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to read environment variables in env section of github action workflow<p>I'm trying to set a env variable based on another env variable in a github workf... | <blockquote>
<p>Is this doable?</p>
</blockquote>
<p>It does not seem like a supported behaviour at the moment.</p>
<p>The docs on <a href="https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#env" rel="nofollow noreferrer"><code>env</code></a> mentions that</p>
<blockquote>
<p>variable... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to manage connections with Sidekiq?<p>Each worker should have it's own resource connection. I read the docs, but it wasn't clear if each thread runs a se... | <p>Sidekiq basically does this when executing each job: <code>HardWorker.new.perform</code>. So, yes.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
authentication class wont let me save in the user model<p>I am trying to save ( $user->save();) the access token to my user table for later use.
but for som... | <p>Tipically when a model is not saved in DB this is related to validation problem .. </p>
<p>You can try using for debugging</p>
<pre><code> $user->save(false); //this disable the validation rules for user
</code></pre>
<p>Then is the user i saved in db you should looking for the validation rule that fail ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way for typescript to infer types that depend on the input parameters?<p>The below describes what I'd like to do:</p>
<pre><code>interface Custome... | <p>you can slightly rewrite your function to use a generic:</p>
<pre class="lang-js prettyprint-override"><code>export function getValue<T extends keyof Customer>(key: T): Customer[T] {
const customer = getCustomer();
return customer[key];
};
</code></pre>
<p>what this is essentially saying is that <code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Support Emoji icons in TFS / Azure devops<p>Well, recently i stared working with TFS after many years using bitbucket. I find it hard to comment on code with... | <p>Starting from TFS 2015 it can support emoji's,You can insert an emoji in <strong>pull request comments and wiki pages</strong></p>
<p><a href="https://docs.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops&viewFallbackFrom=vsts#emoji" rel="nofollow noreferrer">As per this</a></p>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create/write to a output channel only once?<p>I'm trying to learn how to create a vscode extension</p>
<p>theres a function that im printing some text... | <p>Like with any other part you want to share in a JS/TS project, you have to export it. In my extension.ts I created the output channel in the <code>activate</code> function and provide an exported print function to access it:</p>
<pre class="lang-js prettyprint-override"><code>let outputChannel: OutputChannel;
expor... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I set a flash variable in Next.js before a redirect?<p>Laravel in PHP made this easy with <a href="https://laravel.com/docs/9.x/session#flash-data" r... | <p>Your first code is working fine for me (printing the headers in terminal). However, the combination will not work as intended because the headers you set in <code>/foo</code> (say) will be sent to browser, along with a status code of 307, and a location header of <code>/</code>. Now "the browser" will be r... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get color from array returned by canvas.getImageData() method<p>I have a canvas and want to dynamically get the color of a pixel. Im using <a href="https://d... | <p>To get a pixel</p>
<pre><code>var x = 100;
var y = 100;
var imageData = context.getImageData(0, 0, 200, 200);
var index = (x + y * imageData.width) * 4;
var r = imageData.data[index];
var g = imageData.data[index + 1];
var b = imageData.data[index + 2];
var a = imageData.data[index + 3];
</code></pre>
<p>There are... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I set "organize imports" to put each import on a new line<p>Instead of having imports from the same package on the same line I would like each import... | <p>Behind the scenes, Organize Imports for python uses <code>isort</code>. By looking at <a href="https://pycqa.github.io/isort/docs/configuration/multi_line_output_modes.html" rel="nofollow noreferrer">isort's command line arguments,</a> we see that you can achieve this functionality by adding the following arguments:... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Only trigger function on the selected card where cards are displayed using v-for<p>Still trying out Vue with vue material; I used v-for to display the array ... | <p>Replace boolean for <code>showInfo</code> with <code>fruit.id</code> or index:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>Vue.use(VueMaterial.default)
new Vue({
el: '... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extract glmnet's lambda matrix<p>I would like to extract the lambda-matrix of a ridge regression. I can plot it, but I cannot extract the values. The wanted ... | <p>Do you mean the coefficient matrix?</p>
<pre><code>coef(my.ridge)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Detect if a forloop has zero loops<p>I'm trying to handle a case where a <code>forloop</code> with a <code>where</code> clause results in zero loops.</p>
<p>... | <p>Found the answer in the stencil documentation of all places - who knew!</p>
<p>The for tag can take an optional {% empty %} block that will be displayed if the given list is empty or could not be found.</p>
<pre><code>{% for user in users %}
<li>{{ user }}</li>
{% empty %}
<li>There are no ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When an object observed by a satellite will be obscured by the moon/sun<p>I have the satellite longitude, latitude and altitude. Then I have the Ra&Decl ... | <p>You will probably want to create a fixed object to represent the position of the distant object, and then ask for the separation between its position when viewed from the satellite and the position of the sun:</p>
<pre><code>f = ephem.FixedBody()
f._ra = '1:23:45.0'
f._dec = '6:78:90.0'
f.compute(scraft.date)
print... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Problem binding DateOnly in ASP.NET Core 6 MVC<p>I was trying to use the new <code>DateOnly</code> type in .NET 6, but I had trouble with the model binding. ... | <p>Full binding support for DateOnly and TimeOnly <a href="https://github.com/dotnet/aspnetcore/issues/34591" rel="nofollow noreferrer">isn't available yet</a>. Another related issue is <a href="https://github.com/dotnet/runtime/issues/59118" rel="nofollow noreferrer">this one</a>. This is planned for .NET 7</p>
<p>The... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't store float values to sql server using npm mssql with Node.js<p>I am trying to do simple UPDATE query and store a percentage value which will go in a p... | <p>This appears to be a bug in <code>node-mssql</code> that assumes that numeric values are Ints. You can specify the value as something else using the <code>.input</code> method, but then you can't use the tagged template literal.</p>
<pre><code>const updateAttendence = await pool.request()
.input('percentage', sql... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Caching data if connection is down<p>I've got a server that I'm relaying every action that I want to do with a smart contract, but let's say the server can't... | <p>Interaction with smart contract (SC) has 2 types:</p>
<ul>
<li>Call to update status (write data)</li>
<li>Call to view function (read data)</li>
</ul>
<p>In order to do the write data, we need:</p>
<ul>
<li>SC address</li>
<li>Method name</li>
<li>Data option</li>
<li>Parameters</li>
<li>Sender</li>
</ul>
<p>So we ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Issue installing QuantLib Python<p>I am trying to install QuantLib Python. So, I followed through and installed:</p>
<p>1) Anaconda3, boost_1_64_0, QuantLib... | <p>Your paths are correct, but Python is using Visual Studio 2015 (because it's what it was compiled with) and the library you have was produced with Visual Studio 2017. If you use the 2015 version throughout, it should work.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Concatenate to a list of string another string<p>The below code gives back a list of String but I want it work on multiple cases. The problem is that I can't... | <p>This</p>
<pre><code>replaceTab' :: Int -> [[Char]] -> [Char]
</code></pre>
<p>is the same as,</p>
<pre><code>replaceTab' :: Int -> [String] -> String
</code></pre>
<p>What you should focus on is implementing a function, </p>
<pre><code>replaceTab :: Int -> String -> String
</code></pre>
<p>wh... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I change from the Checkbutton on tkinter<p>So I'm very new to Tkinter and don't really know how to use it.
I looked up some similar code and found a s... | <p>It's simple, just remove this checkbox and everything associated with it, like checks about this checkbox etc.</p>
<p>For starter, adjust tabulation after removing these lines:</p>
<pre><code>if (japp.get()):
...
japp = IntVar()
Checkbutton(hej, text="Kostnad per styck", variable=japp).place(x=10, y=50)
</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Data transformation for KendoUI grid<p>I have a JSON data structure that I need to display in Kendo UI grid. The data is something like this</p>
<pre><code>... | <p>The Kendo UI DataSource <strong>schema</strong> has a <code>parse</code> configuration option, which allows you to tweak the data response before the DataSource instance handles it. </p>
<p><a href="http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.parse" rel="nofollow noreferrer"... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Populating initial roles in a production database<p>When deploying an app to production for the first time (for example using Asp.Net Identity for user manag... | <p>The pattern will depend on your use case, and how you expect the app to be deployed. You need to consider the risk profile of the setup environment.</p>
<p>In general, hard coded values are a bad idea, particularly for anything network facing. There are also some issues with automatic "no users" detectio... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deleting node in list<pre><code>*x = L->list[i]; /* Save the deleted element to parameter x */
for(j = i+1; j <= L->size-1; j++)
L->list[i] ... | <p>Within this for loop</p>
<pre><code>for(j = i+1; j <= L->size-1; j++)
L->list[i] = L->list[i+1];
</code></pre>
<p>the variable <code>i</code> used in this statement</p>
<pre><code>L->list[i] = L->list[i+1];
</code></pre>
<p>is not being changed.</p>
<p>It seems you mean</p>
<pre><code>for(j = i+1; ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android 4.3 isProviderEnabled wrong result in Genymotion<p>Genymotion always said that "GPS open".(Version : 4.3).But GPS is inactive.</p>
<p>But my phones ... | <p>You can choose the GPS position of a Genymotion emulator thanks to the GPS widget on the right side of the screen.</p>
<p>Genymotion does not plug the GPS position to your computer's position.</p>
<blockquote>
<p>Pro tip: GPS,bluetooth function is not work good with emulator,just check with real devce, If real d... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Refresh table using ajax<p>I store some user's data in cookies and then I append all data to the table:</p>
<pre><code>$.ajax({
url: "http://127.0.0.1:8... | <p>Nope, it won't refresh everytime you change data in cookies. That's because you only append the first data you received and you saved in cookies.</p>
<p>If you want to refresh your table everytime you change data in cookies you will need to create a listener that tells you that the data has changed.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating column headers and cell borders for Zebble Grid<p>How can I add column and row <strong>borders</strong> and <strong>headers</strong> for each column... | <p>Zebble Grid is not a data grid. It's essentially a List where more than one item can be rendered in each row. But the nature of the cells in each row are the same, as opposed to representing different columns of data.</p>
<p>But in general in mobile UX best practices it's advised to avoid column headers when showin... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
DataTables - non-english letters sorting in 1.10<p>How can I fix the sorting in DataTables 1.10 for non-US letters like <code>š,č,ť</code>?</p>
<p>For examp... | <p>It would really help with a test case, an example of odd values, some info about your locale and language and so on. However, I think you can solve this simply by using <code>localeCompare()</code> in a custom sorting plugin, specifying your locale and very important : Setting <code>sensitivity</code> level to <code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Gem methods not available inside Grape Api<p>I'm currently building my first API with Grape and the Rails 5 api mode and it's going fairly well until now. I ... | <p>It seems that impressionist does not support Grape:</p>
<p>You can use it manually:</p>
<pre><code> imp = Impression.new
imp.impressionable_type = object.class.to_s
imp.impressionable_id = object.id
imp.user_id = current_user.nil? ? 0 : current_user.id
imp.controller_name = "topics"
imp.action_name = "s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to test specific hSpec property using `--match` and cabal<p>I have a bunch of test modules and I can run a specific one using cabal test.</p>
<pre><code>... | <p>Run it like this:</p>
<pre><code>cabal test —test-options=—match=/Module.Name.Here/hspecDescribeString/hspecPropName/
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python RegExp, get group without certan word<p>I have text like:</p>
<pre><code>qwerqwer asdf foo bar
%abc anchor
one
%abc anchor
one thow foo bar
%abc an... | <pre><code>(.+?)(?: foo bar)?\n\%\w+\sanchor
</code></pre>
<p>You need to use reluctant modifier (<code>+?</code>) so it won't eat <code>foo bar</code> and also add a optional <code>foo bar</code> at the end of line</p>
<p><a href="https://regex101.com/r/fU2jA5/1" rel="nofollow">https://regex101.com/r/fU2jA5/1</a></p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Toasty does not autoclose or manual close after hook list<p>I modified the code to generate a toast stack into a ToastContainer dynamically as a notification... | <p>This doesn't close cause Tosty hook to show property that is not present in the hook. To solve it, you can define the show property and create a function to hide it. When all ntfys are closed, the list is cleaned.</p>
<pre><code>const Tsty = (props) =>
<>
<Toast show={ props.show } onClose={ () ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how do i store maven dependencies inside docker image using a Dockerfile<p>so im making a spring boot application that im supposed to put in and run from a d... | <p>If I understood you correctly, you would like to have the Maven dependencies downloaded first then combine them with your app into an image?</p>
<p>If that's what you want then the proper way to do that is as follows:</p>
<ol>
<li>Pull a maven image (normally you call this stage the 'builder' - it's just a name)</li... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to style ButtonGroup with variant='text' in Material UI?<p>I am trying to change the colour of my Buttons nested inside a ButtonGroup. I want to change t... | <p>You want to do it like so:</p>
<ul>
<li><p>use <code>.MuiButtonGroup-grouped</code> to control the style the <strong><a href="https://mui.com/api/button-group/" rel="nofollow noreferrer">ButtonGroup children</a></strong>, regardless of the variant. If you'd like to be more specific, you can use a class based on the ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
onChange React Move Value into Object<p>I have the following code: </p>
<pre><code> handleTextChange = (e) => {
this.setState({
[e.target.n... | <p>You just want to set it in an object with a static name?</p>
<pre><code>this.setState(state => ({
movie: {
...state.movie,
[e.target.name]: e.target.value
}
}));
</code></pre>
<p>PS Your initial state should have <code>movie: {}</code> otherwise the spread will throw an exception.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel - How to find foreign key value<p>first time working with Laravel and PHP. I am trying to insert row in the table <strong>profile</strong> where the ... | <p>Welcome to Laravel :)</p>
<p>On your profile Model on the user method you need to define the foreign key.</p>
<p><code>public function user(){
return $this->belongsTo(user::class, 'uID');
}</code></p>
<p>If you don't provide the foreign key, it will look for <code>user_id</code> field.
<a href="https://... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Publish an Azure DevOps extension from command line fails with 401<p>I develop an Azure DevOps extension. Now I want to automate the publishing process. Here... | <p>Ensure your PAT have Account: 'All accessible organizations'. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
cannot bind to imported function. Error is undefined<p>I'm currently having a problem importing a module and using it in react. This has been asked and I've... | <p>You have to omit the (this) at the right side of the assignment</p>
<pre><code>this.pullProductDetails = pullProductDetails.bind(this);
</code></pre>
<p>Because the function you are binding is not a function of the current component. Also the definition of the pullProductDetails should not be an arrow function, as... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ArgumentMatchers.any() versus the other matchers in Mockito 2<p>With Mockito 2, should <code>ArgumentMarchers.any()</code> be used instead of more specific m... | <p>In short, you could use either one in most cases (especially in Java 8 or newer). <code>any()</code> is often more idiomatic to non-brittle Mockito tests, though there are some pragmatic reasons and some correctness reasons to use <code>anyString</code> or <code>any(String.class)</code>. Beware: the full rationale d... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Querying duplicate rows within Oracle Database<p>I have a table that looks like this.</p>
<pre><code>| File_ID | MD5 Sum | File Size |
| --------- | ... | <p>You can produce a row number using the MD5 and then any duplicate will show up with row number above 1.</p>
<p>For example:</p>
<pre><code>select sum(file_size)
from (
select t.*, row_number() over(partition by md5_sum order by file_id) as rn
from t
) x
where rn > 1
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to embed a file excerpt in Jupyter<p>I would like to disclose a part of my code inside a Markdown cell in Jupyter. The code is located in an external fil... | <p>It is possible with the built-in jupyter command <a href="https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-load" rel="nofollow noreferrer"><code>%load</code></a>.</p>
<pre><code>%load -r 240-255 path/to/file.py
</code></pre>
<p>The cell must be in code mode to execute this command. The only p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to structure recursive descent functions in terms of code sharing?<p>I have a grammar that contains:</p>
<pre><code>constant ::= integer-literal
| char-... | <p>What I might do is to have the code for <code>pattern</code> call <code>parseConstant</code>. Then look at the next token. If it's <code>..</code>, then if the constant is a character constant you can parse the rest of the character range. If the constant is not a character constant you have a syntax error. If the n... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
div table row 2 cannot align when dynamic error message shown<p>Having a div table using Contact Form 7, the alignment is correctly. However, when there is a... | <p>Try </p>
<blockquote>
<p>display: flex</p>
</blockquote>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>.form-row {
display: flex;
flex-direction: row;
}
.column-4 {
width: 20%;
dis... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I use custom ngTemplate<p>I want to create small component with one custom / optional template - it would be nice if I can made it similar to Kendo</... | <p>you can use <code>@ContentChild()</code> to get your component body content,try this </p>
<pre><code>import { ContentChild } from '@angular/core';
@Component({...})
export class YourComponent {
@ContentChild(TemplateRef) contentChild: TemplateRef<any>;
</code></pre>
<p>and in your template you can check <c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select tag is inserting duplicate rows in sql<p>If click function is clicked for first time there are no duplicate rows</p>
<p>When it is clicked for second... | <p>you should unbind any existing event first</p>
<pre><code>$("#btn").off().click(function(){
// ...
})
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React-navigation How to put StackNavigator in TabRouter screen<p>I'm having some issue with <code>react-navigation</code>. I want to have a custom Tab Bar in... | <p>Fortunately, it's very easy.</p>
<p>What <code>StackNavigator</code> (or any other navigator) returns is React component. That means you can use it as <code>screen</code> component for any other route.</p>
<p>Thus, one of your routes <code>screen</code> will be <code>StackNavigator</code>.</p>
<p>Sample code</p>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
LoadError: cannot load such file -- bcrypt<p>I am trying to use bcrypt to secure users password, but when i am creating new user in database i receive this e... | <p>I solved the problem. i was searching for it almost 2 days!</p>
<p>kill all the processes with name spring using the pkill command as follows:</p>
<pre><code> $ pkill -15 -f spring
</code></pre>
<p>open a new terminal and :
bundle exec guard
is it gave you error "bundler: command not found: guard" dont wo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove Duplicates on mongodb<p>I would like to remove duplicates on robomongo, my version 3.0.12 so I cant use DropDups, </p>
<pre><code>{
"_id" : Objec... | <p>if you are prepared to simply discard all other duplicates then you basically want to <a href="https://docs.mongodb.com/v3.0/reference/method/db.collection.aggregate/" rel="nofollow noreferrer"><code>.aggregate()</code></a> in order to collect the documents with the same <code>RegisterNumber</code> value and remove ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I get data from another column and row if certain criteria are met?<p>I have three columns Name, ClientId and GroupID</p>
<pre><code>╔══════╦═════════... | <pre class="lang-sql prettyprint-override"><code>SELECT t1.Name ,
t1.ClientId,
t1.GroupId,
CASE WHEN t1.ClientId = t1.GroupId -- if ClientId and GroupId are the same
THEN t1.Name -- it displays Name as normal
WHEN t1.GroupId = 0 -- if GroupId = ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Optional hash option in Ruby class<p>I'm trying to configure a driver with Capybara where an options hash is only used via an environment variable.</p>
<pre... | <p>You can set any of the <code>Capabilities</code> keys via <code>#[]=</code>, with the key in snake case so</p>
<pre><code>...
caps = Selenium::WebDriver::Remote::Capabilities.new(accept_insecure_certs: true, proxy: proxy)
caps['browser_name'] = 'chrome' if ENV['extra_args']
...
</code></pre>
<p>would work but the... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Erase / Filter rows with info from the ones in blank<p>I have this data in a Google Sheet, basically is a dynamic table that will have more information or co... | <p>try for horizontal erase:</p>
<pre><code>=FILTER(A:D; TRIM(FLATTEN(QUERY(TRANSPOSE(A:D);;9^9)))<>"")
</code></pre>
<p>or vertical erase:</p>
<pre><code>=FILTER(A:D; TRIM(QUERY(A:D;;9^9))<>"")
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I make a menu scroll with the page only within a section?<p>I'm trying to create a page where there is a side menu that scrolls only within a certain ... | <p>Simply use the <code>position:sticky</code> with z-index property. And also use the fixed menu within empty parent div <code>sampleDiv</code>. I hope this solution will be helpful for you.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Looping through column in dataframe and concatenating string based on specific condition in R<p>The following <code>df</code> represents treatments that a si... | <p>Here's one way -</p>
<pre><code>library(dplyr)
library(purrr)
classA <- c("drug-v", "drug-x", "drug-z")
original %>%
mutate(prior_classA_details = lag(map_chr(row_number(), ~{
toString(keep(treatment_administered[seq_len(.x)], function(y) y %in% classA))
}), default = '... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
External custom fact not working on Puppet<p>I'm running Facter 3.6 and trying to add a custom fact. According to the <a href="https://docs.puppet.com/facter... | <p><code>/etc/puppetlabs/facter/fact.d/</code> is the location for custom facts on the client nodes. If you want a custom fact to appear on only that client, then you can add the custom fact to that location. Pluginsync will also transfer your custom facts for the current catalog to that location automatically.</p>
<p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
EXCEL: When dragging cells to the right I need to use information stored in columns not rows (Not sure how to ask this properly)<p>It's probably a simple pro... | <p>You can use the <code>indirect()</code> method to reference a cell by it's "String identifier", i.e. <code>"A3"</code>. When filling out to the right, use <code>CONCATENATE()</code> and <code>COLUMN()</code> to create your String identifiers <code>{A1,A2,A3,A4,A5...}</code> as required: </p>
<pre><code>=2+INDIRECT(... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The procedure entry point GOMP_parallel could not be located in the dll<p>I have a QT application that uses OpenMP. (mingw, win8)
I want to use the .exe file... | <p>Okay, the problem is solved.</p>
<p>I copied dlls from: </p>
<p><code>\Qt\Qt5.5.1\5.5\mingw492_32\bin\</code> </p>
<p>instead of: </p>
<p><code>\Qt\Qt5.5.1\Tools\mingw492_32\bin\</code> </p>
<p>Maybe somebody will find it helpful.</p>
<p>And yeah, Dependency walker wouldn't help in the situation like this. Tha... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spyder IDE: Need to press 'run script' twice to successfully execute Python script<p>I'm currently working on an image processing script in Python (Spyder ID... | <p>I think your issue is related to <a href="https://github.com/spyder-ide/spyder/issues/1831" rel="nofollow">this</a> its a bug in <code>spyder</code>.It provides a partial solution so far is to use a different Matplotlib backend. You can change it in:</p>
<pre><code>Preferences > Console > External modules >... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Running webpack within project<p>Do I have to install webpack globally for me to issue webpack commands?</p>
<p>I installed webpack inside my project folder... | <p>Add the command as a npm script. In your package.json.</p>
<pre><code>{
"name": "app",
"version": "0.0.1",
"scripts": {
"compile": "webpack --config webpack.config.js"
}
}
</code></pre>
<p>Then run </p>
<pre><code>npm run compile
</code></pre>
<p>npm scripts looks for executable created in ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AssertCalled always fails with testify library<p>I am using testify to test my code and I want to check if a function was called.</p>
<p>I am doing the foll... | <p>I tried with this and works:</p>
<pre><code>type Foo struct {
mock.Mock ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AuthenticateAsServerAsync hangs<p>I'm using </p>
<pre><code>await stream.AuthenticateAsServerAsync(serverCert, true, SslProtocols.Tls, false);
</code></pre>... | <h2>Reason</h2>
<p>Seems like the async versions of all network related stuff does not support timeouts.
Thats why AuthenticateAsServerAsync does not support timeouts either.</p>
<p>From the documentation:</p>
<blockquote>
<p>Note</p>
<p>This property affects only synchronous reads performed by calling the Re... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Matplotlib: Where is the first axes object located?<p>Usually when I make a single plot, I just call <code>fig,ax = plt.subplots()</code> without specificati... | <p>I would create the two axes at the same time, as in the following. Note: <code>gridspec_kw={'width_ratios': [4, 1]}</code> allows you to specify how much larger is the first axes with respect to the second.</p>
<pre class="lang-py prettyprint-override"><code>import matplotlib.pyplot as plt
from matplotlib.widgets im... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a better way to retrieve just a model values?<p>Movie model has property <code>watched</code> with a <code>value</code> i.e <code>{watched: 12345}</... | <p>You can use below aggregation</p>
<pre><code>const watched = await Movie.aggregate([
{ "$match": { "user": mongoose.Types.ObjectId(user.id) }},
{ "$group": {
"_id": null,
"watchedIds": { "$push": "$watched" }
}}
])
console.log(watched[0].watchedIds) // [123343, 34546, 45656]
</code></pre>
<p>But I c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create layout similar to the image provided in the link in android<p>I'm new to Android development. I want to create layout similar to the image i ha... | <p>try the following the idea is to make a layout with weight sum and give each child part of the weight</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ionic Save large file @Capacitor/filesystem - Out of memory error<p>I try to store multiple files in the file storage by using the @Capacitor/filesystem Plug... | <p>I found the following package wich solved my problem:</p>
<p><a href="https://github.com/diachedelic/capacitor-blob-writer" rel="nofollow noreferrer">Capacitor-blob-writer</a></p>
<p>It splits the file into multiple parts if it's to low.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Gnuplot heatmap interpolation with svg<p>I am trying to plot a heatmap using gnuplot (5.2.8) with the SVG terminal.
Gnuplot interpolates the colors between t... | <p>It is not gnuplot that does the interpolation - it is the SVG viewing program. Leaving aside the question of how you might persuade the viewer not to do this, you can prevent it from happening by using the keyword <code>pixels</code> in the gnuplot command:</p>
<pre><code>plot percent_sample(i) matrix with image pi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Prevent rules from rerunning when intermediate file is updated<p>Let's say I have two rules in my snakemake file</p>
<ol>
<li>The first rule fetches a remote... | <p>Wrapping the input files for rules 2 and 3 in <code>ancient</code> should prevent them from reacting to file updates. Something like this:</p>
<pre class="lang-py prettyprint-override"><code>rule a:
output: 'a.txt'
shell: 'curl some_url > {output}'
rule b:
input: ancient('a.txt')
# do somethi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to retrieve in java a custom attribute of a particular view object?<p>I have this styles :</p>
<pre><code> <!-- EditText on a blue background -->... | <p>The library in charge of the dialog doesn't know either your custom attribute or your custom style as they don't belong to it.</p>
<p>The style to use should be pass as parameter when you call the library to create the dialog, so the logic to define which style to use should be handle by the code calling the librar... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JavaScript I can't send string parameter to function even I can send int parameter with div.innerHTML on click event<pre><code>script type="text/javascr... | <p>Just use a string template literal</p>
<pre><code>div.innerHTML += `
<br />
<a
href='#nav'
id='teammate'
onclick="QueryAgain('${holder}')">
${researcher_teammate[i][j]}
</a>
<br />
`;
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add values spreadsheet iterating over cells and values to append<p>I would like to add the following formulas to a spreadsheet</p>
<pre><code> sheet["... | <p>...</p>
<pre><code>avg_row_start = 3 # row start of Averaging
avg_row_end = 5 # row end of Averaging
avg_totals_row = 6 # row where the Averaging formulas reside
start_col = 4 # col of first formula 'D' = 4
end_col = 16 # col of last formula 'P' = 16
for row in ws.iter_rows(min_row=avg_totals_row, max... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Markdown - call a result from a table or a list in the text<p>Here is an example of what I'm trying to do. I would like to call in the text a result from a t... | <p>To achieve your desired result assign the result of calling <code>caret::confusionMatrix</code> to variable. Afterwards you could access the <code>Accuracy</code> in an inline chunk like so:</p>
<pre><code>---
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
libra... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change default label of each bubble in bubble chart using chartjs-plugin-datalabels<p>I am trying to add labels to each bubble in the bubble chart usi... | <p>You can use the <code>formatter</code> function in the datalabels plugin to achieve this:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>Chart.register(ChartDataLabels)
co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I need to know how i can call a variable in from a stateful widget to a stateless one<p>I need to call a variable from a stateful widget to another class but... | <p>In order to communicate between the two widgets (<strong>donateMain</strong> and <strong>ButtonsRow</strong>) you'll need a middle-man, like a state-management provided sort of service. But if you want to keep things simple, just pass it via the constructor the same way you're passing the <strong>onSetAmount</strong... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PureInput in redux form example<p>In the <a href="http://redux-form.com/5.2.5/#/examples/deep?_k=e34uy5" rel="nofollow">Deep Form example</a>, the author add... | <p>Well, as the author, I can tell you. Basically, I was struggling to improve the performance of that form, and was trying different techniques, none of them were successful because the performance problem was inherent in the design of <code>redux-form</code> <code>v5</code>, which is why <code>v6</code> got written f... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
calculate angle of rotation image wrt another image<p>I am developing an application which processes cheques for banks. But when the bank's image of a cheque... | <p>What I would do in your case is to find the check within the image using feature matching with your template check image. Then you only need to find the transformation from one to the other and deduce the angle from this. </p>
<p>Take a look at <a href="http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change watermark text to a watermark image<p>I have a <a href="https://unripened-amperes.000webhostapp.com/" rel="nofollow noreferrer">text-editor</a></p>
<... | <p>There is a much easier way to do this with stylesheets that target printing.</p>
<h1>Demo</h1>
<p><a href="https://repl.it/@AnonymousSB/SO53360134" rel="nofollow noreferrer">https://repl.it/@AnonymousSB/SO53360134</a></p>
<h1>HTML</h1>
<pre><code><!DOCTYPE html>
<html>
<head>
<meta cha... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how can i create a geometrical progress program multiple of 10<p>I want to write a program in Python 3 that includes a myprice function which returns X value... | <p>@techUser. You can write something like the following:</p>
<pre><code>def myprice(x, geometrical_factor=10):
"""
A generator of a geometrical progression. The default factor is 10.
The initial term is 'start = 1';
Parameter:
x : int
number of terms to generate
geometrical_factor: int... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas grouping with filtering on other columns<p>I have the following dataframe in Pandas:</p>
<div class="s-table-container">
<table class="s-table">
<thea... | <p>Maybe you can try something with <code>groupby</code>, <code>agg</code>, and <code>query</code> (like below):</p>
<pre><code>df.groupby('name').agg({'name':'count', 'values': 'sum'}).query('name>1')[['values']]
</code></pre>
<p>Output:</p>
<pre><code> values
name
A 30
D 250
</code><... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python 3 Selenium Autofill<p>I am trying to auto login on this site, but it doesn't autofill at all, here is my code.</p>
<p>I tried to search on Google, Yo... | <p>change:</p>
<pre><code>self.driver.get("ts2.travian.si/login.php")
</code></pre>
<p>to</p>
<pre><code>self.driver.get("http://ts2.travian.si/login.php")
</code></pre>
<p>And look for the button for the id = "s1"</p>
<pre><code>loginButtonXpath = "s1"
loginButtonElement = WebDriverWait(driver, 10).until(lambda ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find and highlight non-Latin code-page characters in a Word document<p>I have looked for this on the net but unfortunately no joy. I can find a lot of exampl... | <p>You can't use RegEx inside a Word document; RegEx can only run on a string you'd extract from the document (assign to a String variable). But location in the document and any formatting information is lost. Any search must be done using Word's built-in wildcard functionality which is similar to RegEx but not the sam... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Animation on browser scrolling<p>I have used jQuery like below lines of code </p>
<pre><code> $(window).load(function() {
$(".shuffle").each(function() {... | <pre><code>var isElementInViewport = function ($element) {
//element has to be a jQuery element with length > 0
var domElement = $element[0];
var height = $element.outerHeight();
var rect = domElement.getBoundingClientRect();
return (
rect.top >= 0 - height &&
rect.bott... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Improving the performance of cartesian product of multiple lists<p>I am implementing the Cartesian product of multiple sets in python using recursion.</p>
<p... | <p>A few comments:</p>
<ul>
<li><p>If you think about it, what <code>car_multiple_sets</code> is doing is iterating on its parameter <code>lists</code>. You're doing that using recursion, but iterating on a list can also be done with a <code>for</code>-loop. And it so happens that recursion is somewhat slow and memory-... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Display table rows with specific data providing data from javascript variable<p>Unable to provide data from javascript variable to search the given data in t... | <p>It seems you have to pass the variable outside the quotes.</p>
<pre><code>var name='Ram';
$("#datatable tbody tr").hide();
$("#datatable tr:contains('"+name+"')").show(); //Changed here.Note the quotes
});
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Enabling remote file access on windows server 2008<p>I have an application (c# wcf) running on <code>serverA</code> (windows server 2012) trying to create a ... | <p>Although the ntfs permissions were correct I had to also give the permissions on the share. After that no more permissions denied.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to call a service in view model through the interface<ul>
<li>I have defined a service <code>RestService.cs</code> and trying to call the
service from th... | <p>IntIrestService is the interface, you can't instantiate the interface.<br>
You need to instantiate the concrete class that implements the interface.</p>
<pre><code>IntIrestService intIrestService = new RestService();
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Focused TextField ends up covered by the keyboard in SwiftUI<h4>What I'm trying to accomplish</h4>
<p>A vertical list of <code>TextField</code> views that us... | <p>Chaning two+ states in one closure (when they are related somehow or affects one area) are handled not very good (or not reliable). The fix is to separate them in different handlers.</p>
<p>Tested with Xcode 13.3 / iOS 15.4</p>
<p><a href="https://i.stack.imgur.com/nlawd.gif" rel="nofollow noreferrer"><img src="http... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use repeated labels when grouping data using cut?<p>I need to create a new column to categorize my experiment. The timeseries data is divided in 10 mi... | <p>You could use <code>cut(labels = F)</code> to create numeric labels for your intervals, then use these as an index into the built-in <code>LETTERS</code> vector (or a vector of custom labels). The modulo operator and a little arithmetic will make it cycle through A, B, and C:</p>
<pre><code>library(tidyverse)
librar... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get only first first occurence (if exists) in string with RegEx<p>I have some troubles with a RegEx which don't do what I expect. Can someone tell me where I... | <p>You can use</p>
<pre class="lang-none prettyprint-override"><code>^[A-Z][a-zA-Z]*(?:\s+[a-zA-Z]+)*'s(?!\S)
^\p{Lu}\p{L}*(?:\s+\p{L}+)*'s(?!\S)
</code></pre>
<p>See the <a href="https://regex101.com/r/bRD0rq/2" rel="nofollow noreferrer">regex demo</a>. <em>Details</em>:</p>
<ul>
<li><code>^</code> - start of string</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How does Instagram name uploaded files?<p>I have recently been doing some research on Instagram and its API and have come across its strange file naming. Her... | <p>They explain it all in this blog post here:</p>
<p><a href="https://engineering.instagram.com/sharding-ids-at-instagram-1cf5a71e5a5c" rel="nofollow noreferrer">https://engineering.instagram.com/sharding-ids-at-instagram-1cf5a71e5a5c</a></p>
<p>They create unique ids following a custom numbering scheme they develop... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.