input
stringlengths
51
42.3k
output
stringlengths
18
55k
Excel: VBA code to DISABLE "Clear ALL or Clear Filters" <p>I have a protected Workbook &amp; Pivot table in an excel file on a filter that I'm sending to certain users based on the filter. ( Drill down is on, but Field List and Field Dialogs are turned off).</p> <p><strong>I want to disable these buttons "CLEAR FILTER...
<p>Answer from here:</p> <p><a href="http://stackoverflow.com/questions/21761027/excel-2013-vba-clear-all-filters-macro">Excel 2013 VBA Clear All Filters macro</a></p> <pre><code>Sub Macro1() Cells.AutoFilter End Sub </code></pre>
How to debugg iterative procedures? <p>I am using Dr. Racket and Racket for educational purposes (studying the SICP book). Dr. Racket is great and it has an awesome tool called "trace".</p> <p>After using:</p> <pre><code>(require trace/racket) (trace function) </code></pre> <p>It is possible to see what is happening...
<p>Tracing is not debugging. In DrRacket you press the DEBUG button and right click on the edge of interesting parts, like a <code>if</code> that determines base case or defautl case in a helper and choose "Pause at this point". Then everytime you hit Go you can see the bound arguments a step at a time.</p> <p>If you ...
String Array dimension set considering user input <p>I wrote some code. The idea is to ask user how many names they wish to enter, get the input and set the string array size accordingly. I have managed to finalise the code apart from setting array size. When I try something like this:</p> <pre><code>import java.util....
<p>This is working fine.</p> <pre><code> public static void main(String[] args) { Scanner read = new Scanner(System.in); System.out.println("How many names do you wish to enter?"); int numOfNames = read.nextInt(); String [] names = new String[numOfNames]; System.out.println("Enter the names."); i...
Social network query with MongoDB <p>I have a simple social network implementation with MongoDB. My schema looks like that:</p> <pre><code>User _id name Friend _id user friend Post _id user timestamp text </code></pre> <p>I'm trying to use the <code>aggregate</code> method to get a list of recent ...
<p>In aggregation pipeline, all expressions except accumulators used in the group state do not maintain state i.e. they cannot refer to fields from previous documents. Hence, it is not possible to satisfy this using just a Mongo query. It is better to implement this logic in your application code.</p>
Stopping a for loop <p>I've got a home task writing a programme in which the user inputs his name and surname and the output should be the initials. The problem is that applying this programme I get a line of initials which are repeated 10 times.</p> <p>How can I get the output of just one pair of initials?</p> <p>I'...
<p>This is infinite loop as i and j are being reassigned to 0. "for loop" structure should be like: for ( init; condition; increment ) please use below "for loop" in your program.</p> <pre><code>for (int i = 0; i &lt; argc; i++) { for (int j = 0, n = strlen(argv[i]); j &lt; n; j++) </code></pre> <hr> <p>To get ...
Query for empty has_many through <p>How can I query a <code>has_many :through</code> to see which records have an empty association on the other side? (I'm using rails 5)</p> <pre><code>class Specialty has_many :doctor_specialties has_many :doctor_profiles, through: :doctor_specialties class DoctorProfile has_m...
<pre><code>Specialty.includes(:doctor_profiles).where(doctor_profiles: { id: nil }) </code></pre> <p>See <a href="http://guides.rubyonrails.org/active_record_querying.html" rel="nofollow">Active Record Query Interface</a> for more info on AR querying.</p> <p>Since you're on Rails >= 5, you could use <a href="http://g...
word press page template formatting not working <p>im building a word pres theme and have found that formatting is not working. for example if i build a simple list in a post</p> <pre><code>&lt;ul&gt; &lt;li&gt;one&lt;/li&gt; &lt;li&gt;two&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>it works, but when i try it throug...
<p>Ok so in <strong>page.php</strong> I change this </p> <pre><code>&lt;?php get_header(); ?&gt; &lt;div class="row"&gt; &lt;div class="col-sm-12"&gt; &lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); get_template_part( 'content', get_post_format() ); endw...
Adding a product tag next to WooCommerce product name <p>I am using WooCommerce plugin with extension called Bundled product.</p> <p>When someone views the item, it would show like <a href="https://www.betterce.com/product/property-and-casualty-agent-24-hour-package/" rel="nofollow">this</a>.</p> <p>As you can see fr...
<blockquote> <p>I'm new to Woocommerce.</p> </blockquote> <p>Yes. You can add tags next to the product title... but the plugin as a different structure and more information is needed to know which hook to apply. An example (This code will Run on Single Product page);</p> <p>I suggest check the sourcecode of the plu...
Wordpress HTACCESS 301 Redirect Querystring index.asp <p>I have a basic WordPress HTACCESS. What I want to accomplish is a 301 Redirect from:</p> <p>/index.asp?id=herhaalrecept_aanvragen-5</p> <p>to</p> <p><a href="https://www.example.nl/aanmelden-nieuwe-patienten/" rel="nofollow">https://www.example.nl/aanmelden-ni...
<p><code>Redirect</code> or <code>RewriteRule</code> doesn't match query string. You need <code>RewriteCond</code> for that also you must keep that rule before other WP rules.</p> <pre><code>RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} (?:^|&amp;)id=herhaalrecept_aanvragen-5(&amp;|$) [NC] RewriteRule ^...
Moving data from one table to another using VBA <p>I am currently moving data from table1(named sheet1) in sheet1 to table2(named sheet2) in sheet2 if a value exists. I am new to List objects, and am unsure how to go about this. Sheet 1 will have a lot of data, while sheet 2 will be an empty table at first. I plan to i...
<pre><code>Dim e As String e = "Sheet1" Dim Lo As ListObject, Ros As ListRows, e2 As String Dim Tablesize As Integer, CurrentRow As Integer Dim Sht1 As Worksheet Set Sht1 = ThisWorkbook.Worksheets(e) ''Edited this line for best practice Set Lo = Sht1.ListObjects(e) Set Ros = Lo.ListRows Tablesize = Ros.Count e2 = "sh...
C++ Exceptions in Console App? <p>May be a dumb question, but I would like to use C++ exceptions in a console app (created with the new Win32 Console Application project wizard). I tried many variations on the theme shown below with no joy:</p> <pre><code>try { // do something that may throw an exception } catch( e...
<blockquote> <p>Are exceptions even allowed in non-.NET apps?</p> </blockquote> <p>Yes, they are.</p> <blockquote> <p>Am I missing some include file?</p> </blockquote> <p>It looks like you're missing the necessary <code>#include &lt;exception&gt;</code> and/or the namespace scoping with <code>std::</code>.</p> ...
SQL based on my Example for Month <p>I am new to SQL and Learning on my own. I was wondering if someone can help guiding me to a write SQL.</p> <p>I have the below data:</p> <p><img src="https://i.stack.imgur.com/xWGO3.png" alt="Sample"></p> <p>I am using the following query:</p> <pre><code>SELECT TIMESTAMP ...
<p>This should work.There was a extra timestamp column in select list. </p> <pre><code>SELECT DATEPART(Year, TIMESTAMP) Year, DATEPART(Month, TIMESTAMP) Month, COUNT(*) [Total Rows] FROM stage.ACTIVITY_ACCUMULATOR_archive WHERE TIMESTAMP BETWEEN '01-Jan-2014' AND '30-June-2014' GROUP BY ...
Android: Record raw audio and record video at the same time <p>I develop an Android app based on sound and video records. I would like to get a real-time playback of the mic audio in the headphones while previewing AND capturing the video and sound.</p> <p>What i have now, working fine alone:</p> <p>1) use Superpower...
<p>According <a href="http://bigflake.com/mediacodec/" rel="nofollow">bigflake</a> </p> <blockquote> <p>The MediaCodec class first became available in Android 4.1 (API 16). It was added to allow direct access to the media codecs on the device.</p> <p>In Android 4.3 (API 18), MediaCodec was expanded to include a...
How to include shieldui in asp.net mvc? <p>I'm new to <code>shieldui</code> js and asp.net mvc and I'm doing some examples for a train. I have no problem including the js in a html file but I'm struggling to include it in asp.net mvc. Lets say i have jquery and shield ui in Scripts folder. I did reference <code>Shield....
<p>Later findings: it looks like some time ago there weren't html helper extension methods for that. Are you sure you have something like that? </p> <p>Question reference: <a href="http://stackoverflow.com/questions/23031573/shield-ui-chart-generate-series-dynamically">shield ui chart: generate series dynamically?</a>...
Xcode 8: class_getProperty is Null for Core Data Category <p>I would like to check for properties with <code>class_getProperty</code> on Core Data related classes and categories.</p> <p><strong>Structure</strong>:</p> <pre><code>@interface Person : NSManagedObject @end @interface Person (CoreDataProperties) @propert...
<p>Arg...bad and stupid error.</p> <p>I forgot to add the Categories to the target. Sometimes it is so simple.</p>
AndroidStudio Error After configured SDK path <p>I download the (android studio and android sdk) zip file.</p> <p><a href="https://i.stack.imgur.com/cAPNN.png" rel="nofollow">After configured SDK path, open the configuration has been loading the SDK Manager</a></p> <pre> 2016-10-11 22:58:43,193 [1355018] INFO - nfi...
<p><a href="https://code.google.com/p/android/issues/detail?id=222920&amp;sort=-modified&amp;colspec=ID%20Type%20Status%20Owner%20Summary%20Stars%20Modified" rel="nofollow">Try this</a>.Hope it solve your problem too.</p>
Problems ionic and iOS10 builds <p>My ionic application for iOS worked fine, 'till today when I wanted to make a new build.</p> <p>This is what get's returned by Apple:</p> <blockquote> <p>Dear developer,</p> <p>We have discovered one or more issues with your recent delivery for "AppName". To process your de...
<p>Found the solution: <code>$ cordova plugin list</code> and re-install all plugins and read their docs of how to install them regarding the NSPhotoLibraryUsageDescription etc .</p>
Why does setting android:background on a Button cause loss of L/R padding? <p>I am using Android Studio 2.2.1 with project with these settings:</p> <pre><code>compileSdkVersion 24 buildToolsVersion "24.0.2" minSdkVersion 16 targetSdkVersion 24 </code></pre> <p>If I use the GUI to change the button background, it adds...
<blockquote> <p>This seems like a bug somewhere, but where?</p> </blockquote> <p>Right here:</p> <pre><code>android:background="@color/colorPrimary" </code></pre> <blockquote> <p>Is it in the code generation or is this a bug in Android 4.4? </p> </blockquote> <p>No, it is your replacement background. It is a co...
How to lazy load a custom attribute on a Laravel model? <p>Is there any possible way to lazy load a custom attribute on a Laravel model <strong>without</strong> loading it every time by using the <code>appends</code> property? I am looking for something akin to way that you can <a href="https://laravel.com/docs/5.2/elo...
<p>Is this for serialization? You could use the <code>append()</code> method on the Model instance:</p> <pre><code>$model = MyModel::all(); $model-&gt;append('foo'); </code></pre> <p>The <code>append</code> method can also take an array as a parameter.</p>
Rethinkdb update nested object <p>I have a document like below-</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>{ "badgeCount": { "0e2f8e0c-2a18-499d-8e64-75b5d284e...
<p>Rethink doesn't work like this. It doesn't rewrite object with <code>update</code>.</p> <p>So, for this case you need to <code>replace</code> current object. And, btw, better to use <code>get</code> instead of <code>filter</code>, cause it's faster. There are doing the same in this situation 'cause id field is uniq...
Stored image in SQLite is not shown in Gridview <p>Yesterday I asked <a href="http://stackoverflow.com/questions/39963294/attempt-to-invoke-interface-method-int-android-database-cursor-getcount-on-a/39963507?noredirect=1#comment67207166_39963507">this</a> question where I was putting some static data to sqlite via a co...
<p>You are storing image url in your database, but you are reading an Integer in your <code>MyCityAdapter</code>. You need to get image url again in <code>bindView()</code> method. Once you get the url of the image, you will have to download and store the image itself. But there is no need to write it all yourself. I r...
Android Studio Emulator Showing Up; Not Working <p>Following online instructions, I created an app that converts kilometers to miles, and miles to kilometers. I tried to run the app, and I turned on the emulator. It showed up, but it didn't run the program. That's all I know about the problem. Any suggestions? (I reall...
<p>I believe your emulator is complaining because you don't have enough ram to give to the emulator. </p> <p>I think you go to tools > Android > AVD manager and then select the emulator you want to use. Once selected you should be able to reduce the amount of ram to 1024m like it's asking you to do. I'm not on my pc a...
REST API, HTTP status code and result code <p>This is more a "philosophical" question than a technical one.</p> <p>Assume that you have a message, and users that are allowed (or not) to access this message. Let's assume we have an api to do that, here would be the endpoints :</p> <ul> <li>/message/(id_message)/allow/...
<p>Surely this is not a philosophical question but one about what the standard says and about real advantages of obeying these standards.</p> <p>HTTP specifies GET, PUT and DELETE operations to be <a href="http://www.restapitutorial.com/lessons/idempotency.html" rel="nofollow">idempotent</a>. This means that repeating...
How to change element CSS when hover on a link <p>I have a working wordpress theme, but I want to change some visual aspects. I want to change the background of a couple of elements when I hover the mouse on a specific menu option, something like on this site: <a href="http://www.tecmundo.com.br/teste-de-velocidade.htm...
<p>By adding <code>:hover</code> after your class name in your css file and then define a new class (like that : <code>.yourClass:hover{}</code> , that should be your new class (don't touch the <code>.yourClass</code>, just create a new one with the <code>:hover</code> with the style you want).</p>
Form not reading information from database <p>I am configuring a sign in form from a framework I use every now and then. However, for some reason the <code>$tryagain</code> error keeps populating. I know the information is correct in my database and I even edited the password within the database to remove the hash to e...
<p>I think your error lies in the check you are making here:</p> <pre><code>if($this-&gt;data()-&gt;password === Hash::make($password, $this-&gt;data()-&gt;salt)) { Session::put($this-&gt;_sessionName, $this-&gt;data()-&gt;id); </code></pre> <p>If I read this correctly you are taking the value that the user h...
Error when sending email using postal MVC? <p><strong>Requirement:</strong></p> <p>Send emails to all users dynamically everyday at a particular time, say 6:00 AM.</p> <p><strong>What I did so far:</strong></p> <p>I use a third party library called Quartz.net from Nuget.</p> <pre><code>public class TaskScheduler : ...
<p>According to this issue: <a href="https://github.com/andrewdavey/postal/issues/65" rel="nofollow">Postal Issue #65</a>, it seems that you have <code>HttpContext.Current</code> contains null value when trying to get relative path of your project root directory in IIS deployment server. Here was the checklist to do:</...
node imap attempting to update flags: Error: Command received in Invalid state. <p>Submitting this question and its answer because SA (and for that matter Google) was VERY unhelpful about this.</p> <p>I need to delete all messages in my INBOX. Irrelevant lines below cut for clarity:</p> <pre><code>function openInbox(...
<p>The problem is you've opened the INBOX in read-only mode. That's the 'true' in the second argument right here:</p> <pre><code>function openInbox(cb){ imap.openBox('INBOX', true, cb); } </code></pre> <p>Change that to</p> <pre><code>function openInbox(cb){ imap.openBox('INBOX', false, cb); } </code></pre> ...
How to use find_in_set with join in codeigniter <p>I have 4 tables, and I want to fetch data from all the tables, I can do this by fetching data one by one from each table but I want to do it by using JOIN.</p> <p><a href="https://i.stack.imgur.com/oJon0.png" rel="nofollow">Main Table (which contains ids of other tabl...
<p>Read all 1-1 referred data using Join, cycle through data exploding area_id column</p> <pre><code>area_id -------&gt; ($value = explode($row-&gt;area_id, ',') </code></pre> <p>then read data from database and insert into response array (or object). Of course all of this operation must be done into the model...</p>...
Angular2 component reloads twice for no reason <p>Im working on an angular2 RC4 app and I started to notice something weird. I have a bunch components I can route to:</p> <pre><code>Parent(A) - ManyChildren(B,C,D,E) </code></pre> <p>My component A gets the ID, talks to a service to get an item and updates the state. ...
<p>I don't know the reason of this behaviour. It's strange. But as the documentation says in <a href="https://angular.io/docs/ts/latest/guide/lifecycle-hooks.html" rel="nofollow">https://angular.io/docs/ts/latest/guide/lifecycle-hooks.html</a> you should keep your service logic into ngOnInit() instead of constructor:</...
Upload file to MS SharePoint using Python OneDrive SDK <p>Is it possible to upload a file to the <strong>Shared Documents</strong> library of a <strong>Microsoft SharePoint</strong> site with the <strong><a href="https://github.com/OneDrive/onedrive-sdk-python" rel="nofollow">Python OneDrive SDK</a></strong>? </p> <p>...
<p>I finally found a solution, with the help of (<em>SO user</em>) sytech.</p> <p>The answer to my original question is that using the original <strong><a href="https://github.com/OneDrive/onedrive-sdk-python" rel="nofollow">Python OneDrive SDK</a></strong>, it's <strong>not possible</strong> to upload a file to the <...
How to check Drop date time of an ORACLE view <p>Where can I see at what time a view was dropped from database.</p> <p>For other object types such as Indexes and tables , I use dba_recyclebin to check the droptime , but for a view I do not think that ORACLE captures details in this table. </p>
<p>Assuming that the drop was recent enough that the data is still present in your <code>UNDO</code> tablespace (likely a few hours but up to a few days depending on your workload and configuration) you should be able to use a flashback query on <code>dba_views</code>. You'd need to have the <code>FLASHBACK ANY TABLE<...
How to resolve Angular 2 - Base64 404 Resource not found Error? <p>After doing a fresh <code>npm install</code>, the system is broken. I'm getting an error saying "404 Resourse not found." </p> <p>I have tried the following, which didn't help...</p> <ul> <li>Deleted node_modules and typings folders followed by 'npm i...
<p>I have a similiar issue and in my case it seems to be angular2-jwt loading js-base64. I can't seem to figure out how to correct the issue. However, I also came across this that may be relevant. <a href="https://auth0.com/forum/t/angular2-jwt-unexpected-token-syntax-error-from-system-config/1807" rel="nofollow">http...
Grouping while maintaining next record <p>I have a table (NerdsTable) with some of this data:</p> <pre><code>-------------+-----------+---------------- id name school -------------+-----------+---------------- 1 Joe ODU 2 Mike VCU 3 Ane ...
<p>From your desired output it looks like you are just trying to order the records by school. You can do that like this:</p> <pre><code>SELECT id, name FROM dbo.NerdsTable ORDER BY school ASC, id ASC </code></pre> <p>I don't know what next ID is supposed to mean.</p>
Acquire x-axis values in Python matplotlib <p>Before I ask this question, I have already searched the internet for a while without success. To many experts this surely appears to be fairly simple. Please bear with me. </p> <p>I am having a plot made by matplotlib and it is returned as a plf.Figure. See the following: ...
<p>You can do:</p> <pre><code>l = ax.axes.lines[0] # If you have more curves, just change the index x, y = l.get_data() </code></pre> <p>That will give you two arrays, with the <code>x</code> and <code>y</code> data</p>
"Extra data" error trying to load a JSON file with Python <p>I'm trying to load the following JSON file, named <code>archived_sensor_data.json</code>, into Python:</p> <pre><code>[{"timestamp": {"timezone": "+00:00", "$reql_type$": "TIME", "epoch_time": 1475899932.677}, "id": "40898785-6e82-40a2-a36a-70bd0c772056", "n...
<p>It is not a valid json; There are two list in here; one is</p> <pre><code>[{"timestamp": {"timezone": "+00:00", "$reql_type$": "TIME", "epoch_time": 1475899932.677}, "id": "40898785-6e82-40a2-a36a-70bd0c772056", "name": "Elizabeth Woods"}] </code></pre> <p>and the other one</p> <pre><code>[{"timestamp": {"timezon...
Shell script: top command and date command at once <p>I would like to print in a file the % of cpu usage of a process (top command) + the date when this top command gets the information, for each 0.5 seconds (each line with the date + this cpu information) If I write in a shell script, I would do something like</p> <p...
<p>You can achieve this by piping the output of <code>top</code> through <code>awk</code>, and having <code>awk</code> run <code>date</code>. For example:</p> <pre><code>top -d 0.5 -n 100 -p myProcessPID \ | awk '/myProcessName/ { system("date +%s"); print $0 }' </code></pre> <p>You can exert arbitrary control ov...
How to access to each attribute of an object array using a loop? <p>I have a <code>Person</code> object:</p> <pre><code>class Person{ var name: String var city: String var country: String init(name: String, city: String, country: String){ self.name = name self.city = city self....
<p>You can make use of reflection and MirrorType</p> <pre><code>let firstObj = values[0] let personMirror = Mirror(reflecting: firstObj) for child in personMirror.children { let (propertyName, propertyValue) = child print(propertyName) print(propertyValue) } </code></pre> <p>You can access a specific prop...
Adjusting width of TextAreaFor <p>I have a form that has a few <code>TextBoxFor</code> and 1 <code>TextAreaFor</code></p> <p>Here it is:</p> <pre><code>&lt;div class="form-horizontal"&gt; &lt;div class="form-group"&gt; @Html.LabelFor(m =&gt; m.FromName, new { @class = "col-md-2 control-label" }) &...
<p>I have figured this out. After Inspecting the Elements, I saw that all of the <code>input</code>, <code>textarea</code>, and <code>select</code> had a <code>max-width</code> of <code>280px</code>.</p> <p>So all I had to do was give the <code>textarea</code> a class and set its <code>max-width</code> to something t...
Convert an Int to a date field <p>I'm trying to convert an integer field to an actual date field. Someone created a "date" field that just sticks in a "date" that is actually an integer. I'm trying to convert it to an actual date. </p> <p>I have tried the following to no avail:</p> <pre><code>CAST(CAST(last_purch_da...
<p>Simple cast as date could work</p> <pre><code>Select cast(cast(20161011 as varchar(8)) as date) </code></pre> <p>Returns</p> <pre><code>2016-10-11 </code></pre> <p>If your data is suspect, you could also use Try_Convert()</p> <pre><code>Select Try_Convert(date,cast(2610 as varchar(8))) </code></pre> <p>Returns...
Difference between page and image request <p>My basic question is do browsers handle these two requests differently?</p> <p><code>&lt;a href='imageGenerator.php?id=1'&gt;Browser Request&lt;/a&gt;</code></p> <p>vs</p> <p><code>&lt;img src='imageGenerator.php?id=1' /&gt;</code></p> <p>Both generate an image stream on...
<p>I found out that it had to do with Laravel throwing an error when it couldn't read the env file on occasion.</p>
Limit Kafka batches size when using Spark Streaming <p>Is it possible to limit the size of the batches returned by the Kafka consumer for Spark Streaming?</p> <p>I am asking because the first batch I get has hundred of millions of records and it takes ages to process and checkpoint them.</p>
<p>I think your problem can be solved by <strong>Spark Streaming Backpressure</strong>.</p> <p>Check <code>spark.streaming.backpressure.enabled</code> and <code>spark.streaming.backpressure.initialRate</code>.</p> <p>By default <code>spark.streaming.backpressure.initialRate</code> is <strong>not set</strong> and <co...
Converting a nested array into a pandas dataframe in python <p>I'm attempting to convert several dictionaries contained in an array to a pandas dataframe. The dicts are saved as such: </p> <pre><code>[[{u'category': u'anti-social-behaviour',u'location': {u'latitude': u'52.309886', u'longitude': u'0.496902'},u'month': ...
<p>You are on the right track, but you are creating a new dataframe for each row and not giving the proper <code>columns</code>. The following snippet should work:</p> <pre><code>import pandas as pd import numpy as np crimes = [[{u'category': u'anti-social-behaviour',u'location': {u'latitude': u'52.309886', u'longitu...
Button positioning in Highcharts and name of chart type <p><a href="https://i.stack.imgur.com/YyF51.png" rel="nofollow"><img src="https://i.stack.imgur.com/YyF51.png" alt="enter image description here"></a></p> <p>I need to create a chart using Highcharts like on the picture above.</p> <p>So, I need to know:</p> <ol...
<p>Taken from <a href="http://stackoverflow.com/questions/15935837/how-to-display-a-range-input-slider-vertically">this question</a>:</p> <blockquote> <p>setting height greater than width is needed to get the layout right between browsers. Applying left and right padding will also help with layout and positioning.</...
d3.js format axis uniformly in millions <p>I found <a href="http://stackoverflow.com/questions/19907206/format-y-axis-values-original-figures-in-millions-only-want-to-show-first-thre/39981718#39981718">this thread</a> and it got me halfway to where I need to be and I'm wondering if anyone knows how I can adjust the sol...
<p>You don't need to use a SI prefix in this case. Given this domain:</p> <pre><code>var scale = d3.scaleLinear().domain([200000,1800000]) </code></pre> <p>Going from 200 thousand to 1.8 million, you can simply divide the tick value by 1,000,000 and add a "million" string.</p> <p>Here is the demo:</p> <p><div class...
SAS: What is the fileref referring to in a DDE link? <p>Can someone please explain what a statement like</p> <pre><code>filename fileref dde 'excel|system'; </code></pre> <p>does within SAS?</p> <p>According to <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms648774(v=vs.85).aspx" rel="nofollow">M...
<p>As far as I know, there's not a physical file involved in DDE. Rather, as you note, it is a stream. SAS and C are fairly similar in that sense; files really are more like devices. There are plenty of other similar examples - the <code>pipe</code> device, for example, which allows you to interact with the system c...
How to achieve test isolation with Symfony forms and data transformers? <p><strong><em>Note:</strong> This is Symfony &lt; 2.6 but I believe the same overall issue applies regardless of version</em></p> <p>To start, consider this form type that is designed to represent one-or-more entities as a hidden field (namespace...
<p>First of all, I have next to no experience with Symfony. However, I think you missed a third option there. In Working Effectively with Legacy Code, Michael Feathers outlines a way to isolate dependencies by using inheritance (he calls it "Extract and Override").</p> <p>It goes like this:</p> <pre><code>class Hidde...
I can't inflate a view in a custom infowindow in Mapbox <p>I am doing a map guide for Android using Mapbox and Android Studio IDE, but I am having a hard time dealing with the custom infowindow. </p> <p>I want to inflate the infowindow (the one after I click on a marker) but as of yet I want to use an XML for that for...
<p>Have a look at <a href="https://github.com/mapbox/mapbox-android-demo/blob/master/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/CustomInfoWindowActivity.java" rel="nofollow">this example</a> found in the <a href="https://github.com/mapbox/mapbox-android-demo" rel="nofollow">Mapbox...
How to get the last executed command in a Telegram bot? <p>I have a <strong>telegram bot</strong> like this:</p> <ul> <li>Getting updates by <code>webhook</code></li> <li>Language: C# <em>(I welcome answers with other languages too)</em></li> <li><p>We have the following scenario for the user:</p> <ol> <li>Send <code...
<p>Question 1:</p> <blockquote> <p>What is the best way to make sure the sent photo by the user is right after sending /MyPhoto a_parameter command?</p> </blockquote> <p>I think the best solution is to store /MyPhoto <code>update_id</code> for each user and compare it with uploaded photos <code>update_id</code>. ...
Apache httpd.conf for redirecting ip to hostname - SSL <p>In a similar problem addressed <a href="http://stackoverflow.com/questions/11649944/apache-httpd-conf-for-redirecting-ip-to-hostname">here <em>(Apache httpd.conf for redirecting ip to hostname)</em></a><br /> I would like to know how to do a redirect from an <st...
<p>To redirect from some https site to anything else you need to have a valid certificate for this site, i.e. a certificate where the subject matches the name in the URL. In your case the certificate probably does not include the IP address and that's why the access to the site will result in a certificate validation e...
Postgres: Statistical functions on date time intervals <p>I need to run some statistical analysis on intervals i.e. difference between two datetime fields in a table. </p> <p>According to the aggregate function documentation <a href="https://www.postgresql.org/docs/current/static/functions-aggregate.html" rel="nofoll...
<p>As I said in a comment, to work out sample standard deviation manually, at some point you multiply an interval by an interval. PostgreSQL doesn't support that.</p> <p>To work around that issue, reduce the interval to hours or minutes or seconds (or whatever). This turns out to be a lot simpler than working out the ...
angular databinding 2 numbers to equal another <p>I have 2 divs that must always equal 100%. So they each start out 50%. The one on the left, can be changed from 1-99 (as an input), and the other must match that so they both always stay 100%.</p> <p>for example: div A = 35%, div B must auto-change to 65%. I know how t...
<p>just keep subtracting div a from b first div</p> <pre><code>&lt;div&gt;{{A}}&lt;/div&gt; </code></pre> <p>second div</p> <pre><code>&lt;div&gt;{{100-A}}&lt;/div&gt; </code></pre>
What data structure should be used to represent this table? <p>Given the following dataset.</p> <pre><code>| | English | Maths | Science | Total | |-------|---------|-------|---------|-------| | Alice | 7 | 4 | 6 | ? | | Bob | 3 | 5 | 1 | ? | | Total | ? | ? | ...
<p>You can simply keep a HashMap where key is the 'Name' and the value is the structure of 'English,Hindi... Total'. Apart from all the names in the Key, have a special Name - 'Total' in the Key. So, every time you are adding a student's name, lets say, Alice and subject : English, you need to search for 2 keys: Alice...
Extra Input Tags appear in HTML <p>Recently found an issue when trying to write some Automation Tests for a component in my webapp, I am using Anglur for the front end, and am trying to create a type ahead input textbox</p> <pre><code> &lt;div class="row"&gt; &lt;div class="col-md-4"&gt; &lt...
<p>I found the answer, and it isn't a bug as I first assumed.</p> <p>The Input Tag property <code>typeahead-show-hint="true"</code> is responsible for generating the second input box in the HTML, It is used to display a suggested item in the text box.</p>
Getting rid of || or's in C programming <p>I'm using <code>||</code> so that if the user types in a <code>Y</code> or <code>y</code> it equals the same. Example: <code>(option=='y' || option =='Y')</code> I know there's a single function to get rid of this so that the user types in <code>Y</code> or <code>y</code> it e...
<p>You could try to use <code>tolower((unsigned char)option) == 'y'</code> as described on <a href="https://www.tutorialspoint.com/c_standard_library/c_function_tolower.htm" rel="nofollow">https://www.tutorialspoint.com/c_standard_library/c_function_tolower.htm</a> (you need to add <code>#include &lt;ctype.h&gt;</code>...
urls don't work with linkify.js <p>I am trying to use linkify.js library to convert any urls in the text to hyperlinks. The returned string does not come back with hyperlinks and I don't see any errors either. Please find the code below and advise why this is not working. Thanks.</p> <pre><code>npm install linkifyjs ...
<pre><code>var linkified = linkifyHtml(testStr, { defaultProtocol: 'https' }); console.log(linkified); </code></pre> <p>gives me </p> <pre><code>&lt;a href="http://google.com" class="linkified" target="_blank"&gt;http://google.com&lt;/a&gt;. This is awesome. </code></pre>
Conditional Filtering breaks with whitespace <p>I'm retrieving a subset of database records based on user-entered criteria.</p> <p>Searching by name successfully retrieves all records containing the string ONLY if the string is one word without whitespace. When adding another word or a space it returns an empty result...
<p>Try and remove the spaces.</p> <p>result = result.Where(x => x.Name.Replace(" ","").Contains(searchModel.Name));</p>
decode JavaScript code ? <p>I found this code in the blog template,Already used it. I am afraid to be harmful blog,Or be an injection ..I'm trying to decode it but failed , so please help ? because i want to be sure what is it , </p> <pre> document.write( unescape( &#39;%3C%73%63%72%69%70%74%20%73%72%63%3D%27%68%74%74...
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>console.log( unescape( '%3C%73%63%72%69%70%74%20%73%72%63%3D%27%68%74%74%70%73%3A%2F%2F%61%72%6C%69%6E%61%2D%64%65%73%69%67%6E%2E%...
Avoiding infinite recursion but still using unbound parameter passing only <p>I have the following working program: (It can be tested on this site: <a href="http://swish.swi-prolog.org" rel="nofollow">http://swish.swi-prolog.org</a>, I've removed the direct link to a saved program, because I noticed that anybody can ed...
<p>The short answer: no, you cannot avoid the extra argument without making everything much messier. This is because this particular algorithm for finding a path needs to keep a state; basically, your extra argument is your state.</p> <p>There might be other ways to keep a state, like using a global, mutable variable,...
xcode 8 UIStackView. How to make round buttons? <p>I am using <code>UIStackView</code> and I am trying to make the buttons round. My first four buttons have user defined runtime attributes:</p> <pre><code>layer.cornerRadius Number 10 layer.masksToBounds Boolean true </code></pre> <p><a href="https://i.stack.imgur.c...
<p>I don't know why your attempt to use user-defined runtime attributes is not working; it's a legitimate technique, and I've used it.</p> <p>That said, here's another approach: use a UIButton subclass. Define your subclass to set these values in its initializer (here, <code>init(coder:)</code> is what you'll need to ...
How to analyze a photo sent through JSON <p>I have a Web Service that takes a photo through a POST statement and returns a modified copy of that photo back. We are making changes to the way it processes the photo, and I want to verify that the photo at least has different properties coming back than it did before our ...
<p>Possible duplicate of <a href="http://stackoverflow.com/questions/672916/how-to-get-image-height-and-width-using-java">this question</a></p> <blockquote> <p>... I'm trying to figure out how to get the byte stream into an Java image object so that i can get its dimensions.</p> </blockquote> <p>I'd suggest using a...
SQL query for Length and Between <p>I need to write a query for finding the length of the word between <code>value1</code> and <code>value2</code>. I tried the query below:</p> <pre><code>select * from table_name where LENGTH (column_name (BETWEEN 1 and 2) ); </code></pre>
<p>You can do it like this:</p> <pre><code>SELECT * FROM table_name WHERE LENGTH (column_name) BETWEEN 1 and 2; </code></pre>
Exit code non-zero and unable to see output logs <p>How do I view stdout/stderr output logs for cloud ML? I've tried using gcloud beta logging read and also gcloud beta ml jobs stream-logs and nothing... all I see are the INFO level logs generated by the system i.e. "Tearing down TensorFlow".</p> <p>Also in the case w...
<p>It may be the case that the Cloud ML service account does not have permissions to write to your project's StackDriver Logs, or the Logging API is not enabled on your project.</p> <p>First check whether the Stackdriver Logging API is enabled for the project by going to the API manager: <a href="https://console.cloud...
System.env and values in Properties file are not being read on Slave Nodes of Spark Cluster <p>I do have a multi node spark cluster and submitting my spark program on node where master resides.</p> <p>When the job submitted to slave nodes, the HOSTNAME paramter is giving null value. Here is the line where properties ...
<p>Can you please let us know OS of all the nodes and if you have ensured that noting on Master node is exporting the HOSTNAME. Answering your question will be better if you let us know about your OS detail.</p> <p>May not be correctly related to your context but just for information System.getenv("HOSTNAME") may not ...
How can i fix this error in expressjs <p>i'm using expressjs with jade. I'm trying to do a factorial with an input, but i can't display the answer for example if i input 5 the result is 120, but display a big error. How can i make this? Please can you help me? <a href="https://i.stack.imgur.com/r0nGw.png" rel="nofollow...
<p>I can see at least one mistake: </p> <pre><code>res.send(/factorial + i) </code></pre> <p>isn't in any known way of sending an answer, and probably is the cause of the error . In fact the errro is telling you that you send an invalid result code (45), probably becuase interprets the first char of your response (/)...
How to modify an existing Google Maps marker in an iOS app? <p>I have a small problem. When the user searches for an address, if it exists I zoom to the marker and then I want to give it a different color. I am trying to use this :<a href="https://developers.google.com/maps/documentation/ios-sdk/marker" rel="nofollow"...
<p>Try this..</p> <pre><code>_targetMarker.icon = [UIImage imageNamed:@"marker-icon"]; </code></pre> <p><strong>Note: Marker must be initialised.</strong></p>
Java enum pass as an constructor <p>I am trying to pass a reference of an enum type from a constructor to test some lambdas, method reference, and <code>Stream</code>s. When I try to instantiate the class I am getting a error on the enum. </p> <pre><code>public class Book { private String title; private List&...
<p>Replace </p> <pre><code>Book nails = new Book("Fundamentals of Chinese Fingernail image", Arrays.asList("Li", "Fun", "Li"), new int [] {256}, Year.of(2014), 25.2, COMPUTING); </code></pre> <p>by</p> <pre><code>Book nails = new Book("Fundamentals of Chinese Fingernail image", Arrays.asList("Li", "Fun...
Three.js change rotation on click <p>I want to change/start an animated rotation of an object when I click a button. I understand that the render funciton is an infinite loop and that cylinder.rotation.x += 0.1 adds up the angle and makes the thing go round. I want to change start this parameter using a button. So far ...
<p>Just move <code>render()</code> inside <code>onclick</code>.</p> <pre><code>var render = function () { requestAnimationFrame(render); cylinder.rotation.x += 0.1; renderer.render(scene, camera); }; btn.onclick = function() { render(); }; </code></pre> <p>This works for your specific problem, but probably...
Empty If Optimization <p>Consider the following:</p> <pre class="lang-c prettyprint-override"><code>int status = 0; while(status &lt; 3) { switch(status) { case 0: // Do something break; case 1: if(cond1 &amp;&amp; cond2 || cond3 &amp;&amp; cond4) ...
<p>For a general purpose compiler, the answer is no.</p> <p>Two optimizations that are closely related however, are the <a href="https://en.wikipedia.org/wiki/Optimizing_compiler#Data-flow_optimizations" rel="nofollow">Data flow optimizations</a>, which aims to eliminate double calculations and impossible paths in cod...
Clean # symbol from Json object in Javascript <p>I have this json string, turned into a Javascript object which on one of its levels returns something like this</p> <pre><code>"link": { "#tail": "\n\n\t\t", "#text": "http://static2.server.com/file.mp3" }, </code></pre> <p>I need to g...
<p>What about stripping out the <code>#</code>s before you use the object?</p> <pre><code>function stripHashes(obj) { var strippedObj = {}; Object.keys(obj).forEach(function(key) { strippedObj[key.substr(1)] = link[key]; }); return strippedObj; } </code></pre> <p>This will return a new object ...
Upload multiple files in angularjs and backend using laravel (without form tag) <p>I want to upload multiple files without using form tag and using angular js and i am using laravel 5.2. Below code i tried sending only 1 file it works but on multiple files it fails.</p> <p>HTML Code</p> <pre><code>&lt;input type="fil...
<p>You can try that with <a href="https://github.com/nervgh/angular-file-upload" rel="nofollow">https://github.com/nervgh/angular-file-upload</a>, it supports input type file with multiple parameter and you don't need jquery.</p> <p>You just instate new uploader object: <code>$scope.uploader = new FileUploader({var op...
Azure Worker role and blob storage c# - Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (400) Bad Request <p>I have uploaded files in blob storage. I am trying to download those files from worker role to do some processing on it. The container name is sent from the WebApi2 to the q...
<p>Looking at your code, you're doing the following:</p> <pre><code>string msg = "Container Name: " + receivedMessage.GetBody&lt;String&gt;(); </code></pre> <p>And then you're doing the following:</p> <pre><code> imagesContainer = blobClient.GetContainerReference(msg); // Create the container if it do...
async/await in ASP.NET with synchronous Sql Server connection <p>Is there any real benefit of using async/await in an ASP.NET application if the only I/O calls are to a backend SQL Server database that is not using the ASYNC parameter in its connection string? </p>
<p>Most likely, <code>async</code> is not going to help you in your situation (that is, with a single SQL Server instance). This is assuming that most (or all) I/O-bound ASP.NET requests hit the database.</p> <p>As I stated in my <a href="https://msdn.microsoft.com/en-us/magazine/dn802603.aspx" rel="nofollow">intro to...
How to input and compare a string <p>I'm new to C and I need help. This code doesn't work, even if I type London into the input I recieve the message from else: "Try again".</p> <pre><code>int main() { char capitalCity; scanf("%s", &amp;capitalCity); if (capitalCity == 'London'){ printf("Is the ...
<p>There is no <code>string</code> data type in C programming language. <code>Strings</code> in C are represented as array of characters.</p> <p>In C, <code>char</code> is a data type to represent a character (<strong>char</strong> in C represents the character type, suitable for storing a simple character—tradition...
can synchronized at method level be replaced by Lock? <p>When writing a thread safe class, we use <code>synchronized</code> keyword at two places in code, </p> <p>1.Method level synchronization</p> <p>2.Synchronized blocks</p> <p>As far as I can think of, interfaces like <code>Lock</code> (<code>java.util.concurrent...
<p>There is no special syntax for "acquire the Lock at the beginning of the method, and release it at the end," like there is for <code>synchronized</code>.</p> <p>You can, of course, just do that yourself:</p> <pre><code>public void method() { lock.lock(); try { // rest of the method } finally { ...
Converting factor value to new variable which stores count of how many times it occured in the factor <p>I have ATP data set from kaggle. I am working on it in R.In the data set I have various variables like match date, city, tournament name, winner name, loser name, total set won by match winner, total set won by matc...
<p>If I understand your problem, you can do something like this:</p> <ol> <li>Use the <strong>table</strong> function to colapse the data</li> <li>Then you can use the <strong>apply</strong> function over the output of the first point</li> </ol>
Codeigniter send mail with gmail smtp on localhost <p>I know that question has a couple of duplicates but I think I've tried them all.</p> <p>My mail is never send calling it with the following settings:</p> <pre><code>$config = Array( 'protocol' =&gt; 'smtp', 'smtp_host' =&gt; 'smtp.gmail.com', ...
<p>I found the answer...</p> <p>This is what I ended up using</p> <pre><code>$config = Array( "protocol" =&gt; "smtp", "smtp_host" =&gt; "smtp.gmail.com", //"smtp_host" =&gt; "localhost", "smtp_port" =&gt; 587, "mailpath" =&gt; "C:\\xampp\\sendmail", ...
CGRect init error in swift3 <p>The following code returns a couple of compiler errors after converting to swift3:</p> <pre><code>override init(frame: CGRect) { //Initializer does not override a designated initializer from its superclass super.init(frame: frame) //Must call a designated initializer of the superclas...
<p>I am guessing (from the comment in your code) that you are trying to create a subclass of MKAnnotationView. If thats true, try this.</p> <pre><code>class myAnnot : MKAnnotationView{ override init(frame: CGRect) { super.init(frame: frame) } required init?(coder aDecoder: NSCoder) { fata...
How do I parse complex XML file using DOM? <p>How do I parse complex XML file using DOM ? I need to access each child of grade but I am getting all the classes within xml files.How do I access grade , child , student and teacher elements . </p> <pre><code>public SchoolM readFileNBuildModel(String filePath) { File ...
<p>Use the <code>getElementsByTagName</code> method on the element you are processing e.g. use <code>gradeElemet.getElementByTagName("classroom")</code> instead of <code>doc.getElementsByTagName("classroom")</code>. Then inside all of your nested loops continue that approach to call the method on the currently processe...
how to send a request to Google with curl <p>I work on Linux and try to use <code>curl</code> to send requests to Google and save its reply as a html file.<br></p> <p>When I use Google to search something, such as a string "abc", I find that the link of Google is: <a href="https://www.google.lu/#q=abc" rel="nofollow">...
<p>Anything after the <code>#</code> is handled client side with JavaScript, which is why it doesn't work with <code>curl</code>.</p> <p>You can instead use the traditional, non-AJAX interface on <code>https://www.google.com/search?q=abc</code></p> <p>It appears to block you unless you also spoof the user agent, so a...
Override interface property with constructor parameter with different name <p>I have this code:</p> <pre><code>class AnyUsernamePersistentNodePath(override val value: String) : AnyPersistenceNodePath { override val key = "username" } </code></pre> <p>and </p> <pre><code>interface AnyPersistenceNodePath { ...
<p>You can do what you want simply by removing <code>val</code> from the constructor parameter, so that it is a parameter and not a member. Your final class would be:</p> <pre><code>class AnyUsernamePersistentNodePath(username: String) : AnyPersistenceNodePath { override val key = "username" override val va...
Unable to focus ListView <p>Situation: In MVVM pattern, I have some inputbindings on a listview which work only when the listview is focused. However, whenever user clicks, the listview goes out of focus and user is unable to execute the inputbindings.</p> <p>Problem: <strong>I want to bring the focus on the listview ...
<p>The focus behavior that you describe is easily implemented from the codebehind, and doing so does not violate the MVVM pattern. Consider Josh Smith's post, below:</p> <p><a href="https://msdn.microsoft.com/en-us/magazine/dd419663.aspx#id0090097" rel="nofollow">https://msdn.microsoft.com/en-us/magazine/dd419663.asp...
Retrieve Index When Passing Object to Function <p>I'm passing an Object from an array of objects to a function. Is it possible to still retrieve the index number somehow from the object in the function? I'm doing this in javaScript specifically within the controller of AngularJS. </p> <p>For instance</p> <pre><code>...
<p>Yes you can do,</p> <pre><code>$scope.retrieveIndex = function(passedInObjectFromArray){ return array.indexOf(passedInObjectFromArray); } </code></pre>
NetLogo: Multiple colors with the scale-color reporter <p>Is there a way to get the <code>scale-color</code> reporter to work with multiple colors instead of just one? I'm trying to get multiple groups of patches to be different colors instead of being just different shades of the same color.</p> <pre><code>set m (1)...
<p>You can't use <code>scale-color</code> with multiple colors, but you can do that kind of thing with the built-in <a href="https://ccl.northwestern.edu/netlogo/docs/palette.html" rel="nofollow">palette extension</a>. Something like this might do what you want:</p> <pre><code>palette:scale-gradient [[255 0 0] [0 255 ...
iterating over object in an array throws Cannot read property of undefined <p>I have two arrays <code>caNCourbeData</code> and <code>caN_1CourbeData</code> , each one contains 12 objects, and they have the same object structure.</p> <p>this is an example of an object :</p> <p><a href="https://i.stack.imgur.com/rrKnx....
<p>switch the order of the arguments passed to your forEach callback, index is the second parameter, this works in my console:</p> <pre><code>caN_1CourbeData.forEach(function(caN_1CourbeDataElement, i){ caCourbeElement = new Object(); caCourbeElement.y = '2016-'+(i+1).toLocaleString(undefined, {minimumIntegerD...
Update/create a relationship with a specific WHERE clause <p>I have the following tables</p> <pre><code>client -id -name client_additional_info -client_id -content client_additional_type -additional_info_id -description </code></pre> <p>The relationships are</p> <p>client <code>has many</code> client_additional_in...
<p>Try a combination of using join for your SQL query followed by a simple if and else statement. </p>
google word tree chart last child fade away <p>I implemented a word tree from this link <a href="https://developers.google.com/chart/interactive/docs/gallery/wordtree#implicit-and-explicit-word-trees" rel="nofollow">Google explicit word tree example</a></p> <p>All the settings are same, on that link last child is not ...
<p>You need to set a higher width. As you can see on this example:</p> <p><a href="https://jsfiddle.net/pm9knypd/" rel="nofollow">https://jsfiddle.net/pm9knypd/</a></p> <p>if I set the width like this: </p> <pre><code>&lt;div id="wordtree_basic" style="width: 300px; height: 500px;"&gt;&lt;/div&gt; </code></pre> <p>...
Exchanging out specific lines of a file <p>I don't know if this should be obvious to the more tech savvy among us but is there a specific way to read a line out of a text file, then edit it and insert it back into the file in the original location? I have looked on the site but all the solutions I find seem to be for p...
<p>In 95% cases, replacing data (e.g. text) in a file usually means</p> <ol> <li>Read the file in chunks, e.g. line-by-line</li> <li>Edit the chunk</li> <li>Write the edited chunk to a new file</li> <li>Replace the old file with a new file.</li> </ol> <p>So, a simple code will be:</p> <pre><code>import os with open...
What's "watermark" in VSTS <p>I'm looking at doing some queries in VSTS. I see a "watermark" field. It looks like it's some kind of ID, but I can't figure out what it means. Does anyone know?</p>
<p>Yes, it likes a revision number. The difference is that, the revision increase in work item level while the watermark increase in collection level.</p> <p>For example, you have two workitems:</p> <blockquote> <p>WorkitemA rev:1 watermark: 1</p> <p>WorkitemB rev:1 watermark: 2</p> </blockquote> <p>When you ...
Could not find gem 'refinerycms-disqus (~> 0.0.1) - Ruby <p>I'm Trying to install disqus comments for RefineryCMS-products, first i'm following the steps of <a href="https://github.com/keram/refinerycms-disqus" rel="nofollow">Github</a> , but to add the line gem <code>'refinerycms-disqus', '~&gt; 0.0.1'</code> to the g...
<p><code>gem 'refinerycms-disqus', github: 'keram/refinerycms-disqus'</code> should do the trick.</p>
API service return 200, but it is really a 404 <p>I have this VUEJS / VUEJS Resources snippet that is fetching data from an API service.</p> <pre><code>fetchData: function(name){ var self = this; self.$http.get('http://www.apiservice.com/', { params: { city: name ...
<p>It seems like bad API design to return a "no response found" as HTTP 200, but if you have no control over the API, you'll just have to handle that in your success function.</p> <p>Put your error handling code in a function and call it accordingly:</p> <pre><code>fetchData: function(name){ var self = this; ...
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement <p>I'm trying to get into PDO details. So I coded this:</p> <pre><code>&lt;?php namespace news\system\worker; use news\data\news\NewsEditor; use wcf\data\object\type\ObjectTypeCache; use w...
<p>I receive this error:</p> <p>SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED...
Select Distinct rows from the joining of two SQL tables <p>I'm trying to determine the following from the joining of two tables: TableA: Contains 1 column consisting of unique IDs TableB: Contains multiple columns, one with consisting of the same set of unique IDs but also with a date column for each day of the year. ...
<p>The JOIN portion is unnecessary given your example above, but in the event that you actually only want records that are included in the first table, you could do an <code>INNER JOIN</code> like so.</p> <pre><code>SELECT tb.UniqueID, MIN(DATE) as [Date] FROM [Table B] tb INNER JOIN [Table_A] ta ON ta.[Unique ID] = t...
Automatic update of calculated fields (Excel Pivot table) <p>I am creating a top 10 product by sales calculation off of a pivot table I am running. My question is, I would like this table to populate automatically to the latest week when I refresh the table and am not sure how to do this.</p> <p>Furthermore, there are...
<p>In regards to the date filtering, see my answer at <a href="http://stackoverflow.com/questions/39004607/filtering-pivot-table-with-vba">Filtering pivot table with vba</a> In regards to the calculations, if you use a paramatized GETPIVOTDATA function then you can easily accomplish what you want.</p>
how to make django manage a table that wasnt in the migration but in the database? <p>Ok, where i work we are using a database that we would like to continue using but instead connect it to a different front end. Django 1.8</p> <p>we did a inspectdb and we did a makemigration based on that infomation and migrated </p...
<p>If I got the question correctly, you wan't to use Django models with tables created outside Django, right?</p> <p>It seems that you don't have the <code>id</code> column in that table. Django requires one PRIMARY KEY column or it will try to use <code>id</code> as a default.</p> <p>Try setting an AutoField to a su...
Custom sorting of R datatable column for numbers stored as strings <p>I have a Shiny dashboard in which I use the DataTable package (code closely following the approach in the <a href="http://shiny.rstudio.com/gallery/datatables-options.html" rel="nofollow">Shiny documentation</a>) to build my tables.</p> <p>Everythin...
<p>Section 4.5 - Row Rendering of this DT document has your answer: <a href="https://rstudio.github.io/DT/options.html" rel="nofollow">https://rstudio.github.io/DT/options.html</a></p>
Checking current git branch with ifneq in Makefile <p>I'm trying to get my makefile to check that it's running on the correct branch and throw and error if not. </p> <p>I'm using <code>ifneq</code> to compare them and <code>git rev-parse --abbrev-ref HEAD</code> to get the checked out branch, but it will not see them...
<p>There is no such make function as <code>$(git ...)</code>, so that variable reference expands to the empty string. You're always running:</p> <pre><code>ifneq (, master) </code></pre> <p>which will be always true.</p> <p>You want to use the <code>shell</code> GNU make function:</p> <pre><code>ifneq ($(shell git...
RotatingFileHandler does not continue logging after error encountered <pre><code>Traceback (most recent call last): File "/usr/lib64/python2.6/logging/handlers.py", line 76, in emit if self.shouldRollover(record): File "/usr/lib64/python2.6/logging/handlers.py", line 150, in shouldRollover self.stream.se...
<p>I highly recommend you to use a configuration file. The configuration code below "logging.conf" has different handlers and formatters just as example: </p> <pre><code>[loggers] keys=root [handlers] keys=consoleHandler, rotatingFileHandler [formatters] keys=simpleFormatter, extendedFormatter [logger_root] level=D...
How to open a screen from appdelegate.m handleOpenURL method with REFrosted Sliding Menu & storyboards? <p>I am updating one of my application that uses URL Scheme. I used to have application:handleOpenURL method in appdelegate.m with following code that used to work fine from long time (without Storyboards)</p> <pre>...
<p>You need to call it like this:-</p> <pre><code>UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; urlOpenedMsg2ViewController *nextview = [storyboard instantiateViewControllerWithIdentifier:@"urlOpenedMsg2"]; UINavigationController *navigationVC = [[UINavigationController all...
SQL Query: How to Select across rows and columns <p>I'm certain that this is a simple WHERE clause. I'm just not sure how to write it.</p> <p>Let's say I have the following data where a,b,c(numbers) and d(varchar):</p> <p><a href="https://i.stack.imgur.com/dIdfk.png" rel="nofollow"><img src="https://i.stack.imgur.com...
<p>If you just want the <code>b</code> values, using aggregation and <code>having</code>:</p> <pre><code>select b from t group by b having count(*) &gt; 1 and max(c) &gt; 0 and min(coalesce(c, 0)) = 0; </code></pre> <p>This assumes that <code>c</code> is always positive. Similar logic can be formulated...
Ruby sysread IO much too slow <p>I have a command like this where <code>input</code> is a string that receives the input:</p> <pre><code>STDIN.sysread(1000,input) </code></pre> <p>If it reads more than 100 characters it takes more than 0.1 seconds.</p> <p>I tried it with alternatives such as <code>partialread</code>...
<p>There is probably something odd in your benchmarking setup. What comes to mind first is that your sender might not write fast enough.</p> <p>The following benchmark (using <a href="https://github.com/evanphx/benchmark-ips" rel="nofollow">benchmark-ips</a>) resulted in approximately one read every 1.3 micro-seconds ...