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:
Hiding dropdown with jquery is not working<p>In a Sharepoint site I need to hide a dropdown list that appears on the ribbon, the following code does not thro... | <p>The <code>.</code> characters in the <code>id</code> need to be escaped so that they are not interpreted as a <code>class</code> selector:</p>
<pre><code>$(document).ready(function() {
$("#Ribbon\\.Tabs\\.InfoPathListTab\\.Views\\.ddViews-Medium").hide();
});
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Inserting an image in GUI using QT Designer<p>I am new to QtDesigner. I wanted to know how to insert an image in the GUI using QT Designer. I am trying to ad... | <p>You can start inserting a label. Next, you right click on it an then click "change rich text...". A new window will pop-up.
Click on the figure Icon "Insert figure".</p>
<p><a href="https://i.stack.imgur.com/6h9i3.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/6h9i3.jpg" alt="Insert Figure"></a></p>
<p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to exclude "hidden" type fields while updating the form field values using jQuery<p>In my Django application, I am trying to update input fields using jQ... | <p>The css selector for hidden elements is <code>:hidden</code>, the one for excluding hidden elements is <code>:not(:hidden)</code> so <code>input:not(:hidden)</code> will select all input elements that aren't hidden:</p>
<pre class="lang-js prettyprint-override"><code>$('#'+tempNumTag + ' input:not(:hidden)').val(te... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
global on_message callback firebase flutter<p>In my app, I have configured firebase push notification and I have the configuration code as follows. It shows ... | <p>You should call FCM configure only once or you will run into problems (my experience anyway). If you call .configure in the initState of your home screen, any pages that are lower down the tree (subordinate) and that you navigate to and return from, will react to FCM notifications via the onMessage callback.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
photon chat unity plugin - how to know if a friend is online or not<p>I am using photon chat plugin in a unity3d multiplayer game. I have added some friends ... | <p>To get friends status updates you send a string array with their usernames to Photon.</p>
<pre><code>friends = new List<string>() { "Ford", "Zaphod", "Marvin", "Eddie" };
chatClient.AddFriends(friends.ToArray());
</code></pre>
<p>For all friends online you'll receive an initial update with the current status... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ThreeJS | Detect when an object leaves another object<p>I'm making a ThreeJS project in which I have <strong>planes (Object3D)</strong> flying inside a <stro... | <p><code>Box3</code> is not what you want to use to calculate sphere and plane collisions because the box won't respect the sphere's curvature, nor will it follow the plane's rotation.</p>
<p>Three.js has a class <a href="https://threejs.org/docs/index.html#api/en/math/Sphere" rel="nofollow noreferrer"><code>THREE.Sphe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why host process contains kubernetes pod process<p>when I am list process of host using this command:</p>
<pre><code>[root@fat001 ~]# ps -o user,pid,pidns,%... | <p>This is perfectly normal. <strong>Containers are not VM.</strong> </p>
<p>Every process run by Docker is run on the host Kernel. There is no isolation in term of <em>Kernel</em>.</p>
<p>Of course, there is an isolation in terms of process between containers, as each container's process are run in an isolated proce... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP object attributes not outputting properly<p>I have created a basic PHP Book class which is supposed to print out the $title, $author and $pages. My code ... | <p>remove $ </p>
<pre><code> class Book{
var $title;
var $author;
var $pages;
}
$book1 = new Book();
$book1->title = "Oliver Twist";
$book1->author = "Charles Dickens";
$book1->pages = 373;
echo $book1->title;
echo $book1 ->author;
echo $book1 ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pivot table result join with another table<p>I have these tables:</p>
<p><strong>packages</strong>
<code>id</code>
<code>package_name</code></p>
<p><strong... | <p>If you defined classes <em>relationship</em> in your Subject model, you can achieve related class objects and their properties right now without any changes in the query. </p>
<p>The issue can be in using reserved "class" word though. I would recommend avoiding such words in names. Use "subjectClass" or sort of.</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NGINX nested locations configuration<p>I am trying to configure nginx for a small static "webhosting" for a few products. I am trying to configure nested loc... | <p>Just use <code>rewrite</code> as it's more appropriate for your case, e.g.:</p>
<pre><code>rewrite ^/pets/rabbits/?$ /pets/rabbits.html last;
location /pets/ {
index index.html
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSS won't transition opacity<p>What I want to do in the bigger picture is delay the popup for a few seconds after page-load using pure <code>CSS</code>. I've... | <p>Put the transition on your initial element. </p>
<pre><code>.css-only-modal-check {
pointer-events: auto;
}
.css-only-modal-check ~ .css-only-modal {
/* FOR TRANSITION */
transition: opacity 3s;
}
.css-only-modal-check:checked ~ .css-only-modal {
opacity: 1;
pointer-events: auto;
}
.css-onl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NameError: name 'players_data' is not defined<p>I got this error. How to define the <strong>players_data</strong>?</p>
<blockquote>
<p>NameError ... | <p>It is hard to know what was the original value stored in players_data, as this is an incomplete code from another user; however, based on what they were doing, my guess is that players_data is:</p>
<p><code>players_data = train_data</code></p>
<p><strong>But, why??</strong></p>
<p>They used kmeans algorithm to cr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Oracle SQL get the most recent line per each id<p>I have the following query that returns a list of members with their id and their start and end dates as cl... | <p>Use a CTE and <code>row_number()</code>:</p>
<pre><code>with cte as (
<your query here>
)
select cte.*
from (select cte.*,
row_number() over (partition by id order by startdt desc) as seqnum
from cte
) cte
where seqnum = 1;
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make PHP return an error in a form in a specific location<p>I am making a user registration system with PHP and html. How can I make it so that if the... | <p>Have a look at this site:
<a href="http://www.w3schools.com/php/php_form_validation.asp" rel="nofollow">http://www.w3schools.com/php/php_form_validation.asp</a></p>
<p>Or as already stated, have a look at the jQuery validation plugin</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Placing integers into the next available position of an array inside of a for loop<p>Hi I am attempting to figure out how to iterate through integers, determ... | <p><a href="http://php.net/manual/en/function.array-push.php" rel="nofollow">array_push</a> maybe?</p>
<pre><code>if(isPrime($i))
{
//add to the next available position in $primes array;
array_push($primes,$i);
}
else
{
//add to the next available position in $nonPrimes array;
array_push($nonPrimes,$i)... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I enforce constraints on many-to-many relationships in PostgresSQL?<p>Suppose I have two tables: <code>thread</code> and <code>user</code>, with a jo... | <p>I could imagine a combination of triggers and constraints/indexes. Actually, you <em>could</em> just use triggers, but that requires handling updates, inserts, and deletes.</p>
<p>Instead, you can modify <code>threads</code> to have two additional columns:</p>
<ul>
<li>The number of users</li>
<li>An array of the... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
BottomNavigationView in a fragment, getting a 'must implement OnFragmentInteractionListener' error<p>I am using the Navigation Graph, and in one section of m... | <p>Sounds like you copy/pasted some code / left in part of some auto-generated sample code. If you're not using the <code>OnFragmentInteractionListener</code> interface, just remove that code.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
(Bootstrap 4) : Align Button with the text to be same line<p>How to align all <code>divs</code> to be center on the same line. What I mean I want the button ... | <p>To center align them, make the columns <code>d-flex</code> and use <code>align-items-center</code>...</p>
<pre><code> <div class="row text-center py-4 align-content-between flex-wrap">
<div class="col-lg-4 d-flex justify-content-center align-items-center">
<p class="text-second... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove double opacity caused by use of pseudo elements<p>I am using pseudo elements to dynamically draw segments of circles. My problem is now that I ... | <p>Ok, I see the problem now. If you don't want specific elements to be partially opaque between them but want to be partially opaque with the rest, I recommend to add all those elements inside another element and use the <code>opacity</code> CSS property. Because <code>:before</code> and <code>:after</code> pseudo-ele... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get specific fields using an Angular $resource<p>Is there a way to get specific fields with an Angular $resource? Without creating a new REST endpoint that s... | <p>its all about how you configure your endpoint if you $resources can be parameterized and take key, value pairs to specify query query string params and path based on the url template you used to create the resource ie</p>
<pre><code> var Person=$resource('/url/person/:id')
Person.get({fields:['name','ssn']})
</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to show the target location at a particular position of the map container<p>I created a simple map like in this example from the Leaflet.js tutorial:</p>... | <p>That's easy to do using two utility methods of <code>L.Map</code> called <a href="http://leafletjs.com/reference.html#map-latlngtocontainerpoint" rel="nofollow">latLngToContainerPoint</a> and it's counterpart <a href="http://leafletjs.com/reference.html#map-containerpointtolatlng" rel="nofollow">containerPointToLatL... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ImageMagick v7 distortion<p>I have installed ImageMagickV6 on my linux machine since forever, and recently setup this command to process a distorted image:</... | <p>I will start with this as a first stab and improve it if you provide a sample of what the input and output images are supposed to look like, and if you tell me what errors you get on your Windows box with it:</p>
<pre><code>magick ref_25X.tif -virtual-pixel Gray ^
+distort Plane2Cylinder 60. ^
-rotate... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel 5 input old is empty<p>My routes is here <br></p>
<pre><code>Route::get('sign-up', ['as' => 'signUp', 'uses' => 'UserController@signUpGet']);
... | <p>Your problem looks like you are not actually submitting the username in the first place:</p>
<pre><code><form role="form" method="POST" action="{{route('signUpPost')}}">
<input type="text" class="form-control" name="username" value="{{ old('username') }}">
</form>
</code></pre>
<p>There ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Red Squiggly Lines Appearing Beneath ZipFile.ExtractToDirectory<p>I've got <code>ZipFile</code> method I've been using but it's not working anymore. The code... | <p>You need to add a using directive to the top of your file:</p>
<pre><code>using System.IO.Compression;
</code></pre>
<p>And, since I'm not sure what code you're using, this is how you can extract a Zip File:</p>
<pre><code>ZipFile.ExtractToDirectory(sourceFilePath, destinationPath);
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
angular input checkbox remove field<p>I'm fighting with angular input checkboxes. I have a simple input that looks like this...</p>
<pre><code><input ty... | <p>I had same problem. You can solve it just by deleting <strong>"required"</strong> in checkbox. As I understand it's just</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Display MySQL query result as HTML tables per row<p>I tried to search but didn't find anything that would help me so I created a new thread.</p>
<p>I have M... | <p>Go like this...and place your data accordingly..</p>
<pre><code><table>
<tr>
<th> <!--your table headers -->
...
</th>
while($row = $result->fetch_assoc()) {
<tr>
echo '<td>'.$row["btitle"].'</td>';
echo '<td>'.$row["basin"].'</td>'; //your table data
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Stop table from being generated IF less then X<p>I have a table that is generated upon REST API, I generate for the first 50 in the result. My issue is if th... | <p>Don't compare</p>
<pre><code>$x<50
</code></pre>
<p>but</p>
<pre><code>$x < $responseFromRest && $x < 50
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make superscripts inside glue?<p>I would like to be able to make superscripts inside a <code>glue()</code> function:</p>
<pre><code> glue::glue("{s... | <p>Given your end goal is to format something in <code>{ggplot2}</code> you can use the <a href="https://github.com/wilkelab/ggtext" rel="nofollow noreferrer">{ggtext}</a> package to apply markdown formatting to your labels:</p>
<pre class="lang-r prettyprint-override"><code>library(tibble)
library(ggplot2)
your_sequ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error using self created tableviewcell<p>I'm trying to design a <code>UITableView</code> and a customized <code>UITableViewCell</code> class, however, whenev... | <p>Did you correctly implement the UITableViewDataSource & UITableViewDelegate?
Especially, in the cellForRawAtIndexPath function you should have something like this:</p>
<pre><code>let cell = tableView.dequeueReusableCellWithIdentifier("Cell") as TableViewCell
</code></pre>
<p>"Cell" refers to the identifier of ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VirtualDocumentRoot handling non-existent folders<p>Using Apache, I have set up the VirtualDocumentRoot and it works this way:</p>
<pre><code><VirtualHos... | <p>If you have virtual subdomains that are mapped to folders then couldn't you just check for the existance of the document root? If not exists redirect to the <code>404 subdomain</code> which in turn should use <code>/home/domains/example.com/404</code> perhaps like this. </p>
<pre><code><VirtualHost *:80>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why An error is created when creating the token<pre><code> public static void CreateToken()
{
HttpClient client = new HttpClient();
clie... | <p>The <a href="https://developer.paypal.com/docs/api/get-an-access-token-postman/" rel="nofollow noreferrer">documentation</a> specifies that you should pass the username and password using <a href="https://en.wikipedia.org/wiki/Basic_access_authentication" rel="nofollow noreferrer">basic authentication</a> and that y... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
combining and create new columns based on set values<p>I have a dataframe that has the following:</p>
<pre><code>RECORDID FEEDBACK
1234 Phrase1
1234 ... | <p>We can group by 'RECORDID', select the 'Phrase' elements with a logical index and <code>summarise</code> by <code>paste</code>ing the 'FEEDBACK' column</p>
<pre><code>library(dplyr)
library(stringr)
df1 %>%
filter(!is.na(FEEDBACK) & FEEDBACK != "") %>%
mutate(flag = str_detect(FEEDBACK, '^Phrase\\d+... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Performance issues pertaining to drawRect in iOS on Swift<p>Thank you for taking the time to read my thread. Recently i’ve been developing a simple iOS free-... | <p>I wrote a couple of tutorials a few years ago about drawing in iOS using Objective-C. You might be able to translate this code into Swift without too many problems.</p>
<p>The first article talks about how you can render the on-screen graphics context into an image every time the user lifts his finger from the scre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove item from view when removed from collection<p>I'm using Backbone.js. I am listen to the "add" event of my collection</p>
<pre class="lang-js prettypr... | <p>You have to keep a mapping table between your collection and the model views. When the remove event is trigger based on that mapping table you know which element from DOM should be removed or which is the view.</p>
<p>in addOne function you could setp the view on your model</p>
<pre><code>addOne: function (as) {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calling user-defined database functions<p>Is this possible? I mean, I'm basically looking to do the following...</p>
<p>I have created a function already in... | <p>You can use the <a href="http://blog.3d-logic.com/2014/08/11/the-beta-version-of-store-functions-for-entityframework-6-1-1-code-first-available/" rel="nofollow">Code First Functions convention</a> to invoke stored procedures, TVFs and scalar UDFs from Code First (EF 6.1.1).</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Files missing in cocoapod<p>I have an already developed code with 5 libraries added in pod target. Currently one of them is shown missing (in red) , but it i... | <p>Running "pod update" solved the problem for me.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get time left in a java.util.Timer?<p>How can I get the time left in a util.Timer?
What I want to do is to add a progressbar that displays time left u... | <p>You would need a second timer to refresh the gui in a specific interval.<br>
Another way to achieve this, would be to activate a single timer every second and update the counting in the ui. If the time is up, call your specific action.</p>
<p>A simple expample with console output only:</p>
<pre><code>TimerTask tas... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How does a Keycloak client validate a token<p>I would like to know how does a Keycloak client validate the token, other than checking the signature.
I mean i... | <p>In OIDC normally the token is not actively checked by sending it to the keycloak server everytime. Instead the token is only checked locally (by signature verfication with the servers public key). </p>
<p>So you are right, a logout is not immediately recognized by a client.</p>
<p>Because of that you often have a ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Editing PowerPoint presentation footer from Word VBA<p>I have code in Word that copies a folder, pastes the folder in a similar area, and renames the files t... | <p>In order to change a setting in a <code>HeaderFooter</code> object it's necessary to make sure the object is "visible", otherwise it doesn't exist. So, for example</p>
<pre><code>With oPPTFile.Slides(1).HeadersFooters.Footer
.Visible = True
.Text = "Volcano Coffee"
End With
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Count of matching values in matrix columns<p>I'm not really sure how to word this correctly but I would like to count the number of times there are similarit... | <p>You're on the right track:</p>
<pre><code>result <- t(m) %*% m
dolphins jets bills
dolphins 2 0 2
jets 0 1 1
bills 2 1 3
</code></pre>
<p>Alternatively,</p>
<pre><code> result <- crossprod(m)
</code></pre>
<p><strong>Edit</strong> I was reminded in ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Which is a larger overhead: Creating a new socket each time or maintaining a single socket for data transfer<p>Which is the best method for sending a data us... | <p>It depends on the kind of socket, but in the usual cases it is better to keep the socket unless you have very limited resources.</p>
<ul>
<li>UDP is connectionless, that is you create the socket and there is no delay because of connection setup when sending a packet. But there are still system calls involved and al... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Xcode 6 and Constraints - Greyed out equal widths option<p>I am trying to use the constraints on xcode 6 with side-by-side objects but when I use the "add mi... | <p>You need to right-click drag from one of the objects to the other one to enable that option (It needs to know what heights should be equal)</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to know in which file it is a referenced fp is currently writing in?<p>The idea is, main opens few files, and writes to them given a condition, fp is pas... | <p>This is OS specific and there is no standard way. If you want to do it consistently you can define some data structure that will hold pathname along FILE handle and pass that around instead of plain FILE:</p>
<pre><code>struct file_handle {
FILE *fs;
char *path;
};
</code></pre>
<p>Usually, there is no direct... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
concatenate strings and coalesce<p>I have a query that selects rows from three different tables:
<code>TableA</code>, <code>TableB</code> and <code>TableC</c... | <p>When adding ' / ' and Name, you get null if name is null. Therefore you can remove them simply by adding.</p>
<p>Try this:</p>
<pre><code>SELECT
A.Name,
B.Name,
C.Name,
CONCAT(A.Name, ' / '+ B.Name, ' / '+ C.Name) AS Full_name
FROM
...
</code></pre>
<p>Sample in <a href="http://www.sqlfiddle.com/... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
(C) parsing std in into a linked list, infinite loop<p>For some reason the code keeps segfaulting after the first printf at the for loop near the end. It doe... | <pre><code>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define MAX_LINE_SIZE 1024
struct node
{
char fullString[MAX_LINE_SIZE];
char fileName[MAX_LINE_SIZE];
int lineNumber;
char filler[MAX_LINE_SIZE];
struct node *next;
};
int main (int argc, ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
print.xtable messing up html tags<p>I face difficulties using <code>print.xtable</code> to insert a html table inside another table.</p>
<pre><code>DF=data.... | <p>The problem is that the default <code>sanitize.text.function</code> is changing the html tags. You can try to reset it to a function that does not change anything (setting it to <code>NULL</code> will call the default:</p>
<p><code>print.xtable(xtable(DF,digits=2), type="html",sanitize.text.function=function(x){x})... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In drupal 7 user access only files assigned to him<p>Hello I want to user in system have files that only that registered user can open. And there is no other... | <p>To do it without modules, see this page:<br>
<a href="https://www.drupal.org/node/1792780" rel="nofollow">https://www.drupal.org/node/1792780</a> </p>
<p>Or here are a couple of modules:<br>
<a href="https://www.drupal.org/project/file_access" rel="nofollow">https://www.drupal.org/project/file_access</a><br>
<a hr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Syntax error when adding js file in runtime<p>So i am trying to add a js file at runtime i have this simple HTML</p>
<pre><code><!doctype html>
<he... | <blockquote>
<p>XMLHttpRequest cannot load file:///G:/tt/Desktop/black%20box/bots/test.js?_=1424695256510. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.</p>
</blockquote>
<p><code>getScript</code> loads files via Ajax. You can't... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Arbitrary number of different groupby levels in one go<p>Is there a way to compute arbitrary number of different groupby levels in one go with some pre-built... | <p>Assuming you look for a general way to create all the combinations in the <code>groupby</code>, you can use <a href="https://docs.python.org/3.8/library/itertools.html#itertools.combinations" rel="nofollow noreferrer">itertools.combinations</a>:</p>
<pre><code>from itertools import combinations
col_gr = ['name', '... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Open Windows Explorer from Outlook to choose template<p>I am trying to write a macro that allows a user to select a .oft from a directory. I have been able t... | <p>After some digging around I got this to work. I am obviously a VBA noob so i take no credit for the code - I was just able to mash it together and get it to work. Maybe someone in the future will find it helpful.</p>
<pre><code>Public Function aBrowseForFile(aStartFolder As String) As String
On Error GoTo Err_txtB... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
boost::interprocess scoped_allocator AND Containers of containers NOT in shared memory<p>I have a similar question as before in <a href="https://stackoverflo... | <p>Well. I'm not sure what was the challenge, beyond... yes let's make the allocator a template argument, and define</p>
<pre><code>namespace Shared {
typedef bi::managed_shared_memory::segment_manager segment_manager_t;
typedef bc::scoped_allocator_adaptor<bi::allocator<void,... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java Properties vs Android SharedPreferences<p>The goal seems to be the same: to store key-value pairs. Is there a difference in concept between one and the ... | <p>As far as I can tell, <code>Properties</code> is a <code>HashTable</code> that lets you store key-value pairs on memory with the option of persisting them in XML(and other formats). I do not know where this XML would be stored in Android; you probably need to define a location.</p>
<p><code>SharedPreferences</code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP Parse error syntax unexpected T_ECHO in line 20<p>I really don't see the error, i am working with PHP and HTML, and i don't know what means a T_ECHO erro... | <p>You close your last if and then try to else it.</p>
<pre><code>if($la<3 || $cont<4){echo'</div></div></div>';}
}else{echo'No hay ningun producto registrado';}
</code></pre>
<p>Should be</p>
<pre><code>if($la<3 || $cont<4){echo'</div></div></div>';
}else{echo'No hay ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Invite Facebook friends to my iOS app that is not a game with custom UI<p>I want to invite Facebook friends the way Rounds iOS app work (i.e. show the list o... | <p><a href="https://developers.facebook.com/docs/apps/faq#invite_to_app" rel="nofollow">https://developers.facebook.com/docs/apps/faq#invite_to_app</a></p>
<p>You are supposed to use the Message Dialog on iOS to invite friends. There is no need to get the whole friendlist for that, the user can just select his friends... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JS function return an array containing objects<p>I ran into the following problem.
For a project I get multiple cartesian coordinates (XYZ) which I process i... | <p>It is because the </p>
<pre><code>var location = new Coord("", "", "");
</code></pre>
<p>is not inside the loop, therefore, you keep the same reference of the object and update all indexes</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# MongoDB Update / Upsert List<Object> to Collection<p>I was searching for a way to Update / Upsert in MongoDB a List of items to a MongoDB collection.</p>
... | <p>try a bulk replace like so:</p>
<pre class="lang-cs prettyprint-override"><code> var models = new List<WriteModel<Product>>();
foreach (var product in Config.Products)
{
if (product.ID == null) product.ID = ObjectId.GenerateNewId();
var upsert = new ReplaceOneModel&l... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find customer buying a product after purchasing another<p>I have a business logic question that I do not know how to correctly formulate the sql statement to... | <p>Assuming you're on 12c or higher, you can do this with <a href="https://oracle-base.com/articles/12c/pattern-matching-in-oracle-database-12cr1" rel="nofollow noreferrer">pattern matching (match_recognize)</a>:</p>
<pre><code>CREATE TABLE TEST2 (
customer VARCHAR2(26 BYTE),
purchase_date DATE,
Produ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spark: Sort records in groups?<p>I have a set of records which I need to:</p>
<p>1) Group by 'date', 'city' and 'kind'</p>
<p>2) Sort every group by 'prize... | <p>You need define a Key and then mapValues to sort them. </p>
<pre><code>import org.apache.spark.{SparkContext, SparkConf}
import org.apache.spark.rdd.RDD
import org.apache.spark.SparkContext._
object Sort {
case class Record(name:String, day: String, kind: String, city: String, prize:Int)
// Define your... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Retrieving Drools fact from main scope (Scala)<p>I'm currently inserting an object into Drools working memory and running rules on it (creating a new object ... | <p>After looking around and some prolonged trial and error I realised that FactHandles didn't quite work the way I expected. I was under the impression that they were an ID assigned to an object and that updating the object would mean that it kept its FactHandle (apparently not).</p>
<p>I went about this by creating a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Depending on which parameters can config binding WCF<p>what is config The best For binding WCF in terms of closetimeout, buffer , send Time out and etc .the ... | <p>Your question is kind of hard to understand. There is not a given "best" binding configuration for all wcf services (in that case it would be the only one) - it all depends on your application and the requirements on your application!</p>
<p>Here are two good starting links on msdn:</p>
<p>(1) <a href="https://msd... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sympy name Heaviside not defined within lambdifygenerated<p>The Heaviside function should be built in to Sympy and Numpy, but the following code gives the er... | <p>Several problems with <code>lambdify</code> seem to be occurring simultaneously. I think I could get things working, but you should check whether it makes sense, as I'm not familiar with the specific equations.</p>
<p>In general, calling <code>from sympy import *</code> together with <code>from numpy import *</code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JSF / primefaces Session - Session gets lost<p>I´m new at JSF programming and got a problem with my login/session which gets lost after the login.</p>
<p>I ... | <p>Your <code>LoginController</code> bean looks like its annotations are okay and the code looks like it should work. However, there's a couple other things that you may want to check. Some of this may be obvious but your question is missing a few details so I’m not sure what level of experience you may have and where ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
asterisk random generation using rand in php<pre><code>$r = array(
array('.','.','.','*','.','*','.','.','.','*','.','*','.','.','.','.','*','.','*','.'),
ar... | <pre><code>function generateRandomString($length = 20) {
$characters = '.....*...***..***.*.*';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
for ($i = 0; $i <20; $i++)
{
e... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
error loading jupyter notebook permission denied: ipynb<p>I was working in a jupyter notebook until it froze. It wouldn't save or shut down so I restarted my... | <p>I had possibly the same problem. In my case the problem was that jupyter notebook must have crashed or had some problem whilst autosaving.</p>
<p>As a result, in the folder where the notebook is saved there's a temporary file called ".~nameofnotebook.ipynb".</p>
<p>This file didn't show up in jupyter notebook, but... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Background of 4 images added for each other<p>Please help.</p>
<p>I have 4 pictures.
I wanna show background with animation.</p>
<p>Each picture should fal... | <p>I wrote for you but in objective-c, I think you can convert it to swift.</p>
<pre><code> SKSpriteNode *bg1 = [SKSpriteNode spriteNodeWithImageNamed:@"bg1"];
bg1.zPosition = 1;
SKSpriteNode *bg2 = [SKSpriteNode spriteNodeWithImageNamed:@"bg2"];
bg2.zPosition = 2;
SKSpriteNode *bg3 = [SKSpriteNode ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Linking a chain of IDs (self referential table)<p>We have a League table, and now want the ability to roll leagues over (when a league finishes, start it aga... | <p>SQL Server can do <a href="https://technet.microsoft.com/en-us/library/ms186243%28v=sql.105%29.aspx" rel="nofollow">recursive queries</a>, and there are various ways of modelling linked lists, but do you really need to? Could you take a different approach and have a league-definition table that holds the constant de... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make an admin panel or admin application for e-commerce android application<p>I am making an e-commerce application and I want to make an admin panel ... | <p><a href="https://i.stack.imgur.com/vEkZq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vEkZq.jpg" alt="enter image description here"></a>You could make a separate application which can only be accessed by admins and link this application to the same firebase database. Then implement all the admi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does gulp quit without finishing my task?<p>I have the following gulp task:</p>
<pre><code>var jade = require('gulp-jade');
var data = require('gulp-dat... | <p>The problem is, you have a bug in your <code>.jade</code> file which is causing <code>gulp-jade</code> to throw an error. Ideally, <code>gulp-jade</code> would throw a friendlier gulp error, giving you more info than just a blank screen but, since it's not, you need to handle this error yourself. You can either use ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
rspec stub to allow [hash_key] to be passed<p>How do you create a rspec method stub to allow a response from a method that takes in the hash key to return it... | <p>The line <code>menu.menu_items[item]</code> is in reality composed by 3 method calls. <code>[]</code> is a call to the method <a href="http://ruby-doc.org/core-2.1.5/Hash.html#method-i-5B-5D" rel="noreferrer"><code>[]</code></a> on the <code>Hash</code> returned by <code>menu_items</code>.</p>
<p>I assume <code>men... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
OpenCV - absdiff with a mask<p>I am trying to calculate the absolute difference of two images using a mask so only a region of the images is considered in ca... | <p><code>difference * mask</code> meaning that you are performing <a href="https://docs.opencv.org/4.1.1/d2/dab/group__core__hal__interface__matrix__multiplication.html" rel="nofollow noreferrer">Matrix multiplication</a>, in this case the height of difference must be the same as width of mask, if you want to perform a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
best practice to select and modify entries in nested vectors<p>I'm looking for an efficient way to solve the following (presumably easy) problem: </p>
<ul>
... | <p>Having <code>va</code> on the stack is not necessarily a problem, as long as you move <code>va</code> to its new location. In that case your "moved to" vector will internally point to the storage allocated by your "moved from" <code>va</code> vector (and the original <code>va</code> will become empty).</p>
<p>What ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Setting div elements in front<p>I have the following code.</p>
<p>What I would like to have happen is when an item is checked a new div is created at the to... | <p>Make the image div position:absolute instead of the image inside of it:</p>
<pre><code>a>div {
position:absolute;
margin: 10px 5px;
display: none;
}
a:hover>div {
display: block;
}
</code></pre>
<p>Making it absolute takes it out of the flow of page content, so it can be above everything else.</p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Read the Authors of an Assembly<p>It's quite easy to read some metadata of an assembly, just load the <code>Assembly</code> and then get the custom attribute... | <p>There is <em>No</em> assembly <code>Attribute</code> for <code>Authors</code> neither can it be queried via <em>Reflection or Shell32</em></p>
<p><a href="https://i.stack.imgur.com/oiOQJ.png" rel="nofollow noreferrer">Here's</a> a list of <em>AssembyInfo</em> attributes and <code>Authors</code> is not one of them</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiline pattern with one line of any content included<p>I need to count the occurance of a <strong>multiline pattern</strong> of 3 lines in a htm file. The... | <p>You could use the below <code>pcregrep</code> command.</p>
<pre><code>pcregrep -Mc '^line 1\n[^\n]*\nline 3' file
</code></pre>
<p><strong>Example:</strong></p>
<pre><code>$ cat file
line 1
changing line 2
line 3
foo
bar
buz
line 1
changing line
line 3
foo
bar
buz
line 1
bar
line 3
$ pcregrep -Mc '^line 1\n[^\n]*... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python - subprocess and the env argument<p>I'm finishing up with a project and there is only one thing left for me to do;
looking at an elegant way to launc... | <p>Pass the <code>env</code> parameter to the <a href="https://docs.python.org/3/library/subprocess.html#subprocess.Popen" rel="nofollow noreferrer"><code>subprocess</code></a> function (<code>Popen</code> in your case). To modify the environment of the calling process, make a copy of <a href="https://docs.python.org/3... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wcf service saving changes to database using entity framework<p>I am trying to update/add data using wcf service and entity framework. I have 2 implementatio... | <p>Looks like you have 2 versions of Employee:<br/>
one in 'iPos.Interfaces.Employee'<br/>
another in 'iPos.Service.employee'<br/></p>
<p>Even if they use the same source code, for the compiler they are 2 different classes.<br/>
Just use only one.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rename sequential files to a row/column format<p>I have a number of files numbered from 1 to 128.</p>
<pre><code>image-1
image-2
...
image-10
...
image-99
.... | <p>You just posted a code request with no further effort to explain the problem...</p>
<p>Well, here it is the code you requested:</p>
<pre><code>@echo off
setlocal EnableDelayedExpansion
set "b=abcdefgh" & set "c=0"
for /L %%b in (1,1,128) do (
set /A "d=(a=%%b%%16)+16*^!a+100"
for %%c in (!c!) do echo re... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Exract a id from git show using power shell<p>I have the below input from a GIT show:</p>
<pre><code>commit d5089c3135e104c2b508fe58d98596c96b2ae19a Merge: ... | <p>After you find the <code>id</code>enclosed in double-quotes, get everything <em>not</em> a double quote:</p>
<pre><code>$id = if ($build -match '\bid="([^"]+)"') { $Matches[1] }
# this ^^^^^
</code></pre>
<p><strong>Update</strong>: based on comments, guessing the actual <code>git</code> ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
twitter login not working on my server<p>When I try to login from server</p>
<pre><code>[http_code] => 401
[url] => https://api.twitter.com/oauth/requ... | <p>I think your server time has not set properly</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add-AzureRmAccount : Unable to find an entry point named 'GetPerAdapterInfo' in DLL 'iphlpapi.dll'<p>I am running Azure Automation Runbook which has PowerShe... | <p>I can reproduce the issue with your script on my side.</p>
<p><a href="https://i.stack.imgur.com/RyAy5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RyAy5.png" alt="enter image description here"></a></p>
<p>To fix the issue, change your script into the one below, it will work fine.</p>
<p><st... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I select an alternative if my first Select result is null?<p>In my SQL, I have the following:</p>
<pre><code>SELECT
[PhotoImageID]
,[PhotoIm... | <p>Use if exists to check if your query contains records.</p>
<pre><code>IF EXISTS(SELECT top 1 FROM [Exchequer].[dbo].[TBL_SS_PhotoImages] with (nolock) where PhotoLinkID = @stCode)
Begin
SELECT [PhotoImageID]
,[PhotoImage]
,[PhotoLinkID]
,[Comment]
,convert(varchar,[Timestamp],13) as [Timesta... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why doesn't c++ allow (auto) casting?<p>When converting from for example a void* to a PMY_OBJECT, one would have to do something like this:</p>
<pre><code>v... | <p>You could write <code>auto_cast</code> yourself:</p>
<pre><code>#include <utility>
template <typename From>
class auto_cast {
public:
explicit constexpr auto_cast(From const& t) noexcept
: val { t }
{
}
template <typename To>
constexpr operator To() const noexcept... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Symfony 4 using Logger and Dump inside a Controller<p>I'm new to Symfony 4, I'm using profiler to debug in a dev environment.</p>
<p>I'm trying to debug a ... | <p>Normally the best way to define the route is to use the annotation. You are new and i don't how know you have defined your route.</p>
<p>But if seems that your functions isn't called. So try to set a route and call it in your browser.</p>
<pre><code>/**
* @Route("/mycrud", name="mycrud")
*/
public function batch... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to build a Kony iOS Project using commandline<p>My aim is to build a Kony Project for the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenki... | <p>You need to copy the "<strong>com.kony.ios_5.5.x.jar</strong>" file and rename it to "<strong>com.kony.ios_5.5.x.zip</strong>".</p>
<pre><code> Unzip the "com.kony.ios_5.5.x.zip",
The unzipped folder contains 5 files, one of it is "**iOS-GA-5.5.x.zip**".
Make sure that you DO NOT delete any of these 5 f... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
cURL Download Zip File - " argument is not a valid File-Handle resource"<p>I'm trying to download a zip file from a server I host and store it on another ser... | <p>Your problem is that you have to pass a filehandle to <code>CURLOPT_FILE</code>, not the filepath. Here is a working example</p>
<pre><code>$ci = curl_init();
$url = "http://domain.com/images/images.zip"; // Source file
$fp = fopen("/directory/images.zip", "w"); // Destination location
curl_setopt_array( $ci, array... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Problems with a table selection<p>I'm trying to select the contents (the range X11:Xnn) of the table:</p>
<pre><code> ... | <p>Your main issue is that you are not returning the location of the keywords so that you may use them later. Lets capture those results and we can offset them we we call the range.</p>
<pre><code>Sub Macro3()
Dim rngKeywordOneLocation As Range
Dim rngKeywordTwoLocation As Range
Set rngKeywordOneLocation ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Upload multiple file with ajax and laravel not work<p>i have some problem with my code. The problem is when i upload multiple file with Jquery Ajax(Front) an... | <p>I think the problem is that you use <code>time()</code> to generate random file name on both cases. Since each line is likely to take less than a second, <code>time()</code> will return the same value for both, meaning that file#2 will have the same name as file#1 and will override it.</p>
<p>Try using different fi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Tie skaffold profile to cluster<p>Building off another one of my questions about <a href="https://stackoverflow.com/questions/60061593/tie-skaffold-profile-t... | <p>After digging through the <a href="https://skaffold.dev/docs/" rel="nofollow noreferrer">skaffold documentation</a> and performing several tests I finally managed to find at least partial solution of your problem, maybe not the most elegant one, but still functional. If I find a better way I will edit my answer.</p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to syntax-highlight HTML inside JavaScript strings in VS code?<p>Is there any Vs Code extension to syntax-highlight HTML inside JavaScript strings?</p>
... | <p><strong>If you use lit-html</strong>, There's a plugin in vs code called lit-plugin for syntax highlighting.
Syntax is,</p>
<pre><code>const markup = content => html`
<div>
<table>
${content}
</table>
</div>
`;
</code></pre>
<p><a href="https://i.stack.imgur.com/Ib01E.p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What are the various branches in a github "project page" cloned repository?<p>I have a GitHub repository that I've cloned to my local.</p>
<p>When I run <co... | <blockquote>
<p>What is the difference between refs/heads/HEAD and refs/heads/master?</p>
</blockquote>
<p>It is like a symbolic link (a symref) in order to reference the branch by default (the one you see when you clone)<br>
See "<a href="http://git-scm.com/book/en/v2/Git-Internals-Git-References#The-HEAD" rel="nof... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to automatically increase height of JFrame when I am adding components one by one dynamically<p>I am designing a swing standalone application. In my appl... | <p>Add a ContainerListener to your JFrame. In the componentAdded method, pack the JFrame. Something like this:</p>
<pre><code> JFrame frame = getJFrame();
frame.addContainerListener(new ContainerListener() {
@Override
public void componentAdded(ContainerEvent e) {
frame.pack();
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the dynamic distance between 2 elements in iOS with auto layout<p>I have this following UI that needs to draw a dashed line. I'm not sure how to c... | <p>There are various ways to approach this.</p>
<p>One option... instead of drawing only the red-dotted line as a shape layer, draw the gray line, the red-dotted line and the green bar as 3 sub-layers.</p>
<ul>
<li>Bottom layer: gray line</li>
<li>Middle layer: red-dotted line</li>
<li>Top layer: green "bar" line</li... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
REGEXP_REPLACE capturing groups<p>I was wondering if someone could help me understand how to use Hive's regexp_replace function to capture groups in the rege... | <p>Hive's supported notation (at least for 0.14, and I think I recall it being this way for 0.13.x as well) for regex backreferences seems to be <code>$1</code> for capture group 1, <code>$2</code> for capture group 2, etc. It looks like it is based upon (and may even be implemented by) the <a href="http://docs.oracle... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ReferenceError: "twttr is not defined" even while using twttr.ready()<p>Firebug console throws an error. It states that the code which I'm trying to use for ... | <p>It appears that <code>twttr</code> is not initialized yet. Make sure the script (<code>//platform.twitter.com/widgets.js</code>) is loading before the block of code you have.</p>
<p>This is the reason you're getting undefined (twttr).</p>
<p>After seeing your edits, it's quite clear what is happening. Your scripts... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
while sending mail giving error It is being used by another process.Please Try after sometime in .net<ol>
<li>I'm creating one file and sending that file thr... | <p>looking at your code, you don't need to do the calls to .dispose() as this is what the using block is for, so you could have:</p>
<pre><code>using (var fStream = File.Create(strPath).Close())
{
// these can go - (arguable you dont even need to do the close above,
// bu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
kNN Estimation with Sparse Matrices in Python using scikit-learn?<p>I have data that looks like this:</p>
<pre><code>line1 = '-0.9821 1:15 2:20 4:10 8:10'
l... | <p>The short is that the format you're using is going to cause you a decent amount of grief. The long is that it's still absolutely possible to do this conversion, there's just a decent amount of goo-code that you're going to need. The first thing you're going to need to do is split each string on the first occurrence ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating JTextFields in a for loop to calculate pow of a number stepwise<p>I have a JFrame in which the user shall enter 2 numbers and the powers of that num... | <p>Change your JTextField to a JTextArea to be able to have multiple lines of text, rather then just one line of text.</p>
<pre><code>final JTextArea txt3 = new JTextArea();
txt3.setBounds(300,200,200,200);
</code></pre>
<p>Then in your loop, change txt3.setText(output) to txt3.append(output + "\n").</p>
<pre><code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The easiest way to handle IF / OR in PHP while outputting inside HTML?<p>I have a PHP script that has outputs like these:</p>
<pre><code>$dashboard_output =... | <p>If it is strictly an if/else issue, you can use the ?</p>
<pre><code>$dashboard_output.= '<div>You have '.$orders_count.' order'.($order_count>1 ? 's' : '').'</div>';
</code></pre>
<p>The ? is a quick way to do an if/else. It is "condition" ? "true result" : "false result".</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Overriding and New<p>I'm not sure if this is better suited to programmers on SE.</p>
<p>I'm learning about inheritance, specifically how to use overrides - ... | <p>There is a <em>massive</em> difference between new and overrides.</p>
<p>In case of overrides this overwritten method is called no matter if you hold a base-class object or an object of the derived type.</p>
<p>with new however, the method of the derived class is called <em>only</em> if you hold an object of the d... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Inherited winforms controls not compiling<p>I have the latest stable version of VS2019 with the latest version of Resharper installed. When I create a contr... | <p>If your <code>SpecialTextbox</code> control is not a legit <code>System.Windows.Forms.TextBox</code> (if you accidentally have a <code>MyApp.TextBox</code> or some other imposter class that you accidentally are using by not using a fully qualified name for the TextBox, and one that does not inherit from <code>System... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.