input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Angular 2 : @ViewChildren for recursive component <p>I have a recursive component which displays des tag a</p>
<p>First , there is the parent component
- html</p>
<pre><code><div class=" suggestions" style="display : inline-block;" tabindex=-1 #autocompleteDiv>
<span style="width: auto;cursor: pointer;p... | <p><code>@ViewChildren()</code> only works for direct children.</p>
<p>A workaround would be a shared service where each <code>treeNode</code> registers itself when it is created and removes itself in <code>ngOnDestroy</code>.</p>
<p>The service can't be registered on a <code>treeNode</code> otherwise each <code>tree... |
Excel formula to determine distinct list and sort the values <p>I have a spreadsheet where users enter various year-end data. Each year may have multiple records. Let's say column A contains the year. Sometimes the users don't enter the years in order (e.g. 2015, 2014, 2013, etc.) and sometimes there are blank spaces b... | <p>In <strong>C1</strong> enter:</p>
<pre><code>=MAX(A:A)
</code></pre>
<p>and in <strong>C2</strong> enter the array formula:</p>
<pre><code>=MAX(IF(A:A<C1,A:A))
</code></pre>
<p>and copy down.</p>
<p><a href="http://i.stack.imgur.com/A6Lzo.png" rel="nofollow"><img src="http://i.stack.imgur.com/A6Lzo.png" alt=... |
How to bind the datacontext of a tabcontrol content to an instance of an viewmodel in a observablecollection <p>I want to bind the content of my <code>TabControl</code> to an instance of my <code>StepViewModel</code> in a <code>ObservableCollection</code> Steps.</p>
<p>My ProcessViewModel:</p>
<pre><code>pubic class ... | <p>It looks like there could be a few small issues with the RelativeSource on your DataContext binding for the StepView. Since the template is not part of the visual tree, I don't think you can use FindAncestor. You can use a StaticResource as a pointer to your main DataContext (eg <a href="http://www.codeproject.com/A... |
Sheet API invalid index 1, size is 1 <p>I have this error when i try my code :</p>
<pre><code> private List<String> getDataFromApi() throws IOException {
String spreadsheetId = "1UV816hTkiUo6NLrsqAKgG0VjnSvKwcBB5-iZGX-V8E0";
String range = "Feuille 1!B3:C";
List<String> results = ne... | <p>Ok Google Sheet Api fail reading if one rows is blank, and consider the size as wrong.</p>
<p>Still dont know how to fix this, but this is why i have this error, just have to fill all my grid. (the photo is just a part of my whole grid)</p>
|
How to pass angular data to circular-progress? <p>I have these code to pass data from controller to view:</p>
<pre><code> <div class="subject-name subject-eng">
{{SubjectData['eng']['subject']}} <!-- Works -->
<br/>
... | <p>Thanks to <a href="http://stackoverflow.com/users/5334137/leroydev">leroydev</a>, you save my day. I found the solution by modify the codes to be like this</p>
<pre><code> <circular-progress
value = "SubjectData.eng.value" <!-- Works perfectly! -->
ma... |
Implementing an equivalent of C# TimeSpan in Microsoft Bond <p>Is there an equivalent of C#'s <a href="https://msdn.microsoft.com/en-us/library/system.timespan(v=vs.110).aspx" rel="nofollow"><code>TimeSpan</code></a> in Microsoft Bond?</p>
| <p>There is no builtin type for C#'s <code>TimeSpan</code>, but you can use <a href="https://microsoft.github.io/bond/manual/bond_cs.html#custom-type-mappings" rel="nofollow">custom type mapping</a> to achieve the same result. See this official <a href="https://github.com/Microsoft/bond/tree/master/examples/cs/core/dat... |
What is the apt Oracle data type to store ISOYearMonth? <p>I searched for suitable Oracle data type to store ISOYearMonth. But come across Date, TimeStamp data types to store Date with time with precision variations. Please guide me in selecting apt Oracle data type to store ISOYearMonth.</p>
| <p>I think use <code>DATE</code> type will be most suitable.</p>
<p>You will need truncate dates using <code>TRUNC(my_date, 'MONTH')</code> when you will insert data into table.
In this case you don't need any additional conversion when you will select data for comparisons or arithmetic operations</p>
<p>Of course,... |
Massive idle time before loading a page on Vagrant development site <p>A file with some PHP code alone works well and fast, same for a file with MySQL connection queries. From what I can see everything seems to work well, except when trying to load any page in Magento. First load takes over 60 seconds, then Magento cac... | <p>Hard to say for sure if this is the issue in your case, but I've recently been working on a similar setup to yours and found that changing <code>v.cpus = 4</code> to <code>v.cpus = 1</code> in the Vagrantfile massively improved Magento page load times. You'd think more cpu cores would be faster, but It turns out Vi... |
Yeoman Get Options <p>I wrote this code:</p>
<pre><code>this.option('username', {
alias: 'u',
name: 'Username',
desc: 'A username used for Marketplace authentication',
type: String,
required: true
});
console.log(this.options.username);
</code></pre>
<p>I input the below in my terminal:</p>
<pre... | <p><code>yo</code> is using <a href="https://github.com/sindresorhus/meow" rel="nofollow">meow</a> to parse command line input. I think you need a double <code>--</code> for options input. Try with <code>yo test --username MrZerg</code></p>
|
how to detect bottleneck from response time performance testing <p>Response time for a particular transaction increased between two runs of jmeter tests. How to detect the bottleneck in this case?</p>
| <p>Well, what you ask could fill volumes, for each architectural platform and each type of software you have in use. There are some rules of thumb that can distill the problem you have.</p>
<p>Ultimately scalability is a problem of resources and their use in the machine, particularly finite resources...when you alloc... |
React-Native Build Issues Android for Mac <p>I'm getting the following terminal error after running <code>react-native run-android</code></p>
<p>Error message: <code>failed to find target with hash string 'android-23' in: /usr/local/opt/android-sdk</code></p>
<p>Here are the packages I've installed with android manag... | <p>The android build tools are separate from the platform SDK. You're probably missing the SDK Platform install for Android API level 23. Scroll down and install it.</p>
|
Filtering Onedrive items by lastModifiedDatetime <p>I try to filter OneDrive items from within the Microsoft Graph endpoint, by lastModifiedDatetime property.</p>
<p>Something like that :</p>
<pre><code>https://graph.microsoft.com/beta/me/drive/special/photos/children?$top=3&$orderBy=lastModifiedDatetime
</code><... | <p>Filtering by lastModifiedDateTime is not supported for OneDrive for Business. It is supported for OneDrive Personal. The limitation is not specific to the Microsoft Graph endpoint. There is a note about it in the referenced documentation page.</p>
|
How can I minimise what is installed by Git for Windows? <p>The git for Windows client appears to install an entire mingw distribution onto my machine consuming over 500MB of space.</p>
<p>This is nearly twice as large as the installation of Gimp for Windows!</p>
<p>I already have cygwin, vim and all of the other uti... | <p>Two things are in play here:</p>
<ul>
<li><p>Whatever tool you have used to calculate the space occupied by
the GfW install did it wrong; here's why.</p>
<p>Due to historical reasons many "supplementary" Git executable files
are now just "alternative names" for the main executable file, <code>git.exe</code>.</p>
... |
Compare boolean values in PostgreSQL 9.3 json objects <p>Is there any other way to match a boolean value from a PostgreSQL (<strong>version 9.3</strong>) json object without converting it to string?</p>
<p>What I mean is:
The table contains the following object in its jsoncolumn column:</p>
<pre><code>'{"path":"mypat... | <p>Here're all the valid combinations to validate json(b) boolean:</p>
<pre><code>-- This works only with jsonb, not with json because in Postgres json type is just a string.
SELECT $${ "exists": true }$$::jsonb -> 'exists' = 'true';
-[ RECORD 1 ]
?column? | t
-- All the following works with regular json as well w... |
PL SQL: Connect string and number WITHOUT Concat but '+' <p>Is there a way in PL SQL to write</p>
<pre><code>Output('Variable a:' + var_a + '; Variable b: ' + var_b);
</code></pre>
<p>instead of this long silly code:</p>
<pre><code>Output(CONCAT(CONCAT(CONCAT("Variable a', var_a), '; Variable b'), var_b));
</code></... | <p>PL/SQL uses the same operator as standard SQL to concatenate strings: <code>||</code></p>
<pre><code>Output('Variable a:' || var_a || '; Variable b: ' || var_b);
^ -- the double quotes were also wrong
</code></pre>
|
Custom 404 error page for controllers <p>I have implemented codeigniters 404 override , it works fine for incorrect parameters but when you type in an incorrect controller it goes back to the default 404 page. It is probably a simple solution but cannot seem to find the answer. </p>
| <p>When you need to set custom 404 over ride follow the <a href="http://www.codeigniter.com/user_guide/general/styleguide.html#file-naming" rel="nofollow">style guide</a></p>
<pre><code>application > controllers > Error_404.php
</code></pre>
<p>Filename: Error_404.php</p>
<pre><code>class Error_404 extends CI_... |
CQEngine Optimize for Small DataSets <p>I have an application which needs to apply flexible queries against millions of smaller collections ranging in size from 10 to 10000 items per collection. CQEngine is working great in terms of providing the flexibility to query these collections but is much slower than the previ... | <p>Obviously it depends on your queries, but yes look at your indexes you're using. Navigable sounds ok for timestamp, although you could do a compound on the parts of the timestamp (year then month then day .. etc)</p>
<p>Determine the <a href="https://en.wikipedia.org/wiki/Cardinality_(SQL_statements)" rel="nofollo... |
How to get bigger image in magento? <p>I am using magento rwd theme with a extension - for selected product widget.</p>
<p>The problem I am not able to increase the size of the image.
the relevant code is like this:</p>
<pre><code><?php
$products = $this->getProductCollection();?>
<?php if ($products &a... | <p>You have to set constrainOnly to true on the image helper before resizing:</p>
<pre><code>$this->helper('catalog/image')
->init($product, 'image')
->constrainOnly(true)
->resize(300,400);
</code></pre>
<p>From the PHPDoc of the method:</p>
<pre><code>Guarantee, that image picture will not ... |
Moq not resolving ICollection reference <p>I am using Moq.4.2.1507.0118 and I'm having a problem that I have not seen before. The situation is that I have two classes in my model (A and B) with a one to many relationship. For example:</p>
<pre><code>[Table("A")]
public partial class A
{
public A()
{
t... | <p>You need to instantiate the collection to the A object before injecting the context to the class.</p>
<pre><code> [TestMethod]
public void SomeTest()
{
var theAs = new List<A>
{
new A{ AId=1, Name="test" }
};
var theBs= new List<B>
{
... |
jQuery/CSS bar percentage not working in rails app <p>I've forked a bar percentage, and it works well in <a href="http://codepen.io/mayalin/pen/YGqXrz" rel="nofollow">codepen</a>. When I paste the code snippet html/css/js into my rails app, it doesn't work. There's no animation, no data-percentage display. </p>
<p><a ... | <p>My friend add <code>$(function() {})</code> in the js file, and it works.</p>
<p>My current js file:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$(function() {
$(... |
get view method give null pointer exception in fragment? <p>This is my Adapter Class :-</p>
<pre><code>public class PgListAdapter extends RecyclerView.Adapter<PgListAdapter.FaqViewHolder> {
private Context mContext;
private List<Faq> faqList1;
private ValueAnimator mAnimator;
private int u... | <p>What is PgList? It's a view? Because you need to identify it with an id.</p>
<p>Edit: Normally dialog should close automatically when you press back button, if you didn't override <code>onBackPressed()</code> method from activity.
Anyway, you could implement your own listener for dialog, but for the dialog, not ent... |
Grep data found in grep <p>I have a fairly simple grep that looks something like this:</p>
<pre><code>grep -ri "logout.htm" -n -B 2
</code></pre>
<p>How can I grep the results of that and only display the 2 lines before if it contains "redirect.htm" before the logout.htm?</p>
<pre><code>Results:
Display this:
1.ht... | <p>Well, it's not exclusively grep, but sed could do this:</p>
<pre><code>sed "/Display this/,/Don't display this/!d" test.txt | sed '$d'
</code></pre>
|
MongoDB - How to $inc in a double nested array <p>I'm trying to increment <code>c</code> every time a user choose a label.</p>
<p>My sample dataset has two nested arrays:</p>
<pre><code>{
"id": 123,
"labels": [
{
"label": "orange",
"hitCount": 2,
"hits": [
... | <p>I suggest you to change you data model to:</p>
<pre><code>{
"id": 123,
"labels": [
{
"label": "orange",
"hitCount": 2,
"hits": {
"bob": 2
}
},
{
"label": "red",
"hitCount": 6,
"hits": {
... |
Show a Image on Xamarin from byte[] <p>I saw many examples here and I am trying to adapt to my code! But, when the image appears, it comes blank...
I just want to show the image after the button click. Is not to save on the smartphone.</p>
<p>The .cs code:</p>
<pre><code>ApiCall apiCallFoto = new ApiCall();
ImageSou... | <p>Your BindingContext needs to be <code>this</code> or you have to bind to <code>.</code> </p>
<pre><code>public partial class FotoEnvolvido : ContentPage
{
public ImageSource Imagem {get; set; }
public FotoEnvolvido(ImageSource imagem)
{
InitializeComponent();
Imagem = imagem;
Bi... |
Android: How get media player if prepared? <p>I use <code>media player</code></p>
<p>I want if <code>media player</code> is prepared , play button is visible and if not prepared not visible this button</p>
| <p>Just use <strong><a href="https://developer.android.com/reference/android/media/MediaPlayer.OnPreparedListener.html" rel="nofollow">MediaPlayer.OnPreparedListener</a></strong></p>
<blockquote>
<p>Interface definition for a callback to be invoked when the media
source is ready for playback.</p>
</blockquote>
<h... |
Provide static IP to docker containers via docker-compose <p>I'm trying to provide static IP address to containers, I understand that I have to create a custom network. I create it and the bridge interface is up on the host machine (ubuntu 16.x). The containers get IP from this subnet but not the static I provided.</p>... | <p>Note that I don't recommend a fixed IP for containers in Docker unless you're doing something that allows routing from outside to the inside of your container network (e.g. macvlan). DNS is already there for service discovery inside of the container network and supports container scaling. And outside the container n... |
Program design of a timetable creator <p>For fun, I want to write a timetable creator in python for schools. I.e. a program where schools can input their rooms, teachers, classes and subjects and some preferences and which will output a timetable for each class/teacher/room. I don't have a problem with the logic behind... | <p>One difficult part of this problem is that there are numerous relations that make up a schedule. I would think very carefully about how a teacher T teaches a class and she teaches it in room X at 1:30 pm.</p>
<p>For example, in your program, you may want to know when room X is available. To do this, you will want t... |
Flink TimeStamp, adding calculated field in a stream <p>i have an out-of-ordered stream and i need to order them and sum a field value with the same field in the next frame. My code:</p>
<pre><code>env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);
DataStream<Message> messageswithTS = messages.assign... | <p>Flink does <em>not</em> automatically sort an event-time stream on event-time and does also <em>not</em> provide an operator to sort an event-time stream (which would only possible on the event-time, i.e., to convert an out-of-order stream into an in-order stream). </p>
<p>However, you can implement such an operato... |
In Django, how can I link a static file from within an extended HTML template? <p>I haven't found anything in the Django Docs or any Stack Overflow solutions to this same problem.</p>
<p>Say I have a html file like the following:</p>
<pre><code>{% extends 'base.html' %}
{% block cssfile %}
<!-- css link goes here ... | <p>You need to put <code>{% load staticfiles %}</code> before use <code>{% static %}</code></p>
|
Server upload size limit but not php.ini <p>I use a Linux VPS server. All sites have the same upload limit of 188KB. On all wordpress sites if I upload an image over 188KB I get "Failed to write file to disk."</p>
<p>I used a plugin to download images from external URLs and it just crops the image once it reaches the ... | <p>Okay, so after some thinking and minor researching, I've found a few things:</p>
<p><strong>Disk Full?</strong> <br/>
Make sure that your Disk has some space!</p>
<p><strong>Correct File Permissions</strong> <br/>
You or someone else might have done something to the file permissions, or this could have been done b... |
Cannot add Xamarin.Facebook.AudienceNetwork.Android package <p>Project builds in DEBUG but cannot build in RELEASE without AudienceNetwork package.</p>
<p>Adding Xamarin.Facebook.AudienceNetwork.Android...</p>
<p>Attempting to resolve dependency 'Xamarin.Android.Support.v4 (= 23.4.0)'.</p>
<p>Updating 'Xamarin.Andro... | <p>You will need to take a gander at the dependencies of the packages you're trying to install. For example with the NuGet package you're trying to install:</p>
<p>Xamarin.Facebook.AudienceNetwork.Android (<a href="https://www.nuget.org/packages/Xamarin.Facebook.AudienceNetwork.Android/" rel="nofollow">https://www.nug... |
List Wordpress Terms Including Parent <p>I'm having issues listing terms of a custom taxonomy. Actually I can list the terms that contain posts with their parents. </p>
<p>Here's an example:
I have products in </p>
<p><strong>Boots</strong></p>
<p>-Kid's</p>
<p>-Men's</p>
<p>-Women's</p>
<p><strong>Men</strong><... | <p>I have just go this little snippet of an answer from the <a href="http://wordpress.stackexchange.com/questions/158787/listing-child-terms-of-parent-term">WordPress StackExchange</a>.</p>
<p>I think this is what you want:-</p>
<pre><code><?php
$queried_object = get_queried_object('term');
$term_parent = $quer... |
Hyperledger SDK for Java chaincode (shim-client-1.0) <p>I tried to compile chaincode sample and write my own one (<a href="https://github.com/hyperledger/fabric/tree/master/examples/chaincode/java/SimpleSample" rel="nofollow">https://github.com/hyperledger/fabric/tree/master/examples/chaincode/java/SimpleSample</a>)</p... | <p>I hope that âshim-client-1.0.jarâ will be added to maven repository soon, nevertheless you can try to compile it using source code in âgithub.com/hyperledger/fabric/core/chaincode/shim/javaâ.</p>
<pre><code>gradle build
</code></pre>
<p>and "shim-client-1.0.jar" will be available in github.com/hyperledger/... |
Query to show per week, per day, per hour <p>I'm working in PLSQL, trying to find event counts for a given week, broken down by day and hour.</p>
<p>Essentially I want to plug in the week and then have the count of events such that I can easily discern counts >1M per day AND 300k per hour (=GOLD), 500k per day and 200... | <p>Let me know if it helps:</p>
<pre><code>SELECT T.*,
CASE WHEN CNT_PER_DAY > ... AND CNT_PER_HOUR > ... THEN 'GOLD'
WHEN CNT_PER_DAY > ... AND CNT_PER_HOUR > ... THEN 'SILVER'
WHEN CNT_PER_DAY > ... AND CNT_PER_HOUR > ... 'BRONZE'
ELSE ...
END CATE... |
Android WebView "Cannot read property 'getAttribute' of undefined" <p>I am trying to run a web page in a WebView. The page that I am loading has javascript in it, and it works on my desktop browser but doesn't work in the android emulator. In the emulator, I get this error:</p>
<blockquote>
<p>09-13 18:29:18.496 320... | <p>Try replacing this</p>
<p><code>window.JSInterface.playGame(items[i].getAttribute('href'));</code> </p>
<p>with this</p>
<pre><code>window.JSInterface.playGame(item.getAttribute('href'));
</code></pre>
|
Signin display information in url <p>I have been using this login / registration code with a different website before but when adding it to my new one it just display the information in the url (<code>/signin?username=&password=</code>) I believe that everything is more or less like the old website other than css a... | <p>You typo'ed 'method' in </p>
<pre><code> <form mathod="post" action="" style="margin:20px;">
</code></pre>
<p>The default type is GET which would result in the form parameters being in the URL.</p>
|
Ionic app starter project hangs on NPM install phase <p>When I'm trying to create a simple ionic app with 'ionic start' command, I see that ionic downloads a base app and the template indicated, but then I see 'Installing npm packages...' and it that never ends it's process (I have waited hours).<br>
Ionic creates the ... | <p>You must update your ionic to beta version using:</p>
<blockquote>
<p>npm install -g ionic@beta</p>
</blockquote>
|
Random forest bootstrap training and forest generation <p>I have a huge training data for random forest (dim: 47600811*9). I want to take multiple (let's say 1000) bootstrapped sample of dimension 10000*9 (taking 9000 negative class and 1000 positive class datapoints in each run) and iteratively generate trees for all ... | <p>Something like this would work</p>
<pre><code># Replicate expression 1000 times, store output of each replication in a list
# Find indices of class B and sample 9000 times with replacement
# Do the same 1000 times for class U. Combine the two vectors of indices
i = replicate(1000, {c(sample(which(trainData$class =... |
Is it safe to store a password in the SecurityContext in a custom Authentication implementation? <p>I have created a custom <code>AuthenticationProvider</code>, so I have to return an <code>Authentication</code> implementation with the username and password of the user (for example <code>UsernamePasswordAuthenticationT... | <p>I think its not safe to store password in security conext as the security context is accessible across the application. i recommend we use the password from the UsernamePasswordAuthenticationToken to authenticate and get rid of it.</p>
|
Count the String occurance by extracting the data from log file in specified range of time <p>I am new to shell scripting and my problem is:-</p>
<p>I wanted to get the count of a string that is occurring in the log file. Since the log file always get updated in every seconds so I need the data of previous 15 minute o... | <p>I can do it by using the following the command:-</p>
<pre><code>grep -i "Hey, How R U" /path/to/file | wc -l
</code></pre>
<p>but this command will show the output from the whole file but I just want the output of previous 15 mins...</p>
|
how to make the boxplots with dot points and labels? <p>I have a dataframe as below</p>
<pre><code> G1 G2 G3 G4 group
S_1 0 269.067 0.0817233 243.22 N
S_2 0 244.785 0.0451406 182.981 N
S_3 0 343.667 0.0311259 351.329 N
S_4 0 436.447 0.0514887 371.236 N
S_5 0 324.709 0 293.31... | <p>with facet_wrap:</p>
<pre><code>head(df)
G1 G2 G3 G4 group
S_1 0 269.067 0.0817233 243.220 N
S_2 0 244.785 0.0451406 182.981 N
S_3 0 343.667 0.0311259 351.329 N
S_4 0 436.447 0.0514887 371.236 N
S_5 0 324.709 0.0000000 293.310 N
S_6 0 340.246 0.0951976 393.162 N
... |
ASP.Net C# AjaxControlToolkit timer malfunction with UpdatePanel <p>On a website (using a master page), I use the timer with an UpdatePanel in this way:</p>
<pre><code><asp:Timer ID="Timer1" runat="server" Enabled="true" OnTick="Timer1_Tick" Interval="2"></asp:Timer>
<asp:UpdatePanel ID="UpdatePanel1" r... | <p>I updated AjaxControlToolKit from v7 to v16, now developed by DevExpress and now it works!</p>
|
How to generate pdf with graphs and tables? <p>I have an html page with reports on graphs and tables. Graphs - morris.js and Tables - bootstrapTable(library). I need to generate pdf file on php and allow users to download it from server. How can I do that?</p>
| <p>Try the fpdf library, it helps with creating tables, not sure about graphs</p>
<p><a href="http://www.fpdf.org/" rel="nofollow">http://www.fpdf.org/</a></p>
|
Parser: Enforcing unicity when order is not known <p>Using Attoparsec, I am trying to match strings containing exactly 1 'x', 1 'y', and 1 'z', and any number of 'a', 'b', or 'c', without any constraint on the order of each char.</p>
<p>For instance, "abbb<strong>z</strong>ac<strong>y</strong>aaa<strong>x</strong>cba"... | <p>There are a couple of issues with your code:</p>
<p>Firstly, it doesn't enforce exactly one <code>x</code>, <code>y</code> and <code>z</code> in the string. For instance, it will accept <code>xxx\n</code></p>
<p>Secondly, it's very inefficient. Consider how <code>xyz1</code> is parsed when given the string <code>a... |
Spark DataFrames when udf functions do not accept large enough input variables <p>I am preparing a DataFrame with an id and a vector of my features to be used later for doing predictions. I do a groupBy on my dataframe, and in my groupBy I am merging couple of columns as lists into a new column:</p>
<pre><code>def mer... | <p>User defined functions are defined for up to 22 parameters. For example</p>
<pre><code>val dummy = ((
x0: Int, x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int,
x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int,
x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: I... |
How to find that upload is completed - Node Express <p>In Node Express, I am reading a locally saved zip file and sending it to a Java servlet using request module.</p>
<pre><code>var req = require('request');
//Define a read stream from our source zip file
var source = fs.createReadStream('abc.zip');
//Send our data... | <p>I think this is the same as asked here: <a href="https://stackoverflow.com/questions/14962085/createreadstream-pipe-callback">createReadStream().pipe() Callback</a>
For your case it should work like:</p>
<pre><code>source.on('close', function(){
fs.unlink('abc.zip');
});
</code></pre>
<p>Meaning you just have to... |
unauthorized in the gcm <p><code>CURL --header "Authorization: key=XXXXXXXXX" --header "Content-Type: application/json" https://android.googleapis.com/gcm/send -d "{\"registration_ids\":[\"XXXXXXXX\"]}"</code></p>
<p>this is my request,
im trying to send this from my cmd,
with the api key i created in google console ... | <p>Navigate to the <code>https://console.developers.google.com/apis/credentials?project=<project-name></code></p>
<p>then pick the server key you created. At the bottom of the page you could add whitelisted IP's/ranges.</p>
|
Did not find exact example <p>I am getting this error:</p>
<blockquote>
<p>Msg 102, Level 15, State 1, Line 9 Incorrect syntax near '+'.</p>
</blockquote>
<p>When executing the following code:</p>
<pre><code>DECLARE @Source nVARCHAR(30)
set @source = 'Srce.srce'
select @Source
--drop table #temp1
select ... | <p>You can not pass the name of database through variable.
If you want to forward the name of the database using the variable you have to use dynamic SQL.</p>
|
Less: class then node type <p>I have two <code><p></code> and one <code><button></code> that extend a certain <code>class</code> named <code>test</code>. I want to know if it is possible to add certain style rules to <code>.test</code> and then specific rules for the element type?</p>
<p>I thought of somet... | <p>If I understand correctly you should use <code>:extend</code>:</p>
<p><strong>LESS:</strong></p>
<pre><code>.test {
font-weight: bold;
color: blue;
}
p:extend(.test) {
font-size: 26px;
}
button:extend(.test){
font-size: 20px;
}
</code></pre>
<p><strong>Output:</strong></p>
<pre><code>.test, p, button {... |
Actor Method Start/Stop log | Add additional Information <p>For azure actor services, Actor Method Start Stop logs in Diagnostics window, which looks like below.</p>
<p>How can i add some additional detail such as a Correlation Id every time a method is called ?</p>
<pre><code>{
"Timestamp": "2016-09-14T19:46:40.99... | <p>In order to log custom data for every Actor operation, you can use these methods:</p>
<pre><code>protected override Task OnPreActorMethodAsync(ActorMethodContext c)
protected override Task OnPostActorMethodAsync(ActorMethodContext c)
</code></pre>
<p>In order to get the call context, I've found that CallContext.Lo... |
OrientDB keeps locking records indefinitely <p>I'm running OrientDB (community edition 2.2.9) in distributed mode with multiple nodes.</p>
<p>After a couple of minutes, I start getting the following error on my queries:</p>
<pre><code>com.orientechnologies.orient.server.distributed.task.ODistributedRecordLockedExcept... | <p>Using <code>asynchronous</code> execution mode may cause this problem. See: <a href="http://orientdb.com/docs/last/Distributed-Configuration.html#asynchronous-replication-mode" rel="nofollow">Asynchronous replication mode</a>.</p>
<p>You can try changing execution mode or try adding a retry into your query. Using J... |
Ajax xml not going into success <p>I am trying to access the book.xml file which is in same folder as other files, everything is perfect, but the ajax function wont go into success. [object object] error is being showed.
its a very simple xml. I generally do it via a php file. but i have to do it directly this time. i ... | <p>(<strong>Reason for your ajax call fail</strong>)Your code is working fine just put your <code>books.xml</code> on correct location . Also data in xml file should be valid. </p>
<p>And change</p>
<pre><code> $('.datatable tbody').append
</code></pre>
<p>to </p>
<pre><code> $('#datatable tbody').append
</code></p... |
Pands Columns to Dict Preserving Order <p>Given the following data frame:</p>
<pre><code>df = pd.DataFrame({'a':['a','c','b'],
'b':['foo','bar','baz']})
df
a b
0 a foo
1 c bar
2 b baz
</code></pre>
<p>When I create a dict from the columns, I get this:</p>
<pre><code>dict(zip(df.a... | <p>It's not possible to control the order of keys in a Python dictionary. The standard library contains a different data structure for this - <a href="https://pymotw.com/2/collections/ordereddict.html" rel="nofollow"><code>OrderedDict</code></a> - which remembers the order in which keys were added.</p>
<p>In this case... |
mysql_config_editor with docker <p>Hi I'm trying to use mysql_config_editor tools directly in my Dockerfile:</p>
<pre><code>FROM mysql
RUN mysql_config_editor set --login-path=local --user=root --password
</code></pre>
<p>But this command ask the user to enter the password. Is there a way to set the password directly... | <p>I can think of 2 approaches:</p>
<ol>
<li>Use Interactive mode and <code>commit</code> changes
To do this you will start a container from mysql image with <code>-it</code> switch.</li>
</ol>
<p>then you will do your changes.</p>
<p>and commit changes with docker commit to create a new Image from container.</p>
<... |
Remove objects from an array using UISwitch <p>A little context - I have one ViewController called SelectedListItemsViewController that has a TableView populated by an array of Realm Model Objects called <code>selectedListItems</code>. There's an Add bar button item that navigates to another ViewController called AllLi... | <p>After flailing around at it for the last 3 hours, I figured it out. In my else case of <code>switchState</code>, instead of using</p>
<pre><code> let indexInSelected = arraySelected.indexOf(listItemInCell)!
selectedListItems.removeAtIndex(indexInSelected)
</code></pre>
<p>I i... |
Python3 for-loop even or odd <p>Hi i got stuck in an exercise i have in school. and could use some help. </p>
<p>Create a for-loop that goes through the numbers:</p>
<pre><code>67,2,12,28,128,15,90,4,579,450
</code></pre>
<p>If the current number is even, you should add it to a variable and if the
current number is ... | <p>It looks like you need to adjust your condition mostly.</p>
<pre><code>def listSum(a):
for num in [67, 2, 12, 28, 128, 15, 90, 4, 579, 450]:
if(num % 2 == 0): #subtle difference here.
a += num
else:
a -= num
return a
</code></pre>
<p>this will see just a subtle difference. </p>
|
How can update file content based on grunt-init prompt answers? <p>I have created a custom angularjs project using grunt-init. And want to edit the app module name based on answers given to the prompt while creating the project. But somehow I keep on getting blank string when I use the props object. </p>
| <p>I was able to figure it out. I was not using the props template correctly. The right way to use it is as below, </p>
<p>var moduleName = "{%= name %}"</p>
|
Using dynamic value in css in Angular 2 <p>How would i go about updating the CSS dynamically of an overlay that I have appear only when clicked on.
Here is a portion of my html:</p>
<pre><code><nav class="navigation" [class.navigation--overlay]="isItOpen">
</nav>
</code></pre>
<p>Essentially I would like ... | <p>This might do what you want:</p>
<pre><code><nav class="navigation" [ngStyle]="isItOpen ? {'height.px': windowHeight} : {}">
</nav>
</code></pre>
|
Debugger does not show all of the JS Files in React Native <p>Any ideas why this happens?</p>
<p>I already <code>watchman watch-del-all</code> but hasn't been successful. How do you clear the cache?</p>
| <p>Ah, my mistake. Apparently <code>react-native</code> does lazy loading. That means if you're not "importing" the actual file, then it won't be loaded to your debugger.</p>
|
javax.xml.bind.UnmarshalException: Unexpected element "MDMBroadcast". Expected elements are "" <p>I'm trying to unmarshall the below xml using JAXB but unable to parse it as facing the unmarshall exception. Any help would be much appreciated.</p>
<p>My unmarshalling code: </p>
<pre><code>MDMBroadcast mdmbroadcast=nul... | <p>If the generated JAXB class <code>MDMBroadcast</code> does not have <code>@XMLRootElement</code> defined then unmarshaller may not be able to do this directly. You can use <code>JAXBElement<MDMBroadcast></code> to get around. But I suggest if you can change schema (.xsd) as below, then JAXB generates <code>@XM... |
Does UML have an universal standard way? <p>I'm completely new at UML, and I barely know how it really works.</p>
<p>The point is: Does it have a standard way to do or project stuffs? If I'm trying to do a class diagram, or show a complex connection with a DB, the draws need to follow a rule?</p>
<p>Like if I'm doing... | <p>No. UML is a language. Like you would not say English has a standard way to write a novel, there is no standard way for UML to describe projects. </p>
<p>However, a couple of methodologies have evolved based on UML. It's hard to tell the right one and it will differ from case to case. For me the ICONIX approach did... |
Add data to text with print_r() <p>I have a text file and each time a visitor access this page I am doing a print_r() to it.</p>
<p>How can I use print_r() to add data to my <code>file.txt</code> text file ? Currently the text is overwritten and stores only last print_r().</p>
<pre><code>$output = print_r($data, true... | <p>You can use the <a href="http://php.net/manual/en/function.file-put-contents.php" rel="nofollow"><code>FILE_APPEND</code></a> flag:</p>
<pre><code>file_put_contents('file.txt', $output, FILE_APPEND);
</code></pre>
<blockquote>
<p><strong>FILE_APPEND</strong> If file filename already exists, append the data to ... |
Photon crashing on pubnum publish (red light flashing) <p>I have a program that compiles and flashes to the Photon without problem. It runs well until it publishes a string to PubNub. By changing the string being sent, I get different results.</p>
<p>The following examples are relevant:</p>
<p>This works:</p>
<pre><... | <p>I managed to solve the problem, but i'm not sure why the previous "msg" construct did not work (If anyone can shed light on this for me, I would greatly appreciate it).</p>
<p>Here is the msg construct that i used to solve the problem. It is now in an object form and quite easy to work with on the Javascript side.<... |
Redux Saga Behavior of Component Life-cycle <p>This is a general question. I have a redux saga yielding calls that update the store every x mins and show the store gets updated appropriately in the redux dev tool. In the render method of my component if I click before the data I will get a spinner and if I click after ... | <p>I couldn't at the time account for it but now it makes sense and if it helps anyone else great. It will not be there on the update for the connected redux state but through "componentWillUpdate(nextProps)" & nextProps will have it. </p>
|
Python debuggers not stepping into a coroutine? <p>In the example below:</p>
<pre><code>import asyncio
import ipdb
class EchoServerProtocol:
def connection_made(self, transport):
self.transport = transport
def datagram_received(self, data, addr):
message = data.decode()
print('Receive... | <p>It works if you call <code>await</code> or <code>yield from</code> for your coroutine like</p>
<pre><code>listen = await loop.create_datagram_endpoint(EchoServerProtocol,
local_addr=('127.0.0.1', 9999))
</code></pre>
<p>In your example <code>listen</code> is not a resu... |
How to select datas that doesnt match in another column <p>So i have this table A:</p>
<pre><code>color ID MODEL
-----------------------------
red | 10 | HONDA
blue | 10 | TOYOTA
red | 15 | ISUZU
red | 30 | MITSUBISHI
red | 5 | HONDA
blue | 5 ... | <p>or using an <code>anti join</code></p>
<pre><code>select t1.color, t1.id
from
tableA t1
left outer join
tableA t2 on t2.id = t1.id and t2.color != t1.color
where
t1.color in ('red', 'blue')
and t2.color is null
</code></pre>
|
xcode 8 error denied by service delegate (SBMainWorkspace) <p>Trying to run a build on simulator and i get this error</p>
<blockquote>
<p>The request was denied by service delegate (SBMainWorkspace) for
reason: Security ("Entitlement
"com.apple.frontboard.debugapplications" required to launch
applications for ... | <p>quitting the simulator fixed this for me</p>
|
Objective-C category for NSMutableDictionary not being respected in iOS10 <p>I have an app written in Objective-C with a category for NSMutableDictionary. In iOS9, the app works fine. However when run in iOS10, the app crashes due to an 'unrecognized selector sent to instance'. I've isolated the problem to the NSMutabl... | <p>The error says that the object type is <code>__NSSingleEntryDictionaryI</code>, not the <code>NSMutableDictionary</code> that you expect.</p>
<p>Make a mutable copy of the dictionary that the server gives you and assign <strong>that</strong> to <code>response</code>.</p>
|
How to evaluate an expression in for loop using Python? <p>I want to evaluate an expression inside for loop. I am doing:</p>
<pre><code>for i in range(0,255):
Q[i+1,1] = (np.floor_divide(i, q) * q + q/2)
</code></pre>
<p>but this returns an error saying </p>
<blockquote>
<p>IndexError: index 1 is out of bounds... | <p>The size is 256x1 but still you have to index with starting at 0. So you need <code>Q[i,0]</code> </p>
|
how to use SQL datasource wizard at runtime (Devexpress) ? <p>there is a component in DevExpress called SQLDataSource, this component allows you to import data from any database but not at RunTime,
I'm currently developing a module that import data from any database, obviously it has to be dymanique, is there a way t... | <p>I found a solution, we must first add the reference "DevExpress.DataAcess.UI" to our application, then using "DevExpress.DataAccess.UI.Sql;"
After having drag the SqlDataSource, in the button that we should call the wizard:
  </p>
<pre><code> SqlDataSourceUIHelper.ConfigureConnection (sqlDataSource1);
</code></pr... |
Difference between createStatement Parameters for Scrolable ResultSet (JDBC) <p>As I know, the statement object for scroll-able ResultSet is obtained as below.</p>
<pre><code>Statement statement = connection.createStatement(P1, P2);
</code></pre>
<p>Here P1 may take </p>
<pre><code>ResultSet.TYPE_SCROLL_SENSITIVE
Re... | <p>The second parameter <code>CONCUR_*</code> determines whether <strong>you</strong> can modify the database through the <code>ResultSet</code>. <code>TYPE_SCROLL_(IN)SENSITIVE</code> determines whether modifications made to the underlying rows are seen by you while scrolling the <code>ResultSet</code>. So <code>INSEN... |
Expected 'end' in case statement <p>The following code compiles and runs as expected:</p>
<pre><code>fun {Tokenize Lexemes}
case Lexemes of
Head|Tail then
case Head of
"+" then
operator(type:plus)|{Tokenize Tail}
else
if {String.isFloa... | <p>If you have multiple branches within a case statement, you have to separate them with <code>[]</code>. For example:</p>
<pre><code>case Head of "+" then
operator(type:plus)|{Tokenize Tail}
[] "*" then
operator(type:multiply)|{Tokenize Tail}
end
</code></pre>
|
Ambiguity while using readLines() in R <p>The first line of my dataset contains the name of the columns.
It looks like this --</p>
<pre><code>#"State Code","County Code","Site Num","Parameter Code","POC","Latitude","Longitude","Datum","Parameter Name","Sample Duration","Pollutant Standard","Metric Used","Method Name",... | <p>This is from the Exploratory Data Analysis (EDA) assignment on Coursera, right? I trust you are compliant with the honor code. </p>
<p>What you have in 'cnames' is ONE string enclosed in double-quotes within which the backslash operator has escaped other quotation marks.</p>
<p>To get around this, try:</p>
<pre><... |
Encrypt Existing Database with SQLCipher in Android <p>I have a database file in my assets that I copy in the app database folder. After the copy (it works), I want to encrypt the copied database with SQLCipher.</p>
<p>For some reason, I get this error:</p>
<p><code>Database: sqlite returned: error code = 26, msg = s... | <p>We have an example of encrypting a plain text SQLite database within the SQLCipher for Android <a href="https://github.com/sqlcipher/sqlcipher-android-tests" rel="nofollow">test suite</a> <a href="https://github.com/sqlcipher/sqlcipher-android-tests/blob/master/src/main/java/net/zetetic/tests/ImportUnencryptedDataba... |
mysql connection error which expects parameter 1 to be mysqli <p>( ! ) Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in C:\wamp\www\go4shop\config.php on line 7</p>
<p>I am getting the above arror for below code. Please someone help me</p>
<pre><code><?php
$dbhost = "localhost";
$dbu... | <p>Linkname first, then database name...</p>
<pre><code>mysqli_select_db ( mysqli $link , string $dbname )
</code></pre>
<p>or in your case</p>
<pre><code> mysqli_select_db($db, $dbdatabase)
</code></pre>
|
loading images after page has been loaded <p>I have a page that uses signalR. The server calls a client function and passes in image paths to it. ie 'Contents/myimage.png'. Inside the client function I use jquery to load these images. I'm not getting any errors in chrome and the images don't have that default didn't lo... | <p><code>$.load</code> replaces the html with the content from the url, eg for a function that returns <code><div>replacement</div></code>, you would do:</p>
<pre><code>$("#mydiv").load(url);
</code></pre>
<p>and you'd get</p>
<pre><code><div id='mydiv'><div>replacement</div></div>... |
Java 'has-a' relationship explanation <p>I was reviewing some sample questions for the java certified professional exam, and wanted to get some clarity on the answer to one of the questions:</p>
<pre><code>2. Given:
class Class1 {
String v1;
}
class Class2 {
Class1 c1;
String v2;
}
public class Class3 {
Class2 c1;
St... | <p>Class3 has a Class2 called c1 which has a Class1 called c1 which has a String called v1</p>
<p>so Class3 has a v1: <code>Class3.c1.c1.v1</code></p>
|
How to execute Android Tests with gradle before each "release" build? <p>I have some android instrumented tests under AndroidTests directory in Android Studio. Of course I can manually execute the tests but I need to execute all the tests in the suite after each build ("release" type of build, not during normal debug b... | <p>In general you can define a dependencies for the task using the <code>dependsOn</code> method.</p>
<p>For example:</p>
<pre><code>task A << {
println 'Hello from A'
}
task B << {
println 'Hello from B'
}
B.dependsOn A
</code></pre>
<p>You will obtain</p>
<pre><code>> gradle -q B
Hello fr... |
Applescritp Excel to Find And Replace " <p>I need an applescript to find " and replace with just a space. I found an awesome script on here that works beautifully to find and replace whole words (hello, world) but when you manipulate the script to find " and replace with a space, the " corrupts the code and it no long... | <p>As <strong>"</strong> is a reserved character we need to treat it differently when referencing it in strings.</p>
<p>You could use the <code>quote</code> constant as your argument:</p>
<pre><code>searchAndReplaceTextInCells(quote, " ")
</code></pre>
<p>..or you could send it in as an escaped character:</p>
<pre>... |
How to get the newest table from dynamodb? <p>I'm writing a project which has a python script that create a new table and pass json data to the dynamodb every 6 hours, and has a node js server to read data from dynamodb when is requested. Since the dynamodb will have a new table every 6 hours, how does the node js serv... | <p>I would use a combination of <a href="http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ListTables.htm" rel="nofollow">list table</a> and <a href="http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html" rel="nofollow">describe table</a>.</p>
<p>The first should give you... |
How to make a linear-gradient to fulfill two-coloured body in CSS <p>I've been trying to make that in CSS to my webpage:
<a href="http://i.stack.imgur.com/5Pyr4.png" rel="nofollow"><img src="http://i.stack.imgur.com/5Pyr4.png" alt="linear-gradient"></a></p>
<p>But the only thing I get is a repeated gradient over all p... | <p>You need to specify a height. Use vh which simply means viewport height which is the height of the user's visible area of a web page. That way it would cover the entire height of the screen no matter the device.</p>
<p>The background-attachment property sets whether a background is fixed or scrolls with the rest of... |
Google OAuth Client Deleted, But service still trying to use it <p>I'm setting up an OAuth login flow.
<a href="https://accounts.google.com/o/oauth2/auth" rel="nofollow">https://accounts.google.com/o/oauth2/auth</a> first told me the client was deleted - which is fine - I created a new one.</p>
<p>Now, accounts.google... | <p>Turns out the user was still attached to the old/deleted client, although that client had been deleted. The old and new client shared a Google API project.</p>
|
What is the proper Java Config for simple file copy <p>I'm extremely new to Spring, and even more-so to Spring Integration, so apologies if this is a very basic question.</p>
<p>I'm wanting to build a very basic log file processor to learn the ropes. Very similar to this: <a href="http://forum.spring.io/forum/spring-p... | <p>You config is good so far.</p>
<p>Having such a complex task, I'm not sure how to help you.</p>
<p>You should ask more specific question. We can't write the solution for you.</p>
<p>Not sure why you need to copy files from one dir to another, if you can simply poll them from the source dir, store in the <code>met... |
How to pass a Value from MVC Controller to Angular View <p>I am using angularjs with Asp.net MVC to check the write access of a folder for users. If the user has the write access then I want to show a div which has a link. I have a div in <code>SampleView.Html</code> and I have a method which checks for user's write ac... | <p>I might not be understanding the question exactly correctly, but I you case it might be best just to show or hide it using razor syntax, rather than exposing a variable and handling that in the JavaScript. If you're not returning a Model from your ASP.NET controller, then in your ASP.NET controller set the ViewBag v... |
SSRS Creating a Matrix for each category and page break between them <p>I'm trying to do 2 things:</p>
<ol>
<li><p>Create a matrix that will dynamically regenerate itself for each category in my dataset (could be 2 categories, could be 10)</p></li>
<li><p>Create a page break between each one.</p></li>
</ol>
<p>So as... | <p>You can add a page break between each category. Go to <code>Category</code> group properties in the <code>Page Break</code> tab, select <code>Between each instance of a group</code>.</p>
<p><a href="http://i.stack.imgur.com/Vb5Ef.png" rel="nofollow"><img src="http://i.stack.imgur.com/Vb5Ef.png" alt="enter image des... |
Signed Global IDs for Authentication Tokens - secure or vulnerable? <p>I found that <em>Signed Global IDs</em> are awesome for token based stuff like <strong>reset password</strong> and <strong>account confirmation</strong> functions and would love to get opinions about its security and usability.</p>
<p>Common ways b... | <blockquote>
<p>is the Signed Global ID token secure or vulnerable against specific attacks?</p>
</blockquote>
<p>The Signed Global ID appears to use <a href="http://api.rubyonrails.org/classes/ActiveSupport/MessageVerifier.html" rel="nofollow"><code>MessageVerifier</code></a>:</p>
<blockquote>
<p>MessageVerifier... |
Drawing bezierPath <p>I was tinkering around with BezierPath and noticed something that I can't seem to figure out. This is the code-</p>
<pre><code>UIBezierPath *path = [UIBezierPath new];
CGSize screenDimensions = CGSizeMake([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
CGPoin... | <p>It's a simple problem.</p>
<p>Let's say the screen dimensions are 320x480 (and old iPhone). This means that <code>firstPoint</code> will be <code>160, 240</code>.</p>
<p>In the current code, your view's frame is <code>130, 210, 100, 100</code>. It's width and height are both 100.</p>
<p>The shape layer will be dr... |
Store intermediate values into array with Ruby inject <p>I want to store ruby inject values into array I found one good example (on site <a href="http://matthewcarriere.com/2008/06/23/using-select-reject-collect-inject-and-detect/" rel="nofollow">http://matthewcarriere.com/2008/06/23/using-select-reject-collect-inject-... | <p>it works in my machine.</p>
<p>Have you tried it in a new irb session?</p>
<p>Which version of ruby are you using?</p>
<pre><code>$ ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
$ irb --version
irb 0.9.6(09/06/30)
$ irb
irb(main):001:0> [1,2,3,4].inject([]) {|acc,n| acc << n... |
std::throw_with_nested() on out of memory condition calls std::terminate() <p>I've been strong exception guarantee testing a class, especially on what happens on an out of memory condition, by randomly making <code>malloc()</code> return <code>nullptr</code>. It uses nested exceptions.</p>
<p>Let's say I have the foll... | <p>As far as I understand it, both the constructor of <code>std::nested_exception</code> and the global function <code>std::current_exception()</code> are <code>noexcept</code>, so if an exception occurs in either one, the only allowable course of action is <code>std::terminate</code>.</p>
|
remove duplicate values from items in a dictionary in Python <p>How can I check and remove duplicate values from items in a dictionary?
I have a large data set so I'm looking for an efficient method. The following is an example of values in a dictionary that contains a duplicate:</p>
<pre><code>'word': [('769817', [6]... | <p>This problem essentially boils down to removing duplicates from a list of <strong>unhashable</strong> types, for which converting to a set does not possible.</p>
<p>One possible method is to check for membership in the current value while building up a new list value.</p>
<pre><code>d = {'word': [('769817', [6]), ... |
android passing arguments are correct in first activity , wrong in the second <p>I am passing arguments from first activity to the second , in the first activity i can see all the arguments , but in the second activity one of the argument is being always <code>0</code> , the rest I can see them. I passing <code>id</cod... | <p>Your intent code seems to be correct. </p>
<p>You didn't show your read from parcel code, so it might be there too.</p>
<p>Regardless, parcelable code is a pain in the ass to do, so I suggest you to use a library that makes it automatically. This one github.com/johncarl81/parceler all you have to do is put the <co... |
C# WebBrowser in loop and Fiddlercore <p>I use Fiddlercore to capture multiple url's at the same time inside a loop. </p>
<p>Example: </p>
<pre><code>private void button1_Click(object sender, EventArgs e)
{
// I have 2 url
string arr = new string[]{ url1, url2 };
foreach(var url in arr)
{
n... | <p>Use <a href="https://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.stop(v=vs.110).aspx" rel="nofollow">WebBrowser.Stop()</a> to stop all loading.</p>
<blockquote>
<p>Cancels any pending navigation and stops any dynamic page elements, such as background sounds and animations.</p>
</blockquote>
... |
How to compare a particular field to a string in SQLite <p>The <code>Cons.getpersonIdForRegisteredUser()</code> method returns a string.<br>
My query has two parts: one is to check the person <code>id</code> and the other is <code>data enabled</code></p>
<pre><code>@Override
public Loader<Cursor> onCreateLoader(... | <p>If I understand the error correctly, then you should place that <code>Cons.getPersonId...</code> into the <code>selectionArgs</code>. </p>
<pre><code>String selection = ContactProviderContract.
ContactDatabaseEntry.COLUMN_NAME_PERSON_ID + " != ?" +
+ " AND "
+ ContactProviderCont... |
Replace Case Insensitive StringBuilder <p>I have read many times over about the virtue of using Stringbuilder vs. string when multiple replacements are needed. I need to convert an HTML string (all very simple formatting) to WIKI notation and was going to roll my own from code I found on SO. I'm wondering if there is a... | <p>The benefit of stringbuilder is that you don't create a new string with every replacement. Your implementation doesn't benefit from this property.
If you use a stringbuilder, actually do transformations on the stringbuilder, not on the input string parameter:</p>
<pre><code> public static string ConvertHTML2WIKI... |
How to get the id when is clicked and remove that? Google Maps V3 <p>Here is my code...I try to put event listener but the console says:</p>
<blockquote>
<p>markers.addListener is not a function</p>
</blockquote>
<p>Here is my code.....<a href="https://jsfiddle.net/1LwLczgr/1/" rel="nofollow">https://jsfiddle.net/1... | <p><strong>markers</strong> is an Array object.
Can't we do: </p>
<pre><code>$.each(markers, function(index, value) {
// Add listener here?
});
</code></pre>
<p>Reference:
<a href="http://api.jquery.com/jquery.each/" rel="nofollow">http://api.jquery.com/jquery.each/</a></p>
<p>Or in plain JavaScript: </p>
<pre><... |
asp.net mvc - pass text box value to a hidden value with jquery <p>I need to pass the value of a text box to a hidden field. I am currently setting a default value to the field, but the user may change it before the submitting of the form. I thought this could be accomplished with jquery, but I feel I am missing a piec... | <p>You can use <a href="https://api.jquery.com/change/" rel="nofollow"><strong><code>change</code></strong></a> event like following.</p>
<pre><code>$(document).ready(function () {
$("#myTextBoxVal").change(function() {
$('#myHiddenFieldVal').val(this.value);
}).change();
});
</code></pre>
|
How to remove lines one by one in Richtextbox C# <p>I use this code to delete lines one by one in richtextbox, but still leaving an empty line (whitespace).</p>
<pre><code>var text = "";//Holds the text of current line being looped.
var startindex = 0;//The position where selection starts.
var endindex = 0;//The lengt... | <pre><code>// Gets the number of newline characters in your rich text box
var numberOfNewLines = richTextBox1.Text.Count(r => r == '\n');
for (var i = 0; i < numberOfNewLines; i++)
{
// Finds the first occurance of the newline character
var newlineCharacterIndex = richTextBox1.Text.IndexOf('\n') + 1;
... |
Matlab - import data tool <p>i have got a problem with the import data tool in matlab.
I just installed matlab this morning, at first it worked. However after shutting down the computer once, it doesn't work anymore.</p>
<p>More specifically, it opens and load data from .txt or spreadsheet, but when i click to import ... | <p>Sounds like the import tool works as intended until it cannot find the wait bar. A <a href="http://mathworks.com/help/matlab/ref/waitbar.html" rel="nofollow">waitbar</a> is a loading progress bar, which is available every basic installation of MATLAB (no toolbox required). Either the waitbar is created (do you see i... |
precalculated definition of variable vs initializing by calculation <p>Suppose for example, I wanted to initialize my variables using a function:</p>
<pre><code>int x[10];
void init_x(){
for(int i=0; i<10; ++i){
x[i]=i*i;
}
}
</code></pre>
<p>It doesn't have to be this exact function, it could be m... | <p>If I understand your question correctly, you are asking if you can do the calculations at compile-time instead of at run-time and if there are caveats?</p>
<p>The answer depends on the complexity of the calculations. If they are simple (deterministic as you say) you can usually do this with success. The caveats are... |
Not able to complete execution of the Firebase Init command form directory containing angularjs code <p>I created a new empty app on firebase and now I am trying to initialize it. When I run the firebase init command from the directory containing my angularjs app I do not see the new app on firebase with the arrows. Ju... | <p>It sounds like you might be signed in to an old account or using an old version of the CLI.</p>
<p>Can you take these steps:</p>
<ol>
<li><code>firebase logout</code></li>
<li><code>npm install -g firebase-tools</code></li>
<li><code>firebase login</code></li>
<li><code>firebase init</code> again</li>
</ol>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.