input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
How to change the Progress Spinner in ProgressDialog? <p>I am having an Material ProgressBar library which I want to integrate in a <code>ProgressDialog</code>. How to do it?</p>
<p>I only want to change the <code>Loader</code>/<code>Spinner</code>, nothing else.</p>
| <p>Use This:</p>
<pre><code> progressDoalog = new ProgressDialog(getContext());
// progressDoalog.setMax(100);
// progressDoalog.setMessage("Loading Content......");
progressDoalog.setIndeterminate(true);
progressDoalog.setTitle("Loading Content ");
progressDoalog.setProgressS... |
Selecting first alphabet in a word document <p>Example - </p>
<p>"Let this be the test sentence" , Suppose this line is selected , I need a Word macro to select only the first alphabet , that is 'L' and then format it in which ever way I want...
I am unable to get the macro to select only the first alphabet from the s... | <p>I assume you mean the first character in the selection?</p>
<pre><code>MsgBox Selection.Characters(1)
</code></pre>
<p>Or, to use it to make that character bold:</p>
<pre><code>Dim firstChar As Word.Range
Set firstChar = Selection.Characters(1)
firstChar.Bold = True
</code></pre>
|
spark uses sophisticated ways to leverage memory space - explain <p>I was watching a video on apache spark <a href="https://youtu.be/EuWDz2Vb1Io?t=7064" rel="nofollow">here</a> . Where the speaker Paco Nathan says the following</p>
<blockquote>
<p>"If you have 128 GB of RAM, you are not going to throw them all at on... | <blockquote>
<p>"If you have 128 GB of RAM you are not going to throw them all at once
at the jvm.That will just cause of lot of garbage collection"</p>
</blockquote>
<p>This means that you will not assign all the memory to the JVM only when there is memory requirement for other stuff like garbage collection, off-... |
Multiple ExecutorService finish after main <p>I need some input from you regarding a scenario for which I am doing some POC(Proof of Concept).
I am novice to multithreading in java and trying to some test. My requirement is I want to load millions of records using simple
java and then after doing some conversion with ... | <p>Instead of that while loop I would advise you to use the built-in await function like this:</p>
<pre><code> executor.shutdown();
try {
System.out.println("Waiting for finish");
executor.awaitTermination(1000, TimeUnit.SECONDS);
System.out.println("Stopped nicely");
} catch (Interr... |
More than 1 Facebook user Ids <p>there are more more than one Facebook user ids.</p>
<ol>
<li>returned by the Graph API</li>
<li>which <a href="http://findmyfbid.com/" rel="nofollow">findmyfbid.com</a> returns</li>
</ol>
<p>My questions are:</p>
<ol>
<li>why are there two different ids</li>
<li>can we get one of the... | <p>findmyfbid.com returns the "global/real ID" by scraping the profile, which is not allowed. You should not use that ID anyway and there is no serious/allowed way to get it.</p>
<p>The Graph API returns an "App Scoped ID" that is unique in the App, after authorizing the user. You will get a new one for the user in an... |
Apply filters in AngularJS controller <p>I am newbee to angular and have this filter to translate the text (localization) which works well in my html/view:</p>
<pre><code><input type="button" class="btn btn-link" value="{{'weeklyOrdersPage.reposting' | translate}}" ng-click="sortBy('reposting')" />
</code></pre>... | <p>You don't need to use <code>{{}}</code> when writing code in <code>controller</code></p>
<pre><code>$filter('translate')('weeklyOrdersPage.panelId')
$filter('translate')('weeklyOrdersPage.panelClassification')
$filter('translate')('weeklyOrdersPage.quality')
</code></pre>
<p>That should solve the problem.</p>
|
How to setup cucumber on top of protractor to do end to end testing? <p>Need to setup cucumber framework on top of protractor to do end to end testing. Kindly provide to steps to successfully run the setup</p>
| <p>Steps to setup Protractor cucumber framework:</p>
<ol>
<li>Install npm install --save-dev protractor-cucumber-framework</li>
<li>To implement this framework, utilize the protractor custom framework </li>
</ol>
<p>config option:</p>
<pre><code>exports.config = {
// set to "custom" instead of cucumber.
framewo... |
.htaccess RewriteRule is not redirecting the page <p>im trying to redirect a link like this:</p>
<p><a href="http://spicyyeti.com/strangers/2" rel="nofollow">http://spicyyeti.com/strangers/2</a></p>
<p>to its equivalent:</p>
<p><a href="http://spicyyeti.com/strangers/strangers.php?img=2" rel="nofollow">http://spicyy... | <p>Your first rule is going to match and rewrite to <code>strangers/2.html</code>, you'll need a condition to exclude the <code>strangers</code> URI from the first rule:</p>
<pre><code>RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/strangers/.*$
RewriteRule ^([^\.]+)$... |
Undefined method when using static import <p>I'm reading 'Thinking in Java, 4th edition' and can't get past this exercise:</p>
<blockquote>
<p>Create two packages: debug and debugoff, containing an identical class
with a debug( ) method. The first version displays its String argument
to the console, the second d... | <p>You cannot use the static import as you specified to import the methods</p>
<ol>
<li>You can use the static import to access or import the members(Objects)</li>
</ol>
<p>For Ex: System.out.println(""); -> can be replaced by
out.println(""); if you made a static import of java.lang.System.*;</p>
<ol start=... |
QT make app to check if there is an update on sourceforge.net <p>I want my QT app to check if there is an update on sourceforge.net. For this I use the request: <a href="https://sourceforge.net/projects/kidbasic/best_release.json" rel="nofollow">https://sourceforge.net/projects/kidbasic/best_release.json</a>
If you use... | <p><code>sourceforge.net</code>seems to be closing the connection when the HTTP request's user agent string is <code>Mozilla/5.0</code> (this is the default user agent used by <code>QNetworkAccessManager</code> when no <a href="https://doc.qt.io/qt-5/qnetworkrequest.html#KnownHeaders-enum" rel="nofollow"><code>QNetwork... |
Need each row total value and that should be display at end of row <p>I want to display each row's total value at the end of each row...all the records are being fetched from a database but how to count each row's total value and how to display it at the end of every row? Please help.</p>
<p><div class="snippet" data... | <p>You can simply add a variable before the loop like:</p>
<pre><code>$tot = 0;
</code></pre>
<p>Then after the sum_total calc you add:</p>
<pre><code>$tot += $sum_total;
</code></pre>
<p>I also would do a little change to sum_total (if you work with integers):</p>
<pre><code>$sum_total = intval( $row['stock_count... |
Why Json into db? <p>Why some companies today are using the approach to save json objects into a DB instead creating new table and store data in it?</p>
<p>What are the real advantages?</p>
| <p>In my company we use <code>JSONB</code> in Postgres database because of the need to store dynamic column data which will not fit into a traditional relational model since number of columns would grow all the time or we would have to have columns without meanings and assign those meanings based on some other columns ... |
Combine shapes with CSS <p>I have created a black bar with CSS:</p>
<pre><code>#bg #bar {
top: 300px;
width: 7.5em;
height: 1em;
left: 50%;
margin-left: -3.75em;
margin-top: -0.5em;
position: fixed;
background-color: #333333;
/*border: 1px solid black;*/
z-index: 1;
</code></pre>
<p>}</p>
<p>I would like to add on b... | <p>You can use <code>:before</code> and <code>:after</code> pseudo elements to create circles and <code>position: absolute</code> to position them.</p>
<p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snipp... |
Finding max value of a specific date awk <p>I have a file with several rows and with each row containing the following data-</p>
<pre><code>name 20150801|1 20150802|4 20150803|6 20150804|7 20150805|7 20150806|8 20150807|11532 20150808|12399 2015089|12619 20150810|12773 20150811|14182 20150812|27856 2015081... | <p>I think you mean this:</p>
<pre><code>awk -v date=20150823 '{for(f=2;f<=NF;f++){split($f,a,"|");if(a[1]==date&&a[2]>max){max=a[2];name=$1}}}END{print name,max}' YourFile
</code></pre>
<p>So, you pass the date you are looking for in as a variable called <code>date</code>. You then iterate through all ... |
What is socket hijacking? <p>I'm reading a great <a href="https://blog.heroku.com/real_time_rails_implementing_websockets_in_rails_5_with_action_cable" rel="nofollow">post</a> on Rails 5 actioncable introduction. There it says: "Action Cable uses the Rack socket hijacking API to take over control of connections from th... | <p>Socket Hijacking was implemented with <code>rack 1.5.0</code> - a modular Ruby webserver interface. </p>
<p><code>Rack 1.5.0</code> basically provides a simple and adaptable interface for developing apps in rails. It does this by wrapping HTTP requests and their responses in a simply way. It also combines the API's... |
Python 3.5.2 variable Error <p>I have installed python 3.5.2 but when i try to get the value from user it doesn't work it only shows the message but never get the value from user how can i solve this problem??</p>
<p><img src="http://i.stack.imgur.com/ehBYZ.jpg" alt="enter image description here"></p>
| <p>Like @Moses said, you have to use the <a href="https://docs.python.org/3/library/functions.html#input" rel="nofollow">input()</a> function:</p>
<pre><code>>>> d = input('Enter the num here: ')
Enter the num here: 222
>>> d
'222'
>>> int(d)
222
</code></pre>
|
sharetribe homepage error after login in sharetribe <p>After login with <a href="http://52.27.73.120:3000/" rel="nofollow">http://52.27.73.120:3000/</a> in sharetribe. I getting the errors. It is also mentioned that this is fresh installation of sharetribe. But i am getting errors after login in the system. If someone ... | <p>You didn't install the npm modules or your npm modules installation is failed.</p>
<p>Please try to install npm modules</p>
<pre><code>npm install
</code></pre>
<p>If you have any issues, this <a href="https://www.sharetribe.com/community/t/help-webpack-and-react/151" rel="nofollow">link</a> will help you.</p>
|
How to find maximum value of two numbers in python? <p>I want to get the maximum value from a list.</p>
<pre><code>List = ['1.23','1.8.1.1']
print max(List)
</code></pre>
<p>If I print this I'm getting <code>1.8.1.1</code> instead of <code>1.23</code>.
What I am doing wrong?</p>
| <p>These aren't numbers, they are strings, and as such they are sorted lexicographically. Since the character 8 comes after 2, <code>1.8.1.1</code> is returned as the maximum.</p>
<p>One way to solve this is to write your own comparing function which takes each part of the string as an <code>int</code> and compares th... |
error running meteor on docker <p>I just started a project with meteor on Docker. When it runs <code>meteor</code> after <code>meteor npm install</code> it gives this error</p>
<pre><code>[[[[[ /var/app ]]]]]
=> Started proxy.
/root/.meteor/packages/meteor-tool/.1.4.1_1.139xb76++os.linux.x86_64+web.browser+web.cor... | <p>I have a solution inspired from <a href="http://stackoverflow.com/a/25945966/1586406">this answer</a>. Basically instead of figuring out how to fix the symlinks, we "move" the meteor local files into its own volume. This can be done by creating a volume through docker-compose. The setup will be</p>
<pre><code>versi... |
Matlab clabel with figure-file <p>I´m facing a problem. I open a figure-file (.fig) in Matlab that is a 2D contourf-plot. I created the file with a software that is based on matlab but has a GUI: maptools. I added Isolines in the plot. Each Isoline is labeled by me (clabel in matlab). The problem now is that I can´t ... | <p>When you use <code>contour</code>/<code>contourf</code> you are generating instances of a <a href="http://www.mathworks.com/help/matlab/ref/contour-properties.html" rel="nofollow"><code>contour</code> object</a> that you can address directly. When loading in your figure, specify an output so you have the handle to y... |
How to get all the input values in a form using Selenium <p>Let's take a form of student details;
I want take take all these input data into a <code>List</code> or <code>Set</code>.
Please check the attached picture and give me any suggestions.</p>
<p><img src="http://i.stack.imgur.com/LAM3w.jpg" alt="Studendata"></p>... | <p>To get the inputs and the select you can use a selector like:</p>
<pre><code>input, select option[selected=selected]
</code></pre>
<p>to get only the input use css selector for input tag:</p>
<pre><code>input
</code></pre>
<p>to get also the selected inputs you could use:</p>
<pre><code>input[type=radio], input... |
TIdHTTP and TLS SNI doesnt work <p>On my attempt the TLS SNI extension is missing. I don't know why. Can someone point me in the right direction?</p>
<p>Embarcadero® RAD Studio 10 Seattle Version 23.0.21418.4207</p>
<p>Indy version: 10.6.2.5311</p>
<p>OpenSSL: <a href="https://indy.fulgan.com/SSL/openssl-1.0.2h-i38... | <p>I am not sure in which Indy version it was introduced (probably r5321, you have 5311) so if you update to the latest one, it will use SNI automatically. </p>
<p>I think you forgot to assign the <code>IdSSLIOHandlerSocketOpenSSL1StatusInfoEx</code> procedure to <code>IdSSLIOHandlerSocketOpenSSL1.OnStatusInfoEx</code... |
change Date Format C# <p>I am creating a web app in which if a user wants to show the data between the particular date he enter the date in the textbox with the help of ajax calender extender,
There are two textboxes
1 From date
2 To date </p>
<pre><code>9/1/2016
9/16/2016
</code></pre>
<p>And this is how the date ... | <p>let assume you have two string </p>
<pre><code>string date="10-10-2016";
string datecon="";
datecon=DateTime.ParseExact(datefrm, "dd-MM-yyyy",CultureInfo.InvariantCulture).ToString("yyyy-MM-dd");
</code></pre>
|
Getting broadcast if user installs app successfully using my intent play store url <p>I am working on app which suggested app. If user installs app successfully using my app then he gets reward in my app.
I am getting info about "com.android.vending.INSTALL_REFERRER" action of receiver which provides this but didn't ge... | <p>Hey Just see how it works I have implemented this in my app as well and works for me perfectly so I am posting you referral code:</p>
<p>Create separate class for receiving reference:</p>
<pre><code>import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import andr... |
Extract Xdocument soap response body into new Xdocument <p>I have XML which is parsed into an XDocument:</p>
<pre><code><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
... | <p>I think this will do the trick:</p>
<pre><code>using System;
using System.Xml.Linq;
namespace SO39545160
{
class Program
{
static string xmlSource = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.... |
Syntax error in INSERT INTO statement for register <pre><code>Dim con As New OleDb.OleDbConnection
Dim str As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=..\VisitorPass.accdb"
con = New OleDbConnection(str)
Dim sql As String = "insert into Visitor(Name,Password)values ('" & txtN... | <p>Try enclosing the field password in brackets.</p>
<pre><code>insert into Visitor(Name,[Password])values ..
</code></pre>
<p>This should do the trick when using MS Access.</p>
|
Checking multiple data frame columns at once (flexible manner) <p>Looking for a better way: How can I make R check the values of a flexible subset of multiple columns element-wise (let's say <code>Var2</code> and <code>Var3</code> here) and write the result of the check to a new logical column?</p>
<p>Is there a short... | <p>We can use <code>rowSums</code> on the logical matrix</p>
<pre><code>df$criticalColumnsAreEmpty <- !rowSums(df[criticalColumns]!="")
df$criticalColumnsAreEmpty
#[1] TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE
</code></pre>
<hr>
<p>Or another option (for big datasets to avoid converting to matri... |
What is difference between POST-request of Vert.x and JavaScript? <p>I have vert.x application. In my verticle I have such route to perform post-request:</p>
<pre><code>router.post("/api/1").handler(routingContext -> {
HttpServerResponse response = routingContext.response();
response
... | <p>In your
<code>HttpClientRequest request = client.post(8080, "localhost", "api/1", response -> {
...</code></p>
<p>You missed a "/" in the beginning, it should be:</p>
<p><code>HttpClientRequest request = client.post(8080, "localhost", "/api/1", response -> {
...</code></p>
|
I want to show available time and booked time to the user <p>I am working on booking scheme in which i want to show user whether time slots on selected date is available or booked.</p>
<pre><code> <td style="border:1px solid;padding:11px;">
<?php
$query5=mysql_query("select * from doctorbooking wh... | <p>The <code>$query6</code> is an array so you'll have to loop to be capable to apply the <code>if/else</code> condition. Also, there are syntax errors with php and html tags. </p>
<p>Something like this should work (not tested) : </p>
<pre><code><td style="border:1px solid;padding:11px;">
<?php
... |
Why is split inefficient on large data frames with many groups? <pre><code>df %>% split(.$x)
</code></pre>
<p>becomes slow for large number of unique values of x. If we instead split the data frame manually into smaller subsets and then perform split on each subset we reduce the time by at least an order of magnitu... | <p>More an explanation than an answer. Sub-setting a large data.frame is more costly than sub-setting a small data frame</p>
<pre><code>> df100 = df[1:100,]
> idx = c(1, 10, 20)
> microbenchmark(df[idx,], df100[idx,], times=10)
Unit: microseconds
expr min lq mean median uq max ... |
How to return object or json data to html from handlebars helper <p>This is my handlebar block in html layout:</p>
<pre><code>{{json language}}
</code></pre>
<p>This is my handlebar helper in my main build.js:</p>
<pre><code> handlebars.registerHelper('json', function(language) {
var data = {
"marathi" : ... | <p>Here is an example (<a href="https://jsfiddle.net/2npe8sjp/" rel="nofollow">jsfiddle</a>):</p>
<pre><code>// In your HTML page:
// <script id="my-template" type="text/x-handlebars-template">{{json date}}</script>
// <output></output>
// Define the helper
Handlebars.registerHelper('json', fu... |
How to draw canvas to new html page <p>I am aware that drawing canvas onto the same-page that I am working on is doable. But, how can I draw the canvas to "other page"? For example, every time I click a "draw" button, it will create a new HTML page and draw anything on thas new page.</p>
| <p>You could send the data to the other page using postMessage:</p>
<pre><code>button.onclick=function(){
window.open("drawer.html");
window.postMessage("draw","*");
}
</code></pre>
<p>Now you have to catch it in the drawer html:</p>
<pre><code>window.addEventListener("message",draw,false);
function draw(){
//draw i... |
React-Flux Load initial state <p>I'm trying to make an Ajax request in al React Flux app with axios and I get data after state is set.</p>
<p>I have this code in root app:</p>
<pre><code>InitialData.getInitialPosts();
</code></pre>
<p>The API request it looks like this:</p>
<pre><code>let PostsApi = {
getAllPos... | <p>Your <code>PostsPage</code> component is not set up correctly to listen to changes from the store. The code you have will only grab the list of posts <em>once</em> when it first mounts. You want it to update whenever the Store gets new data.</p>
<p>To accomplish this, you need to utilize the add/remove Change Lis... |
How to echo the date (numbers) from mysql <p>I want to learn php & html so I'm making sketch websites. I want to know how to use echo statement. </p>
<p>I have this code </p>
<pre><code>Welcome, <?php echo $_SESSION['username']; ?> !
Today's date is: <?php echo $_SESSION['trn_date']; ?>
</code></pre>... | <p>Ok, Before echoing your date variable create </p>
<p><strong>Note:- You have to define this variable before echoing it.</strong></p>
<pre><code>$date_today = date("Y-m-d H:i:s");
</code></pre>
<p>After creating this date variable now echo this variable when you are greeting.</p>
<pre><code>Welcome, <?php echo... |
Want to track a file / folder which was earlier ignored by .gitignore <p>I have a folder <code>public/lib</code> which was ignored by GIT as i added following to <code>.gitignore</code> file :</p>
<pre><code>public/lib
</code></pre>
<p>I made initial committ & pushed changes into remote repository. Later realized... | <p>Your whitelist for the subdirectory looks a bit off to me. Try this:</p>
<pre><code>public/lib # blacklist public/lib folder
!public/lib/template # but exclude the template subfolder
</code></pre>
|
Private channel between AWS China and Global AWS <p>I have a project with Web part on both areas (EU and China) and i have two account on both AWS (Global and AWS China). </p>
<p>Can i make private channel between Chinese Zone and any Zone in Global AWS (for example Signapore) for replication of DB/Sync data and other... | <p>Your case and solution for it is described in this whitepaper from page 19
<a href="http://media.amazonwebservices.com/AWS_Amazon_VPC_Connectivity_Options.pdf" rel="nofollow">http://media.amazonwebservices.com/AWS_Amazon_VPC_Connectivity_Options.pdf</a></p>
|
Get content between html tags with identifier inside <p>I have these span tags :</p>
<pre><code><div>
<span style="background: url('/wp-content/themes/minimum-child/img/address.png') 0px 2px no-repeat; padding-left: 20px;">CONTENT 1</span>
<span style="background: url('/wp-content/themes/minimum-c... | <p>It is often said that parsing html with a regex is full of problems - so I'd opt for the simpler method of using <code>DOMDocument</code> to aid processing of the html fragment - you could then use a regex to further refine some of the results if desired perhaps.</p>
<pre><code>$html='
<div>
<span styl... |
How to Track App Installs? <p>I want to track all the Installs of my App as I will be uploading it on my WebSite for download and not PlayStore, and I've read about Google Analytics but I don't want to track screens and all..
Is there any easier way/library or something to track my App installs...</p>
| <p>create a service for your mobile App in your website. whenever a user download application from website and installs it. Then hit that service from your mobile app. The service when receives the request from your application store it in the database. make sure that your database table contains a unique identifier fo... |
Core Data - "days" and "tasks" (to-many-relation) - How to fetch all tasks of a day? <p>I have the entities <code>Day</code> und <code>Task</code>. One day has many tasks and one task has many days.</p>
<p>I want to fetch all tasks of a certain day. I think you have to use predicates for that. I tried this:</p>
<pre>... | <p>Can't test this at the moment but I think you would use
<code>"%@ IN days"</code> as the predicate</p>
<p>Alternatively just fetch the day that you are interested in and use the array that contains the tasks</p>
|
Decrypt a video and play parallelly <p>I encrypt a video using AES and stored in the sd card .
Now I'm able to decrypt the video and play but decryption is taking long time, so the I have to wait until whole video file get decrypted.</p>
<p>Is there any way by which I can decrypt and parallelly play the video without ... | <p>One solution is to use ExoPlayer. I did it in my last project. I had some problem with the decription, but eventually I came up with a solution.</p>
<p>Basically you need to create your custom DataSource that gets data from your file, and on-fly decrypt those data and provides them to the Player. Here you can find ... |
Data not Loading in RecyclerView when retrieving from Firebase <p>I am trying to retreive data from Firebase Database but nothing is loading in my RecyclerView. Below is my <code>MainActivity.java</code>. I don't know where i have gone wrong.</p>
<pre><code>package oerrride.we.huzykamz.testingappfirebase;
import and... | <p>in your Adapter class you are returning null;</p>
<p>return your holder object;</p>
<pre><code>return holder;
</code></pre>
<p>instead of </p>
<pre><code>return null;
</code></pre>
<p>like </p>
<pre><code> @Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v... |
how to insert newline after word in sql table in c# <p>I am trying to insert New Line after word car but it is not working with folowing solution</p>
<ol>
<li><code>Char(13)</code> - not working </li>
<li><code>Environment.NewLine</code> - when i use this it works but appends '(' this char in sql rows like 'Car ( Rat... | <p>With the LoC <code>Car + "char(13)" + "Rate:2CR";</code> you will get a literal string <code>"char(13)"</code> between your 2 values, not a new line. If you want only a new line you can append <code>"\n"</code> or you can append the character equivalent <code>(char)10</code> of new line.</p>
<p>Now what character o... |
Does magnet pull of google cardboard triggers click event in aframe? <p>I don't have Google cardboard right now to test. I'm using <strong>universal-controls</strong> and <strong>mouse-cursor</strong>. Will pulling magnet on Google cardboard trigger click event? Here's my camera universal-controls and cursor</p>
<pre>... | <p>It will if you use the <code>cursor</code> component. The cursor component provides an implementation of Cardboard click (which are just screen taps) and emits the click/mouseenter/mouseleave events.</p>
<p><a href="https://aframe.io/docs/0.3.0/components/cursor.html" rel="nofollow">https://aframe.io/docs/0.3.0/com... |
Apple Mach-O Linker & Ditto Error - Xcode 8 <p>I have just updated my Xcode to Xcode 8 and am now trying to convert my project's code to Swift 2.3. I was able to build a couple times using Xcode 8 without any errors. Now, the following errors came up:</p>
<h3>Error #1: Apple Mach-O Linker Error: Linker command failed ... | <pre><code>1.Quit Xcode
2.Restart the System
3.Select Xcode -> Preferences
This will open pop-up window. Select 'Locations' tab. In Locations sub-tab you can see 'Derived Data' Click on arrow icon next to path.
This will open-up folder containing 'Derived Data' Right click and Delete folder.
4.Clean the Product an... |
improve layout performance <p>I am freelancing to solve crash of an android app. It happens on startup, and I know it is because the activity_main.xml. It has too many views, too many nesting levels. Apart from that (wich I will try to reduce) </p>
<p><strong>what are other strategies to improve layout performance in ... | <p>I have been recently working on improving performance of app and renderd a fast smooth UI let me share you my experience :</p>
<p>The vision of performance in terms of UI is:</p>
<pre><code>Lower the latency of screen draws
Create fast, consistent frame rates to avoid jank/lag.
</code></pre>
<p>And there are so... |
How to I pass values into dependent models with Factory Boy in Django? <p>Im' working on an open source django web app, and I'm looking to use Factory Boy to help me setting up models for some tests, but after a few hours reading the docs and looking at examples, I think I need to accept defeat and ask here.</p>
<p>I ... | <p>In that case, the best way is to pick values from <a href="http://factoryboy.readthedocs.io/en/latest/reference.html#parents" rel="nofollow">the customer declarations</a>:</p>
<pre><code>class CustomerFactory(DjangoModelFactory):
class Meta:
model = models.Customer
full_name = factory.Faker('name'... |
How to ref when date change <p>i need to have counter row when date change so i have ref for the date</p>
<pre><code>Date Ref
01/01/2016 1
01/01/2016 1
01/01/2016 1
02/01/2016 2
02/01/2016 2
05/01/2016 3
05/01/2016 3
05/01/2016 3
07/01/2016 4
07/01/2016 4
07/01/2016 4
07/01/2016 4
12/01/2016 5
12/01... | <p>In SQL Server, you can calculate this using <code>dense_rank()</code>:</p>
<pre><code>select t.*, dense_rank() over (order by date) as ref
from t;
</code></pre>
|
Working with Core Data (multiple ViewControllers) <p>There is 1 thing I don't completely understand about working with <code>CoreData</code> (and I can't find a good answer to my question): how do you use <code>CoreData</code> in an app with multiple <code>UIViewcontrollers</code> ?</p>
<p>At the moment I was playing ... | <p>3-> Setting a public main queue MOC is a good practice. Because main queue is a serial queue.</p>
<p>1-> Using the main queue MOC only for fetching and creating child MOC for each editing is a good practice. Because editing MOCs that can be fetched may cause conflicts.</p>
<p>2-> You can try creating a singleton i... |
umbraco forms posting from protected page gives ysod <p>Using Umbraco version 7.4.3 assembly: 1.0.5948.18141
After creating a form using umbraco 7.4.3 the form works as expected, except when we access the form via a protected page. The form displays, and allows user interaction, however we are unable to submit form fro... | <p>There is a reply in the thread you've mentioned: <a href="https://our.umbraco.org/forum/umbraco-forms/78933-umbraco-forms-and-protected-pages#comment-256103" rel="nofollow">https://our.umbraco.org/forum/umbraco-forms/78933-umbraco-forms-and-protected-pages#comment-256103</a>. Hope it'll help you :)</p>
|
How to rebuild Enterprise Library 6 on Win 8 and VS2015 <p>I have customized the Enterprise Library and now want to rebuild it, but I get some errors when executing the BuildLibrary.bat (Scripts folder) from Developer Command Prompt for VS2015.</p>
<p><strong>Environment:</strong></p>
<ol>
<li>Win 8 </li>
<li>VS2015<... | <p>Ok I solved it by overriding the toolsversion.
Didn't use the BuildLibrary.bat.</p>
<p>Executed msbuild directly with the following switches:</p>
<blockquote>
<p>msbuild.exe EnterpriseLibrary.sln /tv:14.0 /p:Configuration=Debug</p>
</blockquote>
<p>If you want the Release version, replace debug with release.</p... |
JS autocomplete package in ST3 annoying autocomplete list at the end of the line after semicolon <p>I have some annoying issue with my ST3 JavaScript Completions package. So, whenever I hit space even If I haven't write anything yet I get JS autocomplete list with bunch of different functions and every time when I want... | <p>If you visit the package's <a href="https://packagecontrol.io/packages/JavaScript%20Completions" rel="nofollow">page on Package Control</a>, you'll see that the package was just updated 2 days ago. I would suggest that you <a href="https://github.com/pichillilorenzo/JavaScript-Completions/issues" rel="nofollow">file... |
Use hibernate entities from external jar <p>I have created jhipster microservice application, in which i have added a "demographics.jar" file as a dependency.</p>
<p>demographics.jar file contains a class "Address.java" which is JPA entity.</p>
<p>when i refer this class from my code, it generated following error</p>... | <p>Your <code>@EntityScan</code> annotation is probably wrong to scan your 2 packages: <code>com.example.jobcard.domain</code> and <code>com.example.geographics.domain</code></p>
|
Extracting a set from a list of composite elements in python <p>I'm maintaining <code>message_id</code> and <code>message_writer_id</code> together in a python list like so:</p>
<pre><code>composite_items = ['1:2', '2:2', '3:2', '4:1', '5:19', '20:2', '45:1', ...]
</code></pre>
<p>Where each element is <code>message_... | <p>You may use set comprehension like so:</p>
<pre><code>new_set = {item.partition(":")[2] for item in composite_items}
</code></pre>
<p>Set comprehension is fast, and unlike <code>str.split()</code>, <code>str.partition()</code> splits only once and stops looking for more colons. Quite the same as with <code>str.spl... |
WooCommerce get first gallery image as fallback, if post thumbnail is missing and at least the placeholder image <p>I have a problem to receive the first image of the woocommerce gallery, if the post thumbnail is missing. I want to show the post thumbnail, if this is missing, the first image of the WooCommerce gallery ... | <p>So, I found myself an soultion. Is not as perfect as I wished, but it works. I post this this answer, if someone is searching for an similar solution. So, this could be an way:</p>
<pre><code>/* GET PRODUCT IMAGE WITH GALLERY FALLBACK
================================================== */
if ( ! function_exists( 'ze... |
Is there a unique ID available for modifiers? <p>I'm trying to wrangle some WHEN callbacks from attached nodes via the optional id attribute in a modifier script. </p>
<p>If I set it to something arbitrary then it works well enough in most cases, however, if I have the same node specified by 2 different instances of t... | <p>There's the <a href="http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help/files/GUID-25211F97-E81A-4D49-AFB6-50B30894FBEB.htm" rel="nofollow">animHandle</a>, you can get it using the <code>GetHandleByAnim</code> function.</p>
|
Xamarin.Forms MissingMethodException: 'Android.Support.V4.Widget.DrawerLayout.AddDrawerListener' not found <p>I have followed everything from the following link:
<a href="https://developer.xamarin.com/guides/xamarin-forms/user-interface/navigation/master-detail-page/" rel="nofollow">https://developer.xamarin.com/guide... | <p>The solution is, I needed to update the package, only the Xamarin.Forms package. Like the below image. </p>
<p><a href="http://i.stack.imgur.com/Xf8FE.png"><img src="http://i.stack.imgur.com/Xf8FE.png" alt="Follow the red circle at the bottom, only update the Xamarin.Forms"></a></p>
<p>After update, the packages.c... |
WAS 8.5 server startup error <p>I am getting the following error while trying to deploy an EAR on WAS 8.5 in MyEclipseBlue.Can anybody please help?
I have tried changing the class loader order from parent last to first, setting metadata-complete="true" in web.xml , creating a new profile and reinstalling WAS . Nothing ... | <p>You have presumably packaged the servlet API in your application, so you should remove that. FWIW, it's basically impossible to get a LinkageError like this unless either your application or module class loader is set to "parent last". If you did change from parent last to parent first and still see some error, I su... |
How to loop a try and except ValueError code until the user enters the coorect value? <p>I have this code:</p>
<pre><code>try:
phone = int(input("Enter your telephone no. : "))
except ValueError:
print("You must enter only integers!")
phone = int(input("Enter your telephone no. : "))
</code></pre>
<p>I wa... | <p>I believe the best way is to wrap it in a function:</p>
<pre><code>def getNumber():
while True:
try:
phone = int(input("Enter your telephone no. : "))
return phone
except ValueError:
pass
</code></pre>
|
Order List count 2 and 3 with respect to modulus 4 <p>I have a list which I need to sort into an order provided it contains ALL of the numbers in its sequence: </p>
<p>Manually just setting them does not seem like the way to go about it.</p>
<p>I know how to order lists to be ascending or descending but having the mo... | <p>You can do the following:</p>
<ol>
<li><p>Build a valid modulus sequence. That's easy:</p>
<pre><code> var modulusSequence = Enumerable.Range(0, modulus);
</code></pre></li>
<li><p>Now you need a way of generating all valid modulus sequences of a given modulus and length. Thats easy too, just shift left or right a... |
Pass generic into Implicit class <p>I´m pretty newby on Scala, and I´m stack trying to pass a generic type into a implicit class, but I cannot find the way to do it.</p>
<p>Here my implicit class </p>
<pre><code>object Utils{
implicit class cacheUtils[T:ClassTag](cache:CacheApi){
def getVal(key:String): T =... | <p>It seems there are two problems in your code.</p>
<ol>
<li><code>CacheApi</code> should be parametric with type <code>T</code>, meaning, it should look like this: <code>class CacheApi[T](...)</code>, and your <code>cacheUtils</code> class parameter should be <code>cache: CacheApi[T]</code> instead of <code>cache: C... |
How to make scanf to read more than 4095 characters given as input? <p>We have test application in c which takes input using <code>scanf</code> in string format and that string it uses for further processing. </p>
<p>So far everything was working fine, however lately we have condition where need to input more than 41... | <p>As ARBY correctly stated: the actual problem is the discrepancy in the buffersizes of the LibC and the terminal. If you accept that limitation you are OK.</p>
<pre><code>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char input_array[5000];
size_t len;
int res;
p... |
SQL Azure DB Connection Router Repair Message: Do I need to take action? <p>After the well-known issues with SQL Azure and Azure DNS this week, we've just received a message in our Azure portal:</p>
<blockquote>
<p>In the course of this week and next week starting 16 Sep 2016, we will be failing over SQL Azure DB co... | <p>Seems like you won't need to do anything in your case: There's a generic firewall rule already in-place to allow for Azure resources (such as Web Apps) to access SQL Database. And you should already have that rule enabled.</p>
<p>Outbound firewall rules are going to be specific to outside VM's/servers (e.g. on-prem... |
Applying if else condition depending on the type of data returned <p>I am returning data from my php file which can be json or anything else.And i want to conditionally perform the function.
Here is the php code-</p>
<pre><code><?php
ini_set("display_errors", 1);
require_once("db.php");
$resultnew = "SELECT DISTI... | <p>As you're expecting to get JSON back, you should return JSON, and <code>"not ok"</code> is not valid JSON.</p>
<pre><code><?php
...
if (mysqli_num_rows($resultfinal) > 0) {
...
echo json_encode(
array("data" =>
array("item_name"=>$item_name,"des"=>... |
IndexError: invalid index to scalar variable for double and if 'for' statement <p>My main aim is to print out the values of one variable which is in a double <code>for loop</code> and under an <code>if-statement</code>but however I tend to get an error <code>IndexError: invalid index to scalar variable.</code> Here i... | <p>In your next-to-last line, you have the sub-expression</p>
<pre><code>LnPa - LnPa[ka]
</code></pre>
<p>That first reference to <code>LnPa</code> is fine, since that is a float variable, but the second is not. You are trying to treat that float variable as a list or some-such with <code>LnPa[ka]</code>, by indexing... |
How copy node tree in AEM? <p>I need to get java code for copy node tree inside [content/dam/img.jpg and subnodes[jcr:content and metadata]] in to [etc/mynodes]</p>
<pre><code>Source path: conten/dam/img.jp
Destin path: etc/mynodes
</code></pre>
<p>i want copy nodes :img.jpg>jcr:content>metadata</p>
| <p>You can use the JCR API to play with content nodes, here i have used an example with <strong>workspace.copy</strong> to move the <strong>/content/dam/geometrixx/portraits</strong> child nodes to <strong>/etc/mynodes/test</strong></p>
<blockquote>
<p>workspace.copy("/content/dam/geometrixx/portraits", "/etc/mynode... |
Cannot insert data in SQL table when using the same code as previous query <p>I need to insert two pieces of data into two different tables. It successfully does it with one of the tables but not the second. I have used or die mysqli_error to see if it will tell me the error, but it does not show anything. See the code... | <p>In your second query, you try to insert in a table with 7 fields 8 values.</p>
<p>I think you don't want to insert '$username' in the query.</p>
|
Can't install sqlite <p>I use mac.</p>
<p>Gem version: 2.4.5.1
Ruby version: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15]
Gemfile:</p>
<pre><code>source 'https://rubygems.org'
gem 'rails', '3.2.3'
group :development do
gem 'sqlite3', '1.3.5'
end
# Gems used only for assets and not required
# in... | <p>try</p>
<pre><code>bundle update sqlite3
</code></pre>
<p>I saw it here</p>
<pre><code>http://stackoverflow.com/questions/34151296/cannot-install-sqlite3-gem
</code></pre>
|
Issues with Bower on Ubuntu <p>Currently having issues with using Bower on Ubuntu</p>
<p>I attempt to use bower install, bower init and I am advised not to use sudo, but when I do I get the following error</p>
<blockquote>
<p>bower EACCES EACCES: permission denied, open '/var/www/xxxxxx/html/wp-content/theme... | <p>You have to have permission to the directory you are trying to install files in. So you have to use bower as a user who has access to this folder (eg <code>www-data</code> on Ubuntu: <code>sudo -u www-data bower install</code>)</p>
|
Update with a minimum value from a union in Oracle <pre><code>UPDATE table1 t SET t.columnA =
(SELECT MIN(columnB) FROM
(SELECT columnB FROM table2
WHERE table2.fk = t.pk
UNION ALL
SELECT columnB FROM table3
WHERE table3.fk = t.pk))
</code></pre>
<p>gives me <code>ORA-00904: "T"."PK": invalid ident... | <p>This is a problem of scoping. Oracle does not recognize the outer query alias more than one level of nesting deep.</p>
<p>If we assume that values are in both tables, then you can use <code>LEAST()</code> with subqueries:</p>
<pre><code>UPDATE table1 t
SET t.columnA = LEAST( (SELECT MIN(columnB)
... |
Authenticate for new APIM REST APIs? <p>In WSO2 API Manager old <a href="https://docs.wso2.com/display/AM1100/Store+APIs" rel="nofollow">store/publisher APIs</a>, I can login and get a cookie for authentication. But in <a href="https://docs.wso2.com/display/AM1100/apidocs/store/#!/operations#ApisAPIApi#apisGet" rel="no... | <p>You have to create an OAuth2 application using DCR API. Docs can be found <a href="https://docs.wso2.com/display/AM1100/apidocs/store/index.html#guide" rel="nofollow">here</a>. Then call to token API and get an access token.</p>
|
Why do I get this error with auto-generated framework headers in Swift? <p>In my Swift code (in a Framework), I extend UIColor to support the multiplication and addition operators like this:</p>
<pre><code>public protocol Interpolatable {
static func * (lhs: Self, rhs: Double) -> Self
static func + (lhs: Se... | <p>I eventually figured out what's going on and a proper fix for it.</p>
<p><strong>What's going on:</strong></p>
<p>When you create a Framework, it needs to be exposed as a module so that it is usable by other pieces of code. A lot of library classes (including <code>UIColor</code>) are actually Objective-C classes ... |
Magento 2 : How to set product name and product price in custom email template? <p>I want to ask how can we set values of product name and product price in my custom email template.</p>
| <pre><code>$product_id = 'get id';
$model = Mage::getModel('catalog/product') //getting product model
$_product = $model->load($product_id); //getting product object for particular product id
$name = $_product->getName(); //product name
$price = $_product->getPrice(); //product's regular Price
</code></pre>... |
Error in build gradle in Android studio <p>im new in Android .i import github project in Android studio . but i see this problem `Error:java.lang.OutOfMemoryError: Java heap space</p>
<blockquote>
<p>Error:java.lang.OutOfMemoryError: Java heap space
.
Please assign more memory to Gradle in the project's gradle.p... | <p>One of the methods below should work for you:</p>
<blockquote>
<p>METHOD 1 :</p>
</blockquote>
<p>Open gradle.properties file from your project tree
add this line at the memory allocation line</p>
<pre><code>org.gradle.jvmargs=-XX\:MaxHeapSize\=256m -Xmx256m
</code></pre>
<p>or</p>
<pre><code>org.gradle.jvmar... |
Calling Windows 10 bash from a c program <p>I am trying to write a simple program that would parse some string and pass it to bash on Windows 10 (with the not-so-new Linux subsystem). So I try</p>
<pre><code>system("bash");
</code></pre>
<p>(in the actual program I include some arguments for bash, but it behaves the ... | <p>Finally found the problem - file system redirector had been causing the trouble. Using the <code>C:\Windows\Sysnative\bash</code> path works.
Thanks to all that tried to help.</p>
|
C - Segmentation Fault (core dumped) <p>I am trying to write a simple C program that takes the input of a number and returns the sum of the number's digits as well as the reverse of the number. The program is currently incomplete because I keep encountering Segmentation Fault errors when testing it.</p>
<p>Here is th... | <p>You have used incorrect format specifier in the <code>printf()</code> functions, modify it to:</p>
<pre><code>printf("Sum of digits: %d", sum);
</code></pre>
<p>and it will work correctly (<code>%d</code> stands for decimal (numbers) and <code>%s</code> stands for strings).</p>
|
Can variables in a function for later use? <p>Can Python store variables in a function for later use?</p>
<p>This is a stat calculator below (unfinished):</p>
<pre><code>#Statistics Calculator
import random
def main(mod):
print ''
if (mod == '1'):
print 'Mode 1 activated'
dat_entry = dat()
... | <p>There's a problem with the logic. If you go straight to mode 2 this is what will cause this error because "dat_entry" would be undefined.</p>
<p>You've selected mode 2, at this point it doesn't know what dat_entry is:</p>
<pre><code>elif (mod == '2'):
print 'Mode 2 activated'
array = rndom(dat_entry)
</cod... |
reading request object in node.js from localhost <p>I'm new to node.js and I'm trying out a few easy examples using localhost:XXXX. </p>
<p>I want to read my request object from node. I have a book and in the book they use cURL(some program) to comunicate with node instead of the browser. Is it possible to write somet... | <p>You can use your regular browser by testing it. In your URL address enter URL address that you have in your cURL address. For instance:</p>
<pre><code>localhost:3000/index.html
</code></pre>
<p>If you would like to have more sophisticated tool that gives you more information about request/response you can use tool... |
Using Htaccess files on iis (windows 10) <p>Unfortunately I cannot find any information on how to perform URL Rewriting on IIS (windows 10). I develop websites on windows but have a linux server which uses a htaccess file for URL Rewriting.</p>
<p>The issue here is, I find it far too time consuming to manually enter r... | <p>All rules for the IIS URL Rewrite module are stored in text files, either your local web.config or the global ApplicationHost.config file. You can also use a custom config file like <code>rewrite.config</code> and include it in your web.config like:</p>
<pre><code><system.webServer>
<rewrite>
... |
python django run bash script in server <p>I would like to create a website-app to run a bash script located in a server. Basically I want this website for:</p>
<ul>
<li>Upload a file</li>
<li>select some parameters</li>
<li>Run a bash script taking the input file and the parameters</li>
<li>Download the results</li>
... | <p>This can be done in Python using the Django framework. </p>
<p>First create a form including a <code>FileField</code> and the fields for the other parameters:</p>
<pre><code>from django import forms
class UploadFileForm(forms.Form):
my_parameter = forms.CharField(max_length=50)
file = forms.FileField()
</... |
Wildcard use updating 7zip Sfx with similar titles <p>I have 4 different Sfx 7Zip files I need to download and update 1 file in either depending on circumstance.</p>
<p>The file names of the zips vary slightly depending on content and function but all have the word AUTO in the title. </p>
<p>I am updating each file w... | <pre><code>for /L %%q in (1,1,4) do "%~dp0Config\7za.exe" u "%~dp0Installer%%qAuto.exe" "%~dp0Config\config.cfg"
</code></pre>
<p>or</p>
<pre><code>for %%q in (1 2 3 4) do "%~dp0Config\7za.exe" u "%~dp0Installer%%qAuto.exe" "%~dp0Config\config.cfg"
</code></pre>
<p>The first starts setting <code>%%q</code> to 1 then... |
Nodjs Sqllite3 not flushing to disk <p>I'm having problem with sqlite3 not flush to disk. The code I'm using is below. My total filelist are over 470k and the program tends to use several gigabytes of memory. while the program is running test.db is 0 bytes and no journal is used. It only starts to write to disk when <... | <p>I'm think that there is a problem with <code>transaction</code> and <code>db.serialize</code>.<br/>
<code>db.serialize</code> is uncontrolled code. I don't know when it's useful. <br/>
Try control flow like below</p>
<pre><code>var fs = require('fs');
var sqlite3 = require('sqlite3');
var async = require('async');... |
mustache and Internalviewresolvers - Spring MVC <p>I'm trying out mustache templates with spring mvc project. I've some code that is using JSPs and I would like to add mustache templating for some pages only. To do that, I added a new mustacheViewResolver and my existing InternalResourceViewResolver as below.</p>
<pre... | <p>The <code>ScriptTemplateView</code> is not properly checking if the template file is available, which it should according to its Javadoc. This is a bug - check <a href="https://jira.spring.io/browse/SPR-14729" rel="nofollow">SPR-14729</a>.</p>
<p>Please upgrade to the relevant Spring version.</p>
<p>Note that you ... |
Firebase storage rules, `request.resource.md5hash` is null <p>I'm trying to build a web app using FireBase backend and I have a storage rule as the following:</p>
<pre><code>service firebase.storage {
match /b/stuff.appspot.com/o {
match /images/{fname}
{
allow read: if true;
allow write: if requ... | <p>Two things:</p>
<ol>
<li>The property is actually <code>md5Hash</code> (our reference docs are wrong, I just fixed them)</li>
<li>The <code>md5Hash</code> is currently not being passed through to rules (yep, it's a bug, and we're fixing it now, though it takes some time to roll out to production)</li>
</ol>
<p>We'... |
Calculating maximum using existence in pipe separated column values in MySQL <p>COnsider below table</p>
<p>Emp Table
Employee can belong to more than one department in below form</p>
<pre><code>emp departments
E1 D1|D2|D3
E2 D2
E3 D1|D3
</code></pre>
<p>Departments Table</p>
<pre><code>departments Manage... | <p>First of all, if you can, you should change the structure of your data.<br>
The employees table should contain one emp-department relation on each row, employee with more than one should have several rows.</p>
<p>If you stick to the current structure, you can use <code>join</code> to get a table with the mappings b... |
C++ list iterator not accessing content of list <p><strong><em>Visualization</em></strong>:<br>
<strong>NTlist</strong>: [ NTstring, RHSlist ]<-->[ NTstring, RHSlist ]<-->[ NTstring, RHSlist ]...</p>
<p><strong>Ntlocation</strong> "points" to, say ,middle link <strong>^</strong> (above) because NTstring here mat... | <p>At the very least:</p>
<pre><code>list<NTnode>::iterator searchNTList(string NTstring, list<NTnode> NTlist){
</code></pre>
<p>This returns an iterator to the local copy of <code>NTlist</code>. You probably want to pass <code>NTlist</code> by const reference.</p>
|
rotating image on timer without blending the image <p>i'm trying to make an animation of a wheel spinning using timer in c# (wheel image on pictureBox).</p>
<p>Method of rotating image:</p>
<pre><code>public static Image RotateImage(Image img, float rotationAngle)
{
//create an empty Bitmap image
... | <p>When an image is rotated 90 degrees or any angle that's an exact multiple of 90, all pixel are preserved and they just move to their new location. But when you rotate at any other angle, resampling or approximating takes place, and no single pixel moves to a new pixel location, because pixel locations are integers b... |
LibGdx default Application cases the following Error Message ? how to Resolve <p>-- Android Studio 2.1.3 with Latest SDK Running on WIndows 10.</p>
<pre><code>"C:\Program Files\Java\jdk1.8.0_102\bin\java"
Exception in thread "LWJGL Application" java.lang.NullPointerException
at com.badlogic.gdx.backends.lwjgl.Lwj... | <p>Try setting your desktop workiong directory path to your androis assets folder: <a href="https://github.com/libgdx/libgdx/wiki/Gradle-and-Intellij-IDEA" rel="nofollow">Instructions under "Running Your Project"</a></p>
|
How to know the speed of USB device connected? <p>Is there any information field or descriptor available to get the speed of a USB device (low speed or full speed or high speed)?</p>
| <p>You should try using <a href="http://libusb.info" rel="nofollow">libusb</a> and running the <a href="http://libusb.sourceforge.net/api-1.0/group__dev.html#ga58c4e448ecd5cd4782f2b896ec40b22b" rel="nofollow">libusb_get_device_speed</a> command.</p>
|
Remove \r\n\r\n from the results in a textbox <p>I have the following code:</p>
<pre><code>txtcmdApp.Text = RunScript(@"if (Get-Process greenshot -ErrorAction silentlycontinue âComputerName " + txtWSName.Text + " ) {'Open'} else {'Not Opened'}");
</code></pre>
<p>The results shown in the textbox is <strong>Not Ope... | <p>Maybe simply remove the newlines?</p>
<pre><code>txtcmdApp.Text = RunScript(@"if (Get-Process greenshot -ErrorAction silentlycontinue âComputerName " + txtWSName.Text + " ) {'Open'} else {'Not Opened'}")
.Replace(Environment.NewLine, "");
</code></pre>
<p>This will replace all new lines (that is <code>cr+lf</co... |
Swift convert [String?] to [String!] <p>I tested in <strong>Swift 3.0</strong>. I want to add <code>array1</code> to <code>array2</code>, example and errors as below:</p>
<pre><code>var array1: [String?] = ["good", "bad"]
var array2 = [String!]()
array2.append(array1)
//Cannot convert value of type '[String?]' to exp... | <p><strike>In Swift 3 you cannot define an array where the generic element is an implicitly unwrapped optional.</p>
<blockquote>
<p>Implicitly unwrapped optionals are only allowed at top level and as function results.</p>
<p><em>The compiler</em></p>
</blockquote>
<p>What you can do is creating a new array of ... |
Oracle Stored Procedure <p>My question is pretty basic but I am complete newbie to stored procedure and need to get around quickly. Any help will be appreciated,</p>
<p>Below is the current stored procedure we have,</p>
<pre><code>PROCEDURE get_something(
type IN VARCHAR2,
value IN VARCHAR2,
i_type OUT VARCHAR2,
i_i... | <p>I guess you need to use cursor as OUT parameter for your procedure and later use it for your requirement. </p>
<p>Also for "<em>I need to define the list of values in this procedure itself.</em>"
you can use a collection the way I have used in the procedure code (v_array).
You can then use a loop to traverse throu... |
Filerenaming loop not functioning <p>I'm having trouble understanding why my code doesn't work.
I want to rename each file in a particular folder in an order like this:
Foldername_1
Foldername_2
Foldername_3
etc...</p>
<p>The code I wrote should increase the 'num' variable by 1 every time it reloops the for loop.</p... | <p>You are setting <code>num</code> to 0 <em>for each iteration</em>. Move the <code>num = 0</code> <em>out</em> of the loop:</p>
<pre><code>num = 0
for filename in filenames:
num = num + 1
name = "Foldername_{}".format(num)
os.rename(filename, "{}".format(name))
</code></pre>
<p>You don't need to format ... |
php not sending email from contact form <p>I am trying to set up a simple email function in php. Looking through the other questions that address the same issue, it appears that I'm doing the same thing the answers are saying to do. However, when I try to send the email, it doesn't send.</p>
<p><strong>HTML</strong>... | <p>I'm guessing none of the fields are populating. You need to add the name property to each of the fields, that's what PHP is looking for in the <code>$_POST</code> array.</p>
<pre><code><input type="text" id="senderEmail" class="textField" placeholder="Your email" name="email" />
</code></pre>
|
Moving an Angular2 component to another location <p>I'm having the following, simple angular2 component</p>
<pre><code> @Component({
selector: 'dynamic-info-template',
template: '<div id=\"dynInfoTemplate\">dynamic info template<a href="javascript:void(0);" (click)="navigateTo()">Link</a><... | <p>You have to follow just 3 steps to make it work </p>
<ul>
<li>Import {DynamicInfoTemplateComponent} from'./path from the other component'. </li>
<li>in @Component use providers:[ DynamicInfoTemplateComponent ].</li>
<li>in the template in @Component just use </li>
</ul>
<p><code><dynamic-info-template></... |
Doing something after popen is finished <p>I want to make a background process that displays a <code>file</code> with an external <code>viewer</code>. When the process is stopped, it should delete the file.
The following piece of code does what I want to do, but it is ugly and I guess there is a more idiomatic way.
It ... | <p>Using <code>subprocess.call()</code> to open the viewer and view the file will exactly do that. Subsequently, run the command to delete the file.</p>
<p>If you want the script to continue while the process is running, use <code>threading</code></p>
<p>An example:</p>
<pre><code>from threading import Thread
import... |
How to Deploy BizTalk Application into production Server? <p>I have the following doubts in <code>BizTalk</code> deployment:</p>
<ol>
<li>How to deploy the BizTalk application to the production server?</li>
<li>When I am modify the existing BizTalk application like artifacts, custom pipeline/functions, custom classes,... | <p><strong>1. Deployment</strong></p>
<p>For deployment you can use the built-in MSI generation wizard.<br>
It means you deploy the application on a dev environment using Visual Studio, then on the admin console, export the application a MSI using the wizard.
Finally you can use that MSI to deploy the app to the Produ... |
PHP looping through an array, not displaying the first records <p>This is a question concerning a solutions provided by @Blaatpraat which solved that part of my issue.</p>
<p>I now have an array which contains:</p>
<pre><code>Array ( [NXLHR01011474021550] =>
Array ( [UniqueID] => NXLHR01011474021550 [Room] =&... | <p>Could this be what you were going for?</p>
<pre><code><?php
$array = [
'NXLHR01011474021550' => [
'UniqueID' => 'NXLHR01011474021550',
'Room' => '0101',
'AuditBy' => 'navexdemo2',
'AuditDate' => '2016-09-16 11:26:00',
... |
Floating div after certain % of website scrolling <p>I really don't know where to start to search. And to be honest I did not even know how to search for, because I don't know how it calls. (maybe headsup? but all I get is car tuning stuff)</p>
<p>What am I looking for its in the attached image.
When a user scrolls a... | <p>Or yo can use only css </p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>
#div1{
height:50px;
overflow:hidden;
}
#div1:hover{
height:300px;
-moz-transi... |
openURL: deprecated in iOS 10 <p>Apple with iOS 10 has deprecated openURL: for openURL:option:completionHandler
If I have:</p>
<pre><code> [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.google.com"]];
</code></pre>
<p>How it will become? options:<#(nonnull NSDictionary *)#> in detail... | <p>Write like this.</p>
<p><strong>Handle completionHandler</strong></p>
<pre><code>UIApplication *application = [UIApplication sharedApplication];
NSURL *URL = [NSURL URLWithString:@"http://www.google.com"];
[application openURL:URL options:@{} completionHandler:^(BOOL success) {
if (success) {
NSLog(@"... |
why $scope variable inside directive is not getting updated? <p>I have made a directive for highmaps using angular, map is getting rendered. I need to pass the final configured object back to controller. Hence i am assigning like this in directive,</p>
<pre><code> $timeout(function() {
scope.mapconfigured = map... | <p>That because you used <strong>mapconfigured</strong> in scope directive, and in the link directive you tried to define <strong>mapConfigured</strong> with data.</p>
<blockquote>
<p>Replace with this code:</p>
</blockquote>
<pre><code> $timeout(function() {
scope.mapconfigured = mapConfig;
});
</code></p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.