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:
How do I find the files changed in a commit using Rugged?<p>I am planning to use Rugged for programmatically accessing Git repositories.</p>
<p>I need to fi... | <p>You can use <code>Rugged::Commit#diff</code> to get the changes between the commit and its first parent or another <code>Rugged::Commit</code> or <code>Rugged::Tree</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use MouseMotion ints in another method<p>So basically I'm playing around with Graphics and bunch fun things which I want to know before making a game ... | <p>I believe the following <a href="https://stackoverflow.com/help/mcve">mre</a> demonstrates the functionality you want. <br/>
Use <code>drawTrail</code> to turn trail drawing on or off: </p>
<pre><code>import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import java.awt... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Equal height DIVs with rounded corner border-image<p>I'm having some trouble forcing equal height DIVs when used in conjunction with a border-image to acheiv... | <p>You can do this by setting <code>display:table;</code> on <code>.container</code> and <code>display:table-cell</code> on the rounded corner divs</p>
<h2><a href="http://jsfiddle.net/swfour/kky5crmx/4/" rel="nofollow">Demo Fiddle</a></h2>
<p>The issue you will otherwise have is setting the equal heights...these wil... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I apply data augmentation using Sequence API on Keras?<p>I found out online this Sequence API (don't remember where, sorry):</p>
<pre><code>class Pl... | <p>I have modified the answer quite a bit. I will try to fit the data generator in your code as well, mean while I would suggest to go this way to use image generator with basic house keeping of data.<br>
firstly read train csv and import <code>shutil</code> util to move you and align your folder as below mentioned str... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to resize background image as needed<p>i'm trying to create an ui button with image and text.</p>
<p>What i need is simple:</p>
<p>an image centered on... | <p>You just create a UIButton subclass.</p>
<p>1)</p>
<p>If you are using IB: then you can create 2 properties in the .h</p>
<pre><code>@property (weak, nonatomic) IBOutlet UIImageView *image;
@property (weak, nonatomic) IBOutlet UILabel *text
</code></pre>
<p>next you need to connect all the properties to the obje... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to insert records faster<p>I have to read records from CSV file and store them in Mysql database.</p>
<p>I know about "LOAD DATA INFILE" but in my case ... | <p>@Khanna111's answer is good. </p>
<p>I don't know if it helps, but try checking the table engine type. I once encountered the problem in which records are inserting very slow. I changed the engine from InnoDB to MyISAM and insertion becomes very fast.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use the same layer/model twice in one model in Keras?<p>I am trying to make a combined model which passes two different images through a sub-model (an... | <p>Let's assume you have a model built using the following function:</p>
<pre><code>def make_encoder(h, w, c):
inp = Input((h, w, c))
x = SomeLayer()(inp)
x = SomeLayer()(x)
....
out = OutLayer()(x)
return Model(inputs=[inp], outputs=[out])
</code></pre>
<p>Now, to make a combined model, you n... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sending iMessage via Messages.app using Javascript for Automation (JXA)<p>I have been attempting to create a JavaScript for Automation script to send an iMes... | <p>Based on <a href="http://gwfrontiers.blogspot.nl/2015/01/javascript-for-automation-of-messages.html" rel="nofollow">http://gwfrontiers.blogspot.nl/2015/01/javascript-for-automation-of-messages.html</a></p>
<pre><code>with (Application("Messages")) {
send("Hey", {to: services["E:johndoe@icloud.com"].buddies["so... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Map USGSOverlay clickevent multi response on same level markers<p>I used Google Map V3 create 20 markers , click one marker and the marker will show i... | <p>I ran into this before and fixed this issue by using the markerOption infoWindowIndex. So put all of your 20 infowindows in an global array list and for each marker you specify the infowindow by specifying the index like this,</p>
<pre><code>var marker = new google.maps.Marker({
position: item.getLatLng(),... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filtering an aggregated chart with another aggregation field<p>I'm trying to produce something similar to the <a href="https://observablehq.com/@manzt/top-k-... | <p>You can do this following Vega-Lite's <a href="https://vega.github.io/vega-lite/examples/window_top_k.html" rel="nofollow noreferrer">Filtering Top-K Items</a> example along with an extra aggregate transform. Here is an example adapting your spec from above (<a href="https://vega.github.io/editor/#/url/vega-lite/N4K... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set ng-style/style attribute on an li-tag with ng-repeat<p>That code is working:</p>
<pre><code><ul>
<li style="width:100%;" ng-repeat="period i... | <p>Hm... I think period is known on li tag.
I wrote simple example that implement what you want: <a href="http://jsbin.com/dosohehopa/2/edit?html,js,output" rel="nofollow">http://jsbin.com/dosohehopa/2/edit?html,js,output</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Node js commander args returns true instead the value<p>I want to create a script with node and node commander and when i try to grab the values of my args i... | <p>The <a href="https://www.npmjs.com/package/commander" rel="noreferrer">documentation</a> isn't very clear and only shows this by example, but the syntax you have used (<code>'-s, --src'</code>) is for boolean values.</p>
<p>If you want to take a string you need to say so: <code>'-s, --src <item>'</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VueJS + Electron, building issue with API<p>I have an issue:</p>
<p>I'm working on an app in Electron-Vue, and to test if it works outside of the "npm run d... | <p>Actually, after a quick lookup, I've found an answer to this.</p>
<p><a href="https://github.com/SimulatedGREG/electron-vue/issues/214" rel="nofollow noreferrer">https://github.com/SimulatedGREG/electron-vue/issues/214</a></p>
<p>Here, in the case of electron-vue, this can be used to easily get a console while jus... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't Bind name property of Pivot Item to label text in pivot header template<p>I have a Pivot control that uses a Datatemplate as header</p>
<p>In the prop... | <p>Resolved:</p>
<p>It was easy.</p>
<p>I've just created a class with text and image properties in the Datacontext viewModel of the pivot control and binded the object to the header property of the pivot item.</p>
<p>Thanks</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I add a jar file to my local Maven repository using Eclipse m2e on Luna Service (4.4.1)?<p>I am getting an warning message because I manually added a ... | <p>The local Maven repository is effectively a standard Maven repository; as such, it must adhere to a particular format (there are a few Maven-compatible repository formats).</p>
<p>Dropping files into a repository isn't going to cut it, unless you are able to mimic the creation of additional artifacts in accordance ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why do so many projects prepend "v" to the git version tags?<p>A lot of projects (e.g. Linux) prepend <code>v</code> to their git version tags, e.g. <code>v3... | <p>As mentioned in "<a href="https://stackoverflow.com/a/6273142/6309">Is there a standard naming convention for git tags?</a>":</p>
<blockquote>
<p>The reason for the preceding 'v' is historical.<br>
Older SCCS (cvs,rcs) could not distinguish between a tag identifier and a revision number.<br>
Tag identifiers w... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C#: OleDbCommand Update query not working?<p>I have a database with multiple rows and columns with default value of 0. The user have to select a column by ty... | <p>Only <em>values</em> can be variables. Your @time would be a column name and that cannot be a variable. As much as I hate to say this: you will need to insert that part by text-format. </p>
<p>Please be extra careful when doing so, it's an attack vector for sql injection. Best scenario is you let the user pick from... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there any alternative for mysql concat with better performance?<p>I am trying to apply join over two table, the column on which join needs to be applied v... | <p>It would certainly be better to use the static prefix <code>08080</code> so that the DBMS can use an index. It won't use an index with <code>LIKE</code> and a leading wildcard:</p>
<pre><code>SELECT * FROM Employee e INNER JOIN MasterEmployee me
ON e.id LIKE CONCAT('08080', me.id, '_')
AND e.status = me.stat... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When should I call StateHasChanged and when Blazor automatically intercepts that something is changed?<p>I am having a hard time understanding when I should ... | <p>Generally speaking, the StateHasChanged() method is automatically called after a UI event is triggered,
as for instance, after clicking a button element, the click event is raised, and the StateHasChanged() method is
automatically called to notify the component that its state has changed and it should re-render.</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting default styles when upgrading from React Navigation v4 to v5<p>I am currently using React Navigation v4 and migrating to v5. I am using the <a href="... | <p>Put the defaults into a variable and export it. Then import where you need it and use:</p>
<pre class="lang-js prettyprint-override"><code>export const headerStyle = {
/* whatever */
};
// Use in `screenOptions`
<Stack.Navigator screenOptions={{ headerStyle }}></Stack.Navigator>;
// Use in `setOptio... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Superclass reference not able to call subclass method in Java<p>I have a basic doubt in polymorphism in Java. I have written the code below in one file named... | <p>Let's try to look at this line the same way that the compiler would:</p>
<pre><code>animal.dogMethod();
</code></pre>
<p>First, it needs to work out what <code>animal</code> means. That's nice and easy - it's a local variable in the current method, so it doesn't need to look far.</p>
<p>The compile-time type of t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
This.refs for functional components (useRef, createRef) | React native<p>I have used this.refs on a class component and now I am refactoring it to be a funct... | <p>for functional component you can use below hook
React alredy providing useRef hook so you can use it</p>
<pre><code>import React, { useRef } from 'react';
import ViewShot from "react-native-view-shot";
const Mycomponent = () =>{
const viewShotRef = useRef();
// Access viewShotref
console.log(viewShotRef ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to configure Mailgun to be used with Sign in with Apple and Apple's relay service?<p>I have verified my domain as mentioned in the Apple Docs but I am st... | <p>make sure your mailgun subdomain is verified. If your server is at <code>example.com</code> and your mailgun sending domain is <code>sender.example.com</code> you need to add the file you download from <a href="https://developer.apple.com/account/resources/services/configure" rel="nofollow noreferrer">https://develo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How SELECT is executed before GROUP BY in this query?<p>I was looking at the order in which the SQL is executed and I found out that it is: </p>
<pre><code>... | <p>I think this (the <a href="https://stackoverflow.com/questions/11145123/group-by-column-alias">ability to use a column alias</a> defined in the SELECT clause for the GROUP BY) is a probably non-standard extension that some databases allow (but not all).</p>
<p>You are supposed to repeat the exact definition again o... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP code is not working<p>I am working on excercise of a Wrox book and the following code is not displaying anything. Why is the reason for this. Should I ch... | <p>you missed a <code>.</code> after <code>$_SESSION['color']</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Send data to another already running python process via named pipe<p>I am trying to find ways to send data to a running Python (3.7+) process via a named pip... | <blockquote>
<ol start="2">
<li>Is there a way to run the named pipe in its own thread so it can stay blocked?</li>
</ol>
</blockquote>
<p>This is probably the easiest approach. Your attempt failed because you never actually created a different thread. You created two event loops and ran only one. The idea with ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React Cannot read property 'map'<p>I'm using react hooks and I want to display each <code>count</code> that comes from API. But I'm getting error <code>Canno... | <p>You can use <code>Object.values()</code> and <code>Array.map()</code> like so:</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 data = {
model: {
item1: {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Recognize both UILongPressGestureRecognizer and UIPanGestureRecognizer on same UIButton<p>I want to make a <code>UIButton</code> that when you long press it,... | <p>You need to confirm the delegate of those two gestures.
for ex:</p>
<pre><code>let long = UILongPressGestureRecognizer(target: self, action: #selector(record(gesture:)))
long.delegate = self
button.addGestureRecognizer(long)
let pan = UIPanGestureRecognizer(target: self, action: #selector(zoom(pan:)))
pan.deleg... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sharing classes between android client and GAE Endpoints<p>1)I made a dependency out of model module, inside it there's a <code>UserModel</code> class. But I... | <p>Forgot to answer, I had a mysterios compelation error that wasn't surfaced until I started manually all gradle tasks and specially the getClientLibs task. <a href="http://georgik.sinusgear.com/2014/06/23/how-to-debug-gradle-script/" rel="nofollow">More on debugging gradle</a>. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Firestore for web - on offline write, throw rather than save locally & sync on connection restore<p>As far as I understand, Firestore, by default, works in s... | <p>You mention "Firestore for web" in your question's title.</p>
<p>Note that for the web, <strong>offline persistence is disabled by default</strong>, as explained in the <a href="https://firebase.google.com/docs/firestore/manage-data/enable-offline" rel="nofollow noreferrer">doc</a>:</p>
<blockquote>
<p>When you ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Section and Row not properly displayed in UITableView Swift<p>I am trying to implement sections and rows in UITableView but because of nested JSON model stru... | <p>Whatever I understand by you, I make it. Check this code </p>
<p><strong>Create struct as</strong> </p>
<pre><code>struct SectionList : Codable {
let title : String?
var items : [RowItems]?
}
struct RowItems: Codable {
var textField : String?
let itemValue: String?
}
struct SourceData: Codable ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Export MySQL table to CSV with custom header<p>Why when i try to export MySql table to CSV with <code>header('Content-Disposition:attachment; filename="'.$fi... | <p>put this code up in your application then application create view.<br>
I had same issue but i solved it this way..</p>
<ul>
<li>i put peace of code to function/block and place it over echo or render html</li>
<li>put exit; on the end of function/block</li>
</ul>
<pre><code>
if(isset($_POST['submit'])) {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Accessing Objective-C block from Swift<p>I have this Objective-C code in FileManagerHelper:</p>
<pre><code>+(void)getMyVideoObject:(NSString *)videoId compl... | <p>1) Add into your bridging header (-Bridging-Header.h file generated when you add .swift file to Objective-C project)</p>
<pre><code>#import "FileManagerHelper.h"
</code></pre>
<p>2) In swift code use the following call</p>
<pre><code>FileManagerHelper.getMyVideoObject("id") { (video, error) in
}
</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 LINQ query with DataGridView but a subset of table columns?<p>I am trying to learn from a code example from <a href="https://msdn.microsoft.com/en... | <p>It fails because your <code>select</code> statement is creating an anonymous class with two fields in it. It's no longer a <code>DataRow</code>, nor does the compiler know how to cast it back to a <code>DataRow</code> via <code>Cast<T>()</code>.</p>
<hr>
<p>One option is to stick with the method that works, ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
category() got an unexpected keyword argument 'category_name_slug'<p>I'm a beginner with django and was trying out the Tango with Django tutorial. But I'm ge... | <p>Your <code>category()</code> view expects the <code>category_name_url</code> parameter:</p>
<pre><code>def category(request, category_name_url):
...
</code></pre>
<p>But in the <code>urls.py</code> your define the <code>category_name_slug</code> parameter:</p>
<pre><code>url(r'category/(?P<category_name_sl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Removing or adding the empty word from a DFA<p><a href="https://i.stack.imgur.com/CY3kF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CY... | <p>What you have so far looks good but incomplete. Here's a description of what's left; writing it out in symbols is left as an exercise.</p>
<p>In the first case, if the language already contains the empty string, we're done and can use the automaton for the language directly with no modification. If it does not cont... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python3 argparse: When passing string as arg run funcA, if dashed arg run another func<h3>Here's what I'm trying to accomplish:</h3>
<p>When passing a string... | <p>This might help :</p>
<pre><code>parser.add_argument('text', nargs='?', help="write text to file")
</code></pre>
<p>more info : <a href="https://docs.python.org/3/library/argparse.html#nargs" rel="nofollow noreferrer">https://docs.python.org/3/library/argparse.html#nargs</a></p>
<hr>
<p>Note that you should use ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
resize and save files to s3 in meteor<p>Is there any best way to resize and save files to s3 in meteor.</p>
<p>I though about using <code>cfs</code> package... | <p>I've found that the following works in order to integrate <a href="https://github.com/ccorcos/meteor-clientside-image-manipulation" rel="nofollow noreferrer">Clientside Image Manipulation</a> with <a href="https://github.com/CulturalMe/meteor-slingshot" rel="nofollow noreferrer">Slingshot</a> (asynchronous code with... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to pass an exception to a handler and then rethrow the original exception?<p>I am trying to write code which is passed a handler for when erro... | <p>You can use the naked <code>throw</code> to rethrow the current exception.</p>
<p>Rewriting your <code>Handler2</code> to use this would give the following code:</p>
<pre class="lang-cpp prettyprint-override"><code>class Handler2 : public Handler
{
public: void handle(const std::exception& ex) const override
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Netbeans Lowercase Shortcut Not Working<p>Netbeans has a <a href="https://netbeans.org/project_downloads/usersguide/shortcuts-80.pdf" rel="noreferrer">nice s... | <p>To activate this shortcut you have to hit <kbd>Ctrl</kbd>+<kbd>U</kbd> then release <kbd>Ctrl</kbd> and then hit <kbd>L</kbd>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
iOS APNS Development [sandbox] vs Production<p>Guys I'm having some trouble figuring out the key differences between the APNS (push notification) Developer (... | <p>If you want to post your app to the app store you will need to use a Production Provisioning Profile, therefore all notifications sent with APNS Developer Certificate will not arrive to your app signed with a Production Provisioning Profile.</p>
<p>Why not use only a production APNS certificate? Well you can do thi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VBA Change Line Color<p>Simply wanting to change the line color of columns E and B , this is my code:</p>
<pre><code>Sub HistoricalProdUnitAndDemand()
' Cre... | <p>You can create that :</p>
<pre><code>Sub setColor(HexColors As Long)
Range("E").Interior.Color = HexColors
Range("B").Interior.Color = HexColors
end sub
</code></pre>
<p>Then you can place a line in your Sub HistoricalProdUnitAndDemand() like below :</p>
<pre><code>HistoricalProdUnitAndDemand()
[...]
set... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass different CorDapp config to different nodes when using MockNetwork<p>I am writing a test for flows using MockNetwork. There is a counter-flow on ... | <p>It is possible to have different config map to CorDapps installed on different mock nodes. This has to be done through <code>TestCordapp.withConfig(...)</code> passed into <code>MockNodeParameters.additionalCordapps</code> when creating each individual node, as opposed to <code>MockNetworkParameters.cordappsForAllNo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use of between operator in Sequelize?<pre><code>var conditionalData = {
id: {
$Between: [11, 15]
},
technician_id: technicianId
};... | <p><code>$Between</code> should be <code>$between</code>.</p>
<p>If you are using an <strong>older version</strong> of sequelize, you may need to remove the <code>$</code> too</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Showing a JTable in a JTree behaves differently with different look and feels<p>I have a JTree where some of the data to be shown should be shown in a JTable... | <p>I figured this out from the below link:</p>
<p><a href="https://www.daniweb.com/software-development/java/threads/386037/different-height-of-jtree-nodes" rel="nofollow noreferrer">https://www.daniweb.com/software-development/java/threads/386037/different-height-of-jtree-nodes</a></p>
<p>In essence, all that is nee... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I determine the version of Google Play services?<p>I am migrating from Eclipse to Android Studio. I have a project that I imported into Android Stud... | <p>You have the right idea by checking to make sure you do not have any updates.</p>
<p>The easiest way to check is simply when you have the latest downloaded in the Android SDK(locally).</p>
<p>I am using Mac OSX:</p>
<pre><code>~/android-sdk/extras/google/m2repository/com/google/android/gms/play-services/
</code><... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Horizontal form with 3 columns that stack when resized<p>On the web project I am currently working on we are using Bootstrap 3. We are using the a form-hori... | <p>Thanks to jme11 to getting me on the right track. I think I have figured this out - the following layout is exactly the look and behaviour that I need. Hopefully this will help someone else out in the future.</p>
<pre><code> <form class="form-horizontal">
<div class="form-body... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jenkins Groovy: What triggered the build<p>I was thinking of using a Groovy script for my build job in Jenkins because I have some conditions to check for th... | <p>I have something similar - I wanted to get the user who triggered the build, this is my code:</p>
<pre><code>for (cause in bld.getCauses()) {
if (cause instanceof Cause.UserIdCause) {
return cause.getUserName()
}
}
</code></pre>
<p>(bld is subtype of Run)</p>
<p>So, you can get the causes for your... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Some operators are not allowed by Lua<p>I'm having a really odd issue with a Lua implementation into my C++ project. For some reason, it doesn't allow script... | <p><a href="http://www.lua.org/manual/5.1/manual.html#2.5.5" rel="nofollow">The length operator</a> is a lua 5.1 addition. It did not exist in lua 5.0.</p>
<p>Similarly the default string metatable appears to be a lua 5.1 addition.</p>
<p>Compare the lua 5.0 implementation of <a href="http://www.lua.org/source/5.0/ls... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R: Update List Variable In Package<p>I have an R package that contains a list variable. Several functions in this package use this list variable.</p>
<p>I w... | <p>Have a look at function <a href="http://www.inside-r.org/r-doc/utils/getFromNamespace" rel="nofollow">utils::assignInNamespace</a>.</p>
<p>Assume you have defined the following code in a package called myPackage:</p>
<pre><code>tmpList <- list(a=5)
tmpGetList <- function(){ tmpList }
</code></pre>
<p>Then t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Irony Parsing a list delimited with white space<p>I am trying to write a parser for Allen Bradly SLC Language/File format. I have successfully got it to pars... | <p>Using the ValidateTokenMethod, and rejecting anything that was not A-Z Solved this issue.</p>
<p>The problem was that / was being interpreted as the start of a new Register Reference</p>
<pre><code>var SLCFilePrefix = new FixedLengthLiteral("Type", 1, TypeCode.String);
SLCFilePrefix.ValidateToken += (e, s) =>
{... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
asp.net | Data transfer from the Db by the Controller to the View<p><strong>Desc:</strong></p>
<ul>
<li>I get information from a database using EF</li>
</ul... | <p>You are passing <code>List<Karta></code> while in View is expecting <code>ParentView</code>.</p>
<p>So you should do this</p>
<pre><code>var karta = _ecpContext.Karta.Where(f => f.Miesiac == numerMiesiaca && f.Rok == numerRoku && f.Login == userName).OrderBy(x => x.Rok).ThenBy(x => x... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rounding a float to the closest integer within a distance cutoff<p>I have a <code>data.frame</code> with one column that specifies IDs and a few others that ... | <p>It can also be done without a loop by creating a logical <code>matrix</code></p>
<pre><code>dists <- ceiling(df[-1]) - df[-1]
i1 <- dists > 0.5
dists[i1] <- dists[i1] -1
i2 <- abs(dists) > 0.1
dists[i2] <- NA
df[-1] <- df[-1] + dists
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Run the command unix2dos <file_path> and to make sure I opened the file but it doesn't show me ^M any reason<p>I run the command <code>unix2dos <file_path... | <p>Thanks, @shellter I understand what you want to say.
anyway, unix2dos command works well but to confirm I can use <strong>cat -vet file</strong>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dynamically add QAction to a QToolbar and create classmethods<ol>
<li><p>I want a QToolBar to be instantiated like:</p>
<pre><code>tools = customTools(actio... | <p>OK. This works for now:</p>
<p>inside classmethod:</p>
<pre><code>def tool_name(self, f):
self.function = getattr(self, f)
self.function()
</code></pre>
<p>instantiate:</p>
<pre><code>def main():
names = ['action_one', 'action_two']
tools = customTools([name for name in names])
</code></pre>
<p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find and replace in xml file with Python<p>I am really new to Python.
I have a xml file with html inside and a csv file.</p>
<p>xml file example:</p>
<pre>... | <p>This code should do the trick:</p>
<pre><code>from csv import reader
with open('test.xml') as inputfile:
xml = inputfile.read()
with open('test.csv') as csvfile:
for row in reader(csvfile, delimiter=';'):
xml = xml.replace('{{%s}}' % row[0], row[1])
with open('output.xml', 'w') as outputfile:
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error with group by in DB2 - SQLSTATE 42803<p>I've got a SQL script and its failing. This is what it looks like:</p>
<pre><code>SELECT P.SOORT,P.TYPEBETALI... | <p>It is quite difficult to tell what you're trying to do without seeing your data. </p>
<p>But the error is saying that you have not specified how you are going to deal with the rest of the fields in your Group by aggregation:</p>
<p>P.SOORT, P.MIDDELCODE, P.HOEVEELHEID, P.EENHEID, P.BEDRAG, P.MIDDEL</p>
<p>If they... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using MapBox to add multiple GeoJSON sources to the same layer<p>I'm attempting to populate a map with data from <strong><em>multiple</em></strong> GeoJSON f... | <p>You're using the same layer id each time because it's hardcoded in the <code>GeoJSONToMap</code> method. Each layer needs to have a unique layer id.</p>
<p>You're using the same source id each time because it's hardcoded in the <code>GeoJSONToMap</code> method. Each source needs to have a unique source id.</p>
<p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set custom categories to a scatter plot in Power BI?<p>I'm trying to set custom categories for my scatter plot in Power B by writing this measure</p>
... | <p>As far as I know, you can't use a DAX formula to pass a color value.</p>
<p>What you can do is use a measure to assign a fixed value (a category) and then apply a color rule based on that.</p>
<p>I also think that some of the AND conditions in your formula are not working</p>
<pre><code>Categorize =
VAR _threshold ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Guzzle 5 - Get Response Body on ServerException<p>I am using Guzzle (latest 5.2) to do a POST call to a server. The API on this server returns a "HTTP/1.1 50... | <p>I've discovered a solution:</p>
<pre><code>$exception->getResponse()->getBody()
</code></pre>
<p>Could have sworn I tried that hours ago and it didn't work, but I guess not.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change multiple Matrix elements by Index Vectors<p>I have a matrix</p>
<pre><code>myMatrix <- matrix(data = 0, nrow = 4, ncol = 4)
[,1] [,2] [,3] [... | <p>We can <code>cbind</code> the row/column index, subset the <code>myMatrix</code> and assign values to 1</p>
<pre><code>myMatrix[cbind(rowIndexes, colIndexes)] <- 1
myMatrix
# [,1] [,2] [,3] [,4]
#[1,] 1 0 0 0
#[2,] 0 0 1 0
#[3,] 0 0 0 0
#[4,] 0 0 0 1
</code></p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use Future<T> interface?<p>i am wondering how future interfaces work in java for achieving asynchronous execution.</p>
<pre><code>Future<Map> x... | <p>You need to use the <a href="http://docs.oracle.com/javase/tutorial/essential/concurrency/exinter.html" rel="noreferrer">Executors framework</a></p>
<p>Create an ExecutorService, many types exist</p>
<pre><code>ExecutorService executor = Executors.newFixedThreadPool(1);
</code></pre>
<p>Submit a task</p>
<pre><c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
get sgml allow regex for "example.xom/page/200/"<p>I'm trying to get the regular expression for "<em>example.com/page/200/</em>". </p>
<p>Here's what I've d... | <p>You have an extra slash, and you need to use a raw string. And, since there is a single expression only, you don't need to pass a tuple to <code>allow</code>:</p>
<pre><code>rules = (Rule(SgmlLinkExtractor(allow=r"/page/\d+", restrict_xpath=('xxxxx',)),
callback="details", follow= True),)
</code></pr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Copying memory from address to buffer not copying<p>I'm writing a memory scanner and I want to be able to copy the memory content of a particular address to ... | <pre><code> ReadProcessMemory(mb->hProc, ...);
</code></pre>
<p>This is where your problem started, a common mistake when using the Winapi. You <strong>must</strong> add error checking, it is not optional. Failure to do so produces undiagnosable failure. Correct this to:</p>
<pre><code> BOOL ok = ReadProc... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Manually extract date from Rails date model object helpers<p>I'm working with a Rails (v5.1) form that uses <a href="https://guides.rubyonrails.org/form_help... | <p>These attributes are known as multi-parameter attributes and the the functionality is unfortunately buried deep inside of <a href="https://github.com/rails/rails/blob/4f66945cd038bda638fc6729e0d54663d0dfbf22/activerecord/lib/active_record/attribute_assignment.rb#L43" rel="nofollow noreferrer">ActiveRecord::Attribute... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why IConfiguration section mixes ienumerable values?<p>I want to use different appsettings.json files based on ASPNETCORE_ENVIRONMENT variable. My configurat... | <p>This behavior is unfortunately somewhat by design. The reason for this is the way configuration works under the hood. While you are usually writing configuration in a nested JSON structure, the parsed configuration is actually a flat key/value structure.</p>
<p>In your case, the configuration from your <code>appset... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
DRF throw django.core.exceptions.ImproperlyConfigured when override get_queryset<p>Django Rest Framework throw:</p>
<blockquote>
<p>django.core.exceptions... | <p>As per the <a href="https://www.django-rest-framework.org/api-guide/routers/#defaultrouter" rel="nofollow noreferrer">documentation</a>, the <code>basename</code> you provide when registering a <code>ViewSet</code> to your router will be used to generate the URL patterns. You provided <code>basename=CustomUser</code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to detect if entity exist in database<p>I have 2 entities, User and Profile. Profile has in-symfony relation with User, but there is no in-database relat... | <p>Found solution: its fetch: EAGER set to problematic mapping in doctrine.</p>
<p>By default doctrine uses LAZY fetching what results in using Proxy classes generated by doctrine for related entity. That class is almost same as real entity class. Difference is inside getter methods that before returning value perform... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Combine two Tables with identical structure<p>I got two tables which are identical where I am saving a question , surname and forename . One of it is for UK ... | <pre><code>SELECT * FROM (
SELECT SURNAME , FORENAME , Count(*) as RANK
FROM table_UK
GROUP BY SURNAME , FORENAME
UNION
SELECT SURNAME , FORENAME , Count(*) as RANK
FROM table_US
GROUP BY SURNAME,FORENAME
) as t
ORDER BY t.RANK DESC
LIMIT 10
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiple inputs to a function<p>I might just be missing a very obvious solution, but here's my question:</p>
<p>I have a function that takes a few inputs. I... | <p>try</p>
<pre><code>do.call(sampleFunction, sampleInput)
</code></pre>
<p><strong>P.S</strong> <code>sampleInput</code> must be a list. If it is vector use <code>as.list</code></p>
<pre><code>do.call(sampleFunction, as.list(sampleInput))
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Referencing a class from another project in a RazorPage<p>I have a ASP .Net Core 3.1 project named "<strong>MyProject.app</strong>", using Razor Pages. This ... | <p>So, here is my answer. You will be able to reproduce the problem even in your c# code if you add these <code>usings</code>:</p>
<pre class="lang-cs prettyprint-override"><code>using MyProject.app
using Utils.lib
</code></pre>
<p>Because <code>MyProject.app</code> contains the same namespace, the compiler cannot ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you store an array in core data (Swift)<p>My code reads a text file and stores the contents of the file in an array. I'm having trouble with the next ... | <p>You have only created one <code>newFruit</code>. Thus, your <code>for fruit in fruitArray</code> loop is just repeatedly reassigning the <code>fruitname</code> property.</p>
<p>Change your code to:</p>
<pre><code>for fruit in fruitArray {
var newFruit = NSEntityDescription.insertNewObjectForEntityForName ("Frui... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter: CustomPainter Destination image not dropping on BlendMode.src<p>I am trying to learn <code>CustomPainter</code>. I have created two rectangles succe... | <p>It seems to behave as expected.</p>
<p>Documentation of <code>Paint</code>'s <code>blendMode</code>:</p>
<pre><code>/// A blend mode to apply when a shape is drawn or a layer is composited.
///
/// The source colors are from the shape being drawn (e.g. from
/// [Canvas.drawPath]) or layer being composited (the gra... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Split and transform columns into aggregated columns<p>The data I have is as described below:</p>
<h1>Input:</h1>
<pre><code>df = pd.DataFrame({"col1&quo... | <p>We can do <code>melt</code> with <code>split</code> then <code>join</code> back </p>
<pre><code>s=df.melt(['col1','col2'])
s=s.join(s.variable.str.split('-',expand=True).rename(columns={0:'Year',1:'Month'}))
col1 col2 variable value Year Month
0 A1 B1 2015-1 231 2015 1
1 A2 B2 2015-1 432 ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Keys of Dict are not enconded when I read from txt - Julia<p>I read a .txt file (it contains a Dict) but the keys of Dict are with errors. In the original fi... | <p>If I am not mistaken you are reading the file as bytes, not as UTF strings. According to the answer to the linked duplicate question you should first convert the contents of the file to appropriately encoded strings and then parse it as JSON. This would go roughly the following way:</p>
<pre><code>s = open("dict.tx... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular 8 to 9, unable to import the service into the class that use inheritance<p>Upgraded Angular from v8 to v9. The project use its "unique" way of defini... | <p>The short answer is:</p>
<ul>
<li>All classes that are services or used as servies should be annotated with the <code>@Injectable()</code> decorator.</li>
</ul>
<p>Details answer is here: <a href="https://github.com/angular/angular/issues/19417#issuecomment-332851205" rel="nofollow noreferrer">https://github.com/a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I handle message passing from one object to another that has a common abstract class in C++<p>I have a base class INotify which has a virtual function... | <p>Change your Event class </p>
<pre><code>//Event class that sends message to Receiver
class Event:public INotify
{
public:
Event()
{
}
void notify(string msg)
{
container[0]->notify(msg);
}
vector<INotify *>container;
void add(INotify &obj)
{
container.push_back(&obj);
}
};
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Fucnction giving NaN response when calling it through another function<p>If I use a click event to call this function it works fine:</p>
<pre><code>canvas =... | <p>This is answered in the comments on the original post. It was fixed by just removing <code>var canvas = this;</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Read the value entered in text box in html form and use it by retrieving it in a php page<pre><code> <!DOCTYPE>
<html>
<h... | <p>You need to pass the trainno value in the ajax request using "data":</p>
<pre><code>$.ajax({
method: 'GET',
url: 'example.php',
data: { train: $('#trainno').val() },
success: function(Result){
var myObj = $.parseJSON(Result);
console.log(myObj.result);
},
error: f... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python search and replace not working<p>I have the following simple <code>HTML</code> file.</p>
<pre><code><html data-noop=="http://www.w3.org/1999/xhtml... | <p><code>open()</code> does not return a <code>str</code>, it returns a <code>file</code> object. Additionally, you are only opening it for reading (<code>'r'</code>), not for writing.</p>
<p>What you want to do is something like:</p>
<pre><code>new_lines = []
with open('test.html', 'r') as f:
new_lines = f.readl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Symfony: datetime property string contraint violation<p>I am currently learning how to use the Symfony framework. The project that I'm working on is a Web AP... | <p>Deleted: <code>@Assert\DateTime()</code> and everything worked again properly.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
datatables asp.net core razor pages IActionResult new JsonResult<p>How I can set the table content on selection change I am talking about datatables.js libra... | <p>Here is the process I use:
Summary:</p>
<ol>
<li><p>Declare a js variable at a top level scope </p></li>
<li><p>In the document.ready function, instantiate the data table to your global js variable </p></li>
<li><p>On ajax post clear the table via the stored object and then iterate the results and add the rows</p><... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MVC web application dll reference to console application<p>I am working on console application in which I need to refer ddl of MVC web application (wich is b... | <p>You need to include the connection string for the database in the MVC web.config file because in .NET the uppermost .config file in the chain will be the one that is used therefore disregarding the connection string in your app.config of your console app.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
guice injection in static variable<p>I Have doubt about guice injection.
Is it possible to inject a @named variable value to a static variable?</p>
<p>I hav... | <p>Guice does not inject static fields by design. You can <a href="https://google.github.io/guice/api-docs/latest/javadoc/com/google/inject/Binder.html#requestStaticInjection-java.lang.Class...-" rel="noreferrer">request static injection</a> but <a href="https://github.com/google/guice/wiki/Injections#static-injections... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
combine two group by queries to one to get count of both table's record in sql server<p>I have two queries to get Tutor and Parent Counts by Locations, are b... | <p>You can combine both query using a left join</p>
<pre><code>select a.locationid,
count(pa.AddressId) as parentcount, COUNT(ta.AddressId) tutorcount
from Address a
left join ParentAddress pa on a.Id=pa.AddressId
left join TutorAddress ta on a.Id=ta.AddressId
group by a.locationid
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cloud Endpoints won't require authentication<p>I've built a custom endpoints API with Google App Engine that communicates with a web client, and I've success... | <p>There's two auth layers to think about when dealing with endpoints:</p>
<ul>
<li><p>The Client ID layer, which manages what code from where, with what Client ID/secrets can call the API. You can read about this <a href="https://developers.google.com/accounts/docs/OAuth2" rel="nofollow">here</a>.</p></li>
<li><p>The... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Electron App Installation to ProgramFiles<p>What's the best way to make an electron app installer so that it installs it in ProgramFiles? I am using the elec... | <p>The installer will indeed install in %appdata% if you have set build/nsis/perMachine to false (which is default) in your package.json. If you set perMachine to true, the program will be installed in program files, and furthermore if you set oneClick to false, you allow the user to choose where to install.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dictionary elements corresponding to index<p>I have a list that looks something like this:</p>
<pre class="lang-py prettyprint-override"><code>x = ['6115587... | <p>You can just create a dict using <a href="https://docs.python.org/3/library/functions.html#enumerate" rel="nofollow noreferrer">enumerate</a>.</p>
<pre><code>>>> dict(enumerate(x))
{0: '6115587', 1: '2062443', 2: '7022702', 3: '6835792', 4: '3837115'}
</code></pre>
<p>If on the other hand, you need the op... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get Navigation data in View Model Windows phone 8<p>I'm using Mvvmlight INavigationService in the project, from view model I navigate to a view , and pass ob... | <p>You can use the NavigationService to evaluate the NavigationContext:</p>
<pre><code>GalaSoft.MvvmLight.Views.NavigationService _navigationService = [..] // Get your NS instance here or create a new one.
var m = _navigationService.GetAndRemoveParameter(NavigationContext);
// Try to cast:
MyModel model = m as MyModel... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to hide the action link printed at the bottom of each image<p>My page contains several images:</p>
<pre><code><a class="fancybox" href="img/16.jpg"&g... | <p>I can not reproduce the problem on chrome, so i guess its not because of anchor tag. And as Jackson already said, you might have, </p>
<pre><code>a:after {
content: " (" attr(href) ")";
}
</code></pre>
<p>in any of your css framework if you have used.</p>
<blockquote>
<p>if you're using Twitter Bootstrap as ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cant overriding class when mapping with NHibernate<p>I have one class "MyClass" mapping with NHibernate but at my database table name is upper case("MYCLASS... | <p>I found a solution, in mapping just have to add a property Table("TableName").</p>
<pre><code>public class MapMyClass() : ClassMap<MyClass>
{
public MapMyClass{
Table("MYTABLE");
Id(c => c.ID);
Map(c => c.NAME);
}
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I color one Y-axis line different from the other grid-lines?<p>In Rickshaw, I want to color one specific Y-axis grid-line different than the other Y-... | <p>Well I have something more idiomatic where I'm monkey patching the renderer and using D3 selectors:</p>
<pre><code>var y_grid = new Rickshaw.Graph.Axis.Y.Scaled({
graph: graph,
tickFormat: Rickshaw.Fixtures.Number.formatKMBT,
tickValues: y_tick_vals,
scale: scale
});
// Begin monkey business
var old_render ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Understanding Swift argument notation in functions like tableView<p>I came accros Swift recently but there is something I don't understand. I wanna implement... | <p>The differences are <strong>internal</strong> and <strong>external</strong> argument labels. You can use two different kinds of argument labels. Internal are used inside the function itself and external onces are used when you call the function.</p>
<pre><code>tableView(tableView: UITableView, numberOfRowsInSection... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
OpenCL: better to use macros or functions?<p>In OpenCL, which is C-99, we have two options for creating something function-like:</p>
<ul>
<li>macros</li>
<l... | <blockquote>
<p>But macros are basically guaranteed to be inlined, by the nature of macros.</p>
</blockquote>
<p>On GPU at least, the OpenCL compilers aggressively inlines pretty much everything, with the exception of recursive functions (OpenCL 2.0). This is both for hardware constraints and performance reasons.</p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
projecting points onto the sky<p>If I had a sphere with unit radius, and I had some points defined as latitudes and longitudes on that sphere, and I had a ca... | <p>A point at direction (x,y,z) at infinity has homogeneous coordinates of (x,y,z,0). So assuming that you use a typical view-projection matrices to describe your camera model, it is as simple as calculating</p>
<pre><code>P * V * ( cos(lon)*cos(lat), sin(lon)*cos(lat), sin(lat), 0 )'
</code></pre>
<p>and then procee... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change HTML value based on typescript value<p>I'm new to Angular, I'm trying to set a value to an input using typescript to an HTML input, it is working fine... | <p>You have to use arrow function for s3 instance to bind current component this context.</p>
<p><strong>Try this:</strong></p>
<p><strong>component.ts</strong></p>
<pre><code>uploadFile(file) {
const contentType = file.type;
const bucket = new S3(
{
accessKeyId: 'key',
secretAccessKey: 'ke... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
dplyr::filter used with a function on string representation of factor<p>I have a dataframe with some 20 columns and some 10^7 rows. One of the columns is an... | <p>Docendo Discimus gave the right answer in comments. To explain it first see the error I kept getting in my different attempts</p>
<pre><code>> dat %>% filter(europ.id(id))
Error in nchar(id) : 'nchar()' requires a character vector
Calls: %>% ... filter_impl -> .Call -> europ.id -> substring ->... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Try and Catch with Throws<p>So I came across this in our code, and I was wondering what the implication would be. </p>
<p>Java code:</p>
<pre><code>public ... | <p>This:</p>
<pre><code>throws SQLException
</code></pre>
<p>has no implications on this:</p>
<pre><code>try {
//something
}
catch (Exception e) {
//something
}
</code></pre>
<p>The two constructs "don't know about each other". </p>
<p>The <code>throws</code> clause declares that the method as a whole <em... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reduce the PDF file size of MPDF<p>I am creating a 15 to 20 pages PDF using MPDF on Form Submission. PDF file size comes around 2.5MB. Is there a way ... | <p>Compress your images.</p>
<p>Image <code>raven_tours_treks_logo.jpg</code> in your code is 619,75 kB. The file contains it twice - by compressing it correctly, you can save a megabyte or so.</p>
<p><code>raven_tours_treks.jpg</code> has almost a megabyte. It can safely be reduced to 80kB or so - another megabyte s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Provide extra context to all views<p>I'm putting together a project management website for my team using django. My base template includes a sidebar menu whi... | <p>You could use the <a href="https://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors" rel="nofollow noreferrer">template context processor</a>:</p>
<p><code>myapp/context_processors.py</code>:</p>
<pre><code>from django.contrib.auth.models import User
from myapp.models import Proje... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.