input
stringlengths
51
42.3k
output
stringlengths
18
55k
Loading Coldfusion javascript asynchronously? <p>Whenever a page is loaded with Coldfusion, it loads many default Coldfusion javascripts. When I run the Goolge PageSpeed Tools, it always complain about the render-blocking JavaScript. Apparently, Coldfusion has many javascript when a page is loaded such as </p> <pre>...
<p>If you really wanted to do something about this instead of rewriting your UI code, you can actually grab the output from the buffer before it is sent to the client and modify it. Your modifications could be as simple as removing a hardcoded list of script tags and replacing them with a custom script file that you ho...
How can i switch two strings in a 2d array <p>Below is my code. Here, i have to switch two of the names in the 2D array but i'm not sure how to do this.</p> <p>Anyone knows how to do? </p> <pre><code> import java.util.Scanner; public class Homeworktest { public static void main(String[] args) { ...
<p>To swap values of two array locations, first, hold one value in a temporary variable, assign the second location's value to the first location and lastly assign the temporary variable's value to the second location.</p> <pre><code>public static void switchSeats(String[][] people, int row1, ...
Create input file in HDFS <p>I'm trying to create an input file in the hdfs using this command :</p> <pre><code>hduser@salma-SATELLITE-C855-1EQ:/usr/local/hadoop$ ./bin/hadoop fs -mkdir /in </code></pre> <p>but it gives me an error that the connection failed :</p> <pre><code>SLF4J: Class path contains multiple SLF4J...
<p>Your are missing the namenode ( primary ) this is where you code is attempitng to connect. Check the log to understand why it does not started.</p>
How do you animate rows swapping with ListView? (React Native) <p>I'm trying to animate the swapping of two rows with a React Native ListView</p> <p>Here's my datasource code (both in my render method):</p> <pre><code>const ds = new ListView.DataSource({rowHasChanged: (r1, r2) =&gt; r1.id !== r2.id}) var dataSource =...
<p>I suspect the problem is the fact that (according to what you say) you are creating the DataSource in your <code>render</code> method. You should create the <code>ListView.DataSource</code> object in your constructor (or <code>componentWillMount</code>), then call <code>cloneWithRows</code> when your data changes, ...
In OS X who owns the model, NSDocument or NSViewController <p>Working in iOS I've never dealt with OS X and NSDocument based apps. Where should the model reference live, inside the NSDocument or the representedObject in the NSWindow's content NSViewController? Or both?</p>
<p>It should be stored in the NSDocument object as stated by the Apple documentation in <a href="https://developer.apple.com/library/content/documentation/DataManagement/Conceptual/DocBasedAppProgrammingGuideForOSX/Designing/Designing.html" rel="nofollow">here</a>. In particular, check Figure 1-1. Further below, on the...
How to override user input on Jquery autocomplete? <p>I have a simple autocomplete function that searches an array of objects. It's working fine, but I want to override what the user is searching for. </p> <p>I want to <strong>append another input's value to their search</strong>. For example, if they search "cat", I ...
<p>The following will do what you ask by using function for source</p> <pre><code>var terms = ["c++", "java dog", "php dog", "coldfusion", "javascript dog", "asp dog", "ruby"] $("#autocomplete").autocomplete({ source: function(req, response) { var term = req.term + ' dog';// adjust to a dom value or whatever ...
copy elision using STL (vector as example) <p>I was reading about the copy elision in c++. And i was having doubts about STL in c++ using this copy elision.</p> <p>The following code:</p> <pre><code>#include &lt;vector&gt; #include &lt;iostream&gt; using namespace std; vector&lt;int&gt; merge(vector&lt;int&gt; &amp;...
<p>For copy elision, you need to have the "copy" in the first place, i.e. your <code>res</code> vector has to be copy constructed from the return value.<br> Otherwise you'll just have an assignment, which requires getting rid of whatever was in the vector and as such cannot be elided.</p> <p>Notice that it would still...
How to solve "Failed to convert property value[...]" <p>So I have a form with a dropdown in Spring MVC:</p> <pre><code>&lt;form:form modelAttribute="user" action="registerVerify" method="post"&gt; &lt;!-- Other fields--&gt; &lt;spring:message code="register.country" /&gt; &lt;form:select path="country" items="...
<p>Try using the following <em>ConverterRegistry</em> method:</p> <pre><code>&lt;S,T&gt; void addConverter(Class&lt;S&gt; sourceType, Class&lt;T&gt; targetType, Converter&lt;? super S,? extends T&gt; converter) </code></pre> <p>Which will result in:</p> <pre><code>public void ...
Java - add a space after splitting a String <p>I need to add a space after splitting a String with a <code>" "</code> delimiter. The reason I need to do this is because a space has not been added at the start of the next String as shown in this example:</p> <pre><code>"There was nothing so VERY remarkable in that; nor...
<p>If the original string is</p> <pre><code>"There was nothing so VERY remarkable in that; nor did Alice" + "think it so VERY much out of the way to hear the Rabbit say to" </code></pre> <p>that is seen by your code as</p> <pre><code>"There was nothing so VERY remarkable in that; nor did Alicethink it so VERY much o...
Calculate BMI in Java using metrics <p>Please bear with me, I'm an interactive design student in week 2 of a Java class. </p> <p>I need to create a BMI calculator using the following formula:Calculate the BMI using the following formula:</p> <pre><code> w BMI = ___ (h/100) 2 </code></pre> <p>whe...
<p>When you divide the int <code>height</code> by 100 it truncates the decimal since it is still an int. </p> <p>Try initializing the variables as doubles:</p> <pre><code>double weight; double height; </code></pre> <p>Then cast them when you get the int from the input:</p> <pre><code>weight = (double) console.nextI...
Possible to use Docker machine with continuous integration tools? <p>What I'm trying to do: use a continuous integration tool like CircleCI or GitLab to deploy to a DigitalOcean droplet. Locally I'm able to use Docker Machine to run something like </p> <p><code>$ eval $(docker-machine env my-droplet)</code></p> <p>to...
<p>The integration proposed by DigitalOcean is more with Docker Cloud, meaning your CI should push your image to Docker Cloud, for DigitalOcean to use in a Droplet.</p> <p>See "<a href="http://tutorials.pluralsight.com/devops/deploy-horizon-using-docker-cloud-digitalocean#bAfwkQxFwCUX8gOT.99" rel="nofollow">Deploy Hor...
C# Filestream to SQL Server database <p>I want to create a file in SQL Server from a string. I can't figure out how to put it into the database. After reading it seems it has someting to do with filestream. If so then once the stream is created then how do I put that to my DB as a file?</p> <pre><code>FileStream fs1 =...
<p>Create a a column type of any one below. Use ADO.NET <code>SqlCommand</code> write it to database.</p> <ul> <li><code>varbinary(max)</code> - to write binary data</li> <li><code>nvarchar(max)</code> - for unicode text data (i mean if text involves UNICODE chars)</li> <li><code>varchar(max)</code> - for non unicode...
Webadmin and php are not working correctly <p>I have ubuntu server 16.04 running within hyper-v on a Windows 10 computer. I am running LAMP with Apache2, MariaDB, and PHP7.0. I have installed phpmyadmin but when I attempt to call it through my browser I get text, I'm assuming that it is the correct file but it is obvio...
<p>After doing everything that is listed, I had rebooted and tried accessing phpmyadmin with success, so I'm at loss for words. </p>
C - Forward declaration for struct and function <p>I'm trying to figure out how exactly forward declarations interact. When forward declaring a function that takes a typedef'd struct, is there a way to just get the compiler to accept a previously forward declared (but not actually defined) struct as a parameter?</p> <...
<p>Typedefs and struct names are in different namespaces. So <code>struct automobileType</code> and <code>automobileType</code> are not the same thing.</p> <p>You need to give your anonymous struct a tag name in order to do this.</p> <p>The definition in your .c file:</p> <pre><code>typedef struct automobileType{ ...
Android Studio Gradle not Syncing <p>I'm very new to Android Studio and I'm basically trying to open an existing project that I had downloaded and compile/run it. I am getting the following error when Gradle attempts to sync...</p> <pre><code>Error:Cannot read packageName from /Users/Amanda/Desktop/MyProject/src/main/...
<p>some times <code>clean</code> cant delete some of build folder files.</p> <p>try these steps :</p> <p>1- make a copy of your manifest file and delete your manifest file from project. </p> <p>2- delete your <code>app/build</code> folder.</p> <p>3-then clean your project</p> <p>4- add the manifest file again to <...
Routing error after trying to make a post <p>I'm getting a confusing routing error after trying to submit a post. the error is <code>No route matches [POST] "/blog"</code> despite it being in routes.rb. </p> <p>Here is my route file: </p> <pre><code>Rails.application.routes.draw do get 'welcome/index' get '/blog'...
<p>You have to put in your route.rb</p> <pre><code>... post '/blog', to: 'posts#post', as: :post ... </code></pre> <p>first word is the method</p> <p>Maybe you need to look this <a class='doc-link' href="http://stackoverflow.com/documentation/ruby-on-rails/307/routing/1080/resource-routing-basic#t=201610090259581195...
How to split this string to dict with python? <p><strong>String</strong> </p> <pre><code>string1 = '"{ABCD-1234-3E3F},MEANING1","{ABCD-1B34-3X5F},MEANING2","{XLMN-2345-KFDE},WHITE"' </code></pre> <p><strong>Expected Result</strong> </p> <pre><code>dict1 = {'{ABCD-1234-3E3F}' : 'MEANING1', '{ABCD-1B34-3X5F}' : 'MEA...
<p>If you are looking for a one-liner, this will work:</p> <pre><code>&gt;&gt;&gt; dict(tuple(x.split(',')) for x in string1[1:-1].split('","')) {'{ABCD-1B34-3X5F}': 'MEANING2', '{XLMN-2345-KFDE}': 'WHITE', '{ABCD-1234-3E3F}': 'MEANING1'} </code></pre>
Swift/Xcode - UITextView and UIButtons in UIContainerView not responding to touch <p>My buttons and textviews are displaying properly inside the container view but they are not responding to clicks/taps. The container view's height is set to the regular portrait size (780). The container view is placed in a scroll view...
<p>The view controllers you get out of the container are independent controllers. Don't forget to set delegate there. </p>
(BeautifulSoup) how do I access an attribute of a tag? <p>I searched everywhere and I can't seem to get it understood in my head. The documentation at <a href="https://www.crummy.com/software/BeautifulSoup/bs4/doc/#attributes" rel="nofollow">https://www.crummy.com/software/BeautifulSoup/bs4/doc/#attributes</a></p> <p>...
<p>A "tag" is a kind of BeautifulSoup object. For example, <code>soup.find("a")</code> returns a tag object of the first anchor tag in the html being parsed. Just as the documentation says, tag attribute access is just like accessing a dictionary.</p> <pre><code>my_tag = soup.find("a") href_value = my_tag["href"] #or ...
Java: How to implement Dancing Links algorithm (with DoublyLinkedLists)? <p>I am trying to implement Knuth's Dancing Links algorithm in Java.</p> <p>According to Knuth, if <code>x</code> is a node, I can totally unlink a node by the following operations in C:</p> <pre><code>L[R[x]]&lt;-L[x] R[L[x]]&lt;-R[x] </code></...
<p>I am not familiar with Knuth's Dancing Links algorithm, but found <a href="https://www.ocf.berkeley.edu/~jchu/publicportal/sudoku/sudoku.paper.html" rel="nofollow">this article</a> which made it quiet clear. In particular I found this very helpful: </p> <blockquote> <p>Knuth takes advantage of a basic principle o...
Android Glide Image is not showing on the first screen <p>I am using Android glide to load remote images, but here i met a strange problem which image on the first screen not showing but while i scroll down and scroll up again, those images become showing normally.here is the screen shot: <a href="http://i.stack.imgur....
<p>See <a href="https://github.com/bumptech/glide/blob/master/README.md#compatibility" rel="nofollow">https://github.com/bumptech/glide/blob/master/README.md#compatibility</a></p> <blockquote> <p><strong>Round Pictures</strong>: <code>CircleImageView</code>/<code>CircularImageView</code>/<code>RoundedImageView</code...
Should I migrate local JSON database to MariaDB? <h3>Fictional story:</h3> <p>I have a car website containing over 200,000+ car listings around the United States. I get my data from two sources CarSeats and CarsPro updated nightly. Both sources contain about 100,000 detailed listings each in JSON format. The file size...
<blockquote> <p>Will migrating my data from localized JSON files to MariaDB 10.1 be a best practice move? Is that the scalable alternative for the future? What should my stack look like to improve speed and improve search capabilities?</p> </blockquote> <p>Yes. The whole purpose of a database is to make the st...
How do I create an animated gif in Python using Wand? <p>The instructions are simple enough in the <a href="http://docs.wand-py.org/en/0.4.1/guide/sequence.html" rel="nofollow">Wand docs</a> for <em>reading</em> a sequenced image (e.g. animated gif, icon file, etc.):</p> <pre><code>&gt;&gt;&gt; from wand.image import ...
<p>The best examples are located in the unit-tests shipped with the code. <a href="https://github.com/dahlia/wand/blob/master/tests/sequence_test.py" rel="nofollow"><code>wand/tests/sequence_test.py</code></a> for example.</p> <p>For creating an animated gif with wand, remember to load the image into the sequence, and...
How to optimize employee transport service? <p>Gurus,</p> <p>I am in the process of writing some code to optimize employee transport for corporate. I need all you expert's advice on how can this be achieved. Here is my scenario.</p> <p>There are 100 pick up points all over city from where employees need to be brought...
<p>Your problem description is a more complicated version of "The travelling salesman problem". You can look it up on and find some different examples and how they are implemented.</p> <p>One point that need to be clarified : the vehicules to be use will be the employee vehicule that will be carshared or it will be co...
How to make hotkeys in VB6? <p>I've some problem, i'm planning to make a form can hide itself and the form can show again (activate it only with a hotkey). what's the source code for my problem?</p>
<p>Declare with this</p> <pre><code>Dim i As Integer Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer </code></pre> <p>then make a timer</p> <pre><code>Private Sub Timer1_Timer() If GetAsyncKeyState(vbKeyControl) And GetAsyncKeyState(vbKeyR) Then Frmsav.Show End If End Sub <...
What is the best way to fetch huge data from mysql with sqlalchemy? <p>I want to process over 10 millions data stored in MySQL. So I wrote this to slice the sql to several parts then concatenate the data for latter process. It works well if <code>count &lt; 2 millions</code>. However when the <code>count</code> rise, t...
<p>This is because you're using <code>LIMIT</code>/<code>OFFSET</code>, so when you specify offset 3000000, for example, the database has to skip over 3000000 records.</p> <p>The correct way to do this is to <code>ORDER BY</code> some indexed column, like the primary key <code>id</code> column, for example, then do a ...
Python Regex for ignoring a sentence with two consecutive upper case letters <p>I have a simple problem at hand to ignore the sentences that contain two or more consecutive capital letters and many more grammar rules .</p> <p><strong>Issue:</strong> By the definition the regex should not match the string <code>'This i...
<p>It’s probably easier to write your regex in the negative (find all sentences that are bad sentences) than it is in the positive. </p> <pre><code>checker = re.compile(r'([A-Z][A-Z]|[ ][ ]|^[a-z])') check2 = re.compile(r'^[A-Z][a-z].* .*\.$') return not checker.findall(sentence) and check2.findall(sentence) </code...
Are There Alternatives to Collision Detection in Unity3D? <p>So, I'm working on a game and I've run in to the problem that.. I'm trying to detect the collision of two objects, and at first I assumed I needed two colliders. Then I found out I needed a rigid body, now I've come to find both object need a rigid body and t...
<p>There's no way to do exactly what you want. As you did not describe what you are planning to do (not even if 2D or 3D), here's a generic solution:<br> 1) Attach a <code>Rigidbody</code> to only to one of the objects (out of two which could collide)<br> 2) Tick in <code>IsKinematic</code> on <code>Rigidbody</code>so ...
Select columns for ORDER BY only, not returning them in the results <p>So I have a complicated <code>INSERT</code> query which puts information into a relational table based on information pulled from another table and with given variables.</p> <p>Here's the query:</p> <pre><code>INSERT INTO relational (class_id, tea...
<p>If the column is defined in a table/view, you can use it in <code>ORDER BY</code> and omit it from results. But in your case, you are using <em>calculated columns</em> in <code>ORDER BY</code>, so if you want to omit these columns, you have to replace them in <code>ORDER BY</code> with corresponding formula, e.g. </...
maintain, cleanup, compress large number of git repositories in Ubuntu <p>By going through the below git documentation, I learned how to maintain, cleanup, compress and save space for a git repository. But the problem I am facing is, having a large number of git repositories, say around ( 500 ) of them, Its not easy to...
<blockquote> <p>a shell script or something like that ?</p> </blockquote> <p>There is nothing in Git itself for managing <em>multiple</em> repos, so yes, you would need to script the process you are currently doing for one repo.</p> <p>See for instances the approaches taken in:</p> <ul> <li>"<a href="http://stacko...
Modifying search function to exclude posts and limit results to 10 per page on front end only <p>This problem is kind of two part. I have the solution to exclude posts from the search and limit the results to 10 results per page but the problem is it also affects the backend wp-admin area. So if i search for posts thro...
<p>Okay don't wrap your search functions around the <em>is_admin()</em> instead put the <em>is_admin()</em> inside the function</p> <p>Like this:</p> <pre><code>Function search(){ if ( is_admin()){ //Search query for admin } else { //Search query for users } } </code></pre> <p>That shoul...
save image from image tag <img> using POST service call using jquery <p>Am trying to save image from image tag</p> <p>i have tried like file upload method </p> <p>but it not working ,</p> <pre><code> var request = new XMLHttpRequest(); var imageUrl = info.ImageUri + '/Upload?imagePath=' + imagePath + '&amp;i...
<p>You can get the base64 string from the image.</p> <p>html:</p> <pre><code>&lt;img src="http://some/image/source" id="myImage"/&gt; &lt;canvas id="myCanvas" style="display:none;"/&gt; </code></pre> <p>js:</p> <pre><code>var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); var img = document....
WinForms ListView Details Column Rendering Issue <p>I have a simple WinForms ListView that is set to display in Details view with a few items.</p> <p>Maybe this is a well-known issue with an easy fix but I can't seem to get this to look right:</p> <p><a href="http://i.stack.imgur.com/L2rv8.png" rel="nofollow"><img sr...
<p>You should use DatagridView control for multiple column, else look this link <a href="http://csharp.net-informations.com/gui/cs-listview.htm" rel="nofollow">http://csharp.net-informations.com/gui/cs-listview.htm</a> ;)</p>
Returning index of an array based on mixture of values(integer,string) or (integer,float) <p>Hi I am trying to find a index for a number in percentage and integer array. Say <code>arraynum = ['10%','250','20%','500']</code> and user sends a value <code>15%</code>,in which range does this number resides? I could find in...
<p>Use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat" rel="nofollow"><code>parseFloat()</code></a> to get the floating-point value of a string. You can use the fact that it only parses up until the first non-numeric character in the string in order to ignore the <c...
MySQL Group by complex script <p>I have an script that works perfect, but need to add values from another table Current script is</p> <pre><code> select v.id, vm.producto_id, sum(vm.total), count(v.id) from visita v, reporte r, visitamaquina vm, maquina m, (select r.id, empleado_id, fecha, cliente_id from ruta r, ...
<p>Better group the sub table that has multiple data with the same group of your outer group by columns.In your case the <code>VisitaMaquina</code> and <code>reporteproducto</code> should be group by with <code>visita_id, producto_id</code> since they all have repeat rows with the same combination of <code>vid=31 and p...
Emulator does not run on avd manager <p>I created an emulator with API 23 in AVD manager. But when I want to start it, it does not work. </p> <p>And at the bottom shows me this Error:</p> <blockquote> <p>Starting emulator for AVD 'Emulator_6.0' /home/hadi/Android/Sdk/tools/emulator: 1: /home/hadi/Android/Sdk/tool...
<p>Try deleting and redownloading the emulator.</p>
Retrieve data from two table <p>I have two tables <code>tblRegistration(id,name,program,regdno,address)</code> and <code>tblDue(id,regdno,amountdue)</code>. What I want is to pass regdno from a <code>textbox</code> and then retrieve the <code>name</code>, <code>program</code> values form <code>tblRegistration</code> an...
<p>If you haven't any relationship between Registration and Due table. you mustn't join these table. You can Simple run two query to fetch data. the first, from Registration table and the second, from Due table:</p> <pre><code>select * from tblReg where regdno=...; select * from tblDue where regdno=...; </code></pre>
How to implement search in list in given listView using edit text <p>I am creating an app.I have three data in one row (Name,id,other) of list view. so I want to implement search on list view by name using edit text. I am getting search data by name its good but id is not change according to name on search its still sh...
<p>You can apply a constraint to <strong>EditText</strong>, if a number is entered it reads the item at that position of <strong>ListView</strong>. </p>
Fatal Exception: android.view.InflateException: Binary XML file line #17: Error inflating class android.support.v7.internal.view.menu.ExpandedMenuView <p>I am getting below error and problem is that I don’t see any familiar names or my classes in the error message nor in stack trace. The other difficulty is that I st...
<p>You are using wrong resource in your xml. Probably you are trying to use color resource as a drawable (i.e. <code>@color/</code> instead of <code>@drawable/</code>. If you can not reproduce it yourself, you can recheck your xml and replace any color usage with drawable one. Also, it might be because you put your dra...
How to use xpath to get the text <p>I am new to Html and XPath. So I got this trouble. If I want to get the text 'Saturday', what the xpath code should be like? Thank you for your help! The html like this.</p> <pre><code>&lt;div class="D(ib) Va(m) W(1/4)" data-reactid=".28cjlo02kxy.$tgtm-Col1-0-Weather.2.$0.$0.1.1.$0....
<p>Well, there is not enough information to provide a reliable XPath, but, given what we have, I'd have a partial match on <code>data-reactid</code> attribute(s):</p> <pre><code>//div[contains(@data-reactid, "Col1-0-Weather")]/span[contains(@data-reactid, "Col1-0-Weather")] </code></pre>
C Why when passing this int by value, it is incorrectly passing 0 every time <p>Ok so sorry for the length of the code block, but I am at a loss. The variable currentProcess holds the index of the last structue added to the array. I have included print statements to prove that the value of currentProcess is being incre...
<p>M.M is right. <code>{scanf("%1s", &amp;option);}</code> is ugly. Make if "%c".</p> <p>Here is changed code:</p> <pre><code>//function prototypes int addProcess(PCB* arr, int*); //you don't need newSt PCB getPcb(); void printCurrent(PCB[], int); </code></pre> <hr> <pre><code>case '1': //...
I'm using bootstrap to create forms. Unfortunately some of my field values don't post to the action page. <p>Below is the bootstrap code I am using. The form appears properly (this is from an include file). When I submit the form all of the fields pass the variables to the next page - except for the dropdown elements</...
<pre><code>&lt;select id="birthMonth" NAME="GIVE_SOME_NAME_HERE" class="form-control" required="required" data-error="Birth Month is required."&gt; &lt;option VALUE="Jan"&gt;January&lt;/option&gt; &lt;option VALUE="Feb"&gt;February&lt;/option&gt; &lt;option VALUE="Mar"&gt;March&lt;/option&gt; &lt;/select&gt; </code></p...
highcharts dynamic plotlines <p>I am encountering a problem, how to update the plotlines(on YAxis) dynamically? Specifically, I need to calculate a max, min and average value for a period of the chart, then setup the 3 lines which they stand for. How can I do that? many thanks!</p>
<p>This is a very simple example of how to update plotlines dynamically.</p> <ul> <li>It has one data series which can be updated by the press of a button. </li> <li>When pressing the second button, plotlines will be added or removed+redrawn according to the data of the series.</li> <li>If you want to use a subset of ...
stuck in implementing search in django <p>I want to implement search in django. I don't use any search technique like solar etc. I am using simple filter query of django. Now the problem is this: I have a model <strong><code>Product</code></strong> with five field <code>name</code>, <code>cost</code>, <code>brand</cod...
<p>You didn't show your search query. However, I think using <a href="https://docs.djangoproject.com/en/1.10/ref/models/querysets/#contains" rel="nofollow"><code>contains</code></a> (or <a href="https://docs.djangoproject.com/en/1.10/ref/models/querysets/#icontains" rel="nofollow"><code>icontains</code></a> for case in...
reflection to pass tagName as string props to be rendered <pre><code>class Button extends React.Component{ renderAnchor(){ return &lt;a onClick={this.props.onClick}&gt;{this.props.children}&lt;/a&gt; } renderButton(){ return &lt;button onClick={this.props.onClick}&gt;{this.props.children}&lt;/...
<p>You can assign the tag name to a variable and use that variable as the HTML tag.</p> <p>For example:</p> <pre><code>render(){ const CustomTag = this.props.tagName //assign it to the variable return &lt;CustomTag onClick={this.props.onClick}&gt; {this.props.children} &lt;/CustomTag&gt...
Is there a way to create a global setter? <p>What I need is to have a function, which is called every time an assignments is performed, so for example when there is : </p> <pre><code>var a = b; c = d; // or even for(var i=3...){} </code></pre> <p>I could have a function like : </p> <pre><code>function assign...
<blockquote> <p>Is there a way to create a global setter?</p> </blockquote> <p>No. </p> <p>ECMAScript2015 introduces <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Proxy" rel="nofollow">Proxy objects</a> which allows you to do "meta programming" but it doesn't work the way yo...
How to cancel a recurring job in firebase job dispatcher <p>I have created a recurring job, I want to cancel the recurring job when some conditions met.</p> <pre><code>final Job.Builder builder = dispatcher.newJobBuilder() .setTag("myJob") .setService(myJobService.class) ...
<p>The readme on GitHub says:</p> <blockquote> <p>Driver is an interface that represents a component that can schedule, cancel, and execute Jobs. The only bundled Driver is the GooglePlayDriver, which relies on the scheduler built-in to Google Play services.</p> </blockquote> <p>So cancelling is part of the d...
java.lang.NoClassDefFoundError: com.amazonaws.mobileconnectors.apigateway.ApiResponse <p>I made a few changes to my android application, and now I'm getting this. I'm thinking it might be caused by updating the autogenerated ApiGateway SDK that I'm using in my app. But maybe it's something else? I'm not even sure wh...
<p>Okay I figured it out. AWS just updated their Android core. So now when you build it's using a newer version (v2.3.2 now) where the old one was v2.22.2. Once I updated my android application to use v2.3.2 by changing my gradel file, everything worked.</p> <pre><code>compile 'com.amazonaws:aws-android-sdk-core:2....
How to do custom python imports? <p>Is there a way to have custom behaviour for import statements in Python? How? E.g.:</p> <pre><code>import "https://github.com/kennethreitz/requests" import requests@2.11.1 import requests@7322a09379565bbeba9bb40000b41eab8856352e </code></pre> <p>Alternatively, in case this isn't po...
<p>What you're essentially asking is customization of the import steps. This was made possible with <a href="https://www.python.org/dev/peps/pep-0302/" rel="nofollow">PEP 302</a> which brought about certain hooks for for customization. </p> <p>That PEP is currently not the source from which you should learn how impor...
Not able to install Elasticsearch as different user <p>I have downloaded elasticsearch rpm 2.3.1 on centos machine. I want to install it as other then elasticsearch user. By default ES_USER is set as elasticsearch. Can someone please help me if we can override ES_USER with other user while installing rpm or how to rese...
<p>You can change the user running Elasticsearch via the <code>/etc/sysconfig/elasticsearch</code> file under the <code>ES_USER</code> environment variable.</p>
DELETE MethodNotAllowedHttpException with IIS, AngularJS and Laravel <p>I am learning AngularJS 1.5.8 + Laravel 5.3.17 + PHP 7 hosted on IIS/Windows 10, following this <a href="https://scotch.io/tutorials/build-a-time-tracker-with-laravel-5-and-angularjs-part-2" rel="nofollow">tutorial</a>.</p> <p>While sending a HTTP...
<p>I found the reason is because i was passing id:null value to Laravel, accidentally.</p> <pre><code>var Time = $resource('api/time/:id'); //using angular-resource.js Time.delete({id:null}).$promise.then(function(success) { console.log(success); }, function (error) { console.log(error); // HTTP error 405, Met...
Edge Existence (to find if an edge exists or not) <p>Question is: You have been given an undirected graph consisting of <em>N</em> nodes and <em>M</em> edges. This graph can consist of self-loops as well as multiple edges. In addition , you have also been given <em>Q</em> queries. For each query, you shall be given 2 i...
<p>For example when you want to add the edge <code>(3,5)</code> you push 3 into an empty vector ( <code>temp</code> ) and then you <code>push_back</code> temp into <code>v</code>. So now size of <code>v</code> is 1. Then you try to <code>push_back</code> 5 to <code>v[3]</code>:</p> <pre><code>v[a].push_back(b); </code...
how to implement OAuth 1.0a using retrofit for woocomerce Api in android <p>Hi am currently working on a woocommerce api, i need to integrate the api using retrofit. The web site is in <strong>HTTP</strong> so HTTP Basic authentication cannot be used over plain HTTP as the keys are susceptible to interception. The API ...
<p>Finally i found the solution hope this will help some other</p> <p>i go through various documents</p> <p>1)<a href="https://www.skyverge.com/blog/using-woocommerce-rest-api-introduction/" rel="nofollow">Using the WooCommerce REST API – Introduction</a></p> <p>2)<a href="https://github.com/woocommerce/woocommerc...
Android: SQLiteOpenHelper class- What are all the Exceptions that the SQL queries produce? <p>I have the following class named <code>DatabaseHandler</code></p> <pre><code>public class DatabaseHandler extends SQLiteOpenHelper { // Database Name private static final String DATABASE_NAME="contacts_provider"; ...
<p>You must create table in <code>public void onCreate(SQLiteDatabase db)</code> before doing any insertions.</p> <pre><code>public void onCreate(SQLiteDatabase db) { db.execSQL(String.format("CREATE TABLE %s(%s ID INT PRIMARY KEY, %s TEXT, ...
Creating multiple hubs dynamically using SignalR <p>I am currently using <code>SignalR</code> for chat. I have a form and the user will load a specific order into the form. The scenario is that other <code>staff members</code> may search that order number and therefore i want only those people to be in the chat. Curren...
<p>You have to put the users into groups according to the opened order id, change the hub and add a method as below:</p> <pre><code>public class ChatHub: Hub { public void Send(string name, string message,string orderId) { // Call the addNewMessageToPage method to update clients. Clients.Group(orderId).addNewMess...
What is the default value of variable equal to ko.observable()? <p>I have just started learning KnockoutJS. This is code for folder navigation of webmail client.In the view code, a comparision is made whether the reference variable <code>$data</code> and <code>$root.chosenFolderId()</code> point to the same memory loca...
<p>You're 90% there. As you stated, the foreach will iterate over the <code>folders</code> array and <code>$data</code> will be the current item in the array.</p> <p><strong>Picking up the value for chosenFolderId</strong></p> <p>The click binding which calls <code>goToFolder</code> will pass the item it was bound to...
Node&Express:req.flash() requires sessions <p>I have some problems with connect-flash. Here is my configuration </p> <pre><code>var flash=require('connect-flash'); var session=require('express-session'); app.use(flash()); app.use(session({ secret:settings.cookieSecret, key:settings.db, cookie:{maxAge...
<p>You should declare the <code>flash</code> middleware <em>after</em> declaring the session middleware:</p> <pre><code>app.use(session({ secret:settings.cookieSecret, key:settings.db, cookie:{maxAge:60000}, resave:false, saveUninitialized:true })); app.use(flash()); </code></pre> <p>Express proce...
Create sparse matrix for two columns in a Pandas Dataframe <p>I am trying to create a sparse matrix out of a Pandas Dataset (>10Gb)</p> <p>Assume I have a dataset of the type</p> <p>Table: Class</p> <pre><code> student |teacher --------------------- 0 | abc | a 1 | def | g </code></pre> <p>And I have...
<p>You can convert the columns to category type and then use the <code>codes</code> to create the <code>coo_matrix</code> object:</p> <pre><code>import numpy as np import string import random import pandas as pd from scipy import sparse lowercase = list(string.ascii_lowercase) students = np.random.choice(lowercase, ...
How can make the ships to move in the direction they are facing after rotated them? <p>In the script i have 20 space ships. I store each ship start position and then check if each ship moved and travlled 50 distance i rotate the ship. This part is working fine.</p> <p>Now i want to make that if i rotate each ship by 1...
<p>Have you tried Translate?</p> <pre><code>// Example Forwards child.transform.Translate(Vector3.forward * Time.deltaTime * moveSpeed); // Example Backwards child.transform.Translate(Vector3.back * Time.deltaTime * moveSpeed); // you could use: left, right, up, down, forward, back </code></pre> <p>Documentation : <a...
GROUP BY & COUNT with multiple parameters <p>I have a simple configuration : 2 tables linked in a many-to-many relation, so it gave me 3 tables. </p> <p>Table author:</p> <pre><code>idAuthor INT name VARCHAR </code></pre> <p>Table publication: </p> <pre><code>idPublication INT, title VARCHAR, date YEAR, type VARCH...
<p>If you don't care about the <code>journal</code> , don't select it, it is splitting your results. Also, normal filters need to be placed in the <code>WHERE</code> clause, not the <code>HAVING</code> clause :</p> <pre><code>SELECT author.name, COUNT(*) FROM author INNER JOIN author_has_publication ON author.i...
MacOS and Swift 3 with CIAffineClamp filter <p>I need to use <code>CIAffineClamp</code> in order to extend the image and prevent Gaussian Blur from blurring out edges of the image. I have the following code working in Swift 2:</p> <pre><code>let transform = CGAffineTransformIdentity let clampFilter = CIFilter(name: "C...
<p>Seems <code>NSAffineTransform</code> has an initializer <code>NSAffineTransform.init(transform:)</code> which takes <code>AffineTransform</code>.</p> <p>Please try this:</p> <pre><code>let transform = AffineTransform.identity let clampFilter = CIFilter(name: "CIAffineClamp")! clampFilter.setValue(inputImage, forKe...
Issue while running "lektor server" command on windows <p>Python version : 2.7</p> <p>Showing the following error on lektor server command</p> <pre><code>Traceback (most recent call last): File "/Users/item4/Projects/lektor/lektor/devserver.py", line 49, in build builder.prune() File "/Users/item4/Projects/le...
<p>Finally I got the answer. It may helpful</p> <p>I have edited /Users/item4/Projects/lektor/lektor/builder.py and added a single line</p> <pre><code>con.text_factory = lambda x: unicode(x, 'utf-8', 'ignore') </code></pre> <p>after the following line</p> <pre><code>con = sqlite3.connect(self.buildstate_database_fi...
Creating a Open File Dialog Function to be used multiple times <p>I have this piece of code that I would like to make it into a function so I can reuse it by changing some parameters.</p> <p>So this is what I have so far</p> <pre><code>Sub OpenFiles(InFile As IO.StreamReader, verifytheFileName As String,dialogBoxTitl...
<p>Pass the dialogbox in parameters function</p> <pre><code>Sub OpenFiles(InFile As IO.StreamReader, verifytheFileName As String,dialogBoxTitle As String, dialogBox1 as System.Windows.Forms.SaveFileDialog) Dim result As DialogResult Dim FilePath As String Dim FileName As String Try dialogBox1.Title = dialogBoxTit...
Why is the integer not displayed when an exception occurred? <p>I have the following code:</p> <pre><code>int main() { int i = 0; cout &lt;&lt; i; //why is i not printed even though it is before the exception? int j = 1 / i; //divide by 0 j++; cout &lt;&lt; i &lt;&lt; j; return 0; }...
<p>That's probably because the stream isn't flushed. On some platforms, it is flushed after every output, but on others, it is not.</p> <p>So, if you flush it you'll get <code>0</code> as output:</p> <pre><code>cout &lt;&lt; i &lt;&lt; flush; // 'flush' flushes the stream = displays everything immediately </code></pr...
How to properly handle a variable with the same type as the class it belongs to? <p>I am using the two files below for my project. The variable I am referring to, <code>Node parent</code>, was originally not a pointer, but I quickly found out this doesn't work for obvious reasons (memory). </p> <p>So I turned it into ...
<p>You should check if <code>parent</code> is <code>nullptr</code> or not:</p> <pre><code>bool Node::getParent( Node&amp; node ) { if ( parent ) { node = *parent; return true; } else { return false; } } </code></pre> <p>Note that you have to implement the proper copy-co...
Not good print HTML after load page <p>For example you're booking this hotel, after select room[s] hotel You must fill out the form[s].</p> <p>This example, You have selected a room.</p> <pre><code>lenHotel = 1; plusCapacity = 2; </code></pre> <p>‍Script:</p> <pre><code>$(function () { for(var i = 0; i &lt; lenHo...
<p>First look shows me few problems in your code. </p> <p>You should make jQuery understand that where exactly you're trying to append the code. Because jQuery finds the fist element and append there only.</p> <p>Use <code>.eq()</code> to find the index of <code>col-xs-6</code>. </p> <p><code>$("#Step-02").find('.co...
structuring element to remove 1 pixel connection <p>I have been thinking and searching for this but could found anything! can anyone help me on this to finding the structuring element</p> <p>Image is attached : <img src="http://i.stack.imgur.com/2eYq1.png" alt="link to image "></p> <p>Thanks</p>
<p>What you want to do is to use a <a href="http://homepages.inf.ed.ac.uk/rbf/HIPR2/hitmiss.htm" rel="nofollow">hit or miss transformation</a>/operation, it's the operation used in most of <a href="https://en.wikipedia.org/wiki/Hit-or-miss_transform" rel="nofollow">skeleton/thinning transformation</a>. You look for a r...
Cannot downcast from 'UIViewController' to a more optional type 'SubclassOfUIViewController<NSString>' <p>I have a Subclass of UIViewController that is defined as follows</p> <pre><code>@interface SubclassOfViewController&lt;__covariant Type&gt; : UIViewController @end @implementation SubclassOfViewController @end </c...
<p>You usually do not use Optional types for <code>as?</code> casting.</p> <p>Try just removing that <code>!</code>.</p> <pre><code> if let vc = segue.destinationViewController as? SubclassOfViewController&lt;NSString&gt; { </code></pre>
Pyomo Ipopt does not return solution <p>my script is:</p> <pre><code> from __future__ import division import numpy import scipy from pyomo.environ import * from pyomo.dae import * from pyomo.opt import SolverFactory m=ConcreteModel() m.x3=Var(within=NonNegativeReals) m.u=Var(within=...
<p>In the most recent versions of Pyomo, the solution is loaded into the model by default. The results object should be used to check status information. If you want to interrogate the solution you can do so by accessing the model components directly and checking their value, or you can do the following:</p> <pre><cod...
Rails 4, Rspec and Factory Girl: URI::InvalidURIError (Multitenancy) <p>Im following a tutorial on Rails 4 and Multitenancy, but am getting an error when trying to test if a user can sign in as an owner and redirect to a created subdomain. </p> <p>This is the test error:</p> <pre><code>Failures: 1) User sign in si...
<p>So I solved this:</p> <p>The problem was in my SubdomainHelpers file </p> <pre><code>module SubdomainHelpers def within_account_subdomain ### This Line Is the original line let(:subdomain_url) { 'http://#{account.subdomain}.example.com' } ### Changed it to this let(:subdomain_url) { "http://#{ac...
"Add as Library" button missing? <p>Trying to add external library jars to my project, but imports still don't work. Tutorials keep telling me to click "Add as library", but I don't have that option:</p> <p><a href="http://i.stack.imgur.com/jQVkc.png" rel="nofollow"><img src="http://i.stack.imgur.com/jQVkc.png" alt="M...
<p>The <code>libs</code> folder should be a subfolder of <code>app</code>. Instead you have it buried in <code>app/src/main</code>. Note that you already have a dependency for the <code>libs</code> folder if you put it in the correct place.</p> <p>When you use a file manager or the command line to move files to your A...
avoiding circular inclusion when having to pass back values <p>what is the best way to handle circular inclusions in the situation where I have a class that communicates with another class, like an API and gets callbacks from that class.</p> <p>Assume I have a class</p> <p>.h</p> <pre><code>class Requestor; class A...
<p>Use </p> <pre><code>#ifndef __filex__ #define __filex__ </code></pre> <p>At the beginning of each .h and </p> <pre><code>#endif </code></pre> <p>At the end. </p> <p>This way, the .h file is read only once</p>
powershell cmdlet C#? <p>I'm tired to search about way to use powershell in C#, this first time to use Powershell and I don't know how to add it in C#, i have my codes working in Powershell any help to add in C#?</p> <pre><code>New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts...
<p>What have you tried?</p> <p>Here are some links that describes how it can be done. But your question is not very detailed on your requirements... The last one have code you can download and try/modify!</p> <p><a href="https://blogs.msdn.microsoft.com/kebab/2014/04/28/executing-powershell-scripts-from-c/" rel="nofo...
Get records created after a particular time of day <p>Say I have an <code>Event</code> model with a <code>date_time</code> field representing the date time the event is held, and I want to see all Events that are held, say, 'after 10pm', or 'before 7am' across multiple dates. How could I do this? </p> <hr> <p>My firs...
<p>Check if this works for you,</p> <pre><code>s = DateTime.now.change(hour: 6, min: 30).utc e = Date.today.end_of_day.utc Event.where("date_time::time between ?::time and ?::time", s, e) </code></pre>
FilesMatch - how to make every file downloadable attachment? <p>I have the following FilesMatch directive in my .htaccess:</p> <pre><code>&lt;FilesMatch "\.(?i:mp4|pdf)$"&gt; Header set Content-Disposition attachment &lt;/FilesMatch&gt; </code></pre> <p>I cannot find the right expression to have <strong>every</stro...
<p>You can try this</p> <pre><code>&lt;FilesMatch "(?i)\.(mp4|pdf)$"&gt; Header set Content-Disposition attachment &lt;/FilesMatch&gt; </code></pre> <p>But if you mean to allow all file extension then you can try this:</p> <pre><code>&lt;FilesMatch "\.+$"&gt; Header set Content-Disposition attachment &lt;/FilesM...
Which could be the best way for communication of Micro-services without any HARD-CODE <p>I having a bunch of microservices which communicates with each other using <code>RestTemplate</code>. All the communication of microservices is from API gateway.</p> <p>I am doing as following,</p> <pre><code> public List&lt;S...
<p>Try using Feign - it is a declarative REST client. It does not require any boilerplate that you mentioned. Checkout spring-cloud-netflix documentation for more details. In short, your REST client would look like this:</p> <pre><code>@FeignClient(name = "service-name", path = "/base-path") public interface MyClient{...
Implicit library linking and GetModuleHandle/GetProcAdress <p>We are trying to understand some of the finer details of locating a symbol at runtime. I've already reviewed Jeffrey Richter's <a href="http://rads.stackoverflow.com/amzn/click/1572319968" rel="nofollow">Programming Applications for Microsoft Windows</a>, Ch...
<p>Not much to say here. It is perfectly legal to use <code>GetProcAddress</code> with a module handle obtained by calling <code>GetModuleHandle</code>. </p> <p><strong>Update</strong>: I wrote this based on the original form of the question which did not make it clear that the question is meant to cover mobile platfo...
How to pass JSON Data Using PHP CURL in WePay API? <p>I want to use WePay reports API for reporting purpose to show WePay transaction and withdrawal information in my custom application . When I call Wepayreports api I have faced some issues in passing JSON Data using PHP CURL.</p> <p>My Code like below:</p> <pre><co...
<p>Quoting from <a href="https://developer.wepay.com/general/api-call" rel="nofollow">https://developer.wepay.com/general/api-call</a></p> <blockquote> <p>Call arguments should be passed as JSON in the body of the request with content-type HTTP header set to application/json. Make sure to set a valid User-Agent ...
try to find the shortest path between two points in a (x,y) coordinate system in C++. Got 11db erro <p>This is part of my homework which is to find the shortest path between two points in a x,y graph (the size of the graph is 640*340.). THE PATH SHOULD ONLY GO THROUGH THE POINTS WHERE (X,Y)VALUES ARE INTEGERS. I am new...
<p>I dont really understand what you're trying to do here but i know u should use floats or doubles instead of ints if you want to get a decimal anwser.</p> <p>By the way isn't the shortest past just Pythagorean Theorem?</p> <p>The shortest path for the points (Ax, Ay) and (Bx, By) should be sqrt( (Bx-Ax)^2 + (By-Ay)...
Android :: Camera widget example <p>I have been looking for a widget that contain a camera inside without opening the camera app itself.</p> <p>here is the only example i found: <a href="https://www.youtube.com/watch?v=QOJF4eZjzhU" rel="nofollow">https://www.youtube.com/watch?v=QOJF4eZjzhU</a></p> <p>Any help or advi...
<p>You can do this with <code>SurfaceView</code> as described <a href="https://developer.android.com/reference/android/hardware/camera2/package-summary.html" rel="nofollow">here</a>.</p>
WPF Change the object opacity in Circular way <p>For the sake of example lets assume I have Captain America's two shields as displayed in image. I am laying new image underneath the old. Now upon some interaction like a button click, I want an animation effect</p> <p><a href="http://i.stack.imgur.com/CR1yf.png" rel="n...
<p>From my understanding, you have two images, one placed on top on the other. Then you want the top image to turn completely transparent, starting at the center and then spreading out to the perimeter until the entire top image is no longer visible and the bottom image shows through.</p> <p>To do this, I would advise...
Eclipse import a plugin as source project but it's not include src folder <p>I want to modify the plugin org.eclipse.jface.text's source code and build my own plugin.I opened the Plug-ins window(<code>Window &gt; Show View &gt; Plug-ins</code>),found org.eclipse.jface.text,<code>right click &gt; Import as &gt; Source P...
<p>I think that you should try importing the plugin with the source using the dedicated wizard(<code>File &gt; Import... &gt; Plug-in Development &gt; Plug-ins</code>) as shown in <a href="http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fguide%2Ftools%2Fimport_wizards%2Fimport_plugins.htm" rel...
How to fetch data from mongodb using nodejs, expressjs <p><strong>Here is my code file name student.js</strong></p> <pre><code>var mongoose = require('mongoose'); var studentSchema = new mongoose.Schema({ name:{ type: String, required: true }, rollno:{ type: Number, requir...
<p>If you have an existing collection that you want to query using Mongoose, you should pass the name of that collection to the schema explicitly:</p> <pre><code>var studentSchema = new mongoose.Schema({ ... }, { collection : 'student' }); </code></pre> <p>If you don't, Mongoose will generate a collection name for yo...
What are core algorithms behind Deepmind? <p>I am wondering what kind of algorithmic strategy is used in <a href="https://deepmind.com/" rel="nofollow">Deepmind</a> and Alpha Go. Is is better than other AI algorithmic approaches?</p>
<p>The algorithm which is used by DeepMind is called "neural pushdown automata". That is a stackmachine like Forth or Java-Virtual-Machine with the addition that the code is generated by a neural network. <a href="https://arxiv.org/pdf/1605.06640.pdf" rel="nofollow">Programming with a Differentiable Forth Interpreter</...
Static methods with __construct <p>I need to use static methods with <code>__construct()</code> method to instantiate the <code>Client</code> object but the as far as I know there is no way to use the <code>__construct()</code> since the object is not instantiated when using static methods.</p> <p>I thought I can use ...
<p>As an approach this method is fine, but to be more <a href="https://en.m.wikipedia.org/wiki/SOLID_(object-oriented_design)" rel="nofollow">SOLID</a> here I would pass <code>Client</code> in <code>init()</code> function like <code>init(Client $client)</code> rather than instantiating it right in class. So do and <cod...
ElasticSearch group and distribute to buckets <p>I am quite new to elasticsearch but it seems that there is no easy way to create aggregation and distribute doc_count to buckets once previous aggregation is done. For example I have below set of data and I would like to create 4 buckets and group profiles that have sp...
<p>You could do additional grouping with the help of <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-bucket-selector-aggregation.html" rel="nofollow">pipeline bucket selector aggregation</a>. The <a href="https://www.elastic.co/guide/en/elasticsearch/reference/curre...
QSQLITE driver not loaded <p>Im trying to make a program in Qt that uses a SqlLite database, but i can not get it to work...<br><br> When i try to execute a query i get the error:<br> Driver not loaded Driver not loaded<br><br> But when i print out the drivers that are available i get:<br> ("QSQLITE", "QMYSQL", "QMYSQL...
<p>You need to create folder <code>sqldrivers</code> near the executable and copy there the files from folder <code>plugins/sqldrivers</code> from where your Qt system is installed. (at least qsqlite4.dll or 5 or so on dependently from your Qt version)</p> <p>I do not meet necessity to download SqlLite dll to make sql...
PhoneGap/Cordova app notifications <p>I am new to PhoneGap/Cordova, i am looking to add some notifications to my app.</p> <ol> <li><p>Push notification - so when a new article is released on app it will alert the users.</p></li> <li><p>Local Notifications - On set intervals (date and time) I can prompt the user of the...
<p>Steps for enabling push notifications in project.</p> <ol> <li><p>create a project in <a href="https://console.developers.google.com/" rel="nofollow">https://console.developers.google.com/</a> with your project name.</p></li> <li><p>Refer the below link for push plugin installation <a href="https://github.com/phone...
Relative layout overlapping Linear layout <p>I have the following snippet of code:</p> <pre><code>&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:fillViewport="true" android:layout_height="match_parent"...
<p>There are 2 things you can try and see what fits better for your needs.</p> <p>You can align button below the EditTexts</p> <pre><code>&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="...
Why my font color will chang when div transition? <p>Here is also on jsfiddle <a href="https://jsfiddle.net/phmttrsh/" rel="nofollow">https://jsfiddle.net/phmttrsh/</a></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-...
<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>#btn { font-size: 16px; height: 34px; width: 120px; border: 1px solid #20ACB3; text-align: center; ...
Looking for JsonParser dependency <p>I have worked out that JsonParser is in javax.json.stream but i have no idea where i can get a hold of it. Can anyone help me?</p> <p><a href="https://docs.oracle.com/javaee/7/api/javax/json/stream/package-summary.html" rel="nofollow">https://docs.oracle.com/javaee/7/api/javax/json...
<p>If you are using maven, you can add the following dependency</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;javax&lt;/groupId&gt; &lt;artifactId&gt;javaee-api&lt;/artifactId&gt; &lt;version&gt;7.0&lt;/version&gt; &lt;/dependency&gt; </code></pre> <p>you can also download the artefact manually here </p> ...
Splitting a wav file in Matlab <p>I previously asked a question, which is related to my actual problem. I converted a mp3 file to a wav file, by using the program audacity. Th duration of the wav-file is about 10 seconds. I want to split it in 10 parts, which means, each part takes 1 second. How can i make it happen? P...
<p>It depends on what you want to do next. The easiest way to get part of signal is:</p> <pre><code>part=y(1:Fs); </code></pre> <p>you probaly want array of this things so use FOR, or WHILE sructure, smth like this:</p> <pre><code>%in loop part(i)=(i*Fs:i*Fs+Fs); i=i+1; </code></pre> <p>be aware of array length</p>...
How to save Foreign Key text input in Django model form <p>My view passes an id to my form. This id is a foreign key from another table. I am not able to save the id in the database table. (id : voucher_id, table in which i am saving the form : TmpPlInvoicedet)</p> <p><strong>What i want to do</strong></p> <p><stron...
<p>You seem to be creating a new invoice ID and then, in your form, attempting to get the invoice matching that ID. But that invoice doesn't exist yet, of course, because you haven't created it.</p> <p>You might want to use <code>get_or_create</code> to ensure that the invoice is created if it doesn't exist.</p>
How to register REST client in WSO2 API Manager <p>I've been looking through the doc of wso2 apim. <a href="https://docs.wso2.com/display/AM1100/apidocs/store/index.html#guide" rel="nofollow">https://docs.wso2.com/display/AM1100/apidocs/store/index.html#guide</a></p> <p>And found the curl request:</p> <pre><code>cur...
<p>Looks like your DCR call is being blocked by some security filter. May be because you're reaching a wrong endpoint. </p> <p>I believe you're using APIM 2.0.0. If yes, your DCR url should be this. (note version <code>v0.10</code>)</p> <pre><code>http://localhost:9763/client-registration/v0.10/register </code></pre>...
Laravel 5.3 How does bootstrap interpret and display items without internet <p>I'm still learning Laravel 5.3 and started studying it a few days ago. One tutorial project I'm following made use of <code>Fontawesome</code> and <code>Bootstrap</code> where bootstrap link and <code>fontawesome</code> link was included wit...
<p>Your browser has cache too. Do <a href="http://superuser.com/questions/220179/how-can-i-do-a-cache-refresh-in-google-chrome">hard refresh / reload</a> - in Chrome you can do this by opening inspector and then right click on refresh button and click what suits you the most.</p> <p><a href="http://i.stack.imgur.com/U...
The JSON sent by Firebase is invalid <pre><code>{ name: 'anonymous', text: 'Hello' } { name: 'anonymous', text: 'How are you' } { name: 'anonymous', text: 'I am fine' } </code></pre> <p>This code is returned by Firebase and I'm getting the error <code>No JSON object could be decoded</code>. I think this has to do some...
<p>This is not a valid JSON and I think that your <code>firebase2.js</code> is at fault here.</p> <p>Instead of this:</p> <pre><code>{ name: 'anonymous', text: 'Hello' } { name: 'anonymous', text: 'How are you' } { name: 'anonymous', text: 'I am fine' } </code></pre> <p>It should output this:</p> <pre><code>[ { "...
Save base64 JPG to disk in R - Shiny <p>I have the following data frame which can be downloaded from <a href="https://drive.google.com/open?id=0B-PuDZ6SYpScMW5CdXhvLVpJQkk" rel="nofollow">here</a>. The column <code>image_path</code> has jpg files in base64 format. I want to extract the image and store it in a local f...
<p>This creates your images from the base64 strings and saves the files <strong>to your current working directory, subfolder "/images/"</strong>. <a href="http://shiny.rstudio.com/articles/persistent-data-storage.html#local" rel="nofollow">This article describes pretty well how to save files locally in Shiny.</a></p> ...
Android Import java.util.StringJoiner error <p>I tried to import <code>java.util.StringJoiner</code> but I received this message </p> <p><code>Usage of API documented as @since 1.8+ less... (⌘F1) This inspection finds all usages of methods that have @since tag in their documentation. This may be useful when develo...
<p><code>StringJoiner</code> was added in API Level 24. If your <code>minSdkVersion</code> is 24 or higher (i.e., will only run on Android 7.0+), you are welcome to use it. If your <code>minSdkVersion</code> is lower than 24, either replace your use of <code>StringJoiner</code> entirely or only use it on devices runnin...
Update a field 'version' into a table <p>I have this situation:</p> <p>I have two tables:</p> <ul> <li>Table A </li> <li>Staging_Table A </li> </ul> <p>Both tables contain those common columns:</p> <ul> <li>Code</li> <li>Description</li> </ul> <p>Into Table A I also have a column <code>Version</code> which identif...
<p>If I understand correctly process work like that: 1. Data is loaded to staging table Staging_table_A 2. Data is inserted from Staging_table_A itno Table_A with additional column version.</p> <p>I would do:</p> <pre><code>with cnt as (select count(*) c, code from Table_A group by code) Insert into Table_A (select s...
can't return roles in AspNetRoles <p>i need to return all role in identity tabel for create a dropdown list . </p> <pre><code> public class ApplicationRoleManager : RoleManager&lt;IdentityRole&gt; { public ApplicationRoleManager(RoleStore&lt;IdentityRole&gt; store) : base(store) { } public ...
<p>The process to get all roles via setting up <code>ApplicationRoleManager</code> is the following (as per Identity samples provided by Microsoft found <a href="https://www.nuget.org/packages/Microsoft.AspNet.Identity.Samples" rel="nofollow">here</a>).</p> <p>Add the code below to your IdentityConfig.cs</p> <pre><co...