input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
How to iterate through a property in object within an array in Angular? <p>In AngularJs, I'm using ng-repeat option to display <code>questionText</code> property inside each object in an array.</p>
<pre><code>[{
"_id": "57fa2df95010362edb8ce504",
"__v": 0,
"answers": [],
"options": [],
"questionTex... | <p>questionText property value would be displayed like the below in ng-repeat ,where questionText in ng-repeat will represent object in questions list</p>
<pre><code><div ng-controller="viewQuestionController as viewQuestions">
<div ng-repeat="questionText in viewQuestions.questions">
<h2>{{quest... |
How to send a single message to multi connections using UE? <p>I have tried to send messages to various connections via unification engine and it works fine. It's mentioned here (<a href="https://developer.unificationengine.com/" rel="nofollow">https://developer.unificationengine.com/</a>) that its possible to send onl... | <p>It is possible to send same message to multiple connections via unification engine.
The following command will send the same messsage to two facebook connections and a twitter connection</p>
<p>curl -XPOST <a href="https://apiv2.unificationengine.com/v2/message/send" rel="nofollow">https://apiv2.unificationengine.... |
How to dynamically load email configuration file as per database in rails <p>We write all email configuration information in development.rb file.Is it possible to save all this information in database and if we change our database then email will be gone as per our database and All the records must be fetched from the... | <p>You can save the settings in a separate table in the DB, and load it from the DB dynamically in your settings file or when even needed.</p>
<p>A major downside for that would be performances - you will take a big hit for accessing DB to fetch these settings. possible solution here would be using caching. </p>
|
NSURL with JSON returns null <p>I'm keep getting a <code>(null)</code> error when I try to build my NSURL to open another app.</p>
<p>The URL should be </p>
<p><code>ms-test-app://eventSourceId=evtSrcId&eventID=13675016&eventType=0&json={"meterresults":[{"clean":"2","raw":"2","status":"0"}]}</code></p>
<... | <p>You should really be using <code>NSURLComponents</code> to create URLs rather than trying to format them into a string. </p>
<pre><code> NSDictionary* jsonDict = @{@"clean": @"2", @"raw": @"2", @"status": @"0"};
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:jsonDict options:0 error:NULL];
NSString... |
Run a Process silently in background without any window <p>I want to run NETSH command silently (with no window).
I wrote this code but it does not work.</p>
<pre><code>public static bool ExecuteApplication(string Address, string workingDir, string arguments, bool showWindow)
{
Process proc = new Process();
p... | <p>This is how I do it in a project of mine:</p>
<pre><code>ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "netsh";
psi.UseShellExecute = false;
psi.RedirectStandardError = true;
psi.RedirectStandardOutput = true;
psi.Arguments = "SOME_ARGUMENTS";
Process proc = Process.Start(ps... |
Ruby sub not applying in the output file using IO.write <p>I have an issue about getting the same result in the output txt file that I get applying the sub method in a string. So the thing is when I apply the following code in a single string I get the \n before the capital letter in the middle of the string:</p>
<pre... | <p>Ok, I've got the solution, I don't know why but the type of encode of the txt file is in a format that the readlines command is not even able to read, so I copied all the content in another txt file which should be created from scratch and it worked :)</p>
|
How to use ManagedExecutorService with @Asynchronous method? <p>I have a Java EE app that's deployed on WildFly AS.
I have a method annotated with <code>@Asynchronous</code> and I need to set the max number of threads for this method.
I configured a new <code><managed-executor-service></code> in server config, b... | <p>This link: <a href="https://developer.jboss.org/message/851027#851027" rel="nofollow">https://developer.jboss.org/message/851027#851027</a></p>
<p>provides a good answer to how (or when) to use @Asynchronous and when to use JSR-236 ExecutorService and concurrency utilities:</p>
<blockquote>
<p>In short, @Async... |
Facebook App review for B2B web based solutions <p>I have a ticketing solution that is configured to one FB page, from that FB page my application can read the post and comments ad create them as tickets. In a ticket I can post a comment back to the FB page. </p>
<p>My issue is this is not an app also users of the tic... | <p>I totally agree with @Gary</p>
<p>According to the documentation of the <a href="https://developers.facebook.com/docs/apps/test-users/" rel="nofollow">test-users</a> in the facebook developer there are some important things to note while creating the test users</p>
<ul>
<li>They are invisible to the real accounts.... |
How to display image from current working directory in Python <p>I would like to display an image using multiple label in a GUI(Qt Designer). The image file should be grab from current working directory and display on it own label upon user press Push Button.</p>
<p>Image can be displayed in label_2 when i hardcoded t... | <p>The demo script below works for me on Windows XP. If this also works for you, the problem must be in the <code>capture_image</code> function in your example (which I cannot test at the moment).</p>
<pre><code>import sys, os
from PyQt4 import QtCore, QtGui
class Window(QtGui.QWidget):
def __init__(self):
... |
Nlog log file is not created <p>I am trying to log exceptions in console application. I have done everything as always (and then it worked for me...):</p>
<p>NLog.config:</p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/sche... | <p>Your config looks valid, so that shouldn't be the issue.</p>
<p>Some things to check:</p>
<ol>
<li><p>Is you nlog.config in the correct directory? The best way to test is to copy the nlog.config to the directory with your .dll or .exe.</p></li>
<li><p>Enable exceptions to be sure that errors are not captured by Nl... |
implement linear probing in c++ for a generic type <p>I wanted to implement linear probing for hashtabe in c++,but the key,value
pair would be of generic type like: <strong>vector< pair< key,value> ></strong>(where key,value is of generic type).</p>
<p>Now,in linear probing if a cell is occupied we traverse the ... | <p>I think you can just check if the element of the vector has meaningful key and value:</p>
<pre><code>if(vector[i] == std::pair<key, value>())
//empty
</code></pre>
<p>or, if you only care about the keys</p>
<pre><code>if(vector[i].first == key())
//empty
</code></pre>
<p>This approach assumes that ... |
Adding additional information to Simple Jquery FileUpload <p>I'm trying to integrate juqery fileupload with an ajax form submit. The ajax form sends the text and returns the ID of the newly created event, This is necessary to know which event to link with when uploading.
The simple upload demo uses the following code</... | <p>You first need to get the event Id with an ajax post:</p>
<pre><code>function uploadClick(){
var eventId = getEvent();
uploadFile(eventId)
}
function getEvent(){
// make an ajax and return your id
}
</code></pre>
<p>One you got it, then create an URL with a query string indicating the eventId. this URL i... |
Entity Framework Core Self reference optional property <p>I am using Microsoft.EntityFrameworkCore.Sqlite v1.0.1.
This is my entity:</p>
<pre><code>public class Category
{
public int CategoryId { get;set;}
public Category ParentCategory { get; set; }
public int? ParentCategoryId { get; set; }
public st... | <p>Your <code>ParentCategoryId</code> is already optional based on the fact that it is nullable. If it wasn't nullable, it would be required. You don't need to configure it further.</p>
<p>Note, you don't need to configure <code>CategoryId</code> as the Key for <code>Category</code>. It will be configured as the key b... |
Can't synchronize my threads in C <p>I've a problem when I try to sychronize my threads. I have the next code:</p>
<pre><code>static void* CarProcess(void *str);
int main()
{
thread_t *pthreadsArray;
pthreadsArray = (thread_t*)malloc(sizeof(thread_t) * 10);
for (int i = 0; i < 10; i++)
{
i... | <p>One possible source of the problem is that <code>str</code> is not really an <code>int</code> variable. You need to do some casting (both when creating the thread and when getting the argument).</p>
<p>To create a the thread and to properly pass the integer to ity ou first need to cast the value to an <code>intptr_... |
What will be the AngularJS equivalent of jQuery's .bind() / .trigger() <p>I have this trigger / bind code:</p>
<p>service:</p>
<pre><code>$('body').trigger('ready');
</code></pre>
<p>directive:</p>
<pre><code> $('body').bind("ready", function(){
alert("Ready was triggered");
});
</code></pre>
<p>Can I... | <p>You need to use events in AngularJS check the below sample example I hope it will be of help to you, please check <a href="https://toddmotto.com/all-about-angulars-emit-broadcast-on-publish-subscribing/" rel="nofollow">this</a> article for more information on <code>$emit</code>, <code>$on</code> and <code>$broadcast... |
How to develop NPM module for Ionic <p>I am developing library for Ionic 2, that should be installed via NPM, but i can't do this in classic way. If you want to develop module you can use <em>npm link</em> command to link module to your project where you want test and develop it, but in Ionic it everytime fall on compi... | <p>We did experiment with this, to share ngrx-based core module in between a web Angular2 app and an Ionic2 mobile app:
<a href="https://github.com/benorama/ngrx-demo-apps" rel="nofollow">https://github.com/benorama/ngrx-demo-apps</a></p>
<p>However, we did not manage to make it work through <code>npm link</code>, onl... |
React Redux with redux-observable use the router to navigate to a different page after async action complete <p>I am using <a href="https://github.com/redux-observable/redux-observable" rel="nofollow">redux-observable</a> and this is my login epic:</p>
<pre><code>const login = ( action$ ) => {
return action$.of... | <p>I'm totally new to react/redux, but I face the same problem as you, so I create a small APP with a login page.</p>
<pre><code>// On your Login.JS you could implement the component lifecycle
componentWillReceiveProps(nextProps) {
if (nextProps.isAuthenticated){
this.context.router.push({pathname:'/'});
... |
Capturing Ctrl+W on browser <p>First of all, I know there are plenty of questions about this matter already, I've searched for them and most of them are a few years old, that's the main reason I'm asking.</p>
<p>I kinda need to capture Ctrl+W Yes or Yes in all browsers (at least the most common ones, Chrome, Firefox a... | <p>Just in case someone ends up in here.</p>
<p>As Jaromanda told in the comments section (and many others in other posts) <a href="https://developer.mozilla.org/es/docs/Web/API/WindowEventHandlers/onbeforeunload" rel="nofollow">window.onbeforeunload</a> is our best ally. In this precise case, it doesn't serve me wel... |
How can I handle camera and gallery output simultaneously, without using 2 times onActivityResult? <p>I have a dialogue, which asks you to choose if to take a picture or to upload one from gallery. The taken/chosen image I set as background on a Button. how can I handle both outputs, as I can't use 2 times onActivityRe... | <p>First, make a global variable</p>
<pre><code>private final static int GET_PHOTO_BITMAP = 1234;
</code></pre>
<p>Then do the following</p>
<pre><code>private void invokeCamera() {
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, GET_PH... |
Using external variables in Javascript <p>In my <code>views.py</code> I had things like that:</p>
<pre><code>...
if mymodel.name == 'Myname1':
#do something
elif mymodel.name == 'Myname2':
#do something else
...
</code></pre>
<p>but I didn't like it because if <code>Myname</code> change I should search all my... | <p>If you really need to have the same list in javascript then I'd recommend creating a view you can call from an AJAX request that will just return the python dictionary that stores all of these values. This way there isn't any duplication and places where you'd need to update the same thing twice (DRY).</p>
<p>Then ... |
Chrome -- Access-Control-Allow-Origin <p><strong>chrome -- XMLHttpRequest cannot load <a href="http://127.0.0.1:3000/" rel="nofollow">http://127.0.0.1:3000/</a>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.</strong></p>
<p>My web service i... | <p>By requesting <code>http://127.0.0.1:3000/</code> from <code>http://127.0.0.1:8080</code> (and vice versa) you violate the <a href="https://www.w3.org/Security/wiki/Same_Origin_Policy" rel="nofollow">same origin policy</a>, because</p>
<blockquote>
<p>An origin is defined by the scheme, host, and port of a URL. <... |
Apple TV force focus another view <p>I'm working on Apple TV project. The project contains tab bar view controller, normally the tab bar will be appeared when swiping up on remote and hidden when swiping down. But now I reverse that behavior and I want to force focus another view when swiping up(normally focus on tab b... | <p>I got the same issue with focus of UITabbarController before and I found the solution in Apple Support</p>
<blockquote>
<p>Because UIViewController conforms to UIFocusEnvironment, custom view
controllers in your app can override UIFocusEnvironment delegate
methods to achieve custom focus behaviors. Custom vie... |
Generate Signed APK: Project Name <p>While trying to publish my first Android App to Google play I was about to generate the signed APK when I noticed the module name is "app".</p>
<p>From the instructions I followed, I've understood this should be the actual name of my app? (my app's name is not "app", the package na... | <p>Module name does not influence a name that your app is published with. See <a href="http://stackoverflow.com/questions/5443304/how-to-change-an-android-apps-name">here</a> how to do so (you need to change <code>label</code> in your manifest). By default, module name influences such internal things as a folder name o... |
Message: Call to undefined function redirect() <p>I am having a serious problem in using <code>redirect()</code> method. </p>
<p>This is my code;</p>
<pre><code>class ictcon extends CI_controller{
function __construct(){
parent::__construct();
if(!$this->session->userdata("in")) redirect("we... | <p>This function belongs to the url helper. Try loading this helper in autoload file or run this before calling <code>redirect()</code>:</p>
<pre><code>$this->load->helper('url');
</code></pre>
|
When to use $ vs #? <p>I am confused about using <code>$ vs #</code>. I didn't found any guides for this. I used them as<br>
<code>name = #{name}</code>, <code>name like '%${word}%'</code>, <code>order by name ${orderAs}</code>,<code>where name = #{word}</code><br>
Sometimes , these are work fine but at the sometimes ,... | <p>Following the <code>myBatis</code> guidelines <code>#{}</code> is used in your sql statements. </p>
<p>If you take a look any of MyBatis Reference in the Section <a href="http://www.mybatis.org/mybatis-3/sqlmap-xml.html#select" rel="nofollow">Mapper XML Files</a> it says explicity:</p>
<blockquote>
<p>Notice the... |
Insertion in sorted doubly linked list <p>I am given the pointer to the head node of a sorted doubly linked list and an integer to insert into the list.I am told to create a node and insert it into the appropriate position in the list such that its sorted order is maintained. The head node might be NULL.</p>
<p>Sample... | <p>Fairly simple:
You are not breaking out of the loop after succesfully inserting. Therefore it keeps looping over the position it inserts the node in. Make a tiny change:</p>
<pre><code>if(ptr.data>=newn.data)
{
newn.next=ptr;
ptr.prev=newn;
newn.prev=null;
head=newn;
break;
}
</code></pre>
<... |
Call Skype ID from Twilio? <p>Is that possible to call a Skype ID (not a Skype number) using Twilio client application? If possible then how to accomplish this? Please help me if anyone have any idea.</p>
| <p>Twilio developer evangelist here.</p>
<p>I'm afraid that Twilio Client can only call phone numbers or other Twilio Client IDs and not a Skype ID.</p>
|
How can I reuse the same controller class using different constructor arguments <p>I have a controller that accepts some dependency as a constructor argument:</p>
<pre><code>public class AccountsController : ApiController
{
public AccountsController(IAccountsService accountService)
{
this.accountServic... | <p>Here is one way to do it:</p>
<p>Let's say that the two routes are as follows:</p>
<pre><code>config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
config.Routes.MapHttpRoute(
name: "DefaultApi2",
routeTemplate... |
Looping each row in file1.txt over all rows of file2.txt for comparing <p>I have two text files, say file1.txt contains something like</p>
<p>100.145 10.0728</p>
<p>100.298 10.04</p>
<p>and file2.txt contains something like</p>
<p>100.223 8.92739</p>
<p>100.209 9.04269</p>
<p>100.084 9.08411</p>
<p>100.023 9.012... | <p>you can try this;</p>
<pre><code>#!/bin/bash
while read line; do
while read line2; do
Col1F1=$(echo $line | awk '{print $1}')
Col1F2=$(echo $line2 | awk '{print $1}')
Col2F1=$(echo $line | awk '{print $2}')
Col2F2=$(echo $line2 | awk '{print $2}')
if [ ! -z "${Col1F1}" ] && [ ... |
I've got a form filter but I also need to sort (MS Access VBA) <p>I've got an on_load sub to set the filter of a subform which liiks like this:</p>
<pre><code>Me.TabMonths.Pages("pge" & i).Controls("frmTileSchedule" & i).Form.Filter = "[MonthNo] = " & i & " and [YearNo] = " & intYear & ""
Me.Ta... | <p>It's similar to filtering:</p>
<pre><code>Me.TabMonths.Pages("pge" & i).Controls("frmTileSchedule" & i).Form.OrderBy = "Tile ASC"
Me.TabMonths.Pages("pge" & i).Controls("frmTileSchedule" & i).Form.OrderByOn= True
</code></pre>
|
making an arrow with before + after <p>Good day
I have a a link which must have text + arrow looking like this:</p>
<p><a href="http://i.stack.imgur.com/uNvQo.png" rel="nofollow"><img src="http://i.stack.imgur.com/uNvQo.png" alt="enter image description here"></a></p>
<p>I have done arrow,but dont know how to make th... | <p>Here's how you create from pseudo element. Just change the color.</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>.hiretext {
margin-top:105px;
padding:5px 2px 5p... |
How to auto open react DatePicker <p>I have the following code</p>
<pre><code> case 'date':
if (Modernizr.touchevents && Modernizr.inputtypes && Modernizr.inputtypes.date) {
element = (
<input
type='date'
id={this.props.id}
name={this.props.name}
... | <p>Have you tried adding the autofocus property, since the DatePicker opens OnFocus</p>
<pre><code><input type="text" name="inputname" autofocus>
</code></pre>
<p>should work :)</p>
<p>for your code:</p>
<pre><code> element = (
<input
type='date'
id={this.props.id}
name={this.props.na... |
JavaScript test whether variable is a possible DOM element <p>This question has sort of been asked before, but (a) a long time ago and (b) some of the past answers include jQuery.</p>
<p>For current browsers (including IE >= 8) what is the simplest reliable way to test whether a variable is a DOM element?</p>
<p>I do... | <p>You could check it the other way around like:</p>
<pre><code>function doit(element) {
if(typeof element === 'string') { // to be save -> always use type check in js (===)
// string
}
else {
// assuming it is a document element
}
}
</code></pre>
<p>If you really want to check it... |
get related data from ms dynamics crm using XRM SDK <p>I'm trying to retrieve data from crm in a .net application, using the SDK.
I've managed to do simple queries to retrieve lists, but I would now like to get the related entities with items, rather than the ids.</p>
<p>I have tried things like</p>
<pre><code>QueryE... | <p>In the <code>QueryExpression</code> the <code>LinkEntity</code> represents a join. That's why the fields of the joined table are in the <code>Entity</code> row. They can be distinguished from the 'real' entity attributes by the fact that their names are prefixed (including a dot) and their values are wrapped in an <... |
iron-pages: Page Changed Event <p>Is there any event that can be captured by a web component when the page is changed, or even a lifecycle callback?</p>
<p>I tried using the attached callback but it doesn't being fired again..</p>
| <ul>
<li><p>From the parent element of <code><iron-pages></code>, you could <a href="https://www.polymer-project.org/1.0/docs/devguide/observers#change-callbacks" rel="nofollow">observe</a> changes to <a href="https://elements.polymer-project.org/elements/iron-pages#property-selected" rel="nofollow"><code><iro... |
Google Dataproc node idle <p>One of my nodes in my Dataproc cluster is always idle when running a spark job. I've tried deleting and recreating the cluster ect. but it always has one idle node.</p>
<p>The reason seems to be indicated by these three lines from the log that come up every few seconds:</p>
<pre><code>Try... | <p>Since the app attempt, matches the Application ID of your Spark Application, I believe the app attempt is Spark's YARN AppMaster. By default, Spark AppMasters have the (somewhat excessive) same footprint as Executors (half a node). So by default half a worker should be consumed.</p>
<p>If you didn't change some mem... |
Specific background color for Tk in Python <p>How to set specific color such as #B0BF1A instead of black,white,grey</p>
<pre><code>window.configure(background='white')
browse_label = gui.Label(window, text="Image path :", bg="white").place(x=20, y=20)
</code></pre>
| <p>I'm not sure whether this is compatible in python 2.7, but try this:
<a href="http://stackoverflow.com/questions/11340765/default-window-colour-tkinter-and-hex-colour-codes">Default window colour Tkinter and hex colour codes</a> </p>
<p>The code of the accepted answer is as follows (NOT MINE):</p>
<pre><code>impor... |
How to save fileobject/stream to text file on disk in python? <p>I have a file object which is just a string with a large number of youtube urls taken from a playlist, how would I go about saving it to a .txt file?
Thanks</p>
| <p>Assuming your file object is f:</p>
<pre><code>with open("urls.txt", "w") as urls_file:
urls_file.write(f.read())
</code></pre>
<p>It may need improvement depending on the file size.</p>
|
What WordPress theme is this http://www.geekgiftsunder50.com? <p>Hello WordPress gurus can any one tell what theme is used in this website
<a href="http://www.geekgiftsunder50.com/" rel="nofollow">http://www.geekgiftsunder50.com/</a>
Its an Amazon Affialiate website can you guys suggest any theme close to it if not th... | <p>I think it's this theme. If not, i think it's close.</p>
<p><a href="http://repick.wpsoul.net/" rel="nofollow">http://repick.wpsoul.net/</a></p>
<p>Hope this helps.</p>
|
ES6 + jQuery + Bootstrap - Uncaught ReferenceError: jQuery is not defined? <p>How can I import jQuery as the dependency for bootstrap in ES6?</p>
<p>I tried with:</p>
<pre><code>import {$,jQuery} from 'jquery';
import bootstrap from 'bootstrap';
</code></pre>
<p>But I always get this error:</p>
<blockquote>
<p>t... | <p>In Webpack I usually use (<code>webpack.config.js</code>):</p>
<pre><code>externals: {
jquery: "jQuery"
}
</code></pre>
<p>And then:</p>
<pre><code>import jQuery from 'jQuery';
</code></pre>
<p>You could also try:</p>
<pre><code>import * as jQuery from 'jQuery';
</code></pre>
|
Developing algorithmic thinking <p>I encountered a question where a given array of integers I needed to find the pair which could satisfy the given sum.</p>
<p>The first solution that came to me was to check all possible pairs which was about O(n^2) time, but the interviewer requested me to come up with the improved r... | <p>Generally, think about how to do it naively first. If in an interview, make clear what you are doing, say "well the naive algorithm would be ...".</p>
<p>Then see if you can see any repeated work or redundant steps. Interview questions tend to be a bit unrealistic, mathematical special case type questions. Real pro... |
Is it possible to make image the primary key in sql? <p>hello guys i'm developing a face recognition program in c# using <code>eigenface algorithm</code>. </p>
<p>My program does save the live image to sql and if i want to retreive the image the program should compare to the sql if image in live capture and in sql dat... | <p>You could make a encoded picture out of it. For example converting it to Base64 <a href="http://stackoverflow.com/questions/17874733/converting-image-to-base64">Converting Image to Base64</a> and then comparing the strings. Or a Hash of the picture. <a href="http://www.vcskicks.com/image-hash.php" rel="nofollow">has... |
Employee management database design <p>I am wondering about my database design is a bad design, especially at the jobhistory part. Anyone can advise me? Database is totally new to me and i still in learning process.</p>
<p><a href="http://i.stack.imgur.com/0y1dl.jpg" rel="nofollow">Employee management database ERD</a>... | <p>I think, you are keeping 'jobhistory' table for auditing purpose. Use Triggering. When Employee table updated position, then startdate, endDate as today and old position will be inserted in jobhistory table.</p>
<p>You can show Triggering in your ERD.</p>
<p>You can add following field in Employee table,</p>
<ul... |
Windows: Operation could not be completed (error 0x00000002) while using rundll32 <p>I'm new with programming and came across this issue(I'm using windows 7 64x). I'm running this command <code>RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /ia /m "Printer" /f "C:\Program Files (x86)\Project\bin\drivers\Print\printer.inf</code>... | <p>I think Windows cannot connect to the printer.please refer the below path:
<a href="https://support.microsoft.com/en-in/kb/2793718" rel="nofollow">https://support.microsoft.com/en-in/kb/2793718</a></p>
|
r ggplot error: Aesthetics must be either length 1 or the same as the data (250000): <p>I run sample code to generate a graph to describe Markov Chain Monte Carlo.
<a href="https://github.com/davharris/mcmc-tutorial" rel="nofollow">https://github.com/davharris/mcmc-tutorial</a>
However I encounter the following excepti... | <p><code>samples</code>is a matrix, convert it to a dataframe with <code>as.data.frame()</code> so that <code>ggplot2</code>can work with it.<br>
Since you want to have points that are from a different dataframe than the one used for the top plot which is <code>gaussian.plot</code>, you need to define where the data co... |
Collapse the result of the cartesian product <p>To calculate cartesian product with python is very simple. Just need to use
<a href="https://docs.python.org/3/library/itertools.html#itertools.product" rel="nofollow">itertools.product</a></p>
<pre><code>>>> source = [['a', 'b', 'c'], [1, 2, 3]]
>>> l... | <p>Its only a partial solution but assuming you <strong>know for certain</strong> that the result is a valid cartesian product generated by <code>itertools.product</code> and it is over lists of <strong>distinct</strong> values</p>
<pre><code>>>> [list(collections.OrderedDict.fromkeys(y)) for y in zip(*cartes... |
Admob not working with webview <p>My problem is my app don't work anymore. But when I added admob. My webview don't show up anymore. I programmed my app in html and Css. Also now their are not adds showed to.</p>
<p>Main Activity.java</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" da... | <pre><code> <com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
... |
Select distinct rows order by highest values <p>I have a table like</p>
<hr>
<pre><code>Name | Image | Points | Country
-------------------------------
Bob | a.jpg | 100 | USA
Bob | b.jpg | 56 | USA
Sal | c.jpg | 87 | UK
Jim | d.jpg | 34 | UK
Bet | e.jpg | 23 | USA
Bren | f.jpg | 5 | USA
... | <pre><code>DROP TABLE IF EXISTS my_table;
CREATE TABLE my_table
(image VARCHAR(12) NOT NULL PRIMARY KEY
,name VARCHAR(12) NOT NULL
,points INT NOT NULL
,country VARCHAR(12) NOT NULL
);
INSERT INTO my_table VALUES
('a.jpg','Bob' ,100,'USA'),
('b.jpg','Bob' , 56,'USA'),
('c.jpg','Sal' , 87,'UK'),
('d.jpg','Jim' , 34,'U... |
Scala Spark count regex matches in a file <p>I am learning Spark+Scala and I am stuck with this problem. I have one file that contains many sentences, and another file with a large number of regular expressions. Both files have one element per line.</p>
<p>What I want is to count how many times each regex has a match ... | <p>As far as I can see, there are two issues here:</p>
<ol>
<li><p>You should use <code>map</code> instead of <code>foreach</code>: <code>foreach</code> returns <code>Unit</code>, it performs an action with a potential <em>side effect</em> on each element of a collection, it doesn't return a new collection. <code>map<... |
pass parameters as per url in routing <p>I want to pass parameters from one action to another action.
my url routing is like below:</p>
<pre><code> routes.MapRoute("SearchDealbyPrice", "Deal/CategoriesID/{CategoriesID}/FromPrice/{FromPrice}/ToPrice/{ToPrice}/Price/{Price}/GreenCars/{GreenCars}/PageName/{PageName}", de... | <p>Is it what you are looking for ?
I've added your route to RouteConfig and in DealController I've put a RedirectExample method :</p>
<pre><code>public ActionResult RedirectExample() {
return RedirectToRoute("SearchDealbyPrice", new {CategoriesID = 9,FromPrice = 100,ToPrice = 200,Price = 0,GreenCars = 0,PageNam... |
Rails paperclip image size depending on device size <p>I'm using paperclip in my rails application for uploading images.
There are options to resize images.</p>
<pre><code>has_attached_file :photo, styles: {large: '1000x1000>', medium: '500x500>'}
</code></pre>
<p>Is it possible to take the large image for larg... | <p>You have two options for this:</p>
<ol>
<li>Create multiple sizes when you save the image and reference them in the HTML</li>
<li>Save it at the largest size and resize it on demand</li>
</ol>
<p>For option 1, you can use the <a href="https://github.com/thoughtbot/paperclip#dynamic-styles" rel="nofollow">dynamic s... |
Duplicating video Stream Actionscript 3 <p>Good Morning,</p>
<p>i am working on a video class, using a CRTMP Server for streaming. This works fine, but for my solution i need to duplicate the video stream (for some effects).</p>
<p>I googled for duplicate MovieClips and tried to duplicate the video like this.</p>
<p... | <blockquote>
<ul>
<li><em>"This means that i have to double the netstream. This is not what i want."</em></li>
<li><em>"I tried to duplicate the video per <code>Bitmap.clone</code>. But i got an sandbox violation."</em></li>
</ul>
</blockquote>
<p>You can try the workaround suggested here: <a href="http://game... |
Cannot start container : [8] System error: exec: "up3": executable file not found in $PATH <p>I'm new to Stack Overflow and I checked the similar issue in Stack Overflow but not found what I expected answer. so hopefully my questions aren't too silly.
I cannot start my container after I created it.
I use the command:<s... | <p>What do you want to achieve with the parameter <code>up3</code>? This command is executed inside of the container you just started. But Ubuntu does not know this command, because it simply does not exist in the plain Ubuntu image (that's what the error message said: <code>executable file not found</code>).</p>
<p>T... |
django rest framework - Nested serialization not including nested object fields <p>i'm trying to get nested object fields populated, however the only thing being returned is the primary key of each object (output below):</p>
<pre><code>{
"name": "3037",
"description": "this is our first test product",
"com... | <p>By calling the field <code>components_that_fit</code>, you're having the serialiser look for an attribute by that name. (There isn't one, hence your error.)</p>
<p>Two ways to fix it:</p>
<ul>
<li>Call the field <code>components</code>, but declare it as <code>components = componentSerializer(many=True)</code> </l... |
Angular2 HTTP POST An error occurred SyntaxError: Unexpected end of JSON input <p>I have error meantime angular2 post rest data to NodeJS backend.</p>
<p>I see POST is done, server is LOG correct data, but error is showing up on browser.</p>
<p>An error occurred:
SyntaxError: JSON.parse: unexpected end of data at lin... | <p>Awwwww. That was my bad, Take care of your NodeJS Server response. After get POST, should be sended any <code>res.json({status: "OK"})</code> or sommething similar, to get response. This error was not because of Angular2, but because of NodeJS. Browser get empty response from nodeJS, or it was not JSON format.</p>
|
FluentValidation message for nested properties <p>I have a class with complex property:</p>
<pre><code>public class A
{
public B Prop { get; set; }
}
public class B
{
public int Id { get; set; }
}
</code></pre>
<p>I've added a validator:</p>
<pre><code>public class AValidator : Abstract... | <p>You can achieve this by using custom validator for nested object:</p>
<pre><code>public class AValidator : AbstractValidator<A>
{
public AValidator()
{
RuleFor(x => x.B).NotNull().SetValidator(new BValidator());
}
class BValidator : AbstractValidator<B>
{
public B... |
How to use a JPanel as JButton? <p>I must use a swing-ui designer tool to create my UI, that only supports graphically editing JPanels. Those panels (they basically contain complex button designs) to work like a JButton. I cannot use anything other than JPanel as base class of these panels (UI editor limitation).</p>
... | <p>Here is a quick demo, to show you how you could use borders to simulate a button.</p>
<p>The demo also reacts to mouse and key events :</p>
<pre><code>import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.BorderFa... |
Goto statement with condition in C <p>How to do goto statement with if and else condition
i want from my user to make a decision if he/she wants to startover or not</p>
<pre><code> loop1 :
printf("how many dagre entering ? \n");
scanf("%d", &NumOfGrade);
for ( i = 0 ; i < NumOfGrade ; i... | <p>you did't clear input buffer, try this:</p>
<pre><code>loop1 :
printf("how many dagre entering ? \n");
scanf("%d", &NumOfGrade);
for ( i = 0 ; i < NumOfGrade ; i ++ ) {
printf("\nenter the grade\n");
scanf("%d", &grade);
totalGrade += grade ;
if ( grade <... |
Python google query with requests module, get responce in http format <p>I want to execute a google query with requests module in python. Here is my script:</p>
<pre><code>import requests
searchfor = 'test'
payload = {'q': searchfor, 'key': API_KEY, 'cx': SEARCH_ENGINE_ID}
link = 'https://www.googleapis.com/customese... | <p>The google api only supports <a href="https://developers.google.com/custom-search/json-api/v1/overview" rel="nofollow">atom/Json</a>. </p>
<p>So you have to parse the JSON to HTML.
You maybe want to check <a href="https://docs.python.org/2/library/json.html" rel="nofollow">json package</a>.</p>
<p>append something... |
Symfony 2.8 redirect to extenalURL with post data <p>How can i redirect a user to my client shop system and send POST login data to our client Shop system.</p>
<p>This is what the form looks like however its not secure as anybody can read the username and password</p>
<pre><code><form action="http://externalUrl/lo... | <p>You could use BuzzBundle (<a href="https://github.com/sensiolabs/SensioBuzzBundle" rel="nofollow">https://github.com/sensiolabs/SensioBuzzBundle</a>), a simple bundle for making http requests.</p>
|
Regarding Maintenance mode in ASP.NET Core <p>I am working on ASP.NET Core web app with MVC6. I want to implement maintenance mode in my web app such that only certain type of users are allowed to login to web app when it is under maintenance mode. For example all user EXCEPT user with role <code>user</code> are allowe... | <p>Create an action filter or a middle ware that executes the same check for every request</p>
<p>To read more about filters, check this link <a href="https://docs.asp.net/en/latest/mvc/controllers/filters.html" rel="nofollow">https://docs.asp.net/en/latest/mvc/controllers/filters.html</a> </p>
|
Errno::EACCES: Permission denied - /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-16/2.0.0/sqlite3-1.3.12/gem_make.out <p>I've been trying to start a new project of mine, but I had some issues using Rails.</p>
<p>I start by saying that I'm using macOS Sierra 10.12 and Xcode version 8.0 (8A218a).</p>
<p>When I w... | <p>"Your user account isn't allowed to install to the system Rubygems".
This means that you dont have write permissions to the gems installation dir.
Install the gems (with errors in your log) using <code>sudo gem install <gem_name></code>
or say <code>sudo bundle install</code></p>
|
how to make an event listener execute last in javascript <p>Two or more event listeners are listening to a radio button. </p>
<p>How can i make one of them execute the last? </p>
<pre><code> jQuery(document).on('change', '#payment_id_2', function(){
location.reload();
});
</code></pre>
<p>This the event listen... | <p>You can set a timeout but i think its a bad practise to let the browser wait like this. Since this is in async though i dont think there is another way of doing it.</p>
|
Multidimentional array php post <p>I created a form to input a schedule to a certain location and the location will have multiple schedule<br>
The form looks like this (I can add more input form as much as I need)</p>
<pre><code><input name="location[]" type="text">
<input name="address[]" type="text">
... | <p>You need to loop by <code>address</code> for example and insert first of all in <code>address</code> table. After that you need to get the id of the inserted row and use it when you insert in <code>schedules</code> table.</p>
<p>As you didn't try any code I just explain here how you should do and if something is no... |
Traverse a javascript object recursively and replace a value by key <p>Since JSON can not perfom functions i need to eval a JSON string by a key flag in the JSON object. I want to mutate the JSON data when it's in Object form.</p>
<p>I can't find a function/method online that can give me the full path to key based on ... | <p>You could go with <a href="http://ramdajs.com" rel="nofollow">Ramda</a>. It has built in functions that will allow you to map over an object and modify parts of the object in a completely immutable way.</p>
<p>Ramda offers <code>R.lensPath</code> that will allow you to dig into the object, and modify it as needed. ... |
Angular form submission is not working in ng-repeat loop <p>If i submit a form in ng repeat loop then form value is not passed.</p>
<pre><code><li ng-repeat="com in post.comments">{{ com.body }}
<h4>Reply</h4>
<form ng-submit="addReply()">
<textarea name="rbo... | <p>You are using a single istance of your <code>$scope.rbody</code>variable: hence, it's getting replaced on every iteration of ng-repeat.</p>
<p>To fix this issue, simply attach the <code>ng-model</code> of the form to the current ng-repeat iteration, for example:</p>
<pre><code><li ng-repeat="com in post.comment... |
How to write media queries for 1360*768 Screen? <p>Hi i am working on media queries for my site. I created media queries for 1024*768 screen size it works good. i created 1360*768 screen size also but it's not working. Can anyone suggest how this can be done? Here is what I've got so far:</p>
<pre><code>@media (min-w... | <p>Just use min-widths, when you hit the higher resolution your queries will override what came before it.</p>
<pre><code>@media (min-width: 992px) and (max-width: 1199px){ #loginrow{ padding: 135px 0; } }
@media (min-width: 1360px){ #loginrow{ padding: 135px 0; } }
</code></pre>
|
MySQL - How to select 'DISTINCT' overlapping periods (dates or number ranges) <p>Put succinctly, if a query tells me A overlaps B then I don't need it to also tell me that B also overlaps A as they overlap each other. </p>
<p>So I am trying to use a self join in sql to select just 'DISTINCT' overlaps.</p>
<p>To illus... | <p>You can just change to an inequality. And, you should also use <code>JOIN</code>:</p>
<pre><code>SELECT basetable.letter as test_letter, basetable.d1, basetable.d2,
overlaptable.letter as overlap_letter, overlaptable.d1 as overlap_d1, overlaptable.d2 as overlap_d2
FROM test basetable JOIN
test overlapt... |
Which angular 2 release version is more stable for production? <p>Which release is the most stable to use for angular 2 production app?
For example 2.1.0 is more stable than 2.0.0? Or it's the same? </p>
| <p><strong><code>Angular-2.0.2</code></strong> is stable. So, You can use it.</p>
<p>check here : <a href="https://github.com/angular/angular/blob/master/CHANGELOG.md" rel="nofollow">https://github.com/angular/angular/blob/master/CHANGELOG.md</a></p>
<p>Now, Angular2 is going thorugh - <strong><code>2.1.0- RC</code>... |
How to set long text inside editext in such a way that it must display the end of the text? <p>i m creating a browser for my self.so when i set text of edittext by passing the url of some link it shows only the beginning of the url.Ex- if the url is </p>
<p><a href="http://stackoverflow.com/howtocreateabutton/">http:... | <p>so damn simple jsut do this after setting the text:</p>
<pre><code>et.setSelection(et.getText().length());
</code></pre>
<p>i tested and it worked for me if anything wrong put a comment on this post ;)</p>
|
How to check if a file is empty avoid reading the whole file in a submit form? <p>I am using django, and in a web submit form, I want to check if a uploading file is empty, but avoid uploading or reading the whole file to get the file size, because it might be huge and take time to calculate.</p>
| <p>You are probably looking for <a href="https://docs.python.org/2/library/os.html#os.stat" rel="nofollow">os.stat</a></p>
<p>os.stat(path)</p>
<blockquote>
<p>Perform the equivalent of a stat() system call on the given path.
(This function follows symlinks; to stat a symlink use lstat().)</p>
<p>The return ... |
Gerrit Replication to gitlab failed <p>When I configure the replication from Gerrit to gitlab, the replication_log keep reporting:</p>
<pre><code>[2016-10-10 09:36:07,517] [d0b90d12] Missing repository created; retry replication to git@mo-3394cf6e0.mo.sap.corp:CI_prep_group/sprmvc-ui5.git
[2016-10-10 09:37:07,517] [d0... | <p>I solved it by create a new user in gitlab and give it full access to my project, maintain the public key which comes from gerrit server. </p>
|
ETag not received after changing get Request Parameters <p>I am trying to track a unique ID using ETags. </p>
<p>I have a java spring controller deployed - localhost:8080/testTag/hitApi.html</p>
<p>Issue is that i am receiving two different ETags for below two requests. The only difference is in get query parameters ... | <p>ETag value is based on the content on the response <a href="http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/filter/ShallowEtagHeaderFilter.html" rel="nofollow">http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/filter/ShallowEtagHeaderFilter.html</a></p>
|
Why is my instance variable (@reservation.room) nil? <p>I am currently working on a reservation system in rails 5.0.1. I have a user, room and reservation model:</p>
<p><strong>user.rb</strong></p>
<pre><code>has_many :reservations
</code></pre>
<p><strong>room.rb</strong></p>
<pre><code>has_many :reservations
</co... | <blockquote>
<p>Why is my instance variable (<code>@reservation</code>) nil?</p>
</blockquote>
<p>It's not. It is <code>@reservation.room</code> that is nil.</p>
<p>Before you ask "why is that then?", inspect your params that you post to the action.</p>
|
Jquery replace html <p>In confluence I need to change text on a page into an image
Inside of a table i have multiple values that need to be replaced by an image.
So i created following Jquery and put it into a usermacro.</p>
<pre><code><script>
AJS.toInit(function() {
AJS.$("body").html($("body").html().replace(... | <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function(){
$("#btn2").click(function(){
var a= $("#a").html();
a=a.replace('<i> with Ital... |
How is exponent calculated for subnormals in floating point <p>Suppose I have the floating point bits representation like this:</p>
<pre><code>0 0000000000 00000000000000000000000000000000000000000000000000001
</code></pre>
<p>I know that the floating point numbers with the exponent of all zeros are called subnormals... | <p>The exponent isn't calculated differently. The only difference subnormals have is a leading 0 instead of a leading 1 (so your example is equal to <code>0.0000···0001 * 2^-1022</code> instead of <code>1.0000···0001 * 2^-1022</code>.</p>
<p>If you're looking for an equivalent mantissa and exponent such that the... |
Right Aligning Of ' # ' character in C <p>So I was doing my cs50 problem sets and i got stuck in the right aligning of the characters in my output.</p>
<p>The code for my program ( mario.c) is : </p>
<pre><code>#include<stdio.h>
int main(void)
{
int height=-1;
while(height<0 || height>23)
... | <p>printf whitespace first.</p>
<pre><code>for(int i = 1; i <= height; ++i)
{
for (int k = 1; k <= height - i; ++k)
printf(" ");
for(int j = 1; j <= i + 1; ++j)
{
printf("#");
}
printf("\n");
}
</code></pre>
|
Facebook Instant articles' views not counted by Google Analytics <p>I want to share with you the following issue. I have implemented the Facebook Instant articles on my WordPress website via the Instant Articles for WP plugin. The articles show up nicely on Facebook, however, the tracking of an Instant article does not... | <p>My script looks like this: </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-html lang-html prettyprint-override"><code><figure class="op-tracker">
<iframe>
<!-- Google Analytics Code --&... |
Is it possible to install ONLY JBoss AS server tools by URL? <p>Is it possible to have an URL to install only JBoss AS tools server from Jboss Tools pack?</p>
<p>I'm preparing an instruction which I should be simple and avoid error options. I found that instruction "find Jboss tools and select JBOSS AS tools" often en... | <p>@michaldo, unfortunately, no. When you try to install plugin via link, the first thing Eclipse is looking at is <em>p2.index</em> file.
See for more information <a href="https://wiki.eclipse.org/Equinox/p2/p2_index" rel="nofollow">here</a>:</p>
<blockquote>
<p>For example the example p2.index contents below will ... |
Using Blade/Mustache templating mixing Laravel and Vue.Js <p>So I'm trying to build an application with both <strong>Laravel</strong> and <strong>VueJs</strong> but I'm stuck at one point.</p>
<p>Is it possible to use VueJs mustache templating (which is <code>{{exemple}}</code> ) without launching a Laravel error sinc... | <p>I think you can do what you're after using the <code>@{{ example }}</code> syntax that Blade allows us to use when using a JS framework inside Laravel.</p>
<p>Hope this helps! :)</p>
|
Elasticsearch - Get locale specific date in Groovy script <p>I need to update existing documents of a particular type with a new field. This new field should be set to the local day name of a date given by a datetime field in the document. The date time field is in the format yyyy-MM-dd'T'HH:mm:ss, is in UTC but has no... | <p>The Groovy code (for Java 7) you will need is going to be very similar to this:</p>
<pre><code>Date.parse("yyyy-MM-dd'T'HH:mm:ss", ctx._source.datetime, TimeZone.getTimeZone('UTC'))
.format('EEEE', TimeZone.getTimeZone("Europe/London"))
</code></pre>
|
How implement join queries in parse.com javascript? <p>I am new on parse server ( parse.com ). I have two classes "students_records" and "students_fee". I am storing fee records in class "students_fee" with objectId of "students_records" in column "student_id". Now I want to collect records from both classes by one que... | <p>Since parse use MongoDB (NoSQL) behind the scenes there is no real "join". What you can do is to create a array relationship from students to records and then use <strong>include</strong> in your query in order to include all the <strong>records</strong> under a student. </p>
<p>You can read more about it <a href="... |
Devise | autogenerated user password does not show up in email sent <p>I am trying to set up an email where a referrer will fill in some information in a form about a referee. The referee will receive an email to subscribe to my services with 2 different messages depending if he is already existing in the database or n... | <p>Instead of sending them an email with a password (not a best practice), why not send them a link where they can create their own password on your secure site?</p>
<p>The below example will create a reset link for them to click and give them a temporary password so that devise is happy, and then send an email with t... |
Activity not destroying completely <p>I have an application with the following activities:</p>
<pre><code>A->B->C
</code></pre>
<p>On <code>C</code> I am using the following code to play an mp3 file in loop when my web service returns true (which we check for periodically):</p>
<pre><code>void PlayBeepLoop()
{... | <p>Remove super.onBackPressed() and add @Override above your onBackPressed() method.</p>
|
JUnit assertThat: check that Object equals String <p>I have <code>Map</code> declared as following:</p>
<pre><code>Map<String, Object> data
</code></pre>
<p>I put a <code>String</code> in it and verify its value like this:</p>
<pre><code>assertEquals("value", data.get("key"));
</code></pre>
<p>Now, I'd like t... | <p>The "more assertThat" way of doing things would be:</p>
<pre><code>Map<String, Object> expectedData = Collections.singletonMap("key", "value");
asssertThat(data, is(expectedData));
</code></pre>
<p>Please note:</p>
<ul>
<li>Maybe you need type hints for the call to singletonMap</li>
<li>Besides the <em>is<... |
chef recipe - how to add a timeout to ::File.exists? in ruby_block <p>Consider this code:</p>
<pre><code>ruby_block 'wait for tomcat' do
block do
true until ::File.exists?('/usr/share/tomcat/webapps/system/WEB-INF')
end
end
</code></pre>
<p>How can I add a <code>timeout</code>, so that in the case that the de... | <p>Just using ruby (untested, I may have forgot something there):</p>
<pre><code>ruby_block 'wait for tomcat' do
block do
iter=0
until ::File.exists?('/usr/share/tomcat/webapps/system/WEB-INF') || iter > 5 do
sleep 6
iter++
end
raise "Timeout waiting for tomcat startup" unless iter <... |
Extract parent from a filepath <p>I would like to decompose a GCS URI of form :</p>
<pre><code>gs://bucket/folder1/folder2/test.csv
</code></pre>
<p>I need these capturing groups : "bucket" and "folder1/folder2/test.csv"</p>
<p>The problem is that I do not know how to exclude / from a group of any character.</p>
<p... | <p>Here is a sample in JS to match your require, another language should the same.</p>
<pre><code>/^gs:\/\/(.+?)\/(.+)$/
</code></pre>
<p>Check result <a href="http://scriptular.com/#%5Egs%3A%5C%2F%5C%2F(.%2B%3F)%5C%2F(.%2B)%24%7C%7C%7C%7C%7C%7C%7C%7C%5B%22gs%3A%2F%2Fbucket%2Ffolder1%2Ffolder2%2Ftest.csv%22%5D" rel="... |
Syntax error near END keyword? <p>I am defining this SQL Server SP, but I am getting the following error message, which is not very detailed:</p>
<p><code>Incorrect syntax near the keyword 'end'. 32 8</code></p>
<p>I am closing all <code>BEGIN</code> with an <code>END</code>, therefore I can't get it why is the en... | <p>From <a href="https://msdn.microsoft.com/en-us/library/ms190487.aspx" rel="nofollow"><strong>MSDN</strong></a></p>
<pre><code>BEGIN
{ sql_statement | statement_block }
END
</code></pre>
<p><em>{ sql_statement | statement_block }</em></p>
<blockquote>
<p>Is any valid Transact-SQL statement or statemen... |
aiohttp how to log access log? <p>I am trying to get a basic logger for aiohttp working, but there are simply no log messages being logged. Note_ logging custom messages works as expected.</p>
<pre><code>async def main_page(request: web.Request):
return "hello world"
def setup_routes(app):
app.router.add_get(... | <p><code>LOG_FORMAT</code> should be "%s" if any.
<code>'%a %l %u %t "%r" %s %b "%{Referrer}i" "%{User-Agent}i"'</code> is a valid parameter for <code>.make_handler(access_log_format=...)</code> call, not <code>logging.Formatter</code>.</p>
<p>As first step I suggest setting up root logger and after that going down to... |
Spring MVC 4 controllers not called <p>EDIT: I realized I made a mistake in my <code>ComponentScan</code> as a lot of commenters pointed out, I changed it but it is still not working (still 404). </p>
<p>I have a project and I'm using all annotations-based configuration. Here is the configuration files:</p>
<p><code>... | <p>Can you tell the name of the package to which 'AuthorController' belongs ? I think issue is with <code>@ComponentScan(basePackages = "src")</code>. Here you should add package name of the controller classes.</p>
<pre><code>@ComponentScan(basePackages = "com.sample.app")
@ComponentScan(basePackages = "com.sample.*... |
Plotting decision tree, graphvizm pydotplus <p>I'm following the tutorial for decision tree on <a href="http://scikit-learn.org/stable/modules/tree.html" rel="nofollow">scikit</a> documentation.
I have <code>pydotplus 2.0.2</code> but it is telling me that it does not have <code>write</code> method - error below. I've... | <p>The problem is that you are setting the parameter <code>out_file' to</code>None<code>.
If you look at the [documentation][1], if you set it at</code>None<code>it returns the</code>string<code>file directly and does not create a file. And of course a</code>string` does not have a 'write' method.</p>
<p>Therefore, do... |
Seaching big files using list in Python - How can improve the speed? <p>I have a folder with 300+ .txt files with total size of 15GB+. These files contain tweets. Each line is a different tweet. I have a list of keywords I'd like to search the tweets for. I have created a script that searches each line of every file fo... | <h2>1) External library</h2>
<p>If you're willing to lean on external libraries (and time to execute is more important than the one-off time cost to install), you might be able to gain some speed by loading each file into a simple Pandas DataFrame and performing the keyword search as a vector operation. To get the mat... |
Cannot resolve symbol activity_is_not_in_background? <p>activity_is_not_in_background is showing red line in if statement
i just follow this tutorial <a href="http://stackoverflow.com/questions/19145061/how-can-i-create-a-thread-that-running-on-background-on-android">How can i create a Thread that running on backgroun... | <p>You need to initiate the variable first
e.g.
boolean activity_is_not_in_background = true;</p>
<p>you will need to make this variable false, when you start another activity. If you still did not get it, u may comment and I will get back to you ASAP.</p>
|
LIRC mode2 waits for continuous user input, in Raspberry pi I am building a universal remote using java. looking for receiving input (RAW). <p>I am looking for a solution in java for recording inputs for LIRC codes of any remote. </p>
<p>i have tried</p>
<pre><code> Process p = Runtime.getRuntime().exec("mode2 [drive... | <p>First of all there is already at least one Java application which can record LIRC codes for any remote: IrScrutinizer at <a href="http://www.harctoolbox.org/IrScrutinizer.html" rel="nofollow">http://www.harctoolbox.org/IrScrutinizer.html</a></p>
<p>That said, you did not mention the lirc version used. IIRC, older v... |
Fade out elements then fade in selected <p>I've been trying to write a function that fades out all of my elements and then fades in the selected one only I can't get it working for some reason. </p>
<p>I've used other articles on SO only it hasn't seemed to have helped.</p>
<p>Can anybody point me int he right direct... | <p>The problem is that you're not using the right selector.</p>
<p>This uses the exact same code but fixes your problem which is the missing selector which was the <code>.</code> before the variable <code>item</code></p>
<p>Update <a href="https://jsfiddle.net/mL329edr/2/" rel="nofollow">JSFiddle</a></p>
<p><div cla... |
Create a custom URL and outputting HTML form data <p>For my first Flask project I wanted to create a basic Flask app using Riot Game's API for League of Legends. I've got all the processing of API working but I'm having trouble going about outputting it.</p>
<p>I take the input from a form on one page.</p>
<pre><code... | <p>You should post the error as well.</p>
<p>In a quick looks this should be fixed:</p>
<pre><code>@app.route('/currentgame/<string:region>/<string:name>', methods=['POST'])
def current_game_output(region, name):
region = request.form['region']
summoner_name = request.form['summoner_name']
api... |
How to create html with link-to property inside custom jquery plugin? <p>I have a custom jquery plugin that use to create drop down html for a search box.
Inside that, html is created as follows.</p>
<pre><code>$.each(stack, function (i, stackItem) {
var url = _getItemURL(stackItem, lang);
... | <p>First, I would recommend you to think if you really need that jQuery plugin or could go with a plain ember solution. There are some pretty fancy addons like <a href="http://www.ember-power-select.com" rel="nofollow">ember-power-select</a>.</p>
<p>But if you really want to do that you need to understand that a <code... |
Updated Android Studio, receiving DuplicateFileException <p>I just updated Android Studio and I cannot build my app after doing so. I receive an exception looking like this:</p>
<pre><code>Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformE... | <p>Just Remove:</p>
<pre><code>compile fileTree(include: ['*.jar'], dir: 'libs')
</code></pre>
<p>from</p>
<pre><code>dependencies {}
</code></pre>
<p>The <code>jackson-core-2.2.2.jar</code>is already present in your <code>libs/</code> but another dependency is trying to add it again externally. </p>
|
Regex may contains a group or not <p>I have multiple string to parse. This text could be multiline or not.
Also, some part may not be exist. I have some samples to understand what I need.</p>
<p>Samples;<br>
1-singleline) 00026A123456123456789012741852<br>
2-multiline) 00030A789ABC210987654321258369X123</p>
<p>X ... | <p>If there can be only 1 <code>X</code> separating the groups, or it is the first <code>X</code> that always separates the groups, you may use</p>
<pre><code>^(?<group1>.*?)(?:X(?<group2>.*))?$
</code></pre>
<p>See the <a href="https://regex101.com/r/hpScrj/3" rel="nofollow">regex demo</a>.</p>
<p>The f... |
Hive: external partitioned table from Avro <p>Is it possible to create an external table in Hive based on Avro files that also add columns for the directory partitions:</p>
<p>Let's say I have data stored in <code>/data/demo/dt=2016-02-01</code> and so on. I then tried the following but I get 0 rows when I select from... | <p>Since the partition name is in your case <code>dt</code>, not <code>date</code>, you have to use <code>PARTITIONED BY (dt string)</code>, and then you still need to add the partitions to the metastore :</p>
<pre><code>ALTER TABLE demo ADD PARTITION (dt='2016-02-01')
</code></pre>
<p>If you have several partitions,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.