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:
StackLevelTooDeep in Rails 4.0.12 application<p>When booting Rails 4 application (migrated from Rails 3) everything works correctly - however when trying to ... | <p>Problem was one of the scopes in model - in Rails 4.0.12 if you have scope called <code>all</code> you <strong>will</strong> get <code>StackLevelTooDeep</code> exceptions when trying to access that model from controller.</p>
<p>However when updated to Rails 4.1 it gave message about wrong scope name: <code>all</cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Most frequent occurance size per user<p>Unfortunately I have another problem I´m not able to solve alone - I want to list the size the every user ordered the... | <p>Using Base R:</p>
<p>Using <code>tapply</code> to loop over the customerID groups and summarize the sizes using <code>table</code></p>
<pre><code>tmp <- with(DB, tapply(size, customerID, function(x) {
tbl <- table(x)
most <- which(tbl == max(tbl))
if (length(most) > 1) return('-') else return(nam... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
android app doesnt crash after installiation<p>So I have very weird problem with android app that I developed that I really do not understand how to address.... | <p>You have posted only your manifest and not the logs. My guesses based on that is the problem may be within your <code>package</code> declaration, rest everything seems fine.</p>
<pre><code><manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app".....
</code></pre>
<p>The package sh... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pandas calculate delta time<p>Here's some code where that will generate some random data, and chart plus lines representing 30th & 90th percentiles.</p>
... | <pre><code>minStart = df.loc[df['Random_Number'] < df.quantile(0.3)[0]].index[0]
maxStart = df.loc[df['Random_Number'] > df.quantile(0.90)[0]].index[0]
hours = maxStart - minStart
hours
</code></pre>
<p>df.quantile doesn't return a number so you need to get the first entry of it</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parsing embedded expressions in Roslyn<p>I am trying to write a parser for a QML-like markup language and I would like to allow C# expressions in the markup.... | <p>You need to call <code>CSharpSyntaxTree.ParseText()</code>, and pass a <code>CSharpParseOptions</code> with <code>SourceCodeKind.Interactive</code>, which allows top-level expressions.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Handsontable Dynamically Set Settings<p>I have a very big handsontable. I have dropdown columns defined, but, the values for the sources are retrieved with A... | <p>You can, and should, use:</p>
<pre><code>hotInstance.updateSettings({
columns: getNewColumns()
})
</code></pre>
<p>Where <code>getNewColumns()</code> would return an array of columns with the data and new source (or make the AJAX call from in here). That should do it!</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting ’Cannot find config for target=opencl -device=intel_graphics -model=unknown, workload=' error` when trying official TVM tutorial<p>I'm trying to run ... | <p>What you are seeing is not an error, but a warning. Because TVM could not find a log file which contains the optimized schedules, it will just use the default (<em>fallback</em>) schedules.</p>
<p>To get rid of the warning, you need to use AutoTVM (as in <a href="https://docs.tvm.ai/tutorials/autotvm/tune_relay_x86... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Array to Map: no suitable method found for Collectors.toMap<p>I want to convert array into Map using Java 8 streams:</p>
<pre><code>String[] arr = {"two", "... | <p>Actually the <code>1</code> is the error. The value <code>1</code> cannot serve as the <code>valueMapper</code>, whose type should be <code>Function<? super T, ? extends U></code>. </p>
<p>In your example the value mapper should be a function that accepts an element of your <code>Stream</code> (a <code>String... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why session.save(object) does not set id automatically in hibernate?<p>I am using hibernate as a JPA provider for my application and now I have a requirement... | <p>Since the id is generated by the database it will only be there after the entity is actually written. Since hibernate tries to delay the actual write so it might safe some database-hits, <code>session.save()</code> will not necessarily trigger the id-generation.</p>
<p>Try adding <code>session.flush()</code> after ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Iterate through HTML div and extract the value from a child span using JavaScript or jQuery<p>How do I find a value in a nested div in JavaScript and hide t... | <p>You can do this using jQuery as below:</p>
<pre><code>$('.state-names').each(function(i, obj) {
if($(this).text().includes("Florida")){
console.log("Found Florida")
$(this).hide()
}
});
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MyBatis, nested results for collection is empty<p>I'm following the example in the MyBatis website to create a mapper that has a nested collection, when I do... | <p>My problem was that in the select I put resultType instead of resultMap,</p>
<p>So the select should be like:</p>
<pre><code> <select id="getProviderById" resultMap="Provider">
select P.idProvider as idProvider
,P.providerType as providerType
,P.username as ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Symfony2 persist not working from my controller<p>I am new with symfony and I've been trying for several days to implement a multiple image upload. I use ent... | <p>Ok i managed to fix this somehow by regenerating my User entity with</p>
<pre><code>php app/console doctrine:generate:entities BeArtsUserBundle
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bootstrap dropdown - shown.bs.dropdown event not firing after css transition<p>I have this problem with the shown.bs.dropdown event handler for the bootstrap... | <p>For everyone having this problem i'll post here how i managed to work around this issue/problem.</p>
<p>Basically i set the fade in class when the user clicks and let it there until the menu is closing. If the menu starts to close, the fadeIn class is removed, the fadeOut class is added and after the animation is c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
error Uncaught SyntaxError: Unexpected token <<p>i want to create a form which has 2 dropdown, the second dropdown will be trigger by the first dropdown with... | <p>The reason you get that error is because your <code>mysqli_query</code> is incorrect.</p>
<p>You have your <code>link</code> which is null. Your <code>link</code> should be the connection to your database, ie:</p>
<pre><code>$link = mysqli_connect("localhost", "my_user", "my_password", "database");
$query = "SELEC... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Excluding specified sheets when saving the .PDF version<p>I would like to hide specified sheets in my workbook, because I don't want them to be saved in my .... | <p>Try this piece of code, please:</p>
<pre><code>Sub SplicingAsbuilt()
Dim Sh As Worksheet, arrSh As Variant, arr As Variant
arrSh = Array("Materials - Specifications", "Fire Stopping", "Trunking", "Drop Length Calculator", _
"BoM", "BoQ Civils", "BoQ Cabling")
For Each Sh In ThisWorkbook.Sheets
If Sh.Nam... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python cant pickle getset_descriptor<p>I was trying something with <code>types.MappingProxyType</code>:</p>
<pre class="lang-py prettyprint-override"><code>... | <p><code>d</code> is indeed a dictionary. The issue you are running into is that pickle cannot serialize methods and attributes of classes independent of the class. When you look at the contents of <code>d</code> you see:</p>
<pre class="lang-py prettyprint-override"><code>{'__module__': '__main__',
'l': [1, 2, 3],... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
violin plot from two data.frames<p>I want to create a violin plot using ggplot2. The y axis should be number of occurrences. This can either be represented b... | <p>Thanks a lot for the great responses. I get a bit closer to my imagined output if I combine @CMichael 's two answers. </p>
<pre><code>p1 <- ggplot(subset(plotData, group %in% c("A","B")), aes(x=as.factor(group), y=N, group=group, fill=group)) + geom_violin() + theme_bw()
p1 + geom_boxplot(data=subset(plotData, ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to include loop counter in name of array when declaring it? (in C)<p>I have this loop which creates a certain number of array depending on a v... | <blockquote>
<p>I want to include the counter of the array at the end of the array name such that it is: <code>array1[]</code>, <code>array2[]</code>, <code>array3[]</code> and so on, one for each iteration</p>
</blockquote>
<p>That is not possible. C is a compiled language, meaning that a program (the compiler) cre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
OpenSSL Error "PHP OpenSSL extension not working"<p>When I visit the <strong>System environment</strong> section in the Install tool, TYPO3 will print:</p>
... | <p>TYPO3 executes <a href="http://php.net/manual/en/function.openssl-pkey-new.php" rel="nofollow"><code>openssl_pkey_new()</code></a> and only checks the return value, ignoring any actual errors.</p>
<p>To find out what the problem is, just execute the function yourself.</p>
<pre><code>echo '<?php openssl_pkey_new... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android Camera2 Sample<p>I am trying to find a camera sample for android because I would love to mess with it and see what I can do. I am using the sample co... | <p>The camera2 API does not exist prior to Android 5.0, so you cannot use it on a device running Android 4.4.</p>
<p>You can follow the API guide for the older camera API here instead:
<a href="http://developer.android.com/guide/topics/media/camera.html#custom-camera" rel="nofollow">http://developer.android.com/guide/... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can i create a git commit template passing the branch name?<p>Every day i wrote my commits like this:</p>
<pre><code>git commit -m "[develop] - Fix some fea... | <p>You can use a <code>prepare-commit-message</code> hook to modify the commit message if you like. This hook allows you to edit the file containing the commit message, which is passed as the first argument. See the <code>githooks(5)</code> manual page for more details.</p>
<p>As a note, it usually isn't a good idea... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select specific items from a file using sed<p>I'm very much a junior when it comes to the <code>sed</code> command, and my <code>Bruce Barnett</code> guide s... | <p>With sed:</p>
<pre><code>sed '/^bravo|/!d' filename
</code></pre>
<p>Alternatively, with grep (because it's sort of made for this stuff):</p>
<pre><code>grep '^bravo|' filename
</code></pre>
<p>or with awk, which works nicely for tabular data,</p>
<pre><code>awk -F '|' '$1 == "bravo"' filename
</code></pre>
<p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to address / access dynamicly created Objects?<p>i try to address dynamicly created Objects to get values via methods.
I crated the Objects dynamicly and... | <p>You need to store the players in a Map which maps the player names to the player objects. </p>
<pre><code> HashMap<String, Player> mp = new HashMap<String, Player>();
for(int i = 0; i < playersCount; i++){
Player player = new Player(arraylist.get(i));
mp.put(arraylist.ge... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rust wasm: How to access Webassembly.Memory of current instance (from Rust)?<p>Looking at the function signature of <a href="https://docs.rs/js-sys/0.3.35/js... | <blockquote>
<p>It needs an argument buffer which refers to the current wasm instance's memory buffer.</p>
</blockquote>
<p>First of all, it's worth noting that this is not necessarily true. That binding is for a standard JavaScript API - <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Glo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Homework issues. Trouble writing methods for a calendar appointment program<pre><code>import java.util.Arrays;
/**
* Class Day: This class is used to repre... | <p>/**
* This method should return whether or not there is an appointment scheduled at
* any hour of this day.
*
* @return true if there is an appointment scheduled during any hour of this
* day, false if there are no appointments for this entire day.
*/</p>
<pre><code>public bool... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to access array created from a struct?<p>I made a struct called cities and outside of the struct I created an array of type cities with its parameters. I... | <p>You are prefixing with an underscore</p>
<pre><code>citywinds[1]._windspeed
</code></pre>
<p>where the property is</p>
<pre><code>public int windSpeed;
</code></pre>
<p>Try this</p>
<pre><code>var speed = citywinds[1].windSpeed;
</code></pre>
<p>you will also need to mark <code>cities[] citywinds</code> as <co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Apply custom made function to pandas df<p>I have defined the following function that searches through the nested dictionaries for a value of a specific key.<... | <p>The key error seemed to be caused by the first if statement:</p>
<pre><code>if len(search_dict) == 1:
search_dict = search_dict[0]
</code></pre>
<p>I had issues with the Dict type checking, and opted to try with collections.Mapping instead of dict. I tested the solution below and it seemed to work.</p>
<pre c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python not understanding simple math question<p>I am making mortgage calculator, I have provided information for variables p, i, n, but get error in the equa... | <p>What you shared is not valid python code. Here is an example of code that will accomplish what you are asking:</p>
<pre><code># define function:
def CalculateMortgage(p, i, n):
# calculate numerator:
numerator = p * (i *(1+i) ** n)
# calculate denominator:
denominator = ((1+i) ** n - 1)
# cal... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
folium draw star marker<p>I am looking into drawing three different markers on a folium map: square, circle and star.
The first two are done using BeautifyI... | <p>Just working on <a href="https://python-visualization.github.io/folium/plugins.html#folium.plugins.BeautifyIcon" rel="noreferrer">BeautifyIcon options </a> can satisfy your needs:</p>
<pre><code>import folium
from folium.plugins import BeautifyIcon
# Make an empty map
m = folium.Map(location=[15, 0], tiles="OpenSt... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring dependency injection using setter method?<p>I have below classes.</p>
<pre><code>public class SomeBeanClass implements SomeInterface{
private I... | <blockquote>
<p>But <code>SomeBeanClass</code> does not have any property named <code>AccountHistory</code>.</p>
</blockquote>
<p>It does, right here:</p>
<pre><code>public void setAccountHistory(IAccountHistory acctHistory) {
this.acctHistory = acctHistory;
}
</code></pre>
<p>A <em>property</em> isn't a <em>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SignalR Websocket Exception when closing client<p>When starting and stopping a SignalR client that is connected to a basic self hosted server like this:</p>
... | <p>Looks like a <a href="https://github.com/SignalR/SignalR/issues/2685" rel="noreferrer">known issue</a> which might be fixed in v3.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get the number of contents of a dm_document?<p>I am trying to add a new content to my <code>dm_document</code> with the <strong>DFCMethod</strong> ... | <p>The method your are looking for is <code>int getPageCount()</code>.
You can also get the main content format (content type) name by the method <code>String getContentType()</code>.</p>
<p>Then you can use received values as parameters in a call of the <code>ByteArrayInputStream getContentEx(String format, int pageN... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
c# calling web service error: "The client certificate is Not provided. Specify a client certificate in client credentials"<p>I am trying to call a web servic... | <p>You can specify the client certificate on the ChannelFactory:</p>
<pre><code>var channelFactory = new ChannelFactory<ws_name_webreqSoap>(basicHttpsBinding, endpointAddress);
channelFactory.Credentials.ClientCertificate.SetCertificate("CN=client.com", StoreLocation.CurrentUser, StoreName.My);
var channel = cha... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
tf.data.Dataset - Why is the performance of my data pipeline not increasing when I cache examples?<p>I'm currently trying to learn more about building effici... | <p>This statement does nothing:</p>
<pre><code>if cache: self.train_ds.cache()
</code></pre>
<p>It should be:</p>
<pre><code>if cache: train_hr_ds = train_hr_ds.cache()
</code></pre>
<p>Like other dataset transformations, <code>cache</code> returns a new dataset instead of modifying an existing dataset.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to get only those in an FTP directory by a given name?<p>I would like to Download only one file group.
In this case I want to download the humidity data ... | <p>With <a href="https://stackoverflow.com/q/9282753/850848#28187442">most FTP servers</a>, this will do:</p>
<pre><code>files = ftp.nlst("*rhum*")
</code></pre>
<p>(although it is non-standard way).</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error While connecting to postgresql with pyspark in shell - org.postgresql.Driver Class not found exception<p>I am running the following program in pyspark ... | <p>Try this.</p>
<pre><code>pyspark --packages org.postgresql:postgresql:42.2.10
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Node.js on a Raspberry Pi Zero W with dependencies not downloading automatically<p>I Made a Discord bot, and I wanted to host it on a Pi, but once I got node... | <p>well I fixed it by first installing the npms on my pc to a specific folder then transferred it with Filezilla </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to run sql script on every EF migration<p>I want to run some custom Sql after <em>every</em> migration. I was hoping there was a global event or somethin... | <p>You can override the seed method of the configuration class: <a href="http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-3" rel="nofollow">http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-3</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Update table based on aggregate of other column in same table<p>I have a table with three columns right now that looks something like this:</p>
<pre><code>A... | <p>Here you are:</p>
<pre><code>UPDATE Table n
INNER JOIN
Table m ON n.B = m.B
SET
n.D = m.c
WHERE
m.C IS NOT NULL;
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Array Formula to Ignore Rows Where Value Exists<p>This array formula works beautifully for what I need:</p>
<pre><code>=IF(S12="","","Fastest Loop Completed... | <p>I was able to get the formula to work by converting the strings to numbers within an <code>IF()</code> statement:</p>
<pre><code>=IF(S12="","","Fastest Loop Completed in "&TEXT(MIN(IF((S12:S1048576<>"")*(R12:R1048576<>"")*(IF(U12:U1048576="B","",1)<>""),S12:S1048576-R12:R1048576)),"[m]:ss"))
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting start time of mp4 video with millisecond precision<p>I am doing a project that requires me to know the exact datetime that a particular frame of a vi... | <p>This problem came up when I was trying to track the times that an athlete was performing an act of a sport. For example, a basketball player shooting 10 free-throws--the 10 moments, with millisecond-precision, where the player released the ball. <strong>The main thing I really needed was to graph the occurrences rel... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
.Net Core Identity - migrate from Postgresql to SQL Server<p>I have a .NET Core 3.0 MVC website with Identity. The database is a Postgresql database (mainly ... | <p>If the application is build on the same stack, lets say in your case Dot net core with Aspnet Identity, then the hashes can be migrated with no issue at all. Everything is handled by dotnet and it is not bound to the underlying datastore. </p>
<p>Create the schema and populate it and you will be good to go. No need... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to properly use Stripe api for saved card on client side<p>I am currently working with Stripe API. I was able to use one time payment properly, and save ... | <p>You are correct. You would use the PaymentMethod's id (<code>pm_******</code>) like so:</p>
<pre><code>stripe.confirmCardPayment( "{{ $client_secret }}", {
payment_method: payment_method.id,
}). then( ... )
</code></pre>
<p>Documented here: <a href="https://stripe.com/docs/js/payment_intents/confirm_card_payment... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
remote form only if user isn't signed in Rails 4<p>I just want unsigned-in users to use the form with remote: true but at the same time signed_in users shoul... | <p>your solution does not work because your second call to <code>simple_form_for</code> is in the block you just passed to the first call of <code>simple_form_for</code>. you could just use the ternary operator to set the <code>remote</code> option to true or false, like this:</p>
<pre><code><%= simple_form_for(@po... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Server migration from GCM to FCM<p>We're looking to finally update our server to use Firebase Cloud Messaging since Google Cloud Messaging was deprecated and... | <p>I don't see it in the Maven Repo, but <a href="https://github.com/google/gcm/releases" rel="nofollow noreferrer">it's GitHub releases page</a> itself has the <a href="https://github.com/google/gcm/releases/tag/v1.0-SNAPSHOT" rel="nofollow noreferrer">v1.0-SNAPSHOT</a> available -- which contains the updates (that I ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to monitor/view all actions/methods/events/filters/etc that make up a request?<p>In terms of performance profiling an ASP.NET MVC application is there a ... | <p>I'd recommend just installing <a href="http://getglimpse.com/" rel="nofollow">Glimpse</a>. It gives you more information that you'd probably want or care to see, but it can be highly useful in a number of scenarios during development. It's free, open source, and available via Nuget for easy integration into your pro... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scala Futures and java 8 CompletableFuture<p>The introduction of <code>CompletableFutures</code> in Java 8 brought to the language features available in the ... | <blockquote>
<p>What are the differences, and why a Scala developer should prefer Scala Futures over java 8 CompletableFuture ?</p>
</blockquote>
<p>Rephrasing what @dk14 pointed out in comments I'd say that <code>CompletableFuture</code> doesn't have idiomatic Scala api.</p>
<p>For scala developer the implications ar... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Show/hide control based on dropdown selection mvc 4 razor c#<p>Here is my code</p>
<pre><code>@Html.DropDownListFor(z => z.SelectedReportId, new SelectLi... | <p>Included javascript inside a @section scripts{} section and it started working, </p>
<pre><code>@section scripts{ <script type="text/javascript">
$(function () {
$('#SelectedReportId').change(function () {
var value = $(this).val();
if (value == '1') {
$('#IncludePhotos').show(... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I get all the text within a tag using a Nokogiri CSS selector?<p>I am trying to extract text from an HTML page using Nokogiri. I am using CSS selector... | <p>It looks like you can simply call the <code>#text</code> method of the target element and it will include all child text nodes:</p>
<pre class="lang-ruby prettyprint-override"><code>doc = Nokogiri::HTML(your_html_snippet)
str = doc.css('td').text
str # => "\n\nsome text\n\n\nmore text\n\n"
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R GLM function omitting data<p>I'm creating a logistic regression model predicting a factored binary outcome variable (yes/no), but am running into a weird i... | <p>You are correct in that <code>na.omit</code> will omit the missing values and run your model. In fact, you should see identical outputs when you run <code>summary(model_1)</code> and <code>summary(model_2)</code>.</p>
<p>However, the <code>nagelkerke</code> function that you are using runs into issues when there ar... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to store form data in laravel?<p>routes/web.php</p>
<pre><code>Route::get('/','UserController@index');
Route::post('/index','UserController@store');
</c... | <p>change in your <code>web.php</code></p>
<pre class="lang-php prettyprint-override"><code>Route::post('/index','UserController@store')->name('store');
</code></pre>
<p>add <code>method="POST"</code> in your form which is <strong>missing</strong> </p>
<pre class="lang-php prettyprint-override"><code>@extends('la... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
java.lang.IllegalStateException: Cannot load configuration class : com.project.config<p>I have a spring core application. In which I have private constructor... | <p>You should make a public constructor in order spring framework can instantiate the bean, the other way you can do it is doing a public static factory method, but you will need to say to the spring framework, what uses this method in order to instantiate this bean.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Dynamically Create Formal Arguments from a DataFrame of Argument Values (R)<p>I have a dataframe of values that I would like to use to build arguments... | <p>If you use <code>stringsAsFactors=FALSE</code> to prevent the elements of <code>argVals</code> from getting turned into factors:</p>
<pre><code>argVals <- data.frame(name, size, nationality,
stringsAsFactors=FALSE)
</code></pre>
<p>then </p>
<pre><code>as.list(argVals[1,])
## $name
## [... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Validation: "th start tag in table body."<pre><code><table>
<thead>
<th>Table Heading</th>
</thead>
<tbody>
<tr>.... | <p><code>th</code> is a table header cell - it needs to be within a table row (<code>tr</code>):</p>
<pre><code><table>
<thead>
<tr>
<th>Table Heading</th>
</tr>
</thead>
<tbody>
<tr>.....
</tbody>
</table>
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to include () in query<p>iam have two modal i I'm trying to include all <strong><em>Post</em></strong> that belong the User. However, I keep getting the ... | <pre><code>public virtual ICollection<Post> Post{ get; set; }
</code></pre>
<p>please use look like this for using relationship between two table then use include syntax.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kafka delete topics when auto.create.topics is enabled<p>We have a 2 node kafka cluster with both <code>auto.create.topics.enable</code> and <code>delete.top... | <p>Even if you've mentioned that no consumer/producer is consuming/producing from the topic, it sounds that this is the case. Maybe you have any connectors running on Kafka Connect that replicate data from/to Kafka? </p>
<p>If you still can't find what is causing the re-creation of the deleted Kafka topics, I would su... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
WooCommerce change price when adding product to order in admin<p>We have customers who have different discount percentages. This is all programmed and workin... | <p>This works for adding item meta and changing the item price in the order admin screen:</p>
<pre><code>function action_woocommerce_new_order_item( $item_id, $item, $order_id ) {
// only run this from the WP admin section
if ( !is_admin() )
return;
$item_type = $item->get_type();
// retu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does `Product` implies `reflection`?<p>Does the use of <code>Product</code> implies <code>reflection</code>?</p>
<p>More precisely: Does <code>Product.getCl... | <p><code>getClass</code> is method which came from JVM part of Scala and it exists for every reference type, it has nothing in common with <code>Product</code>. It will return <code>Class[T]</code> object, representing reference run-time class.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Simulating an apk file using java swing for using it in my desktop<p>I have a list of apk files which i must have the facility to use it inside a java swing ... | <p>You just can't.</p>
<p>Android applications requires a lot of dependencies that are not available in the <em>classic</em> Java environment.</p>
<p>However, you can run Android applications on your desktop through some emulators such as <a href="http://www.andyroid.net/" rel="nofollow">Andy</a> or <a href="http://w... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Autowiring in custom jsr validator<p>So I followed the documentation on this <a href="http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html... | <p>I eventually fixed this by putting the LocalValidatorFactoryBean in a jpaPropertyMap and setting it on my LocalContainerEntityManagerFactoryBean:</p>
<pre><code>Map<String, LocalValidatorFactoryBean> jpaPropertyMap = new HashMap<>();
jpaPropertyMap.put("javax.persistence.validation.factory", localVa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I submit an XCode bug to Apple?<p>As a developer, I have come across a few bugs in Xcode and Swift, which don't lead to crashes, and thus don't report... | <p>Apple provides some informations on their website <a href="https://developer.apple.com/bug-reporting/" rel="noreferrer">how you can send bug reports</a> to them. The best way is to use the <a href="https://bugreport.apple.com/problem/viewproblem" rel="noreferrer">Apple Bug Reporter.</a></p>
<p><a href="https://deve... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Fatal error: Call to a member function bind_param() on a non-object in PHP<p>I am trying to store data into database from my form.I have try below code,but i... | <p>You use <a href="http://php.net/manual/en/mysqli.construct.php" rel="nofollow"><code>mysqli_*</code></a> in OOP style so you have to use the keyword <code>new</code> and remove the <code>_connect</code>part for the connection like this:</p>
<pre><code>$conn = new mysqli('localhost', 'root', '','tmtool');
//^^... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Intercept video frames in a WebRTC session for effects processing?<p>I have a C#/C++ app that captures a video stream from the camera connected to a user's P... | <p>Since you are using a port of Chromium, this means that you should have access to WebGL calls through WebKit.</p>
<p>Instead of doing it on the app-side, try doing it on your HTML.</p>
<p>Since the question is "Intercept video frames in a WebRTC session for effects processing?" I think this post and the demo it ha... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vue class component AddEventListener and RemoveEventListener usage<p>I want to implement draggable line using <code>mousedown</code>, <code>mousemove</code> ... | <p>I've overengineered my code.
There is no need to use <code>arrow-functions-class-properties</code>, or defining context by using <code>method.bind(this)</code>. The following code should work:</p>
<pre class="lang-js prettyprint-override"><code>import { Vue, Component } from "vue-property-decorator";
@Component
ex... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
argparse with argument_groups and mututally_exclusive_group<p>I have the following:</p>
<pre><code>def parser():
p = argparse.ArgumentParser()
peopl... | <p>Here's the help:</p>
<pre><code>usage: foo [-h] [--config-file CONFIG_FILE] [--name NAME]
[--age AGE]
optional arguments:
-h, --help show this help message and exit
people_list:
--config-file CONFIG_FILE
</code></pre>
<p>An argument group like <code>people</code> controls h... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I query the remote for the currently used submodule commit id?<p>I have a repository with submodules.
I would like to be able to see which commit of the ... | <p>You cannot query the remote server for the contents of the repository without fetching first, and submodule hashes are considered part of the contents of the repository. They're stored in tree objects, so it's necessary to pull down the relevant objects first.</p>
<p>You don't have to check out the branch, though.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R studio Rolling returns<p>I have quarterly stock returns data and would like to calculate rolling annual returns. For example:</p>
<p>The Rolling_Annual Re... | <p>You could use <code>rollapplyr</code> from <code>zoo</code> to calculate the rolling calculation.</p>
<pre><code>zoo::rollapplyr(df$Stock/100, 4, function(x) prod(1 + x) - 1, fill = NA) * 100
#[1] NA NA NA -12.9537 -17.0053 3.3125 3.4622 4.4489 17.0858
</code></pre>
<p><strong>data</strong></p>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
QtWebEngine debugging<p>Recently Qt introduced the <code>QtWebEngine</code> module. Is there a way to invoke developer tools and debug JavaScript code inside... | <p>I just ran across this so I added it here for posterity.</p>
<p>It was just added to Qt 5.5 git. You have to enable it via an environment variable <code>QTWEBENGINE_REMOTE_DEBUGGING=<port></code>. You can put <code>0.0.0.0:<port></code> if you are doing debugging of an embedded device and cant use the ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using Select2 Ajax call with Ruby on Rails and ElasticSearch<p>I'm trying to implement a select2 search to dynamically produce results based on the users inp... | <p>Solved!</p>
<p>I realised I had my JSON in the wrong format even though I was following the official select2 documentation: <a href="https://select2.org/data-sources/formats" rel="nofollow noreferrer">https://select2.org/data-sources/formats</a></p>
<p>So instead of storing my data in a hash and then converting th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
plugin to receive Audio file<p>I'm fairly new to Java and Android and I'm trying to make an Android plugin for Unity using Eclipse.</p>
<p>The goal is to le... | <p>So, I still wasn't able to forward the actual file (wav) then try to convert it to SoundPool. What I did was something different:</p>
<ol>
<li><p>I put the audio files into the StreamingAssets folder so that when the project is packaged, I still have access to these raw files (although in Android, their compressed ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Merge Sorted Linked Lists with head node<p>I am writing a void function void merged_lists (cell * l1, cell * l2, cell * l3); who receives two linked lists, h... | <p>There is a first problem with this code</p>
<pre><code>if (!l1)
l3 = l2;
if (!l2)
l3 = l1;
</code></pre>
<p>You override <code>l3</code> with the value of <code>l2</code> or <code>l1</code>. The result is a memory leak because the head node <code>l3</code> was referring to has no more references. </p>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular Material Datepicker toggle icon click event<p>Is it possible to somehow catch click event on angular material datepicker toggle icon? I want trigger ... | <p>Use opened and closed event emitter provided by angular date picker component to listen open and close of calander component.</p>
<pre><code><mat-form-field class="example-full-width">
<input matInput [matDatepicker]="picker" placeholder="Date">
<mat-datepicker-toggle ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reduce JSON object containing JSON objects into an array of the form [Path, Value]<p>I'm trying to reduce a JSON object of nested objects, arrays, and string... | <p>Recursive approach, Use <code>reduce</code> and <code>Object.etnries</code></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>const appleObjects = {
apples: {
colors: [... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make Debian consider a data file as text?<p>Sorry for this bad title.
Here is my problem : I have a PHP file (which works fine in Production btw), con... | <p>Can you open the file with VI for example ? </p>
<p>And see at the very beguinning (or the very last) of the file, if you can see any special chars (hexadecimal, etc).</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to parse facebook permissions from Koala response?<p>I am using Koala gem to get user permissions.</p>
<pre><code>permissions = client.get_connections('... | <p>Original suggestion of</p>
<pre><code>permissions.map { |h| puts h.fetch('permission') if h.fetch('status') == 'granted' }
</code></pre>
<p>is close but has two issues, first already pointed out is superfluous <code>puts</code> call. Second, as there probably may be values with status other than 'granted', the res... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I pass a type as parameter in PHP?<p>I'd like to pass (any type, not only PHP's primitives) Type as a function parameter. More like a C++'s template. Is ... | <p>If you want to instantiate something like the above, how about passing the classname as a string and then instantiating it!</p>
<pre><code>function foo($obj_string)
{
$object = new $obj_string();
//do stuff with $object
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get a list of all rows from one table, that satisfies multiple criteria in two different tables<p>I have 4 tables - <code>employee</code>, <code>company</cod... | <p>Use a subquery to find the companies with multiple employees, and a left join to action:</p>
<pre><code>select e.*
from (select company_id
from employee_company
group by conpany_id
having count(*) > 1) c
join employee_company ec on ec.company_id = c.company_id
join employee e on ec.employee_id ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
c how to cut of the first x words of a string?<p>I have a char array:</p>
<pre><code>char tmp[2048];
</code></pre>
<p>I want to cut of the first x words of... | <p>Here's a rough implementation:</p>
<pre><code>const char* TrimWords(const char* input, int nWords)
{
while (nWords)
{
if (!isspace(*input) && isspace(*(input + 1)))
{
nWords--;
}
input++;
}
return input;
}
</code></pre>
<hr>
<pre><code>TrimWords(... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set a minimal default range for a column chart in Highcharts<p>I'm using Highcharts for a column chart that has positive and negative percentage values. </p>... | <p>Currently you have to do it yourself.
It can be accomplished by running a function to check the min/max and reset if needed.</p>
<p>Something like this (quick dirty example): </p>
<pre><code>function setMinAxisExtremes(chart, axis, min, max) {
var ax = axis == 'y' ? chart.yAxis[0] : chart.xAxis[0];
var... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using methods of react component in native dom element<p>I'm using React with Fluxxor to create a tree like visual component. For each node in the tree I wan... | <p>What you are doing is against React's principle.
Changing the DOM elements will make React's DOM
diffing absurd. You can fix your code like below. <strong>But highly not recommended.</strong></p>
<pre><code>componentDidMount: function() {
var id = "dd"+this.props.item.self.id;
var ulMarkup = "<ul id='"+... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I have two action need to pass in to my onClick button on react.js. But When I do, I fail to get it? is it any solution to solve it?<p>Consider the code belo... | <p>I would do it this way:</p>
<pre><code> // use handler function is cleaner
handleClickUserDetail = (e) => {
e.persist(); // persist the event to send it to onHide if needed
e.preventDefault();
this.props.onHide(e); // send the event to onHide if needed
this.setState({ userDetailModalSho... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UnicodeDecodeError reading binary input<p>I try to port my code from python 2.7 to 3.4. Under 2.7 it works quite well.
I will import a Picoscope binary file ... | <p>You need to read the files in binary mode:</p>
<pre><code>bin_file_A = open(infile_A, "rb")
bin_file_B = open(infile_B, "rb")
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
.addClass not working (gets removed on refresh)<p>I'm pretty new to jQuery and I'm trying to set a class based on <code>localStorage.getItem</code>but it isn... | <p>Try re-adding the class on document ready:</p>
<pre><code>$(function() {
if (localStorage.getItem("active_layout") == 2) {
$("#laa").addClass("active");
};
});
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use Python SSHTunnle to forward multiple ports<p>I need to forward to multiple ports which are sits behind a server</p>
<pre><code>server1(22) -> ... | <p>Both examples can be modified slightly to work the way you want.</p>
<p>There is the singular versions of bindings (<code>local_bind_address</code> & <code>remote_bind_address</code>) and the plural versions of bindings (<code>local_bind_addresses</code> & <code>remote_bind_addresses</code>.</p>
<p>The sin... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Integration using the Trapezium Rule in C giving wrong answer for certain values<p>I've written some code to Integrate the function 5x^4 + 4x^3 + 3x^2 + 2x +... | <p>The problem is that in the exit condition of the inner loop, you compare two floating point numbers. After <code>numberOfStrips</code> iterations, it's not guaranteed that <code>z == b</code> because of floating point accuracy. It's entirely possible that <code>z < b</code> or <code>z > b</code>. In the <code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I extend external scss rule without including it in the output?<p>GIVEN that there is existing scss file that defines rules like <code>.btn {..}</code> o... | <p>Sass does not currently support this by default, neither with the @import nor @use rule.</p>
<p>Nonetheless, if you (can) use npm packages (<a href="https://www.npmjs.com/" rel="nofollow noreferrer">npm</a> / <a href="https://yarnpkg.com/" rel="nofollow noreferrer">yarn</a>) in your project, then <a href="https://g... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select Random Files From Txt File and Save to Another Txt - VBScript<p>I have a text file with 350.000+ lines. I need to select 100 random lines from that fi... | <pre><code>Sub Randomise
Randomize
Set rs = CreateObject("ADODB.Recordset")
With rs
.Fields.Append "RandomNumber", 4
.Fields.Append "Txt", 201, 5000
.Open
Do Until Inp.AtEndOfStream
.AddNew
.Fields("RandomNumber").value = Rnd() * 10000
.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to resolve SQLiteException error when insert data in database<p>So basically I am stuck as to why I cannot add any data. I have basically followed along ... | <p>Can you please replace below code snippet any try again to insert:</p>
<pre><code> public static final String CREATE_TABLE =
"CREATE TABLE IF NOT EXISTS " + DB_TABLE + "("
+ ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
+ NAME + " TEXT"
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Programmatically saving a file on an Android device<p>I'm writing some UI tests, and I need to be able to have those tests programmatically take screenshots ... | <p>Put a WRITE_EXTERNAL_STORAGE permission request in your manifest file.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UITableView reloadData not work<p>this is my UITableView code</p>
<p>in viewDidLoad</p>
<pre><code>self.audioHistoryTableView = [[UITableView alloc] init];... | <p>Can you set the delegate and datasource via the interface builder instead? Also if it's made in the interface builder why do you have to initialise the table? Remove this:</p>
<pre><code>self.audioHistoryTableView = [[UITableView alloc] init];
self.audioHistoryTableView.delegate = self;
self.audioHistoryTableView.d... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set local notification custom sound from assets<p>This is my notification function , <strong>How to set a custom sound from my assets?</strong></p>
<pre><co... | <p>Custom sounds should be set from the native Android and iOS projects. For Android this will be the <code>raw</code> folder.</p>
<p>You can play the custom sound by defining its name while instantiating the NotificationDetails</p>
<pre><code>AndroidNotificationDetails(
'repeating channel id',
'repea... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Marquee from database in asp.net<p>First, I used marquee with repeater and it is working fine, but it shows all data at the same time.</p>
<p>My code look l... | <p>There are few things you can check</p>
<ul>
<li><p>The Repeater control has no horizontal or vertical "direction". You either need to control it via css: </p>
<pre><code><ItemTemplate>
<div style="float:left">
<asp:Label ID="Label1" runat="server" Text='<%# Eval("notification") %>' />
&... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is fetch_sub really atomic?<p>I have the following code (written in C++):</p>
<p>Code in StringRef class:</p>
<pre><code> inline void retain() const {
... | <p><code>fetch_sub</code> is as atomic as can be, but that's not the problem.</p>
<p>Try modifying your code like so:</p>
<pre><code> if(m_refCount.fetch_sub(1, std::memory_order_release) == 1){
Sleep(10);
std::atomic_thread_fence(std::memory_order_acquire);
deleteFromParent();
</code></pre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can't a derived class override base class' interface type abstract property with a type that extends that interface?<p>In the following code, compiler co... | <p>This wouldn't be safe since you could do:</p>
<pre><code>interface ITest3 : ITest1 { }
public class Test3 : ITest3 { }
A b = new B();
b.TestProperty = new Test3();
</code></pre>
<p>however <code>Test3</code> does not implement <code>ITest2</code> as required by <code>B</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Widgetset Error after Vaadin 7 to Vaadin 8 Migration<p>i converted the Project from Vaadin 7 to Vaadin 8 using compatibility in the pom.xml</p>
<p>I had in ... | <p>The <code>com.vaadin.v7.Vaadin7WidgetSet</code> is additional widgetset that contains Vaadin 7 compatibility widgets for Vaadin 8. This is not included in standard client jars. You are probably missing <code>vaadin-compatibility-client</code> or <code>vaadin-compatibility-client-compiled</code> in your project.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
IDisposable created inside Linq - Exception Safety<p>I have something similar to the following setup:</p>
<pre><code>class DisposableContainer : IDisposable... | <p>Your assumption is correct. Already created <code>DisposableObject</code>s would not be disposed properly.</p>
<p>You can fix it by using a temporary list that holds the created items, and disposing them if needed:</p>
<pre><code>public void Populate(IEnumerable<OtherThings> things)
{
var temp = new List... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Perl Match anything inside brackets placing each instance into groups<p>I am trying to grab anything from inside Brackets (making sure to match only the firs... | <p>If you capture part of a regex, and do so with the 'g' flag - as you're doing - the result is an array, not a string. </p>
<p>Like this:</p>
<pre><code>#!/usr/bin/perl
use strict;
use warnings;
my @matches;
while ( <DATA> ) {
push ( @matches, m,\[(\w+)\],g );
}
print join ("\n", @matches );
__DATA__
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using awk to trim away parts of a text file outside 2 patterns<p>I'd like an elegant <code>awk</code> solution to edit the lines in a file. So far I've only ... | <p>Here is an <code>gnu awk</code> (gnu due to multiple characters in Record Separator)</p>
<pre><code>awk -v RS="GROUPS|WATER" -F"\n" 'p=="WATER"{exit} {$1=p $1}NR>1; {p=RT}' file
GROUPS data data data data mo data mo data mo data even more even more
GROUPS data data data data mo data mo data mo data even more ev... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Categories assigned to user model - rails<p>Within my rails app I have two models. A User model and a Book model. A user uploads and has many books.</p>
<p>... | <p>Obviously you could create your own solution for the problem but <a href="https://github.com/mbleigh/acts-as-taggable-on" rel="nofollow">ActsAsTaggableOn</a> is a very good solution for it. It is not such a heavy weight as other gems.</p>
<p>Bonus: You can go back any time if it becomes too heavy for your applicati... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Finding Gaps in Timestamps with Multiple Users and Overlapping Timeranges in PostgreSQL<p>This is a continuation of a previous post on this site: <a href="ht... | <p>To handle gaps, I would recommend combining them first -- say using a CTE. The following does the logic by:</p>
<ul>
<li>Looking at the maximum end date <em>before</em> a given row (for the same room and same time.</li>
<li>Doing a cumulative sum where there is a gap between the previous maximum end date and the s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.