input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
indoor atlas: using the API offline? <p>I am using the indoor atlas API. I am wondering if there is a way to work with the API affline and have a valid magnetic map offline, so my application wont be dependant on the state of the cloud servor?</p>
| <p>Unfortunately there's no offline solution today. Newest SDK can handle the situations when the network breaks for a while, but the accuracy decreases the longer you stay offline.</p>
|
Suppress Windows c# built in message box errors <p>I want to suppress the c# windows form message box errors. Like in my application there is a config file for the printer configuration, so when there is no printer attached or there's an issue with the port it gives an error. I want to suppress that built in windows er... | <p>Being forms you could add a try catch on Application.Run:</p>
<pre><code> try
{
Application.Run(new Form1());
}
catch (Exception ex)
{
//MessageBox.Show(ex.Message);
}
</code></pre>
<p>Or would recommend handling the event as per
<a href="http:... |
Password not resetting on a database through an ASP.Net application <p>I am trying to reset a password to an employee number on a database through a ASP.Net application. The trouble is that it is not actually resetting the password on DB even though I am getting a confirmation message that the password has been reset.<... | <p>you missed </p>
<pre><code>sqlCmd.ExecuteNonQuery();
</code></pre>
|
JQuery hidden element input issue traversing <p>I have a problem I just can't figure out. I have a set of DIV's which are <code>display: none;</code> by default:</p>
<pre><code><div id="pivot">
<div id="leftcol">Pivot</div>
<div id="rightcol">
<input class="small" value="030-... | <p>Use <code>:has()</code> in the selector to match a DIV that contains a visible input.</p>
<pre><code>$(this).parent('div').parent('div').nextAll('div:has(.input:visible)').first().find('.input:visible').focus();
</code></pre>
|
How do I pass two meta value to WP_Query <p>I'm having issues with my WP_Query. So I have two select boxes created using ACF one for Country and one for sector. When I select country and leave sector empty I get all the posts with the selected country and like wise for the sector. What I need to do is filter it further... | <p>Please try following code with relation AND & compare operator.
Also please check WP_Query class at <a href="https://codex.wordpress.org/Class_Reference/WP_Query" rel="nofollow">https://codex.wordpress.org/Class_Reference/WP_Query</a></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="tr... |
Component with attribute selector causes child elements not to render <p>I have created a component with attribute selector. When I use this attribute, the child elements of the original element are not rendered. Is this normal? I want both the original children and the applied component to be rendered because I cannot... | <p>You need to add</p>
<pre><code><ng-content></ng-content>
</code></pre>
<p>in the parent component for child components to be rendered</p>
<p><a href="http://plnkr.co/edit/kLxUZLUhCnevxQEB1uSe?p=preview" rel="nofollow"><strong>Plunker example</strong></a></p>
|
"Win32_Printer Where Network = TRUE" return no result in visual studio installer project <p>Using the following code, I can find and delete the print queue</p>
<pre><code>Dim scope = New ManagementScope(ManagementPath.DefaultPath)
scope.Connect()
Dim printers = New ManagementObjectSearcher(scope, New SelectQuery("Sele... | <p>The most likely explanation is that network resources printers (and other network items like mapped drive letters) are specific to the user context. In Visual Studio setups that run for Everyone the custom actions run with the local system account (which is required for them to be elevated) so it won't find them. Yo... |
How can I get the position from FlowDocumentScrollViewer? <p>I'm trying to get the position from FlowDocumentScrollViewer.
And save it to db.</p>
<p>After that, close and re-open the program.
At that time, the scroll should be set to what I saved position.</p>
<p>Simply, I hope to save that I watched position. and la... | <p>as described <a href="http://stackoverflow.com/a/561319/5018591">here</a> you need to get the scollviewer property of your FlowDocumentScrollViewer. than you can get scrollbar position with myScrollViewer.VerticalOffset and set it with myScrollViewer.ScrollToVerticalOffset(double value)</p>
|
Create a batch file to rename some files <p>I need a batch file that renames my files in according to the folder name.</p>
<p>For example I have this folder:</p>
<pre><code>E:\PROGET\01_Progetti\1_TRATTATIVE\IT.16.9291_Fabbricato ad Milano (MI) - Ing. Bianchi\03-CALCOLO\02-XLS\
</code></pre>
<p>Which contains </p>
... | <p>This is the complete solution of this question:</p>
<pre><code>@echo off
setlocal enableDelayedExpansion
SET mypath=%~dp0
set "projectnumber=%mypath:*IT.16.=%"
set "projectnumber=%projectnumber:~,4%"
for %%F in (*92XX*) do (
set "name=%%F"
ren "!name!" "!name:92XX=%projectnumber:~0%!"
)
</code></pre>
|
What data type should be used as an alternative for boolean in Postgres, HSQL, MSSQL? <p>We are using Oracle, Postgres, HSQL, MSSQL.</p>
<p>Since boolean is not supported by Oracle, we are using number(1,0) . So, other databases are getting affected. </p>
<p>What is the data type to be used in Postgres, HSQL, MSSQL, ... | <p><code>number</code> and <code>*-int</code>were the most common methods I've encountered so far, whereas <code>number</code> was used more frequently.</p>
<p>Edit:</p>
<p>As @a_horse_with_no_name mentionied, you're probably fine using number.</p>
|
How to Combine multiple column into one in php SQL <p><a href="https://i.stack.imgur.com/FfpXh.png" rel="nofollow">I have this data. Can someone help how can I combine them into one?</a></p>
<pre><code>id employeeID date timein timeout timein1 timeout1
1 12286 2016-09-10 08:08:00 00:0... | <p>If it was me, I'd probably adopt a schema roughly as follows:</p>
<pre><code>id employeeID datetime activity
1 12286 2016-09-10 08:08:00 in
2 12286 2016-09-10 12:08:32 out
3 12286 2016-09-10 12:41:54 in
4 12286 2016-09-10 17:10:05 ...
</code></pre>
|
How to map unique dns names to service fabric port <p>I have a local service fabric cluster which has 6-7 custom http endpoints exposed. I use fiddler to redirect these to my service like so:</p>
<p>127.0.0.1:44300 identity.mycompany.com </p>
<p>127.0.0.1:44310 docs.mycompany.com</p>
<p>127.0.0.1:44320 comms.mycompa... | <p>Instead of using multiple ip addresses you can use a <a href="https://en.wikipedia.org/wiki/Reverse_proxy" rel="nofollow">reverse proxy</a>. Like <a href="http://www.haproxy.org/" rel="nofollow">HAProxy</a>, <a href="https://www.iis.net/downloads/microsoft/url-rewrite" rel="nofollow">IIS</a> (with rewriting), the <a... |
Swift 3: Stop it from converting [NSString] to [String] <p>I have this Objective-C method.</p>
<pre><code>+ (NSArray<NSString *> *_Nullable)getValues;
</code></pre>
<p>which is converted in Swift to [String]
and must be passed to another Objective-C method in Swift, which looks in Objective-C like</p>
<pre><co... | <p>Because the <code>getValues</code> returning array can be null, you have to cast it to <code>[NSString]?</code>:</p>
<pre><code>let bla = C.getValues() as [NSString]?
</code></pre>
<p>Then, since the init method requires a non-null parameter, you have to force unwrap <code>bla</code>:</p>
<pre><code>MyClass(bla!)... |
Text and line drawn on ToggleButton canvas appear on screen but not on screenshot <p>I have created a view <code>MyToggleButton</code> that extends <code>ToogleButton</code>. I overwrite the Togglebutton's <code>onDraw</code> method to draw a line on the button and to rotate it's text.</p>
<p>Here is <code>MyToggleBut... | <p>The problem is that both <code>btn1.isDrawingChaceEnabled()</code> and <code>btn2.isDrawingChaceEnabled()</code> return <code>false</code>. </p>
<p>Even if you call <code>setDrawingCacheEnabled(true)</code> on the RootView, it is not set as <code>true</code> recursively on all his Children View (I tested it with L... |
Storing the data in table ( SQL) <p>I am new to this programming field basically i from electrical field. now i learn SQL concepts.i have one database in that database had two table. my database name is "<strong>MyDataBase</strong>",and first table name is "Assets" then my second tale name is "<strong>AssetAssigneeMap... | <p>i got my desired output,
what i did in here is ,i defined "assetId" is a "not null" type.In above code i didn`t add text to store <strong>assetId</strong> so only i get wrong output.</p>
<p>right code is below</p>
<pre><code>database.AssetAssigneeMappers.Add(new AssetAssigneeMapper()
... |
arduino and GSM shield <p>I wanted to connect arduino mega with GSM shield(mounting) and a ultrasound sensor with a battery(9V) to post data and send SMS. but it was working for 10 minutes and stops working i.e the lights are on but the signal is not constant(checked with all the networks and signal strengths : no issu... | <p>This is power issue, GSM modem uses 1W (200mA at 5V) of power on 850/900 MHz, and 2W on 1800/1900 MHz, and GSM shield requires peaks of up to 2A current.
You need more batteries or dc power supply.</p>
|
Reading and closing large amount of files in new class result in OSError: Too many open files <p>I have large amount of files and I need to traverse them and search for some strings, when string is found, the file is copied into new folder, otherwise its closed.</p>
<p>Here is example code:</p>
<pre><code>import os
i... | <p>Reason why you have same thing logged multiple times:
Every time <code>main.get_module_logger("StringsFilter")</code> is called, you call <code>logger.addHandler(...)</code> on <strong>the same logger</strong> returned from <code>logging.getLogger(name)</code>, so you get multiple handlers in one logger. Better make... |
Posting meassages form PC to Slack by using JavaScript <p>I am trying to post messages from an app on my PC to Slack by using JavaScript. </p>
<p>Could anyone tell me how to do that and I would be grateful if it was with simple example.</p>
<p>Thank you very much in advance </p>
| <p>You can use <a href="https://github.com/slackhq/node-slack-sdk" rel="nofollow">Slack</a> recommended <code>node-slack-sdk</code> library to do this.</p>
<p>Samples are given in the <a href="https://github.com/slackhq/node-slack-sdk#send-messages" rel="nofollow">GitHub</a> page.</p>
|
Dynamic select fluent nhibernate <p>First of all, sorry for my bad english.</p>
<p>I have a little trobule figurering this one out.
I have three tables and I need to make it so that the user can decide witch columns to fetch from the database.
I have tried using Dynamic nuget, but wont work.
The code i need is somethi... | <p>var columnProjection = Projections.Property(() => aliasForTable.Column1)</p>
<p>you can use above variable in nhibernate select statement to decide which column you want to fetch. Create this assignment for each of your case and you're done</p>
|
Creating and using Sequence in Oracle stored procedure - Sequence doesn't exist <pre><code> DECLARE
v_emp_id NUMBER;
empid NUMBER;
stmt VARCHAR2(1000);
BEGIN
SELECT MAX(emp_id) + 1 INTO v_emp_id FROM employees;
BEGIN
dbms_output.put_line(v_emp_id );
stmt := 'C... | <p>During compile time sequence not exists so compiler returns error. Execute immediate will be executed on runtime but compiler don't know that it will create sequence you called later in code.</p>
<pre><code>create or replace procedure createtest as
begin
execute immediate 'create table t1 (c1 number)';
insert into... |
How can I page query database without lost records? <p>We want to programmably copy all records from one table to another periodically.</p>
<p>Now I use <code>SELECT * FROM users LIMIT 2 OFFSET <offset></code> for fetch records.</p>
<p>The table records like below:</p>
<pre><code>user_1
user_2
user_3
user_4
us... | <p>First you should use an unique index on the source table and use it in an order clause to make sure that the order or the rows is consistent over time. Next you do not use offsets but start after the last element fetched.</p>
<p>Something like:</p>
<pre><code>SELECT * FROM users ORDER BY id LIMIT 2;
</code></pre>
... |
Unable to start activity: bind value at index 1 is null <p>I write below codes, but when running application show me <strong>Force Close</strong> error.<br></p>
<p><strong>Database helper codes:</strong></p>
<pre><code>public boolean checkFavPost(String title) {
// 1. get reference to writable DB
SQLiteDatab... | <p>Okay, so first thing's first: This is the main reason why your app crashed:</p>
<pre><code> java.lang.IllegalArgumentException: the bind value at index 1 is null
</code></pre>
<p>This is from a wrong binding parameter of a PreparedStatement. There are possibilities of <code>title</code> being passed into <code>... |
function template as a function argument <p>I want to implement a function which acts as MATLAB sort().
I defined a structure and a function template in a head file, as below.</p>
<pre><code>template<typename T_val> struct SORT_DATA
{
T_val value; //
int index;
};
template<t... | <p>You should <strong>specify template</strong> of <code>ccmp</code> function, as Piotr commented, but you do not need to take address of function:</p>
<p><code>
std::sort(data1, data1+15, ccmp<double>);
</code></p>
<p><a href="http://cpp.sh/72ia" rel="nofollow">Here is working sample</a></p>
<p>And if you... |
Should we write dependent: destroy on a join table model? <p>I have 3 models A, B and C. B is the join table between A & C. The association is made through a <code>has_many :through</code>.</p>
<p>I was wondering if the non-join-table models (A & C in my case) should have <code>dependent: :destroy</code> with ... | <p>No, because you can delete records without instantiating them which wouldn't call dependent destroy and you'd be left with orphaned records.</p>
<p>For example <a href="http://api.rubyonrails.org/classes/ActiveRecord/Relation.html#method-i-delete_all" rel="nofollow">delete_all</a></p>
<p>Instead if you add a forei... |
Kotlin, instantiation issue and generic <p>I have a class Vec3i that extends Vec3t</p>
<pre><code>data class Vec3i(
override var x: Int = 0,
override var y: Int = 0,
override var z: Int = 0
) : Vec3t(x, y, z)
</code></pre>
<p>that has as one secondary constructor as follow</p>
<pre><code>constructor(v: Vec3t&l... | <p>For completeness, as stated in my comment, the following compiles correctly:</p>
<pre><code>data class Vec3i(
override var x: Int = 0,
override var y: Int = 0,
override var z: Int = 0
) : Vec3t<Int>(x, y, z) {
constructor(v: Vec3t<out Number>) : this(v.x.toInt(), v.y.toInt()... |
Unable to get the reason for compiler errors on increment operators for variable and constant <p>I am testing the below scenario using increment operator</p>
<pre><code>int i=3;
int j=2;
System.out.println("data: "+(i+++j));
</code></pre>
<p>Here I am getting the expected output, but if I change it to</p>
<pre><code... | <p>By using
<code>+(i+++j)</code>
the increment operators work on variables i.e i++ is the same as i+=1
by using <code>+(2+++3)</code>
since 2 is not a variable,you cannot increment it i.e 2+=1 is not a legal statement in java</p>
|
Semantic HTML: where to place my form buttons? <p>Consider the next form:</p>
<pre><code><form>
<h2>Form</h2>
<fieldset>
<legend>Simple list with Create/Delete</legend>
[...]
<footer>
<button>Add</button>
&... | <p>You can place your form fields and buttons in separate <code>section</code> blocks.</p>
<pre><code><form>
<section class="fields">
<fieldset>
<legend>Simple list with Create/Delete</legend>
...
</fieldset>
</section>
<s... |
Set radio buttons using Jquery and html <p>My Jquery code is as follows</p>
<pre><code><script type='text/javascript'>
window.onload=function(){
$(document).ready(function() {
$('input[type=radio][name=name]').change(function() {
if (this.value == 'value1') {
$("#myModal1").modal('show');... | <p>Radio buttons are meant for mutually exclusive choices - not to be selected at the same time (use checkboxes for that):</p>
<p>also you can simplify your logic a bit:
set the value to either 1 or 2 for the radio buttons - on the change event - grab the value from the radio buttons and use that as a variable to trig... |
How to run this project on Eclipse Mars? <p>I imported an android project from <a href="https://drive.google.com/file/d/0B0z3LFuVZAYYQ214VVVtODh3OWM/view?usp=sharing" rel="nofollow">here</a>, it says min SDK 10 and max SDK 19, so I downloaded the API versions from 10 to 19, also in layout -> main.xml -> in Android vers... | <p>Taken from the 3rd red line of the shared image</p>
<blockquote>
<pre><code>java.lang.RuntimeException: Unable to instantiate application com.foxdogstudios.peepers.PeeperspAplication:
java.lang.ClassNotFoundException: Didn't find class "com.foxdogstudios.peepers.PeepersApplication" on path
/data/app-lib/com.foxdogs... |
Video Upload issue in android <p>I am trying to upload an mp4 file from sd card to remote server. The upload is getting sucessfully, but while i am trying to play that file by url using VideoView it is showing "can't play this video ". This issue is happening for only videos which is captured using phone, Suppose if i ... | <p>Yes it may occurs because your URL contains white-spaces so you need to just remove space and set </p>
<blockquote>
<p>%20</p>
</blockquote>
<p>insted of white-space like :</p>
<blockquote>
<p>URL url1 = new URL(your_url.trim().replace(" ", "%20"));</p>
</blockquote>
<p>hope it works for you</p>
|
Repopulating Scraped Table Data Via Web Source Based on a Cell Input (from a Barcode Scanner) <p>I am scraping the table data from a sports card authentication site (e.g. psacard.com/cert/25819397/) that encapsulates every card in acrylic and has a unique barcode with a web source table import. <a href="https://i.stack... | <p>I found the solution, it is here: <a href="https://www.youtube.com/watch?v=ZJ30U0qw850" rel="nofollow">https://www.youtube.com/watch?v=ZJ30U0qw850</a></p>
<p>It needs some scripting of the operations, but that is fairly straightforward. The logic is worked out.</p>
<p>1) Scan card, which enters integer (barcode) o... |
How to check whether app is compatible in all devices or not? <p>I have developed app and tested it in the all the possible devices i have(i.e. on physical devices,genymotion).But i got reviews from client that in some devices it works and in some devices it won't.</p>
<p>I have added the <code>minSdkVersion</code> an... | <p>There is a tool which lets you test your app with multiple virtual and real devices. The link is :</p>
<p><a href="https://testobject.com" rel="nofollow">https://testobject.com</a></p>
|
AngularJS with jquery <p>I am new to angularJS .. previous I use to work with Jquery. </p>
<p>So I have question in my mind, can we access variable which are declared in angularJS "<strong>$scope.options</strong>" using jquery.?</p>
<pre><code> var hostApp = angular.module('hostApp', []);
hostApp.controller('h... | <p>Yes you can using <strong>$apply</strong></p>
<p>HTML:</p>
<pre><code><input type="text" id="txtbox" ng-model="txt" /> <br />
text is : {{ txt }}
<br />
<input type="button" id="btnJq" value="Jquery change" />
</code></pre>
<p>Script:</p>
<pre><code>angular.module("md", [])
... |
Getting Facebook profile picture URL from graph API for Ionic Hybrid Application <p>Facebook graph API tells me I can get a profile picture of a user using</p>
<p><a href="http://graph.facebook.com/100001225634061/picture?type=large" rel="nofollow">http://graph.facebook.com/100001225634061/picture?type=large</a></p>
... | <p>Don't use <strong>http</strong>. You can use the <strong>https</strong>.</p>
<p><a href="https://graph.facebook.com/100001225634061/picture?type=large" rel="nofollow">https://graph.facebook.com/100001225634061/picture?type=large</a></p>
|
Laravel routing page not fount error while passing veriable <p>I am new to the Laravel while I reading the documentation I had a problem under routing.. it shows we can pass verifiable like this,</p>
<pre><code>Route::get('user/{id}', function ($id) {
return 'User '.$id;
});
</code></pre>
<p>here what is the <cod... | <p>Your route is correct</p>
<pre><code>Route::get('/{id}', function ($id) {
echo 'ID: '.$id;
});
</code></pre>
<p>i have tested it and its working fine</p>
<p>Can you check .htaccess file under public folder.</p>
<pre><code><IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -... |
Regular expression finding '\n' <p>I'm in the process of making a program to pattern match phone numbers in text.</p>
<p>I'm loading this text:</p>
<pre><code>(01111-222222)fdf
01111222222
(01111)222222
01111 222222
01111.222222
</code></pre>
<p>Into a variable, and using "findall" it's returning this:</p>
<pre><co... | <p>The <code>\s</code> matches both <em>horizontal</em> and <em>veritcal</em> whitespace symbols. If you have a <code>re.VERBOSE</code>, you can match a normal space with an escaped space <code>\ </code>. Or, you may exclude <code>\r</code> and <code>\n</code> from <code>\s</code> with <code>[^\S\r\n]</code> to match h... |
Angular ng-repeat in select options showing extra space and not selecting default value. <p>I am trying to show a list of years in a select box through angular's <code>ng-repeat</code> but it is showing an empty line before list of years and not showing selected value which should be first year in the list. you can see... | <p>Use <a href="https://docs.angularjs.org/api/ng/directive/ngOptions" rel="nofollow"><code>ng-options</code></a> instead of <code>ng-repeat</code> it works and it's better.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="sni... |
Elseif is not working in Excel Makro (VBA) <p>i have a little problem in my excel macro. </p>
<p>Description of the Problem:</p>
<p>I want to create a Macro, which hide / unhide special Sheets, if one answer is a Dropdown Menu used.</p>
<p>Dropdown Menu:</p>
<p>Australian</p>
<p>Austria</p>
<p>Germany</p>
<p>And... | <p>I think you forgot quite a few ""
As @Raph said, select case is way cleaner to look at.</p>
<p>Tip: Always use Option Explicit, you would have spotted this one!!!</p>
<p>Tip 2 : you may use lcase( ) to compare case insensitive</p>
<pre><code>Sub Choose_Country()
c2 = something I dare hope :D
select case c2
case... |
low performance by DBINFO('sqlca.sqlerrd1') of Informix 9.40 <p>After a row was inserted I read the serial of inserted row with DBINFO('sqlca.sqlerrd1'). The select proccess takes a lot of time ( 5 - 10 sec ).
For the analyse I switch on the sqexplain before the insert command</p>
<pre><code>set explain on;
load from... | <p>When you use </p>
<pre><code>SELECT distinct dbinfo('sqlca.sqlerrd1') FROM transaction;
</code></pre>
<p>you are in fact reading all the rows in the table <code>transaction</code>, returning the <code>DBINFO('sqlca.sqlerrd1')</code> value in each row. Since the value is always the same, the distinct will only retu... |
JAVA - Storing result set in hash table by grouping data efficiently <p>I'd like to store in a hash table a result set coming from a query execution.
The hash table is something like this</p>
<pre><code>Map<List<String>,List<Object>>
</code></pre>
<p>where </p>
<pre><code>List<String>, the ha... | <p>Instead of using List as key. Use a class having List as its instance variable. Override equals very carefully.</p>
|
Copy multiple image and text things to the Clipboard for pasting into MS Office <p>I have copy text and image into word document at that time image and text store into clipboard that works fine.but i have get clipboard text and image using c# that time only text value get not image path,how to image path also get?</p>
| <pre><code>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
publi... |
Unity : 30fps vs 60fps on 30fps animation <p>I'm testing this on mobile, i have a 30 frame animation with 30 frame rate, i build it to my mobile with in-game target frame rate of 30 and 60. since the animation frame rate would be time base in unity, the animation would be exactly 1 second on both build.</p>
<p>This is... | <p>I think i might have the answer, that's because since the animation would be time base, unity would fill better on empty keyframe in 60fps. example : set a position keyframe on 1st frame, then set another position key frame at 30th frame, unity would effectively play this as a 60 frame rate animation since there are... |
Java getting unreported exception <pre><code> public void createDirectory(String path) {
try {
shellSupport.executeCommand("hadoop fs -mkdir "+path);
logger.info("Directory "+path+" created successfully");
} catch(Exception exc) {
throw exc;
}
}
</code>... | <p>Isn't it enough just to add:</p>
<pre><code>public void createDirectory(String path) throws Exception {
try {
shellSupport.executeCommand("hadoop fs -mkdir "+path);
logger.info("Directory "+path+" created successfully");
} catch(Exception exc) {
throw exc;
}
}
</code></pre>
<p>T... |
Passing parameter (directory) to %cd command in ipython notebook <p>I'm trying to pass a parameter (directory) to a %cd command in ipython notebook as below:</p>
<pre><code> rootdir = "D:\mydoc"
%cd rootdir
</code></pre>
<p>but i get the following error:</p>
<pre><code> [Error 2] The system cannot find the file spe... | <p>You can use <code>$</code> to use the value in a variable.</p>
<pre><code>%cd $rootdir
</code></pre>
|
Count visits to a file/image and store to db <p>My application is based on rails <code>4.2.4</code>. My application provides a <code>js</code> file that websites can paste into <code><head></head></code> and we provide some services to them.</p>
<p>I have seen that <strong>Facebook</strong> uses pixels lik... | <p>Instead of serving your JS as a static asset (e.g. file served directly from disk), serve it using a normal controller action. Then add the counting bits in that controller action. </p>
|
How to plan releases for MS CRM 2016 project <p>We got a couple of enhancements as part of the project on a MS CRM 2016 on prem implementation.
The client wants UAT and PRod release after every sprint. </p>
<p>Plus, every sprint is of 3 weeks out of which 2 weeks is (coding + SIT testing) and 1 week of UAT,
for eg. Sp... | <p>Normally, we plan releases based on deadlines. And based on that we plan both the required CRM environments, and also, very important, TFS branches.</p>
<p>A typical workflow might go through the following stages:
DEV -> TEST (UAT) -> Staging -> Production. </p>
<p>If you're gonna have concurrent releases where y... |
Projects on Algorithms and Datastructures <p>I have required knowledge about basic data-structures and algorithms. Suggest me some mini-projects so that I can implement Graphs, Hashing etc.I learn't Java Programming.</p>
| <p>Implement a(n almost) rectangular board with hexagonal cells which provides a method to tell all the neighbours of a cell when given a cell by {line, col}.</p>
<p>Unlike a pure rectangular grid in which a cell have 2,3 or 4 neighbours, a whole hexagonal-cell grid (you know those <a href="https://www.colourbox.com/p... |
Text misaligned when the responsive navigation button is clicked <p>I am just testing the Responsive Top Navigation example provided by W3Schools, I've done a minor modification on the internal style sheet so the text <code>Home</code> will move to the center of the menu and it misaligned when I click on the navigation... | <p>Like I said in comment, the problem is because your <code>li.icon</code> switch between <code>position: relative</code> to <code>position: absolute</code></p>
<p>You have to fix it to <code>position:absolute</code></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">... |
How to use the node.js 'request' library with this http request? <p>I was trying to make a simple request to site. it should get html text, but it gets ' '</p>
<p>NPM module here: github.com/request/request </p>
<p>Code:</p>
<pre><code>var fs = require('fs');
var request = require('request');
var options = {
... | <p>To answer your question i will copy/paste a part of my code that enable you to receive a post request from your frontend application(angularJS) to your backend application (NodeJS), and another function that enable you to do the inverse send a post request from nodeJS to another application (that might consume it):<... |
What am I doing wrong with this negative lookahead? Filtering out certain numbers in a regex <p>I have a big piece of code produced by a software. Each instruction has an identifier number and I have to modify only certain numbers:</p>
<pre><code>grr.add(new GenericRuleResult(RULEX_RULES.get(String.valueOf(11)), new R... | <p>Your problem is that you are assuming a negative look ahead changes the cursor position, it does not. </p>
<p>That is, a negative lookahead of the form <code>(?!xy)</code> merely verifies that the <em>next</em> two characters are not <code>xy</code>. It does not then swallow two characters from the text. As its ... |
Change <td> Background Color After Validation <p>I have a form inside a table. I want to change the <code><td></code> background color after form validation for the error. I manage to do it by inserting an if condition on each <code><td></code> style attribute. Is there a short way. </p>
<p>For example may... | <p>You can create an array of string with all the invalid fields name property and then it will take care to set the background color for those fields: </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 ... |
Where should I put code that I want to always run for each request? <p>Maybe this is more of an ASP.NET MVC question than an Orchard question but I'm relatively new to both and I don't know the answer in either case.</p>
<p>ASP.NET MVC applications don't technically have a single point of entry, so where am I supposed... | <p>All what should you do to achieve this, is implementing new <code>IActionFilter</code> or <code>IAuthorizationFilter</code> like the following:</p>
<pre class="lang-cs prettyprint-override"><code>public class CheckAccessFilter : FilterProvider, IActionFilter, IAuthorizationFilter {
public void OnActionExecuting... |
How can I add music player onClick Android <p>I'm making an app in android.</p>
<p>I have a button in my app. When I tap the button play, a song starts playing. But now I want my app to play song1 on my first click, on second click song2 and on third click song3 (song1, song2 and song3) are different mp3 files. </p>
... | <p>Make a counter variable and a array/list of your music files. on every tap you play the music on index of your counter. after playing them just increase the counter by 1. Done</p>
|
Wrong response from the webhook: 400 Bad Request <p>I'm recently tried to use webhook to get update from telegram. my program work correctly whit getUpdates().
but when i set webhook i got </p>
<blockquote>
<p>"Wrong response from the webhook: 400 Bad Request"</p>
</blockquote>
<p>error when try to check status of ... | <p>I found my answer</p>
<p>every things was ok. the error happens because of my framework. </p>
|
Composer - autoload classes in CodeIgniter outside vendor folder <p>I've been working on setting up a CodeIgniter project with composer. I'm wanting to include <code>php</code> classes stored in files outside the <code>vendor</code> folder - in a <code>shared</code> folder.</p>
<p>My directory structure:</p>
<pre><c... | <p>Well after looking further, there's a property called <code>classmap</code> (<a href="https://getcomposer.org/doc/04-schema.md#classmap" rel="nofollow">documentation</a>) in the root package.</p>
<pre><code>"autoload":{
"classmap":["shared/application/","shared/base/", "shared/data/"]
}
</code></pre>
<p>This l... |
cursorboundexception whille displaying listview from content provider <p>somebody pls get me out of this.I am trying to display a list from an sqlite database which worked absolutely fine but dont know what went wrong it showed cant find provider info.I fixed it and then when i am running the code with list_cursor.move... | <p>Try this solution </p>
<pre><code> @Override
@TargetApi(15)
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
if (row == null) {
row = mActivity.getLayoutInflater().inflate(mLayoutId, null, false);
}
Cursor list_cu... |
Automatically generated git commit message with regex <p>I'd like to set up a git alias that would execute git commit with auto generated message like this:</p>
<p>"Affected files: [...], [...], [...]."</p>
<p>Whereby [...] is a regex match against respective file name.</p>
<ul>
<li>I want to use it only when updati... | <p>You can achieve this by placing a <code>commit-msg</code> hook (read: script) in the <code>.git/hook</code> directory of your project.</p>
<p>Running <code>git diff --cached --name-status</code> should give you all the information about the [about to be] committed files, which you can parse with <code>awk</code> (o... |
Wit.ai: How to send a message when confidence below a certain level? <p>I'm playing around with the Wit.ai Facebook Messenger Example (<a href="https://github.com/wit-ai/node-wit/blob/master/examples/messenger.js" rel="nofollow">https://github.com/wit-ai/node-wit/blob/master/examples/messenger.js</a>)</p>
<p>Is there ... | <p>You can use the Wit API directly and skip the ui all together if you want more fine control.</p>
<pre><code>function getIntent(message) {
var serviceResult = {};
var url = 'https://api.wit.ai/message?v=20161006&q='+message;
var options = {
uri: url,
qs: {},
method: 'POST',
headers: {},
... |
flexbox div goes off screen on small screen <p>Code first:</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-css lang-css prettyprint-override"><code>html {
display:flex;
width:100%;
height:100%;
}
bod... | <p>You can make use of Flexbox's <code>auto</code> margins.</p>
<ol>
<li>Remove <code>justify-content: center</code> from <code>.container</code>.</li>
<li>Add <code>margin-top: auto</code> to <code>.block1</code>.</li>
<li>Add <code>margin-bottom: auto</code> to <code>.block2</code>.</li>
</ol>
<p><div class="snippe... |
How to find epoch for last month same day? <p>I have below PLSQL code which finds the epoch for last month same day, however it fails when I run it on month end for 31 and 01 days.</p>
<pre><code> SET serveroutput ON
DECLARE
vDay VARCHAR2(30) := '&Enter_current_day';
vDate VARCHAR2(30... | <p>Maybe something like this would do the trick?</p>
<pre><code>DECLARE
vday VARCHAR2(30) := '&Enter_current_day';
vdate DATE;
vepoch NUMBER;
v_today DATE := SYSDATE - 30;
BEGIN
vdate := to_date(to_char(v_today, 'MM') || '-' ||
least(to_number(vday),
to_... |
Should I get BluetoothGatt.GATT_SUCCESS also when disconnecting from a device? <p>I am working with custom devices and I am struggling to manage the Bluetooth LE correctly.</p>
<p>My only concern is not getting 0 (<code>BluetoothGatt.GATT_SUCCESS</code>) when I read the <code>status</code> value along with value 2 on... | <p>The int error codes need to be converted to HEX and mapped to the values in the following file:</p>
<p><a href="https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/android-5.1.1_r13/stack/include/gatt_api.h" rel="nofollow">https://android.googlesource.com/platform/external/bluetooth/bluedroid/+... |
Convert row values into columns using LINQ in c# <p>I have a list as below</p>
<pre><code>PillarId Quarter Feature
1 Q12106 France
1 Q12016 Germany
1 Q22016 Italy
1 Q32016 Russia
2 Q22016 India
2 Q32016 USA
3 Q22016 China
3 Q32016 Austr... | <p>Try this</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace ConsoleApplication16
{
class Program
{
static void Main(string[] args)
{
DataTable dt = new DataTable();
dt.Columns.Add("Pil... |
Ionic / AngularJS key not accessible in ng-repeat <p>I am trying to access the <code>{{key}}</code> from an <code>ng-repeat</code> from a controller using <strong>Ionic 1</strong>. The <code>{{key}}</code> that is generated as text is different from the <code>{{key}}</code> I am receiving at the controller, not sure wh... | <p>Just remove the curly brackets from the <code>ng-click</code> function call.</p>
<pre><code><div class="row" >
<button class="button button-block button-balanced"
ng-click="loadInlineHistory(key)"> <i class="ion-plus"></i></button>
</div>
</code></pre>
|
Page redirect on clicking of "Cancel" button of a confirm dialouge <p>Please look at the code snippet - </p>
<pre><code><form action="post" onsubmit="return confirm('Are You Sure?')">
<a id="saveBtn" class="btnClass">Save<a/>
</form>
</code></pre>
<p>When I click on the 'Save' and then ... | <p>You should probably not use the <code>onsubmit</code> attribute, go with the unobtrusive event listener approach for better readability and maintainability.</p>
<p>Something like this should show the general idea and you can update it with your own redirect link:</p>
<pre><code>var submitLink = document.getElement... |
NSIS: Change the text "Execute:*******" to custom text <p>I'm very new to NSIS and created a script to install all my programs in a chained fashion. The script works very well but I would like to change the text in the highlighted box to show the name of the program being installed. For example, if the installer is ins... | <p>You can use instruction <strong>DetailPrint "Installing: Adobe Acrobat Reader"</strong> </p>
<p>to add the string "Installing: Adobe Acrobat Reader" to the details view of the installer.</p>
<p>But next command (in your script) will overwrite this text (e.g. "Extracting file ...") so you may use <strong>SetDetails... |
Azure Blob Storage returns 404 on PUT <p>I created new blob storage; set CORS to allow all (*) origins; created new container (dev); set container access policy to "Container". Now when I'm trying to upload file (file.txt) to my container I get 404 ResourceNotFound "The specified resource does not exist." response.
I m... | <blockquote>
<p>set container access policy to "Container"</p>
</blockquote>
<p>Setting container access policy to <code>Container</code> will only work for read operations. For write operations, the requests need to be authenticated. </p>
<p>For authentication, you would need to create an <code>Authorization</code... |
Instrumental test for Realm database gives "Call 'Realm.init(Context)' before creating Realmconfiguration" even though I call it <p>For my Android application I use the Realm mobile database. I want to write tests for this, and the best way I found of testing was using instrumental tests. </p>
<p>This is the construct... | <p>Considering the fact that the Context stored in Realm is the application configuration like this</p>
<pre><code>// Thread pool for all async operations (Query & transaction)
volatile static Context applicationContext;
</code></pre>
<p>Which is initialized like this</p>
<pre><code>public static synchronized vo... |
Meteor error: Could not locate the bindings file <p>I have respond from meteor: "Error: Could not locate the bindings file." and then it shows places searched for file - in one of them file exist - look attached picture <a href="https://i.stack.imgur.com/10yFW.png" rel="nofollow">screen showing sought file exist in se... | <p>In the net are lots of advices what to do and I did everything I found but none sad to do "meteor update" and only this works for me. So thumbs up, please.
reason was most likely: creation of the app on older version of the meteor. That worked fine most of the time but adding accounts-password course it couldn't fi... |
SPARQL to encompass all sub-properties of a property <p>I want all Wikidata items that have ended, so I wrote this:</p>
<pre><code>?item wdt:P582 ?endtime.
</code></pre>
<p>Problem: it does not include items that have been "abolished".<br>
<a href="https://www.wikidata.org/wiki/Property:P576" rel="nofollow">abolished... | <p>If Wikidata includes subproperty relationships, you just need: </p>
<pre><code>?p rdf:SubPropertyOf* wdt:P582 .
?item ?p ?endtime.
</code></pre>
|
Google Cloud Project charges for download <p>I am getting charged for service cloud-storage/BandwidthDownloadAmerica as mentioned here: <a href="https://cloud.google.com/storage/pricing#network-pricing" rel="nofollow">https://cloud.google.com/storage/pricing#network-pricing</a></p>
<p>Though, my google cloud storage b... | <p>EMEA stands for "Europe, Middle East, and Africa", so BandwidthDownloadAmerica does indeed include EU. So it seems correct that you incur these charges.</p>
<p>(Granted, the naming is not great here, we're working to fix that)</p>
|
d3js v4: Add nodes to force-directed graph <p>I would like to render a <strong>force-directed graph in d3js v4</strong> and provide a function for <strong>dynamically adding new nodes and links</strong> to the simulation. My first attempt (see below) still has some major issues:</p>
<ul>
<li>Already existing nodes and... | <p>You forgot to <code>merge()</code> your nodes. I have updated your code quickly:</p>
<p><strong>graph.js</strong></p>
<pre><code>var Graph = function(targetElement, graph) {
var self = this,
width = targetElement.offsetWidth,
height = width / 2,
svg = d3.select(targetElement).append('svg')
... |
How to Replace special Character in Unix Command <p>My source data contains special characters not in readable format. Can anyone help on the below :</p>
<p><a href="https://i.stack.imgur.com/sY3ZC.png" rel="nofollow">Source data:</a></p>
<p><a href="https://i.stack.imgur.com/2bVpw.png" rel="nofollow"><img src="https... | <p>you can use <code>tr</code> to keep only printable characters:</p>
<pre><code>tr -cd "[:print:]" <test.txt > test2.txt
</code></pre>
<p>Uses <code>tr</code> delete option on non-printable (print criteria negated by <code>-c</code> option)</p>
<p>If you want to <em>replace</em> those special chars by somethi... |
Why is my angular-ui-tour not finding the steps of my detached tour? <p>I'm using <a href="http://benmarch.github.io/angular-ui-tour/#/docs" rel="nofollow">angular-ui-tour</a> to enable my project to have multiple tours within the same DOM, because is has a detached tour option which I need to do so.</p>
<p>My depende... | <p>I've managed to resolve this question. Apparently this is a known bug of <a href="https://github.com/benmarch/angular-ui-tour" rel="nofollow">angular-ui-tour</a> and will be fixed in the next patch.</p>
<p>For more information about this question, I can refer you to the <a href="https://github.com/benmarch/angular-... |
Is it secure to pass the DB query to AzureML as a global parameter? <p>When using AzureMLBatchExecution activity in Azure Data Factory, is it secure to pass the DB query as a global parameter to the AzureML web service? </p>
| <p>When you talk about "secure", are you worried about secure transmission between AML and ADF, or secure storage of your DB query information? For the former, all communication between these two services will be done with HTTPS. For the latter, our production storage has its strict access control. Besides, we only log... |
SwitchPreference dependency on two other switch preferences <p>I have three <code>switchpreferences</code> in my app (say, switch1, switch2 and switch3). What I want to achieve is whenever switch1 <code>AND</code> switch2 are set to <code>false</code>, switch3 must also be set to <code>false</code> automatically. If ei... | <p>Implement onCheckChangedListener for switch1 and switch2 and add the below statement in your onCheckChanged() callback method.</p>
<pre><code>switch3.setChecked(switch1.isChecked() || switch2.isChecked())
</code></pre>
|
UnHandled Exception while dynamically adding TextBox <p>I am trying to dynamically add textbox onclick of button. Below is my code. I am able to add one textbox, but while adding next textbox after completing all code <code>UnHandled exception</code> is thrown. I don't know from where it is being thrown. </p>
<pre><co... | <p>You can try below code for adding dynamic <code>TextBox</code> with line break:</p>
<pre><code>TextBox t = new TextBox();
t.ID = "textBox_" + i;
ViewState["controlidlist"] = controlidlist;
controlidlist.Add(tb.ID);
UpdatePanel1.ContentTemplateContainer.Controls.Add(t);
Literal lit = new Literal() { Mode=LiteralMode... |
Setting up a worker thread to continuously check a bool value of an object <p>I am running this code in a form, but when i start it, it freezes. This is because <strong>while</strong> keeps the other code from running. I want to setup a separate worker thread for this while task. However i do not know how to set up a w... | <p>Getting multi-threading right is not an easy task and should only be done if really necessary.</p>
<p>I have an alternative suggestion:</p>
<p>Your Controller <code>game</code> raises an event when the game is over:</p>
<pre><code>class Controller
{
...
public event EventHandler GameFinished;
privat... |
SQl sum items conditionally <p>I have the below code. It counts 1 if it is certain work and 0 if it is other work. I need a way to count 0.5 if it is a third work. I have tried this and it always seems to count in whole numbers. Is there a way to do this using SQL? I have searched and cannot find such a way to calculat... | <pre><code>SELECT TOP 1000
[Type of Work],
SUM(case when [Type of Work] IN ('LEP Decisions','Creditable Coverage','Pends','Demographics','Consents','POA','PCP','Housing Verifications','LEP Cases') then 1
WHEN [Type of Work] IN ('') -- Put your work list
THEN 0.5
else 0 END)as count
,[User ID]
FROM [Medicare_Enrollm... |
PHP: sleep() for particular line of code <p>is it possible to use sleep() (or some other function) to wait before execution?</p>
<p>I have for example:</p>
<pre><code><div>bla bla</div>
<?php
$a
echo $a; ?>
some divs and html
<?php
$b
echo $b; ?>
</code></pre>
<p>How to execute the first php... | <p>Yes, you can use <code>sleep()</code> to delay execution, but since the output is usually buffered and isn't sent to the browser until the script has finished the result isn't what you're after.</p>
<p>If you do a <code>flush()</code> and <code>ob_flush()</code> right after calling <code>sleep()</code> the output b... |
Join results from two MySQL tables <p>I have two MySQL tables from which i can't get joined results.</p>
<p>The first one is just a list of companies and their names:</p>
<pre><code>companies:
____________________________
companyid | companyname |
1 comp1
2 comp2
</code></pre>
<p>The s... | <p>Check you joining condition.</p>
<p>Try this,</p>
<pre><code>select a.companyname,b.role from companies a, roles b
where a.companyid=b.companyid and
(b.uid = 1 and
b.suspended <> 0);
</code></pre>
|
"Unknown Host" - Connecting to PostgreSQL database in SQL Shell (Windows) <p>I've previously been using PostgreSQL in Ubuntu using:</p>
<pre><code>$sudo -i -u postgres
</code></pre>
<p>to access postgres through the terminal to create a role and database. And then able to log in and make changes using:</p>
<pre><cod... | <p>Entered server as localhost IP.</p>
<pre><code> Server [localhost]: 127.0.0.1
Database [localhost]: [dbname]
Port [5432]: 5432
Username [postgres]: [username]
</code></pre>
|
Android RecyclerView - scrolling changes items <p>I have a recyclerview with linear layout manager and it contains different items.
one of the items have a button that hides or display the nested layout of this items. </p>
<p>So I added something like 10 rows of the specific type, and when I click on specific item, it... | <p>You have to set the visibility state for each view (each call to onBindViewHolder). I guess what happens for you is that you set the visibility for a view that is later recycled and have the visibility set. </p>
|
Is it necessary for MQTT client to have same key, cert as used by MQTT broker for TLS? <p>I am using node.js mosca MQTT broker and node.js mqtt package for implementing mqtt client.</p>
<p><a href="https://github.com/mcollina/mosca" rel="nofollow">https://github.com/mcollina/mosca</a></p>
<p><a href="https://www.npmj... | <p>For a basic secure connection the client only needs to know the CA cert used to sign the brokers certificate. It uses this to prove to it's self that the broker is who it claims to be.</p>
<p>If you are using self signed certificate (which I'm guessing you are) then the CA certificate is the same as the broker cert... |
Java is taking a class from the wrong path <p>I have 2 projects: project1 and project2 and the class <code>Class1</code> in both projects but there are differences between these classes.</p>
<p>I'm trying to use Project1.Class1 in a XHTML file but sometimes it takes <code>Project2.Class1</code>.</p>
<p>I have already... | <p>It is not a problem with java. If you have 2 java classes with same name and package structure, the class which is first seen in class path will be loaded in to the memory. The other class will be omitted as per the class loading policy.</p>
<p>If you want use only one class, Keep that class alone in the classpath ... |
How to position a toast in Nougat's multi-window mode? <p>While using Nougat's new multi-window mode, I noticed that a <code>Toast</code> will be displayed over another app if my own app is in the top window in portrait mode.</p>
<p><a href="https://i.stack.imgur.com/E6Y3z.png" rel="nofollow"><img src="https://i.stack... | <p>I suspect this is the intended behaviour. Beyond there not being any straightforward way to achieve what you desire, according to the <a href="https://material.google.com/components/snackbars-toasts.html" rel="nofollow">Material Design Guidelines</a> Toasts are used primarily to convey system messages and should app... |
Prioritizing recursive crawl in Storm Crawler <p>When crawling the world wide web, I would want to give my crawler an initial seed list of URLs - and would expect my crawler to automatically 'discover' new seed URLs from internet during it's crawling.</p>
<p>I see such option in Apach Nutch (see topN parameter in <a ... | <p>StormCrawler can handle recursive crawls, and the way URLs are prioritized depends on the backend used for storing the URLs.</p>
<p>For instance the <a href="https://github.com/DigitalPebble/storm-crawler/tree/master/external/elasticsearch" rel="nofollow">Elasticsearch module</a> can be used for that, see the READM... |
Chart.js: Chart not resizing in iframe <p>I am trying to show multiple diagrams/charts at the same time using chart.js.
For my setup, I have one <strong>chart.html</strong> file which displays the diagram and a <strong>split.html</strong> file which creates multiple iframes (2 so far) and loads the <strong>chart.html</... | <p>Change iframes to divs with modifiing your splitter.js:</p>
<pre><code>$(document).ready(function () {
const splits = 2;
for(var i = 0; i < splits;i++){
var chartContainer = $('<div id="frame' + (i + 1) + '"></div>').appendTo("#content");
var canvas = $('<canvas class="diagram">').appen... |
Android autoTesting with Cucumber and Espresso <p>I have a problem with Cucumber, I can't start tests, all the time I have the same problem, and have no idea how to fix it.</p>
<p>When I run tests I got this message:</p>
<pre><code>Started running tests
Test running failed: Instrumentation run failed due to 'cucumber... | <p>I think you're missing some <code>build.gradle</code> configuration parts like:</p>
<pre><code> testApplicationId "cucumber.cukeulator.test"
testInstrumentationRunner "cucumber.cukeulator.test.Instrumentation"
</code></pre>
<p>Check this <code>Cucumber</code> example <code>build.gradle</code> configuration ... |
Recompile, relink, vertex shader in shader program <p>I have in place a system for detecting changes made to my shader files. When a shader is changes, let's say the vertex shader, I want to compile that one and replace it with the old version (while <strong>not</strong> changing the input/output of the shader and thus... | <p>Linking does not invalidate any attribute bindings since they are part of the VAO state and not of the program. There are two things that could happpen when relinking the program:</p>
<ul>
<li>The index of an attribute might change. This can be prevented by either fixing them in both shaders (<code>layout (location... |
Bouncing Slide Menu with Jquery <p>I'm new to Jquery and fairly new to HTML/CSS, but because I'm the type that learns through hands-on experience, I've been building a practice website while I learn new things, and have been experimenting with elements I'd like to eventually implement on a genuine site.</p>
<p>I've be... | <p>You have a space between your <code><li></code> elements and the dropdown menu (<a href="https://jsfiddle.net/8g48k77c/" rel="nofollow">You can see it here</a>).
Just remove / move it.</p>
<p>I did </p>
<pre><code>nav {
[...]
// padding: 10px 0;
padding: 0;
}
nav li {
[...]
// padding: 0 10px;
pa... |
Parse dates and create time series from .csv <p>I am using a simple csv file which contains data on calory intake. It has 4 columns: <code>cal</code>, <code>day</code>, <code>month</code>, year. It looks like this:</p>
<pre><code>cal month year day
3668.4333 1 2002 10
3652.2498 1 2002 11
3647.... | <p>You can use parameter <code>parse_dates</code> where define column names in <code>list</code> in <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_csv.html" rel="nofollow"><code>read_csv</code></a>:</p>
<pre><code>import pandas as pd
import numpy as np
import io
temp=u"""cal,month,year,day... |
VSTS SonarQube cannot find TRX file <p>I am using Visual Studio Team Services to carry out an automated build, and using SonarQube to display Code Quality, Coverage, etc. I am also using a privately hosted build agent.</p>
<p>The build steps all work successfully with data being processed and populated through to Son... | <p>This is a known issue, and will be fixed by the next release. See: <a href="https://jira.sonarsource.com/browse/SONARMSBRU-262" rel="nofollow">https://jira.sonarsource.com/browse/SONARMSBRU-262</a>.</p>
<p>We just announced the RC versions of the products that have this fix, you can give them a try. See <a href="ht... |
How can I schedule tasks to CPUs? <p>I have some tasks defined as Docker containers, each one will consume one full CPU whilst it runs.</p>
<p>Id like to run them as cost efficiently as possible so that VMs are only active when the tasks are running.</p>
<p>Whats the best way to do this on Google Cloud Platform?</p>
... | <p>You're right, all the major cloud container services provide you a cluster for running containers - <a href="https://cloud.google.com/container-engine/" rel="nofollow">GCP Container Engine</a>, <a href="https://aws.amazon.com/documentation/ecs/" rel="nofollow">EC2 Container Service</a>, and <a href="https://azure.mi... |
Why in C# is implicit casting from T to T[] not included? <p>I'm curious as to why we cannot consume the following method:</p>
<pre><code>void Foo(Bar[] items);
</code></pre>
<p>With:</p>
<pre><code>Foo(new Bar());
</code></pre>
<p>It would compile and work if the method signature included params</p>
<pre><code>vo... | <p>Since the <code>params</code> keyword creates an array of <code>Bar</code> which is filled by the compiler with your single instance of <code>Bar</code>.
If you define an <code>array of Bar</code> by your self then the compiler thinks "Ok, this is not my concern. The programmer will take care to provide the needed ... |
Javascript change function triggers tagname <p>I have working HTML and Javascript code but only for one <code>select</code> tag. And the issue is that I need it to cover all <code>select</code> tags I have in HTML. So colors in all options should be changed according to its <code>value</code> while selecting them.</p>
... | <p>You're specifically targeting the first <code>select</code> element with <code>select[0]</code>. If you want to apply this to <em>all</em> of them, you'll need a loop:</p>
<pre><code>for (var i = 0; i < select.length; i++) {
select[i].onchange = function() { ... }
}
</code></pre>
|
XML column compare in SQl server 2005 <p>I want to compare two XML columns with multiple rows in SQL Server 2005.</p>
<p>Table structure is as below</p>
<pre><code>CREATE TABLE [dbo].[UpdationLog](
[LogID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
[CustID] [int] NOT NULL,
[OldValue] [xml] NOT NULL... | <p>Here is one way. Not sure this is the ideal method but should get what you are looking for </p>
<pre><code>SELECT CustID,
Attribute,
Max(CASE WHEN iden = 'old' THEN val END) AS OldValue,
Max(CASE WHEN iden = 'new' THEN val END) AS NewValue
FROM (SELECT o.value('@CustID', 'int') AS C... |
Removing unwanted users from assignee list <p>I have a fairly vanilla JIRA cloud instance with 5 developers, however when assigning an issue, using the box to search for a user, I see what appears to be spam users in my list.</p>
<p>How do I remove these users? They do not show in the /admin/users section, as active o... | <p>The first point to check is within the <a href="https://confluence.atlassian.com/adminjiraserver071/managing-project-permissions-802592442.html" rel="nofollow">project permissions</a> (Toolgear->Projects->select project->Permissions). Since your users appears in the Assignee dropdown on the issue page, the user must... |
Conditional code for each build phase <p>I'm building a project from commandline with:</p>
<pre><code>xcodebuild -project ABC.xcodeproj -xcconfig ABC.xcconfig -target "All" -configuration Release
</code></pre>
<p><strong>How to have a few lines of codes that differ from one build phase to another?</strong></p>
<p>e.... | <p>The solution is to select the relevant target in XCode, go in <em>Build Settings</em>, and then search for <em>Preprocessor macros</em>, and then add a name, like <code>VST2</code> for each Debug, Release, Tracer.</p>
<p>Then in the code, it's possible to do:</p>
<pre><code>#ifdef VST2
...
#endif
</code></pre>
|
Android SQLite long value being retrieved/cast as an int value <p>I have an <code>INTEGER</code> column in my database table and have saved the value of <code>1476355625598</code> to it (by updating an existing row).</p>
<p>When I immediately check the value by doing a query, I get the same, correct, value of <code>14... | <p>The OP find his error before I have the time to write this but I will still post it to close it. OP can add his own if he want (no hard feeling ;) ) (This will prevent others to spam later to get some rep point...)</p>
<p>As excepted, the problem was coming from the retrieving of the value from the cursor. Even if ... |
Android: How to modify a WebView created in main activity from another activity <p>I have created a Webview in my Main Activity and I load the relevant html file. When I hit the settings icon, I launch another activity(SettingsActivity), I want to be able to alter the WebView from the SettingsActivity.</p>
<p>Eg. in m... | <p>In your case you should run <code>startActivityForResult()</code> when starting <code>SettingsActivity</code> and send bundled changes data via return <code>Intent</code> with result. Read official <a href="https://developer.android.com/training/basics/intents/result.html" rel="nofollow">docs</a> that cover two-way ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.