input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Unable to connect to sql server using java 8 <p>I'm trying to connect to my sql server 21014 using java 8. But i'm getting error. </p>
<pre><code>import java.sql.*;
import java.io.*;
import java.net.*;
import java.util.Scanner;
public class DBConnec
{
public static void main(String a[])
{
try
... | <p>Try this:</p>
<pre><code>String url = "jdbc:jtds:sqlserver://localhost:1433/dictionary";
</code></pre>
<p>You missed the colon after <code>sqlserver</code>. </p>
<p>You should not be adding JDBC driver JARs to the jre/lib/ext directory. Learn how to use CLASSPATH properly.</p>
|
angular material design page layout container not showing properly <p>I have created simple page in AMD on my local machine.i have used <code><div layout="row"></code> to divide a page into 2 column ,parts just like bootstrap col-md-6 and i refered this link:<br>
[<a href="https://material.angularjs.org/1.0.5/lay... | <p>Your Div must have to inside your <code>layout="row"</code> div, since this will defined your Row and inside row will divided into equally width by use of <code>flex</code> </p>
<p>See <a href="https://material.angularjs.org/1.0.5/layout/container" rel="nofollow">material design doc</a></p>
<pre><code><div layo... |
Render Link in material ui Drawer <p>I want to add my react-router links to <code>Drawer</code>. I tried this:</p>
<pre><code><Drawer width={200} open={this.state.drawerOpen} docked={false} onRequestChange={this.toggleDrawer}>
<Link to="/businesspartners">
<MenuItem onTouchTap={this.toggleDrawe... | <p>Use inline style <code>textDecoration: 'none'</code> for the link.
<code><Link></code> gets rendered as a standard <code><a></code> tag, which is why we can apply textDecoration rule there.</p>
<pre><code><Drawer width={200} open={this.state.drawerOpen} docked={false} onRequestChange={this.toggleDr... |
How to read and then write back a wide string? <p>I'm trying to read wide string from a terminal and then input it back. I was expecting something like</p>
<pre><code>wchar_t input[32];
getn_wstr(input, sizeof(input) -1);
mvaddwstr(1, 0, input);
</code></pre>
<p>to work. Except it doesn't even compile. Turned out tha... | <p>According to the ncurses <a href="http://invisible-island.net/ncurses/man/curs_get_wstr.3x.html" rel="nofollow">manual page</a>:</p>
<blockquote>
<p>These functions are described in <em>The Single Unix Specification, Version 2</em>. No error conditions are defined. This
implementation returns <strong><code>... |
Wildfly 9 exception "Too many open files" <p>I already configure the ulimit and /proc/sys/fs/file-max as 1000000 on our server.
When I find "Too many open files" exception in server.log, I use "lsof | wc", then the result is larger than 1000000, so it is not a configuration issue. The result of "lsof | wc" is from 3... | <p>Try Wildfly 10.1. If you are using SSL there have been some bug fixes that may be relevant.</p>
|
Extreme server load <p>I am using a vps server and I run a joomla 3.6.0 site with k2 cck. For searching my k2 items I use the Ja k2 filter component. I tried to communicate with the programmers of the component but with no luck.</p>
<p>When I have the default settings of the search results page (ascending) everything ... | <p>Plan A: Don't call it "fulltext"</p>
<p>Plan B: Put backtics around it: `fulltext`</p>
<p>Plan C: Don't use a 3rd party software package that fails to help you with issues like this.</p>
<p>We can't judge the indexes without seeing the <code>SELECT</code>.</p>
|
Is it possible to allow people to upload videos on my Youtube channel to my website authentication in asp.net <p>Is it possible to allow people to upload videos on my Youtube channel to my website authentication in asp.net ?
or</p>
<p>upload video in one youtube channel. different dieferent authentication but channel... | <p>The code sample below calls the API's videos.insert method to upload a video to the channel associated with the request. for more details go through this <a href="https://developers.google.com/youtube/v3/code_samples/dotnet#upload_a_video" rel="nofollow">click here</a></p>
<pre><code>using System;
using System.IO;
... |
finding location from requestLocationUpdates() from GPS not working <p>I am creating a map application, which gets location from GPS, i'm finding location from requestLocationUpdates(), but i'm not getting any response from GPS provider, however when i'am using network provider i'am getting location, can anyone help wh... | <p>Your code is correct. GPS usually doesn't give you any info within the building, if you try to test the app outside, you will get the results. </p>
|
In Android how to get current Activity context when extend FirebaseMessagingService calling on onMessageReceived? <p>My Code for integrate FCM..
I want to get current activity context when push arrives.
Purpose for casting listener with context.</p>
<p>Snippet code here...</p>
<pre><code>public class MyFirebaseMessag... | <p>If I understood correctly, basically you want to cast context of activity to interface that activity implements. The issue is: you can not get current activity context, because maybe/probably there is no current activity at all. There is some context available but this context can't be used for what you want. Let me... |
How to securely store a password to a mailserver in a web application <p>and no, I don't mean to store my users passwords encrypted, I use password_hash() for that.
The thing is I want to send users E-Mails with PHPMailer and the E-Mail-credentials should be configurable through the web application and thus, stored on ... | <p>Usually this kind of passwords is stored in a file. It's opinionated, so take your own conclusions out of it, but you should have a file with read permissions for your web application in a non web reachable (pretty obvious, but prefer to state it) dir. Usually this file should be encrypted when out of the server (if... |
JBoss EAP 6.2 CDI beans.xml <p>I've got a simple question about getting cdi running in JBoss EAP 6.2
Pojos that are injected with @inject (from javax.annotation) are always null.</p>
<p>The only thing I can find is that I need to add a beans.xml. I added that in de META-INF folder of my jar (inside an ear).
Still I do... | <p>I was missing to following in standalone.xml</p>
<pre><code><extensions>
<extension module="org.jboss.as.weld"/>
</extensions>
<subsystem xmlns="urn:jboss:domain:weld:1.0"/>
</code></pre>
|
How to suspend Rebus execution while another process is locking tables <p>I need to implement two API to suspend and to reactivate Rebus dequeuing process.</p>
<p>The situation is that the service bus Rebus and another software share the same database and tables to store application data (not the queue), but the latte... | <p>I would consider the following two options before doing anything else:</p>
<p>1) Simply stop the process that hosts your Rebus endpoint during the time when the database is locked.</p>
<p>If your endpoint is hosted as a Windows Service (which in many cases it probably should), you can simply make a script <code>ne... |
Redshift large data load, executing Python function <p>I have a large data load into Redshift table called <em>responses</em>, that consists around 450M rows. On each of the rows I perform a Python UDF that parses the user agent.</p>
<p>I set a distribution based on a column <em>question_id</em>, that has around 1.5M ... | <p>Ahhhh, I found the problem, table from which I was reading data and applying parsing was wrongly distributed, keeping all the data in a a single slice, so that is why parsing was slow, and only one node was working.</p>
|
PHP, Efficient Way to Remove Html Formatting From a Tumblr API return <p>So I'm fairly new to php. Only ever worked with js. But I'm currently experimenting with creating the post blurb to be shared on facebook/twitter, myself. More of an Exercise then anything else as the tumblr api returns an excerpt anyway.
To put ... | <p>Have you tried PHP's <code>strip_tags</code> function?</p>
<p><a href="http://php.net/manual/en/function.strip-tags.php" rel="nofollow">http://php.net/manual/en/function.strip-tags.php</a></p>
<p>Example below is from the link above:</p>
<pre><code><?php
$text = '<p>Test paragraph.</p><!-- Comme... |
how to keep an image over an image in xaml uwp <p>I want to place an image in a circular shape and that shape should be over a grid and image.
below is xaml code which will show where i want to place that circular shape with an image on it.I have place that circular shape using canvas on grid 2 but it shold be over im... | <blockquote>
<p>I have place that circular shape using canvas on grid 2 but it shold be over
image "sign_in_footer.png"</p>
</blockquote>
<p><a href="https://msdn.microsoft.com/library/windows/apps/hh759773" rel="nofollow">Canvas.ZIndex</a> declares the draw order for the child elements of a Canvas. A higher z-or... |
How to use team foundation server in visual studio 2015 <p>I am completely new to team foundation server and trying to understand how it works. Here are some questions which I've been struggling with for a while:</p>
<p>1- Once a team project has been created, how can solutions be attached to it?</p>
<p>2- Is any tea... | <p>I'll try to answer each of you questions</p>
<ol>
<li>You can add a solution to your Team Project either my right-clicking the solution node in the Solution Explorer and selecting <em>Add Solution to Source Control...</em> or through the Source Control Explorer by placing the solution in your workspace and clicking... |
Objective c How to prevent SLComposeViewController to not to share post via Facebook app in iPhone <p>I am using SLComposeViewController to share a post on facebook including image and Url.</p>
<p>Earlier it works fine when we provide account details in the iPhone settings/facebook.</p>
<p>But now it is sharing post ... | <p>Latest update on FB is not supporting pre-populated text. Its only support #tag text & image or url.</p>
<p>Please read this FB doc:- <a href="https://developers.facebook.com/docs/sharing/ios" rel="nofollow">https://developers.facebook.com/docs/sharing/ios</a></p>
|
Unique permutations of fixed length integer partitions where each element has a maximum <p>This question is similar to a question I had several months ago: <a href="http://stackoverflow.com/questions/36435754/generating-a-numpy-array-with-all-combinations-of-numbers-that-sum-to-less-than/36563744#36563744">Generating a... | <p>I've had to think about this pretty long, but I've managed to modify the solution to <a href="http://stackoverflow.com/questions/36435754/generating-a-numpy-array-with-all-combinations-of-numbers-that-sum-to-less-than/36563744#36563744">Generating a numpy array with all combinations of numbers that sum to less than ... |
ListView Control add multiple records <p>Is this is possible to make list view empty with textbox and dropdownlist also with eight header and 10 rows with textbox and dropdownlist and when click on button all row one by one data save in database using ajax...
<a href="http://i.stack.imgur.com/PM8Ou.png" rel="nofollow">... | <p>If you want to create a ListView with 10 rows. Create a dummy list and DataBind it to the ListView.</p>
<pre><code> List<int> myList = new List<int>();
for (int i = 0; i < 10; i++)
{
myList.Add(i);
}
ListView1.DataSource = myList;
ListView1.D... |
gitlab ci scripts during which $? is allowed to be non-zero <p>In our project we have a shell script which is to be sourced to set up environment variables for the subsequent build process or to run the built applications.</p>
<p>It contains a block which checks the already set variables and does some adjustment.</p>
... | <p>Use <code>command_that_might_fail || true</code> to mask the exit status of said command.</p>
<p>Also note that you can use <code>grep -q</code> to prevent output:</p>
<pre><code>echo "$LD_LIBRARY_PATH" | grep -q "$LIBRARY" || true
</code></pre>
<p>This will however also mask <code>$?</code> which you might not w... |
simple SNTP python script <p>I need help to complete following script:</p>
<pre class="lang-py prettyprint-override"><code>import socket
import struct
import sys
import time
NTP_SERVER = '0.uk.pool.ntp.org'
TIME1970 = 2208988800L
def sntp_client():
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
da... | <p>There is nothing wrong with your script as written, you need to look for another reason why the server might not be responding to you, such as firewall settings.
My own python SNTP script is almost exactly the same:</p>
<pre><code>#!/bin/env python
import socket
import struct
import sys
import time
TIME1970 = 220... |
How to get easy rules .jar file? <p>I've developed a java web application and now I want to integrate a rule engine as part of this application.</p>
<p>I checked Easy Rules and as mentioned in their website it's just a jar file that I need to add to the project but then in order to get the jar file i need to install m... | <p>You are most probably <a href="https://github.com/EasyRules/easyrules" rel="nofollow">refering</a> to the <a href="http://search.maven.org/#artifactdetails%7Corg.easyrules%7Ceasyrules-core%7C2.3.0%7C" rel="nofollow">following</a> Maven dependency:</p>
<pre><code><dependency>
<groupId>org.easyrules&l... |
Barcode not display in Print Preview - javascript print method <p>I want to generate a order receipt with barcode but barcode is not showing in print preview its showing on html page.
Its working fine on my local server. But on live server its not working.</p>
<p>For printing purpose I have use Javascript method. For... | <p>I have tried the many solution but its not possible with normal javascript. The <strong>JQPrint</strong> plugins is working for me in this issue.</p>
<p>For that have to include only <strong><a href="https://github.com/tanathos/jquery.jqprint" rel="nofollow">jquery.jqprint-0.3.js</a></strong> javascript file &... |
how to print json data <p>I have following json file and python code and i need output example...</p>
<p><strong>json file</strong></p>
<pre><code>{"b": [{"1": "add"},{"2": "act"}],
"p": [{"add": "added"},{"act": "acted"}],
"pp": [{"add": "added"},{"act": "acted"}],
"s": [{"add": "adds"},{"act": "acts"}],
"ing": [{"a... | <p>This doesn't have anything to do with JSON. You have a dictionary, and you want to print the keys, which you can do with <code>data.keys()</code>.</p>
|
Jekins schedule slave node availability <p>We have a number of machines that we would like to use as slave nodes for Jenkins, but only in certain time intervals (i.e. not during working hours). Is it possible to configure a slave node to be used as a slave for builds in particular time range? For example: a M-F fr... | <p>In the <strong>slave configuration panel</strong>, select <strong><code>Take this slave on-line according to a schedule</code></strong>.</p>
<p>You can then specify the startup time and the desired uptime for the slave.</p>
<p>You must be <strong>careful with long-running jobs</strong> though -- if a three hour jo... |
Resize Main Window <p>I have used the setGeometry method in order to give a size to all my widgets. I know it wasn't the best thing to do but this is the first time I use PyQt.
The problem now is that when I click on the Maximize button, all my widgets stay the same...
I have tried to use the resizeEvent, but PyQt does... | <p>You're going about this in completely the wrong way. Qt already handles all this kind of stuff for you automatically (so long as you use the right APIs).</p>
<p>I suggest you do the following:</p>
<ol>
<li>Read Qt's <a href="http://doc.qt.io/qt-4.8/layout.html" rel="nofollow">Layout Management Overview</a>.</li>
<... |
Run javascript everytime page is loading <p>In my web application I have a modal popup containing a loading bar. I make this appear on any command that I know will take a few seconds to execute, button click etc.</p>
<p>This is currently working fine except for one complication, the in house web server it is running o... | <p>Set in your javascript a <code>BeginRequestHandler</code> and a <code>EndRequestHandler</code> like this:</p>
<pre><code>$(document).ready(function () {
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndReques... |
how to send json format to server <p>I wan the data to be in this format </p>
<pre><code>{"email":"s@gmail.com","password":"1"}
</code></pre>
<p>but getting in this format </p>
<pre><code>{ '{"email":"s@gmail.com","password":"1"}': '' }
</code></pre>
<p>my client code,</p>
<pre><code>headers.append('Content-Type',... | <p>try this</p>
<pre><code> $.ajax({
url: this.header1+'login',
data: {"email":"s@gmail.com","password":"1"},
type: 'POST',
success: function(response) {
alert(response);
}
});
</code></pre>
|
lessphp load error with file LESS <p>I'm new with the lessphp library, I'm using Joomla and I'm working with a template, I'd like to compile a less file with a php file, this is way I'm using phpless, to compile my LESS file I'm using this code:</p>
<pre><code>require "lessc.inc.php";
$less = new lessc;
echo $less->... | <p>Ok, I got the problem, I wrong the joomla string, I changed in this way and now it's working:</p>
<pre><code>echo $less->compileFile(JPATH_SITE.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.$this->template.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.less');
</code></pre>
<p>Thank you all!<... |
MLOAD ERROR CODE 4 IN TERADATA <p>I am getting this error in production environment. I want to know the exact cause of this error. Can you please help me when we get this error in teradata mload utilities.</p>
<p>This is what i got when i searched for this error message. </p>
<p><strong>4:- When there is any warning ... | <p>It is exactly what you said, just a warning. It could be rejected rows going into the ET or UV tables. It could be headers and trailers with a different number of delimiters or record length. Only way to be sure is to check the logs.</p>
<p>If you have no stop turned on and the number of rows rejected is within tol... |
Is there an alternative way to convert coordinates for rects? <p>I fell into a trap, and it's too late to refactor everything. For reasons that are too long to explain here (but they are valid and the codebase works fine), I had to abstract away <code>UIImageViews</code> as a return type in one of the methods, and inst... | <p>Try to extend the protocol in this way:</p>
<pre><code>extension Viewable where Self: UIView {
func frame(inCoordinatesOfView parentView: UIView) -> CGRect {
let frameInWindow = UIApplication.applicationWindow.convertRect(self.bounds, fromView: self)
return parentView.convertRec... |
set action (gesture recognizer) on text which is inside of textView <p>okay so assume the below text as it is inside an textView</p>
<pre><code>bla bla bla bla bla bla
bla bla bla bla bla bla
bla bla bla bla bla bla
bla bla *doAction*
</code></pre>
<p>i have some text which i'm showing in my textView and i want ... | <p>1) Using <code>attributedString</code>, you can achieve the desired behaviour. Below is example:-</p>
<pre><code> @IBOutlet weak var terms: UITextView!
let privacyURL = "http://www.programmincrew.in";
override func viewDidLoad() {
super.viewDidLoad()
self.terms.delegate = self
let str = "By using ... |
Add CSRF-TOKEN into angularJs 2 <p>I am making a website using Django and AngularJs2.</p>
<p>When I created the login form then submit form, Django shows an error:</p>
<blockquote>
<p>forbidden (CSRF token missing or incorrect.)</p>
</blockquote>
<p>I know Django wants me to add a CSRF token, but I don't know how.... | <pre><code>from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def your_view(request):
pass
</code></pre>
<p>or if you want to have csrf, send it with your angular</p>
<pre><code>$httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';
$httpProvider.defaults.xsrfCookieName = 'csrftoken';
</code></pre... |
How to add multiple textviews inside linear layout in .XML file? <p>My <code>TextView</code> is not displaying in the Screen.</p>
<pre><code>This app shows information from your SIM card and gets your MAC address. If you have 2 SIM cards inserted, information from SIM card in slot 1 will be retrieved.
Mobile Country C... | <p>Change your all <code>TextView</code>height <code>match_parent</code> to <code>wrap_content</code>
it will solve your Problem.</p>
<p>So Change this</p>
<pre><code><TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/intro" />
<TextView
... |
AndroidRuntime: FATAL EXCEPTION: main : application has stopped error <p>I get the error Fatal Exception main whenever I run application .
the app uses opencv 2.4.10 it has worked on one device and it fails on my device I couldn't figure out why this is happening.</p>
<p>I don't know which part is code is causing this... | <p>Apparently there is a task running which is using the <code>context</code> here with <code>OpenCBLoader</code></p>
<pre><code>(!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mLoaderCallback))
</code></pre>
<p>The problem related with <code>context</code> i.e the context is not valid anymore
.Tr... |
C++ if statement order <p>A portion of a program needs to check if two c-strings are identical while searching though an ordered list (e.g.<code>{"AAA", "AAB", "ABA", "CLL", "CLZ"}</code>). It is feasible that the list could get quite large, so small improvements in speed are worth degradation of readability. Assume th... | <p><code>std::binary_search</code> may help:</p>
<pre><code>bool cstring_less(const char (&lhs)[4], const char (&rhs)[4])
{
return std::lexicographical_compare(std::begin(lhs), std::end(lhs),
std::begin(rhs), std::end(rhs));
}
int main(int, char**)
{
const char ... |
Filtering by ID and count with Rails AR <p>I have a many to many relation between users and teams, which is reflected in my rails models as <code>has_many through</code> (instead of HABTM) in both models. </p>
<p>I want to find all teams that contain the user with ID <code>42</code> and no other users. This would be q... | <p>Unless you want to write complicated raw SQL, it'll be best to split this into two queries:</p>
<pre><code># assuming Team.table_name == 'teams'
user = User.find(42)
required_teams = user.teams.joins(:users).group('teams.id').having('COUNT(*) = 1')
</code></pre>
|
How to Disable the components of a panel when a button is clicked <p>I have some problem with my code!.... I was able to create an array of 12 JButtons in a circular form in a JPanel with the code below!... I am setting an actionListener on each JButton, and I want to disable others once one of the Jbuttons is clicked.... | <p>try this solution:</p>
<pre><code> quest.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JButton b = (JButton)e.getSource();
for(Component c : yourPanel.getComponents())... |
How to mount windows folder using docker compose volumes? <p>How to mount windows folder using docker compose volumes?</p>
<p>I am trying to set up docker container using <code>docker-compose</code>.
My <code>docker-compose.yml</code> file looks as follow:</p>
<pre><code>php-fpm:
build: php-fpm
container_name: ph... | <p>I fixed it by going to: Local Security Policy > Network List Manager Policies and Double-clicked unidentified Networks then change the location type to private and restarted Docker. <a href="https://forums.docker.com/t/volume-mounts-in-windows-does-not-work/10693/92" rel="nofollow">Source</a> </p>
|
Release Ruby Sequel connection <p>I am facing some pooling problems using the ruby sequel gem and postgres.
I believe that my Sidekiq Jobs aren't releasing the connections they use from the pool.</p>
<p>I connect to the db when starting sidekiq using</p>
<pre><code>DB = Sequel.connect(db_uri, max_connections: 20)
</c... | <p>First, you need to understand that your worker is not necessarily using a single connection, but could be using many different connections, unless you are specifically doing something to limit it to a single connection (via Database#synchronize or Database#transaction).</p>
<p>You should not need to disconnect spec... |
Integration testing of JMS <p>I have a suite of integration tests, which creates a full Spring context for my application, mocks out the end points towards other application and runs tests, for instance calling a REST-service and then check the result in the database, that other web/REST-services has been called, and s... | <p>Figured it out:</p>
<p>Something like this:</p>
<pre><code>Boolean messageWaiting = true;
while (messageWaiting) {
messageWaiting =
jmsTemplate.browse(myQueue,
(session, browser) -> browser.getEnumeration().hasMoreElements());
}
</code></pre>
<p>With this instead of thre... |
Ajax success function shows "1" on the top left corner of blank page instead of refreshing the div <p>I am developing a yii2 application. I select data from the Bootstrap modal popup and submit to a controller action where I have an insert query. After I submit the data from modal popupthe data is submitted it shows a ... | <p>Your <code>on</code> event for form i.e. <code>beforeSubmit</code> is invalid. Try replacing it with <code>submit</code>. </p>
<p>Because of this your <code>form</code> is submitting.</p>
<p>Replace <code>$( "#select_group" ).on('beforeSubmit', function(e) {</code></p>
<p>To <code>$( "#select_group" ).on('submit'... |
Suppressing exceptions when using Cloudrail to logout of Box <p>In my app I use "service.logout" in Cloudrail to log out of Box. If it is already logged out an exception is thrown. I can ignore this exception in my app but is it possible to suppress it completely? Note that no exception is thrown in the equivalent circ... | <p>This is actually unintended behavior, there shouldn't be an error. We fixed that together with our new version of the SDK (v2.7.0). Let me know if this solved the issue. With the new version we also released our first version of the new developer portal which allows you to get statistics about your app(s) and stay i... |
how to make a dynamic query using cakephp 3? <p>I have a filter to search the database from it. But if any of the filter fields are empty it is to ignore. </p>
<pre><code>$name = $this->request->data['name'];
$status = $this->request->data['status'];
$code_transaction = $this->request->data['code_tra... | <p>You can do something like this:</p>
<pre><code>$query = ['name'=> $name, 'status'=> $status, 'id'=> $code_transaction];
$newdataquery =[];
foreach($query as $key => $data) {
if (strlen($data) > 0 )
$newdataquery[$key] = $data;
}
$orders = $this->Orders->find('all')->where($newdataquery... |
How to set Grid in Vaadin <p>Hi I am working on a vaadin application integrating the vaadin app in the application UI . The image is : <a href="http://i.stack.imgur.com/8HrFj.png" rel="nofollow"><img src="http://i.stack.imgur.com/8HrFj.png" alt="enter image description here"></a></p>
<blockquote>
<p>the Scroll bar i... | <p>I have had this error too.</p>
<p>A developer who compiled the theme when project started had</p>
<p><code>$v-included-components: remove($v-included-components, grid);</code>
in the theme scss file.</p>
<p>Please comment this line out or remove the line completely and try again</p>
|
Unable to find an element in div class <p>I am trying to click an element..it is span located in div. I could get the locator. but when I used it in the code, it says element is not clickable. </p>
<pre><code>WebElement BookEditor=driver.findElement(By.xpath("//*[@id='appNavPanel']/div/span[2]"));
WebElement BookEdito... | <p>Try to move to the element to make it visible before clicking on it</p>
<pre><code>Actions action = new Actions(webdriver);
WebElement bookEditor = driver.findElement(By.cssSelector("[data-original-title='Book Editor']"));
action.moveToElement(bookEditor).perform();
driver.findElement(By.cssSelector("div.tooltip.fa... |
Angular 2 RC6: 'pattern-list' is not a known element <p>Simply running the application I get no error and it works just fine, but when I run my tests I get the following error:</p>
<pre><code>'pattern-list' is not a known element:
1. If 'pattern-list' is an Angular component, then verify that it is part of this modu... | <p>I think you need</p>
<pre><code>TestBed.configureTestingModule({imports: [AppModule]});
</code></pre>
|
Adding subscribers to static segment using MailChimp API v3.0 <p>I am having troubles using the PATCH operation on static segments.</p>
<pre><code>PATCH /lists/{list_id}/segments/{segment_id}
</code></pre>
<p>According to the <a href="http://developer.mailchimp.com/documentation/mailchimp/reference/lists/segments/#" ... | <p>I'm having exactly the same problem. I suspect that the actual update is done through an underlying, and rather slow, batch operation, because if you wait long enough, the member_count returned by a GET will eventually reflect the count of email addresses in the array. </p>
<p>Update: I was informed by MailChimp su... |
ext. news extended with two fields: now strange cache behaviour <p>typo3 7.6.10
news 4.3.0</p>
<p>I have a strange cache behaviour:</p>
<p>I made an extension which extends the news model with a select field "teasercolor" and a checkbox "showimage".</p>
<p><a href="http://pastebin.com/ViPEemr9" rel="nofollow">http:/... | <p>in TYPO 7.6 you should use the Override TCA files, not ext_tables.php.</p>
<p><a href="https://docs.typo3.org/typo3cms/extensions/mktools/Utilities/TcaOverrides/Index.html" rel="nofollow">https://docs.typo3.org/typo3cms/extensions/mktools/Utilities/TcaOverrides/Index.html</a></p>
|
How to install Mule ESB community runtime 3.7.0 to anypointstudio 6.1.0 <p>I have just downloaded new version of anypointstudio i.e. 6.1.0 and it came with default 3.8.1 community runtime and for my project I need to add 3.7.0 . But I can not find it in market place and when I downloaded mule ESB 3.7.0 runtime standalo... | <p>Go to Help-> Install New software -> click Add -> Use this url <a href="http://studio.mulesoft.org/r4/updates" rel="nofollow">http://studio.mulesoft.org/r4/updates</a>. It have lower versions,
Since you downloaded directly 3.8 you can see
<a href="http://studio.mulesoft.org/r5/updates" rel="nofollow">http://studio.m... |
Why is git merge saying two branches are up-to-date? <p>We have an MVC5 web application and I am confused why git is telling me 2 branches are up-to-date.</p>
<p>The two branches are <code>master</code> and <code>feature1</code>. When I am on <code>feature1</code> and do <code>git merge master</code> I get</p>
<block... | <p>Doing a merge doesn't mean that the branches will become same. It's just that the new changes of the different branch will be merged onto the existing branch.</p>
<p>If you have a line commented out in the feature1 branch and that was of course done after it was taken out from the master, then merging from master w... |
Data structure for fast searching of custom object using its attributes (fields) in Java <p>I have abstract super class and some sub classes. My question is how is the best way to keep objects of those classes so I can easily find them using all the different parameters.</p>
<p>For example if I want to look up with re... | <p>You can use <code>Sorted</code> or <code>Ordered</code> data structures to optimize search complexity.
You can introduce your own search index for custom data.</p>
<p>But it is better to use database or search engine.
Have a look at <a href="https://www.elastic.co/products/elasticsearch" rel="nofollow">Elasticsearc... |
Trouble in call command <p>I'm usually stuck on making a game now...I can't solve the the call command problem This is an example :::</p>
<pre><code>:verifile1
cls
echo.
echo Before you can continue give out the following information...
echo.
echo What is your username?
echo.
set /p name1=U... | <p>if you are calling a label then call it thus</p>
<pre><code>Call :Label arg
</code></pre>
|
run flask application using google compute engine <p>I'm new to flask and google compute engine.</p>
<p>when i'm running my flask application on google compute engine , using curl I can see my flask methods are running.</p>
<p>I want to see the web page which flask is using, the problem is when I'm running my flask t... | <p>finally I'm able to get the solution of the question I have asked.</p>
<p>Follow the Link : <a href="http://www.datasciencebytes.com/bytes/2015/02/24/running-a-flask-app-on-aws-ec2/" rel="nofollow">http://www.datasciencebytes.com/bytes/2015/02/24/running-a-flask-app-on-aws-ec2/</a></p>
<p>Somehow my question is al... |
Google Plus sign in 'Choose an Account' dialog appears with No profile picture <p>I integrated google plus sign in to android but when i clicked on 'Sign In' button the 'Choose an Account' dialog appears with No profile picture and all the other functionalitites are working fine.I am using below dependencies
c... | <p>I implemented it in my code, it working fine may be its help you. i used com.google.android.gms:play-services-auth:9.4.0.</p>
<pre><code> gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(Constants.GOOGLE_SERVER_CLIENT_ID)
.requestServerAuthCode(Co... |
Can't find variable: FileTransfer on IOS <p>I'm using the cordova's <code>FileTransfer</code> plugin with the <code>ionic-native</code> wrapper. The app runs successfully in iPhone simulator but when I run the app in my mobile device I get the error in the console as:</p>
<p><code>ORIGINAL EXCEPTION: ReferenceError: C... | <p>Uninstalling all the plugins and just running <code>ionic run ios</code> command fixed this issue. Since the <code>ionic state reset</code> also does the same thing, this might be a problem with the CLI.</p>
|
How to remove unwanted HTML tags from user input but keep text inside the tags in PHP using DOMDocument <p>I have around ~2 Million stored HTML pages in S3 that contain various HTML. I'm trying to extract only the content from those stored pages, but I wish to retain the HTML structure with certain constraints. This HT... | <p>You can use strip_tags() like this:</p>
<pre><code>$html = '<div id="content">
Some text...
<p class="someclass">Hello <span style="color: purple;">PHP</span>!</p>
</div>';
$updatedHTML = strip_tags($text,"<p><h1><h2><h3><ul><ol><li>"... |
Scrape links using HtmlAgilityPack <p>I need to scrape every Profile href link from:</p>
<pre><code><div class="avatar" style="height:85px; float: left; margin: 7px 0 7px 14px;">
<span style="font-size: 8px">04.09.16 10:22:42</span>
<br>
<a href="/Profile/user_3383.h... | <p>You can select the <code><a></code> elements first, and then add <code>href</code> attribute from each <code><a></code> to the <code>ListBox</code> :</p>
<pre><code>Dim getLink = HtmlUsers.DocumentNode.SelectNodes("//div[@class='avatar']/a[@href]")
For Each profileLink As HtmlAgilityPack.HtmlNode In ge... |
PayPal IPN : Completed 500 Internal Server JSON::GeneratorError (source sequence is illegal/malformed utf-8): <p>I was receiving the following error when I tried to save the parameters from PayPal IPN notification:</p>
<pre><code>Completed 500 Internal Server JSON::GeneratorError (source sequence is illegal/malformed ... | <p>I found a similar questions at:<br>
<a href="http://stackoverflow.com/questions/32058125/delivery-status-failed-notify-url-ipn-in-ruby-on-rails">Delivery status Failed notify_url IPN in ruby on rails</a><br>
<a href="https://www.reddit.com/r/rails/comments/4nw7xn/help_force_utf8_encoding_on/" rel="nofollow">https://... |
The height of the link is greater than the parent <p>I have little problem. I redesign my portfolio and I have section with my all works. Grid is simple, all projects look like box with the same height and width but I have inside <strong>href</strong> tag and he has more height than parent.</p>
<pre><code><div clas... | <p>Change the height of <code>.grid .portfolio-item .item-block</code> to:</p>
<pre><code>height: 300px;
</code></pre>
<p><a href="https://jsfiddle.net/4pf20zLd/2/" rel="nofollow">https://jsfiddle.net/4pf20zLd/2/</a></p>
|
Error with PHP validation <p>I am creating a basic auction site and got quite far with help from this community. I am near finishing this now but having a slight issue with server side validation.</p>
<p>Auctions are listed on a PHP page with html and PHP, PHP runs a MySQL query and then lists the results. Example her... | <p>The way that you're handling AJAX error is not very good because it only alerts you that you have an error, but you don't know what goes wrong.</p>
<p>In the AJAX object, replace the current error callback with one that logs the actual error to the console:</p>
<p>replace</p>
<pre><code>error: function() {
... |
Java: synchronize keyword doesn't block object on different thread <pre><code>public class SynchronizeTest {
public synchronized void methodA() {
System.out.println("calling method a ...");
sleep(2000);
System.out.println("ending method a");
}
public void methodC() {
System... | <p>When you use the <code>synchronized</code> keyword on an instance method, it means that method on that object can be only invoked by one thread at the time.</p>
<p>That doesn't imply any form of locking on all the object's methods, i.e. other instance methods can be invoked during that method's invocation - easier ... |
Automatic properties documentation for Java application <p>Are there "Javadoc-like" instruments for configuration properties in Java application?</p>
<p>I'm currently working on Java application, which uses usual Java properties files for configuration. This is an "enterprise app", so we have dozens of properties and ... | <p>You can use <strong>PropDoc</strong> for properties file Document generation. PropDoc is a utility that aims to improve the documentability of Java Properties files. </p>
<p>It can read in a standard Java Properties file and parse JavaDoc-like annotations out of the comments of properties. Result is a meta-model th... |
How can I convert for loop implementation into vectorized calculation in Octave? <p>I am trying to develop develop code to find cost fuction in logistic regression. I want to replce below forloop implementation with vectored iplementation. </p>
<pre><code> for i = 1:m_theta
sum_gr = sum(error.*X(:,i));
... | <p>Assuming <code>error</code> to be a vector, you can simply use <code>matrix-multiplication</code> -</p>
<pre><code>grad_temp = error.'*X/m
</code></pre>
|
Physically move mssql instance with service broker to another server <p>What we are doing is simply shutting down sql server and physically moving mssql folder to another server. After that operation service broker not working correctly. What to do to make service broker work on a new server? What's the correct way to ... | <p>Alright, we moved folder with database files to fresh new instance of sql server on another machine. After few tests we get the expected error <code>An error occurred while receiving data: '10054(An existing connection was forcibly closed by the remote host.)'.</code> and in SQLProfiler it shows as <code>Connection ... |
UINavigationController deinit never called <p>From some <code>ViewController</code> of my <code>UINavigationController</code> stack I present another <code>ViewController</code> and will never come back, but the problem is that <code>deinit{}</code> is not called. How should I remove each <code>ViewController</code> fr... | <p>First of all, when you call <code>presentViewController:animated:completion:</code> you will present the new <code>viewController</code> <strong>modally</strong>, outside of the <code>navigationController's</code> hierarchy.</p>
<p>If you wish to present it within the <code>navigationController</code> hierarchy use... |
how to create a table between 2 rows of an other table? <p>i'm in a situation where i need to display a table (to hold data retrieved from a database) between rows if a certain condition is fulfilled.</p>
<p>so to simplify the problem, let us imagine i have a table with only 2 TRs, and 2 TD per TR:</p>
<pre><code> &l... | <p>You can add another row with a data cell that spans for two column and can then put your nested table inside the cell. </p>
<pre><code> <table >
<tr>
<td>First row</td>
<td>First row</td>
</tr>
<tr>
<td colspan="2">
... |
jquery 'form.valid' not supported error IE <p>On my MVC project I have a Login page that works perfectly in Chrome, but in IE (11) I get the following error:</p>
<blockquote>
<p>SCRIPT438: Object doesn't support property or method 'valid'</p>
</blockquote>
<p>This is my code:</p>
<pre><code>if (!$('#formLogin').va... | <p>When checking only one element, I use length instead of valid()</p>
<pre><code>if ($('#formLogin').length==0) {
return false;
}
</code></pre>
|
Why IntegerValidator from Apache Commons fails with this number <p>I'm using the <a href="https://commons.apache.org/proper/commons-validator/" rel="nofollow">Apache Commons Validator</a> library to validate an integer. With this code:</p>
<pre><code>public class App
{
public static void main( String[] args )
... | <p>In es_ES locale (Spanish), dot "." is a thousands separator, not a decimal point. So 0.1 is interpreted as 1. One tenth would be written with a decimal comma: 0,1.</p>
<p>In your second example you're using en_US locale, where dot is indeed a decimal point.</p>
|
Stop Tracking images <p>It is possible that Vuforia, once it has detected an image of your BBDD stop trying to find more images, keeping a 3D object in the last detected position fixed and that you can move the camera in extended tracking mode around the object 3D?</p>
<p>Thanks</p>
| <p>It sounds like what you are trying to accomplish is something along the lines of <a href="https://en.wikipedia.org/wiki/Dead_reckoning" rel="nofollow">Dead Reckoning</a>.</p>
<p>The reason we can't really get proper dead reckoning with a mobile device (assuming that is what you are running Vuforia on) is because th... |
Check if array contains certain string, then select that item <p>Okay, this might sound very vague, but I will try to explain best I can.</p>
<p>I have an image, and I collected its source with the <code>.attr('src')</code> function. This image is one of 5 other images, all in the same div. So far I have collected two... | <p>Assuming your variables <code>src</code> and <code>array</code>:</p>
<pre><code>var index = array.findIndex(function(img) {
return img.src === src
})
var elementYouWant = array[index - 1]
</code></pre>
<p>You may add a check if <code>index</code> is zero, because in that case <code>index - 1</code> would be <... |
Graphics.DrawImage generates some 'noise', a keyline near image edge <p>I have a service that resizes/crops images on demand by loading a full size file and cropping it, resizing it to the requested dimensions and requested quality.</p>
<pre><code>public static byte[] Resize(Image sourceImage, int? targetWidth, int? t... | <p>The problem already starts from your source image. If you take a close look at it in Photoshop (or another editor), you'll notice that those artifacts are in the source image but much fainter. When scaling images, source pixels are not just copied to their new position, but interpolated. It means that in some cases ... |
Take two elements and wrap them in a div and insert another div inside <p>I'm trying to wrap radio input with its label and then insert an element into the newly created wrapper, but between the input and the label, and I can't seem to find an easy way</p>
<p>I'd like to turn this</p>
<pre><code> <field... | <p><strong>How about:</strong></p>
<pre><code>$('input[type="radio"]').each(function(index) {
$(this).next('label').andSelf().wrapAll("<div class='toggle-box'></div>").parent().append('<span><i></i></span>');
});
</code></pre>
<p><strong>Please check below snippet.</strong></p>... |
Batch Files If statement <p>I've got a batch file which I've put together, which DOES work. However, I think the coding is a bit ugly and could or possible should be done in a better way.</p>
<p>Essentially this file is run via a Scheduled Task daily and is designed to look inside a specific directory for a csv file w... | <p>Here's a quick untested rewrite:</p>
<pre><code>@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
REM Define User Variables
(SET master=c:\credit_allocation\processed\master.csv)
(SET stucred=c:\credit_allocation\student_credit.csv)
(SET srv_cmd=%ProgramFiles%\PaperCut MF\server\bin\win\server-command.exe)
(SET option=adjust-us... |
Matching strings in jQuery <p>I have this table</p>
<pre><code><table>
<tr>
<td>Name</td>
<td>John Stevenson</td>
</tr>
<tr>
<td>Name</td>
<td>John Stevenson</td>
</tr>
<tr>
<td>Name</td>
&... | <p>Try following</p>
<pre><code>$("table").find("td:contains('John Stevenson')").each(function () {
$(this).css({color: "red"});
});
</code></pre>
<p>For reference - <a href="http://plnkr.co/edit/q45cGWpW8ql7FfoNaKDj?p=preview" rel="nofollow">http://plnkr.co/edit/q45cGWpW8ql7FfoNaKDj?p=preview</a></p>
<p><strong>E... |
Identical Custom Cells being output (Swift) <p>I am trying to create a custom <code>TableView</code> that will output custom cells depending on the keys contained in a <code>Dictionary</code>. I have created classes and outlets for each custom cell, but when I build and run; the same custom cell is displayed multiple t... | <p>Instead of using <code>Dictionary</code> try to use <code>Array</code> that contains your all keys with sorted and use that array with <code>tableViewDataSource</code> methods.</p>
<pre><code>var keysArray = [String]()
keysArray = Array(dataDict.keys).sorted(<)
func tableView(tableView: UITableView, numberOfRo... |
ngModel with a bind function not working in ng2 <p>If I do in a template of a component something like:</p>
<pre><code><input [(ngModel)]="myProperty"></input>
</code></pre>
<p>then it works, but if I do it with a function in my component it does not:</p>
<pre><code><input [(ngModel)]="getMyProperty()... | <p>the directive ng-modal is used to bind the data with the controller.
when you write:
<strong></strong>
means you are assigning the value of input control to myProperty variable. </p>
<p>But when you write :
<strong></strong>
then you trying to assign the value of the input control to the function/method w... |
Is there a keyboard shortcut to select current line in PhpStorm? <p>In PhpStorm there is shortcut to extend selecting <code>ctrl + w</code>. It there shortcut to select all current line? I looking for something that works like <code>ctrl + l</code> in Sublime?</p>
| <p>There is such action available but if it has shortcut assigned ... that depends on keymap used.</p>
<p>In any case:</p>
<ol>
<li><code>Settings/Preferences | Keymap</code></li>
<li><code>Editor Actions | Select line at Caret</code> (or just use search box)</li>
<li>Assign any shortcut you wish (or use provided one... |
How to use models in console controllers in Yii2? <p>I have created contoller file in console folder like :</p>
<pre><code><?php
namespace console\controllers;
use Yii;
use yii\console\Controller;
use backend\models\User;
class TestController extends Controller {
public function actionIndex() {
echo ... | <p>In Yii2, if you want to use models in console than you should create model under <code>console\models\</code> and than you can use that model. </p>
<p>I have found this from this website : </p>
<p><a href="http://latcoding.com/2015/08/27/run-controller-yii2-via-console/" rel="nofollow">http://latcoding.com/2015/08... |
Map moongose object to DTO object in expressjs <p>I would like to parse objects from moongose result to DTOs for my views. I have a query example here, that return a result mongoose object:</p>
<pre><code>const returnedData = (err, result) => {
//Result object is a schema from Moongose
cb(err, re... | <p>This might come handy for you</p>
<p><a href="http://mongoosejs.com/docs/api.html#document_Document-toObject" rel="nofollow">http://mongoosejs.com/docs/api.html#document_Document-toObject</a></p>
<p>Since mongoose returned objects are basically modeled after the Document the above tells how it will convert it to p... |
AVCaptureDevice.hasFlash returns true for front camera when no flash exists <p>Not sure what to do about this. Who do I call/what do I do to resolve this? AVFoundations programming guide has a hasFlash and is flashmode supported feature but they don't work properly. The front camera should return false but instead it r... | <p>You can check like,</p>
<pre><code> AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
BOOL hasFlash = [device hasFlash];
if (hasFlash) {
NSLog(@"device has a flash");
}
else{
NSLog(@"device hasn't flash");
}
</code></pre>
|
How to run tests in behat on firefox 48.0 using selenium stand alone server? <p>Previously I worked with Behat 3 and Stand Alone Server 2.45 and everything worked properly. </p>
<p>I use PhpStorm as my IDE. Later, after installing the update of Firefox (ver. 48.0) my tests stop working. I also try to run tests with Se... | <p>Maybe we need some more information about your behat.yml and the information that the selenium logs are giving to you.</p>
<p>Only for reference, here you have my config for running firefox under Behat 3 an Selenium3-beta3. </p>
<pre><code> extensions:
Behat\MinkExtension:
base_url: "http://www.your... |
TensorFlow freeze_graph.py: The name 'save/Const:0' refers to a Tensor which does not exist <p>I am currently trying to export a trained TensorFlow model as a ProtoBuf file to use it with the TensorFlow C++ API on Android. Therefore, I'm using the <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow... | <p>The <code>--filename_tensor_name</code> flag is used to specify the name of a placeholder tensor created when you construct a <a href="https://www.tensorflow.org/versions/r0.10/api_docs/python/state_ops.html#Saver" rel="nofollow"><code>tf.train.Saver</code></a> for your model.*</p>
<p>In your original program, you ... |
UIAlertView and UIAlertController title does not display <p>I have created an alert as follows :</p>
<pre><code>// UIAlertView
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"WARNING" message:@"Are you sure you want to quit ?" delegate:nil cancelButtonTitle:@"Confirm" otherButtonTitles:@"Cancel", nil];
[... | <p>Both of them is work in my side.</p>
<p>Try to use this code:</p>
<pre><code>#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIAlertView *... |
How to bind nested property in label <p>I want to bind an object property to a label. However I cannot get the binding to work properly. The object that I am binding is from a weather API.</p>
<p>code:</p>
<pre><code>public seald class CurrentWeatherRepsonse: WeatherItem
{
Temperature { Value {get; set;} }
}
pu... | <p>Check what is your data context. As already discussed for given problem your data context should be <code>weatherObserver</code> object as your properties are declared under that.
Sharing one view with different objects as data context will work only if you have the same property names at same levels. Though this is... |
Will hashing a UUID with CRC32 be always unqiue? <p>For example, I have a UUID 3f107c44-336c-409b-b6d8-889d552a5339, if I hash it with a CRC32, can I ensure none of the hash of UUID will collapse?</p>
<p>=========</p>
<p>Reason I wanted to ask this is because I was uncertain if I am correct.</p>
<p>What I really wan... | <p>No. A UUID represents a 128-bit value. A CRC-32 is only 32 bits. So at <em>best</em> you have a mapping of any one CRC-32 value to 2<sup>96</sup> (79,228,162,514,264,337,593,543,950,336) different UUID values.</p>
|
How to send form data as json in angular2 <p>I am trying to send my form data as json but not able to do so can any one help please....
my ts,</p>
<pre><code> headers.append('Content-Type', 'application/x-www-form-urlencoded')
this.http.post(this.header1+'login', JSON.stringify(form), { headers: headers })
... | <p>i cleared it by including the following steps in my node.js</p>
<pre><code> app.use(function (req, res, next) {
// Website you wish to allow to connect
res.header('Access-Control-Allow-Origin', '*');
// Request methods you wish to allow
res.header('Access-Control-Allow-Methods', 'GET... |
Easiest way to parallelise a call to map? <p>Hey I have some code in Python which is basically a World Object with Player objects. At one point the Players all get the state of the world and need to return an action. The calculations the players do are independent and only use the instance variables of the respective p... | <p>The most straightforward way is to use <a href="https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.multiprocessing.Pool.map" rel="nofollow">multiprocessing.Pool.map</a> (which works just like <code>map</code>):</p>
<pre><code>import multiprocessing
pool = multiprocessing.Pool()
def do_stuf... |
How to create PDF of Report generate by Microsoft Dynamic CRM using WCF Service? <p>I am working on Microsoft Dynamic CRM. I can create PDF from Report of the Order. But I want to create PDF from WCF Service. I have order Id. I want to create PDF of that orderId using WCF Service.</p>
<p>I can add order, retrieve orde... | <p>On-Premise, where you can "talk" directly to the server, you could bypass CRM and invoke the Reporting Service URL which would let you download the PDF.</p>
<p>Online, sadly, it cannot be done (no SSRS to talk to).</p>
|
Is there any equivalent in C# and Java for the C method _strtod_l? <p>C method _strtod_l can convert string "13.361389" to double value 13.361389000000001 , is there equivalent in C# and Java also can get the same result? I found the Convert.ToDouble in C# cannot do it.</p>
<p><a href="http://i.stack.imgur.com/KH45G... | <p>For C# you can use <code>Double.Parse("13.361389", CultureInfo.InvariantCulture)</code></p>
<p>For Java you can use <code>Double.parseDouble("13.361389")</code></p>
|
How to refer to bootstrap's CSS which was downloaded as gradle dependency? <p>My question is that i am not sure how to refer to the bootstrap lib which is in the 'External Libraries' in my project. </p>
<p>In the build.gradle file i added:<br>
<code>compile group: 'org.webjars', name: 'bootstrap', version: '3.3.7'</co... | <p>Gradle downloads and <a href="https://docs.gradle.org/current/userguide/dependency_management.html#sec:dependency_cache" rel="nofollow">cahces dependecies</a> locally. It references the artifacts from the cache whenever needed, the IDE, the compiler all get a path to the artifact from the cache.
The reference that ... |
vue router $this not defined <p>I am using vue-router, in one of the component/vue, I tried to load histories transaction from database when the specific component is load:</p>
<pre><code><script>
import store from '../store'
export default {
data() {
return {
histories: []
}
... | <p><code>$this</code> doesn't exist, you need to use <code>this</code>: </p>
<pre><code>export default {
data() {
return {
histories: []
}
},
route: {
activate() {
this.getHistories()
}
},
methods: {
getHistories() {
this.... |
Wait For Each AsyncTask to finish before executing the next AsyncTask <p>I have 4 AsyncTask classes in my Fragment. I want to execute all four of them, but one at a time. I have tried things like task.execute().get() and task.execute().getStatus(). These don't seem to work well - I get an error that I can't run another... | <p>Why not execute those AsyncTasks in an SingleThreadExecutor?</p>
<pre><code>Executor executor = Executors.newSingleThreadExecutor();
</code></pre>
<p>And then execute your task on your executor:</p>
<pre><code>task.executeOnExecutor(executor);
</code></pre>
<p>This way only one thread will be used to run your As... |
I tried to visit vtable of a C++ polymorphic class, but failed with core dump, why? <p>I wish to use a small program to detect the feature of vtable. I know for most popular compilers, they'll generate objects with leading size_t of its head to be a pointer to vtable. So I tried to convert this pointer and use it for a... | <p><strong>Update:</strong></p>
<p>You have a mistake here:</p>
<pre><code>pf* pvtable=(pf*)p;
</code></pre>
<p>You are casting the pointer to object <code>C</code> to a pointer to vtable. Therefore you are interpreting the content of the <code>C</code> object as a vtable. Instead you need to go one indirection furt... |
Update frame after each iteration <p>I am currently coding a port-scanner in Qt(C++) for Mac. The process of checking if a certain port is open or not works completely fine. <strong>But</strong> if the port range which the user wants to check is too big, every port will be checked but the output happens only after this... | <p>Perhaps something like this:</p>
<pre><code>//...
bool tooManyPorts = dif > 10000; // Set flag to true if port range is too big (for example more than 10 000 ports
//
QString msgs = "";
for (int i = portmin; i <= portmax; i++) {
int s = socket(AF_INET, SOCK_STREAM, 0);
addr.sin_port = htons(i);
... |
Tag input field not working with turbolinks <p>I'm trying to create a ruby on rails project, and as part of this project I'm using <a href="https://github.com/bootstrap-tagsinput/bootstrap-tagsinput" rel="nofollow">this</a> jQuery plugin to manage tags input. However the tag field works on first refresh but not after a... | <p>try 'turoblinks:load'</p>
<p>instead </p>
<pre><code>$(document).ready(function(){
</code></pre>
<p>use:</p>
<pre><code>$(document).on('turbolinks:load',function(){
</code></pre>
|
Azure WebJob Storage Exception <p>I'm getting the following error when running my continuous webjob.</p>
<p><strong>An unhandled exception of type 'Microsoft.WindowsAzure.Storage.StorageException' occurred in Microsoft.Azure.WebJobs.Host.dll</strong></p>
<p><strong>Additional information. The client could not finish ... | <p>As far as I know, the following settings could be the possible cause:</p>
<ul>
<li>WEBJOBS_IDLE_TIMEOUT - Time in seconds after which we'll abort a running triggered job's process if it's in idle, has no cpu time or output. The default value is 2 minutes.</li>
<li>SCM_COMMAND_IDLE_TIMEOUT - By default, when your bu... |
What type of image filtering/processing do mobile PDF scanners use to convert a captured image into a monochrome/black and white image? <p>I am trying to implement my own monochrome/black and white filter in C# to scan text documents. My approach is to apply a threshold filter on the captured image. However, I often ru... | <p>You need two ingredients.</p>
<p>One is "background reconstruction", i.e. retrieving the intensity of the white sheet "under the characters", for instance by morphological opening.</p>
<p>The other is "shading correction", i.e. compensating the unevenness of the background illumination by comparing to the reconstr... |
WPF DataGrid AutoGenerateColumn base class inheritance <p>I have a problem showing items of a special type in a <code>DataGrid</code>. I created a minimal example.</p>
<p>Let´s say I have an abstract <code>BaseClass</code> and many inheriting <code>ChildClasses</code>: </p>
<pre><code>public abstract class BaseCla... | <p>What you want to do can't work, because the properties shown in data grid columns have to be present in every entry of the <code>Items</code> collection. Only the properties declared in your <code>BaseClass</code> are guaranteed to be present in every instance that is put into the <code>Items</code> collection.</p>
... |
Align elements at bottom of div <p>I want each button "Read more" of each div to be aligned in the same level (and in this case at the bottom of the div). The problem is that I don't want to give a specific height to the divs and neither change any markup or style.</p>
<p>I could use a bunch of pseudo class selectors ... | <p>Flexbox can do that.</p>
<p>It will set all the columns to equal height and tell the button to be at the bottom of each column.</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-overrid... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.