input
stringlengths
51
42.3k
output
stringlengths
18
55k
Index exceeds matrix dimensions error in matlab database <p>i have database named 'data' , in gui i have 3 editbox which are name,gpa,salary and a push button . have data in database like this :</p> <pre><code>field= {'name','gpa','salary'} newdata = {'Andre',3.2,$1000} </code></pre> <p>my program like this :</p> <p...
<p>The result of <code>fetch</code> in your case is going to be a struct, therefore to access the individual elements you need to use <a href="http://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-structure-array.html" rel="nofollow">dot referencing</a> instead of <code>()</code> indexing.</p> <pre><code>s...
Creating & Inserting into a SQL Table which contains data using a hyphen '-' in Oracle 10g <p>I'm currently trying to figure out the best way to create a table that contains data (account number) utilizing a '-'. Here are my goals:</p> <ol> <li>Be able to create the table and insert the account numbers into the AcctNu...
<p>This seems like a very strange way to insert multiple rows. How about this?</p> <pre><code>INSERT INTO accounts(acctnum, prefix, suffix) SELECT '123-0097', NULL, NULL FROM DUAL UNION ALL SELECT 'X089-056', NULL, NULL FROM DUAL UNION ALL SELECT '123-0097', NULL, NULL FROM DUAL UNION ALL SELECT '123...
highcharts adding point dynamically <p>I'm trying to add a new point to highcharts line graph every 3 seconds using the following code. But it does not add the new point. I verified that point coming back from json was correct like [x,y]. Without getjson part and using a point like [3,4] it works. But when I add json...
<p>I got it working by bringing 'var series = this.series[0];' after 'getjson'</p>
I'm stuck in AWS Lamba : Getting Started Guide <p>Part 1.1 <strong>Set Up an AWS Account and Create an Administrator User</strong></p> <p><a href="http://docs.aws.amazon.com/lambda/latest/dg/setting-up.html" rel="nofollow">http://docs.aws.amazon.com/lambda/latest/dg/setting-up.html</a></p> <p>In the section for creat...
<p>If you are running the AWS CLI somewhere other than an EC2 server, then you are correct that you have to provide the Access Key and Secret Key. You will need to go back to the IAM console and create those keys.</p>
where to put android.support.v4.widget.SwipeRefreshLayout and how to implement it? <p>just wanna ask where to put the android.support.v4.widget.SwipeRefreshLayout on my codes? I'm confused if it should be on my activity_main.xml or in my list_item.xml file..</p> <p>Here is my activity_main.xml:</p> <pre><code> &lt...
<blockquote> <p>To add the swipe to refresh widget to an existing app, add SwipeRefreshLayout as the parent of a single ListView or GridView. Remember that SwipeRefreshLayout only supports a single ListView or GridView child. - <a href="https://developer.android.com/training/swipe/add-swipe-interface.html" rel="nofol...
angular2 hide mdtooltip after clicking <p>I am creating a sidebar. It should be composed by many icons, and when a user click on a specific Icon, redirect to a corresponding page. but the problem is after clicking on a icon, tooltip (from angular2-material) does not hide, and after each click on a icon, its tooltip bec...
<p>The <code>MdTooltip</code> class implements <a href="https://www.npmjs.com/package/@angular2-material/tooltip#methods" rel="nofollow">a <code>hide()</code> method</a> that you could use to programmatically hide your tooltip.</p> <p>But your tooltip should not be stuck. It should go away when the mouse moves away. ...
R: reshaping data frame to long data format with reshape2 <p>I am trying to play around with the <code>mpg</code> dataset in <code>ggplot2</code>, and I would like to convert the wide data format to long data format for the columns <strong>cty</strong> and <strong>hwy</strong>:</p> <p><strong>Wide/Original data format...
<p>I'm sure this is a duplicate question, but...</p> <p>I think you had your <code>id.vars</code> mixed up</p> <pre><code>library(reshape2) melt(mpg, id.vars = c("manufacturer", "model","class"), variable.name = "road_type", value.name = "efficiency") ## or melt(mpg, measure.vars = c("cty","hwy")) #...
What is the correct fix instead of using if ( variable != null ) to bypass the origin of issue <p>If ( variable != null ) {now do the code that depends on variable}</p> <p>Followings is a fact : Such approach supresses the business logic that when was written it assumed that a non null object will be provided, now wha...
<p>If there's really a business reason to cater for the situation where your <code>variable</code> is <code>null</code>, then you the developer should provide an <code>else</code> block.</p> <p>Concerning literature, yes there is actually a performance cost to throwing exceptions, so it's recommended you avoid your ap...
Get closest div inside clicked <li> <p>I'm trying to get the closest DIV inside a li item, to apply a new class:</p> <pre><code> &lt;ul id="menu"&gt; &lt;li class="here"&gt; &lt;img src="image"&gt; &lt;div class="border selected"&gt;&lt;/div&gt; &lt;/li&gt; &lt;li class="here"&gt; &lt;im...
<p>Please look at this <a href="https://jsfiddle.net/richbuff/1ztsm6m6/" rel="nofollow"><strong>jsfiddle</strong></a>.</p> <p>The relevant code is:</p> <pre><code>$("#menu li").on("click", function(){ $("#menu li div.border").removeClass("selected"); $(this).find("div.border").addClass("selected"); }); </code></p...
How to get Google maps query results with API? <p>I cannot for the life of me figure out how to get a simple google maps query to work with the API. All I want to do is get JSON for the foodbanks around Denver. So far I have:</p> <pre><code>var gm_api_key = "apikeyhere"; // return locations for foodbanks in denver v...
<p>Ok, so the problems were twofold: one, the <code>keyword</code> or <code>name</code> arg is the correct one to use here, not <code>query</code> that I would expect to use. Two, the <code>radius</code> parameter is in meters, so for around 100 miles it would need to be about 150000. A correct page call should be:</...
Mobile App to Auto Fill and Submit a web form, from a source of data <p>I have a mobile app project, that need to auto fill a web form from a source of data (excel/txt/json/etc), and post it automatically. I see the tutorial on youtube, somebody doing it via windows app (using Visual Basic), here's the video: <a href=...
<p>It's not simple, I would do it by doing the parsing of the JSON file and, according to the elements, creating dinamically and programmatically a form and filling it.</p> <p>For istance if you get from the parsing 3 texts and the first node is called "email", the second "password" and the third "confirm password", y...
S3 File upload using Play-S3 fails for images but works for text files <p>I am trying to upload a file to S3 using Scala Playframe work <code>2.4.1</code> Specifically using the module play-s3 <code>7.0.2</code></p> <p>I can get it to work for text files but when I try and upload an image I get this message, <code>Th...
<p>The solution to this is to not use play 2.4.1. There is something wrong with the hashing of binary data with 2.4.1. 2.4.2 works just fine though.</p> <p><a href="https://github.com/Kaliber/play-s3/issues/70" rel="nofollow">https://github.com/Kaliber/play-s3/issues/70</a></p>
C - Constructor, better to return struct or pointer to struct? <p>I'm currently making a RedBlackTree in C and I still don't understand which one is better / more ideal when it comes to having a constuctor function for your structures. </p> <pre><code>struct RedBlackTree* RedBlackTree_new() { struct RedBlackTree *...
<p>The real difference is the lifetime of the object. An object allocated on heap through dynamic allocation (<code>malloc</code>/<code>calloc</code> and <code>free</code>) survives until it's explicitly freed.</p> <p>On the contrary an object which has automatic storage, like in your second example, survives only the...
Change QML Listview delegate from C++ <p>I am trying to change the delegate of qml listview from C++ but currently I stuck at how to change the alias which represents the delegate property.</p> <p><strong>Update on details:</strong> <em>I have multiple delegates in separated qml files, in my application there are many...
<p>I think that there is a better way to do this.</p> <p>Steps:</p> <p>1) create a model in c++ side.</p> <pre><code>class Model : public QObject { Q_OBJECT Q_PROPERTY(qint32 status READ status WRITE setStatus NOTIFY statusChanged) public: Model(QObject *parent = Q_NULLPTR); ... } </code></pre> <p>2) pass t...
PHP number_format error <p>I have a string like:</p> <pre><code>R$10,25 </code></pre> <p>I need to convert it to:</p> <pre><code>10.25 </code></pre> <p>I'm trying with:</p> <pre><code>$value = 'R$10,20'; $value_subs = str_replace(array('R', '$'), '', $value); $value_formated = number_format($value_subs, 2, ',', '....
<p>combining @Hayden Schiff 's answer</p> <pre><code>&lt;?php $value = 'R$10,20'; $value_subs = str_replace(array('R', '$',','), array('','','.'), $value); $value_formated = floatval($value_subs); $another_value = 20.40; if($value_formated &lt;= $another_value) { echo "Less or equal";...
click on button to send adb commmand python <p>I would like to build a program to send adb commannd to mobile when i click the buttton, i tried with the following code but the command is not send to device,I'm new in Python. Please can someone help me to solve this problem</p> <pre><code>from Tkinter import * import o...
<p>In this line:</p> <pre><code>b = Button(root, text="Enter", width=30, height=2, command = lambda:(button)) </code></pre> <p>the button function is not being called by command when you click (replace button with a print statement to test). Remove the lambda and replace it with just command = button.</p>
Get Server time Not Local time <p>this is my php script to show server time but this is showing local machine time can any one help me where i am doing wrong ? i have 1 other script ffor server time but that show NaN so i have to make it work but i cant understand what is wrong in this and why that is not showing ser...
<p>Assuming it's time() function in PHP...</p>
How can I register my mobile app with FitBit to use it's API if my mobile app needs FitBit API to be developed? <p>I am new to developing mobile applications. I want to develop a mobile app that reads data from a FitBit watch and does something with that data. After searching on the Internet and on dev.fitbit.com I mus...
<p>For getting data you must first register your app on fitbit. You dont't need to create your application first what you are trying to build. To register your app, it needs some basic information about your app like Application Name, Description etc. </p> <p>Provide these information about your app. After register...
how can i combine 2 sheets with lists based on a single value? <p>I have 2 sheets with info. I need a master sheet that lists the entire row if it is false. it needs to be an array in case it is changed to true, it will be removed from the master list. is this possible without VB?</p> <p>SHEET1</p> <pre><code>animal ...
<p>You can use Power Query for that. Power query is a free add-in from Microsoft for Excel 2010 and Excel 2013 and built into Excel 2016 as Get &amp; Transform.</p> <ul> <li>Create a connection-only query to the table on Sheet1</li> <li>create a connection-only query to the table on Sheet2</li> <li>append the two quer...
boto error to launch ec2 instance <p>i am using ansible to create an ec2 isntance . during the playbook run, i am getting the error as:</p> <pre><code>TASK [create a single ec2 instance] ******************************************** An exception occurred during task execution. To see the full traceback, use -vvv. The e...
<p>You need to install boto3 (<code>pip install boto3</code>)</p>
Parse: How to get user to sign up with phone Number? <p>I don't want the user to sign up with username, email, password. I just want the user to have a username and phoneNumber that it checks with verification via SMS. How do I go about doing this?</p> <p>If I were to use just username and password for signup it would...
<p>The most successful way is to use 3rd party OTP service API. Using this the user registering on your app will receive one time password for number verification. Successful entry will proceed to successful registration. Steps to got for it:</p> <ol> <li>Start leaning how to use OTP for android. <a href="https://www....
Python: Replacing character error with read in file <p>Goal: I just want to take the comma away as that is the only character that will screw up my (course required) file parsing for bayesian analysis (i.e word,2,4) instead of say (i.e. word,,2,4)</p> <p>So I'm currently trying to read in an email in the form of a tex...
<p>If you just want to remove the extra comma and as you said nothing is working out you can use the simple split and join (assuming comma is the only delimiter here)</p> <pre><code>','.join([s for s in 'word,,2,4'.split(',') if s]) </code></pre>
Android Studio :: E/AndroidRuntime﹕ FATAL EXCEPTION: <p>My app crashed the moment i run it. I need help. Thank you very much in advance.</p> <p>I'm kinda new on android studio, not sure what i did wrong.</p> <p>Error: </p> <pre><code>09-14 02:55:11.013 4502-4502/com.example.adrian.loginregister E/AndroidRuntime: F...
<p>try to change</p> <pre><code>final TextView bRegister = (TextView) findViewById(R.id.bRegister); </code></pre> <p>line to</p> <pre><code>final TextView bRegister = (TextView) findViewById(R.id.tvRegister); </code></pre> <p>becuase in your <code>xml</code> file you are giving <code>Register TextView</code> <code...
using a string to reference an object in C# <pre><code> private void check_boxes(ref int which_series_a, string wh_bx) { // ******************** Checks to see if box is checked ********************** if (wh_bx.Checked == true) </code></pre> <p>I have tried <code>this.</code> and <code>this.Contr...
<p>Assuming wh_bx is the name of the checkbox.</p> <pre><code> private void check_boxes(ref int which_series_a, string wh_bx) { var myCtrl = this.Controls.Find(wh_bx, true) as CheckBox; if(myCtrl != null) { if(myCtrl.Checked){} } } </code></pre>
Disable text input unless a selector option is chosen <p>I have a selector with a list of options. One of the options is 'other' in which case the user may enter their own option in a textbox below.</p> <p>How can I make the textbox disabled and greyed out only to become active when the 'other' option is selected?</p>...
<p>Maybe a little something 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-js lang-js prettyprint-override"><code>$(document).ready(function() { $("#list").change(function() { $("#otherbox").p...
shell script "tar" error while running in jinja2 <p>While running shell script in jinja2, I'm getting some errors. Commond is:</p> <pre><code>resultFilesPath=/var/data/output cd $resultFilesPath; tar czvf {% for tar_file in outputs.output %}{{ tar_file.path }} ./* {% endfor %}; </code></pre> <p>error is:</p> <blockq...
<p>As stated in the error. Look at the man <a href="http://linux.die.net/man/1/tar" rel="nofollow">page for <code>tar</code></a>. The option <code>f</code> requires you to specify the target archive file name:</p> <pre><code>tar czvf archive.tar.gz {% for tar_file in outputs.output %}{{ tar_file.path }} ./* {% endfor ...
Article and Tags relationship in ASP.NET MVC <p>I am trying to build an Article-Tags relationship model in ASP.NET MVC. there are Articles, which can have have multiple tags (eg: funny, fools, serious etc) describing the type of the article. I am thinking of two approaches to make this relationship:<br><br> 1. Making a...
<p>"Best" is a little subjective, but with the many-many table design you'll find it easier to do queries. If you use a list of tags and decide you want to find a specific type of article, you'll have to parse the tags field first. Not impossible to do that, but definitely less convenient than having the extra table....
why is php bccomp equal? <p>php version 5.4.33 php.ini: bcmath.scale = 0 (also tried bcmath.scale = PHP_INI_ALL)</p> <p>problem:</p> <p>php5433 -r "echo bccomp(0.00000001, 0, 9);" print 0</p> <p>php5433 -r "echo bccomp(1.00000001, 1, 9);" print 1</p> <p>why? Anyone can help?</p>
<p>it's because <a href="http://php.net/manual/en/function.bccomp.php" rel="nofollow"><code>bccomp</code></a> first 2 arguments are meant to be strings. as you can see <a href="http://www.tehplayground.com/#cSdpsJi8U" rel="nofollow">here</a> when they are strings it works as expected. why is this? i'm not sure but it p...
How to create a form with 2 select tag, adding element from this select to another select, and handle form submission? <p>I would like to create a form like this, which I can add/remove individual/all element between <strong>Available</strong> and <strong>Seleteted</strong> select tag. </p> <p><a href="http://i.stack....
<p>assuming you can use jquery</p> <p>I have two selects <code>multiselect1</code> and <code>choosenItems</code> </p> <p>Below I copy selected items from <code>multiselect1</code></p> <pre><code>var options = $('select.multiselect1 option:selected').sort().clone(); for (var i = 0; i &lt; options.length; i++) { ...
Query to select rows that contain uppercase words <p>The following query produces some rows that do NOT contain UPPERCASE words and I'm not sure why.</p> <p>Any ideas?</p> <pre><code>SELECT exampleColumn FROM table WHERE exampleColumn REGEXP '[[:upper:]+]$'; </code></pre> <p>Thanks!</p>
<p>I think you mean this,</p> <pre><code>SELECT exampleColumn FROM table WHERE exampleColumn REGEXP '^[[:upper:]]+$'; </code></pre> <p>This selects only the columns having uppercase letters only.</p> <p>Update:</p> <pre><code>SELECT exampleColumn FROM table WHERE exampleColumn REGEXP '\b[[:upper:]]+\b'; </code></pr...
PHP : How to get the lowest array value together of the key <p>I have a an array and I need to get the lowest value together of key. Because i need to check if the value has contain the right key or not</p> <pre><code> Array ( [120] =&gt; 97.00 [132] =&gt; 92.67 [124] =&gt; 72.33 [131] =&gt...
<pre><code>$array=array("120" =&gt;97.00 ,"132"=&gt;92.67,"124"=&gt;72.33 ,"131"=&gt;49.67,"129"=&gt;29.00,"127"=&gt; 25.00); //get minimum value from array $minvalue=(min($array)); echo "Min Value= ".$minvalue; //get key of minimum value from array $key = array_search($minvalue, $array); echo "Key of Min Value".$...
log in with google account,using email and then creating password for app iOS <p>I am new in iOS development and I want to use Google login in my app where email is taken from Google account but the password is created for the app and creates new account for the app and stores it on server. How to do this ?</p>
<p>Following is steps to Get Email from Google Sign in :</p> <p>Step 1 : Use Pod <code>pod 'Google/SignIn</code></p> <p>Step 2: Import <code>#import &lt;Google/SignIn.h&gt;</code> (This import in either Bridging-Header for <code>Swift</code> or in your controller for <code>Objective c</code>)</p> <p>Add <code>GIDSig...
Posting data from a form using $http (REST) <p>I'm trying to use Angular for CRUD operations, but I'm having some trouble sending POST requests to the server.</p> <p>Here's my controller:</p> <pre><code>angular.module('myModule').controller("ListingCtrl", function($scope, posts) { $scope.addProject = function ()...
<p>I think the way you have added <strong>create</strong> method is not proper, you have to add that method on factory object</p> <p>Put the create method on an object returned from factory.</p> <p>In your service </p> <pre><code>angular.module('myModule', []) .factory('posts', ['$http',function($http){ var ...
Multiple <br /><br><br/>\r\n occurences needs to be replaced with <br /> <p>I need to replace multiple occurences of <code>&lt;br /&gt;</code>, <code>&lt;br&gt;</code>, <code>&lt;br/&gt;</code>, <code>\r</code>, <code>\n</code>, <code>\r\n</code> with only 1 <code>&lt;br /&gt;</code>, but only where it shows up togethe...
<p>You may want to try first exploding with end of line (<code>PHP_EOL</code>), strip out everything but the <code>&lt;a&gt;</code>, then <code>array_filter()</code>, <code>implode()</code>, and <code>trim()</code>:</p> <pre><code>$str = 'This is paragraph 1&lt;br&gt; This is paragraph 2&lt;br /&gt;&lt;br&gt; ...
how do I add a tabbar on top of my google map? <p>I am trying to add a tab bar on top of my google map however, whenever I run this code xcode always crashes and tells me "fatal error: unexpectedly found nil while unwrapping an Optional value"</p> <p>Here's my code:</p> <pre><code> @IBOutlet var tabControlller: UITab...
<p><strong>You can't set UITabBar on top in iOS. you can use any custom controll.</strong></p> <p>See this</p> <p><a href="https://developer.apple.com/reference/uikit/uitabbar" rel="nofollow">https://developer.apple.com/reference/uikit/uitabbar</a></p>
Android Share Intent not working <p>Im trying to share an image, it seems to work only when the SD card is mounted or when the phone doesn't have a SD card slot. But when I dismount the SD card, it wouldn't share and it gives me two errors. </p> <ul> <li><p>FATAL EXCEPTION: main ...
<p>try this code for share drawable image:</p> <pre><code> Uri imageUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + getResources().getResourcePackageName(R.drawable.ic_launcher) + '/' + getResources().getResourceTypeName(R.drawable.ic_launcher) ...
VBA: Drop down list - get items before and after the selected item <p>I have a drop-down list in my sheet. When I make a selection, is it possible to get the items before and after the selected item in the list?</p> <p>Example:</p> <p><a href="http://i.stack.imgur.com/Owmmu.png" rel="nofollow"><img src="http://i.stac...
<p>This will do it:</p> <pre><code>' rename "Combobox1" to the name of your control below Private Sub ComboBox1_Change() Dim idx As Long With ComboBox1 idx = .ListIndex If idx = 0 Then MsgBox "Next item: " &amp; .List(idx + 1, 0) ElseIf idx = .ListCount - 1 Then ...
Sort dataframe group according to a target vector in R <p>I have a dataframe such as shown below (original data is really big). I want to sort them based on the group of target vector and get the result.</p> <p>dataframe</p> <pre><code>sample group A AA B CC C CC D BB ...
<p>You could turn <code>group</code> into a <code>factor</code> and then use <code>order</code> e.g. for your sample data</p> <pre><code>... df$group &lt;- factor(df$group, levels=c('AA', 'CC', 'BB')) df[order(df$group), ] </code></pre> <p>would result in </p> <pre><code> sample group 1 A AA 5 E AA ...
ControlChars Fields <p>Hi I importing CSV file into SQL using vb.net and right now I don't know what should i use of ControlChars Fields.</p> <p>Whenever I used <strong>ControlChars.Lf</strong></p> <p>My sql script looks like this:</p> <pre><code>INSERT [dbo].[TblR8Mix] ([WireID], [PadNo], [Pattern], [Tester]) VALUE...
<p>I knew it.</p> <p>Change this .. </p> <pre><code>For Each row As String In csvData.Split(ControlChars.Cr) </code></pre> <p>into this code:</p> <pre><code>For Each row As String In csvData.Split(ControlChars.CrLf, ControlChars.Lf) </code></pre> <p><a href="http://stackoverflow.com/questions/6408155/vb-net-split-...
resultCode == RESULT_OK is not working in redmi note3 <p>Hi I want to capture image and do some opration for that image in my next activity.I have tried to run the below code in Samsung and Moto G and its working fine.When I tried same code with redmi note3,after Clicking right mark it is coming to the same activity.Ho...
<p>replace this:--</p> <pre><code>i.putExtra(MediaStore.EXTRA_OUTPUT, MyFileContentProvider.CONTENT_URI); </code></pre>
Why APOC (apoc-3.0.4.1-all.jar) not able to load in neo4j community edition, the same with other custom neo4j plugins? <p>However, the plugin as loaded in the enterprise edition with issue even with warnings. Also, there is not way to check for logs.</p> <p>error : Starting Neo4j failed: Component 'org.neo4j.server.da...
<p>Both Community and enterprise version of Neo4j running on the same machine. This is command used to find the running process</p> <p>ps aux | grep java</p> <p>Kill the enterprise process and restart the community edition.</p>
Replace fragment in ViewPager - Getting NPE <p>I have searched the other answers regarding how to replace a fragment within a viewPager but to no avail.</p> <p>The setup is the usual, I have 2 fragments.</p> <p>[Fragment1][Fragment2]</p> <p>From the action bar I have a search button which starts a new Intent in over...
<p>I came through same problem, It won't work if you a commit a fragment in <code>onActivityResult()</code></p> <p>But you can achieve this by</p> <pre><code>boolean replaceFragment=false; @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { replaceFragment = true; } @Overri...
How to add edit button on every row of a HTML table <p>(That's it. I don't know how to add edit button under "edit column" of each row.) Please suggest me any solution for this problem.</p> <p><a href="http://localhost/test/logindetails.php?edit=Modify#" rel="nofollow">enter link description here</a><br> <a href="ht...
<p>Just you want create mnew page details.php redirect using edit link then update records</p> <pre><code>while($std = mysqli_fetch_array($records)) { echo "&lt;tr&gt;"; echo "&lt;td&gt;" . $std['id'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $std['username'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $std['p...
JS file from AssetBundle not found (404 Error) - Yii2 <p>I created yii 1 application and used following script in order to navigate in view file:</p> <pre><code>$(function() { $('a[href*="#"]:not([href="#"])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') &am...
<p>Use '/Index/menu_navigate.js', that will help you to get correct path.</p>
Does Foundation 6 have a way to stop link's from being followed (like when opening reveal modals) <p>I'm using Foundation 6's "Reveal" to create modals. When I use a reveal trigger on a link that has a href, the modal pops up but then the page goes to the link as well. I only want it to go to the link if there is no JS...
<p>Try something like the following. </p> <pre><code>$('[data-open]').on('click', function(e) { e.preventDefault(); }); </code></pre>
Can't open some html files in chrome (mac) <p>There are some HTML files (no pattern that I've figured out) that I can't open via the terminal, GUI or right clicking Open in Browser via Sublime Text 3. </p> <p>The default browser to open the file is definitely set to Chrome. When I say to open the file in the browser i...
<p>you can open this html file and try "command + option + I" to see the file content in the console window, if it's real html file there will be source code reveal. i don't think it can be the chrome's problem.</p>
cannot execute something from variable vbscript <p>the data of C:\highlight2.txt is : "document.all.status1.innerText = 'component failure'"</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 prettypr...
<p>If you have a string containing code to execute, you need to <a href="https://msdn.microsoft.com/en-us/library/03t418d2(v=vs.84).aspx" rel="nofollow">execute</a> it:</p> <pre><code>&gt;&gt; For Each s In Split("WScript.Echo 1|WScript.Echo 2", "|") &gt;&gt; WScript.Echo "Statement:", s &gt;&gt; Execute s &gt...
parse table using beautifulsoup in python <p>I want to traverse through each row and capture values of td.text. However problem here is table does not have class. and all the td got same class name. I want to traverse through each row and want following output:</p> <p>1st row)"AMERICANS SOCCER CLUB","B11EB - AMERICANS...
<p>If the data is really structured like a table, there's a good chance you can read it into pandas directly with pd.read_table(). Note that it accepts urls in the filepath_or_buffer argument. <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_table.html" rel="nofollow">http://pandas.pydata.org/...
why output list is empty in my code in Python 2.7 <p>Using Python 2.7 and trying to do simple tokenization on UTF-8 encoded files. The output of <code>a</code> seems a byte string, which is expected, since after <code>tk[0].encode('utf-8')</code>, it converts from Python <code>unicode</code> type to <code>str/byte</cod...
<p>It appears that <code>jieba.tokenize()</code> returns a generator. A generator can be iterated over only once. Better do</p> <pre><code> b = [tk[0] for tk in segment_list] a = [tk.encode('utf-8') for tk in b] </code></pre>
couldn't find file 'bootstrap' with type 'application/javascript' <p>I am watching the old One Month Ruby on Rails lectures without being enrolled in the course and encountered this problem. I have searched through about 20 stackoverflow and github tutorials and can't find the problem, any help is greatly appreciated. ...
<p>you use <code>gem bootstrap-sass</code> than in your application.js use</p> <pre><code>//= require bootstrap-sprockets </code></pre> <p>and in your application.css use</p> <pre><code>// "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables" @import "bootstrap-sprockets"; @import "boot...
Prevent select from going out of the div: <p>The <code>select</code> tag is going out of the background <code>&lt;div&gt;</code>. I don't want to give background color to <code>body</code> of html page. Any solution with HTML,CSS and jquery is welcome.</p> <p>Here is the embedded code in Plunker: <a href="http://embed...
<p>Add a clear div below the <code>&lt;/article&gt;</code> as show below</p> <pre><code>&lt;article&gt; ..... &lt;/article&gt; &lt;div style="clear:both;"&gt;&lt;/div&gt; </code></pre>
Latest Google Play Services 9.6.80 cause "FirebaseCrash: Failed to initialize crash reporting" <p>Notice the latest version when the App is installed fresh, with FirebaseCrash enabled, the App took quite a while (over a minute to start)... and end up with the following crash. Removing firebase crash library from the ap...
<p>Found this <a href="https://groups.google.com/forum/#!topic/android-developers/7qS2CoPqxnw" rel="nofollow">https://groups.google.com/forum/#!topic/android-developers/7qS2CoPqxnw</a>. Seems like broad issues that Google should own. The temporally solution is <strong>remove Firebase Crash Library</strong>. The problem...
Can we give boost to fields through solr config file? <p>Every time we mention in query to give boost. Is it possible to mention boost for any field name in solr config itself ?</p>
<p>in the requestHandler config :</p> <pre><code>&lt;requestHandler name="/select" class="solr.SearchHandler"&gt; .... &lt;lst name="appends"&gt; &lt;str name="qf"&gt;my_col^1&lt;/str&gt; &lt;!--str name="qf"&gt;my_col^boost_val&lt;/str--&gt; &lt;!--str name="bq"&gt;my_col2^boost_val&lt;/str--&gt; &lt;/...
Explaining Scope in Javascript <p>I'm teaching an undergrad course in CS and I selected Javascript as a language because it is so light weight. I tried to write code and test it for the basis of all my lectures. Today I discovered that I had not correctly understood the output from my own code. I had fallen prey to the...
<p>Your first finding is new to me also so I will try to address your second question.</p> <p>Variables can have two types of scope ie local or global.</p> <p>All variables inside a function is considered a local variable. Unlike many other programming languages, JavaScript does not have a block level scoping. It onl...
Retrieve opening hours with holiday messages via Places API <p>I'm looking to show (within a site) the operating hours for a large number of global storefronts which are managed via Google MyBusiness/Places. When making an API request for a Google Place entry, it will return the opening hours as follows:</p> <pre><cod...
<p>It doesn't look like its available thru API, unfortunately. I did find that business owners who uses Google Places can <a href="http://googlesmb.blogspot.com/2010/10/google-places-and-tags-holiday-guide.html" rel="nofollow">update their business hours</a> for holidays. It just might only be available on their pages ...
Idiomatic Wicket way of serving resources from Amazon S3 <p>What is the Wicket way of serving user-uploaded assets from AWS S3?</p> <p>Requirements:</p> <ul> <li>No direct requests from browser to S3; all traffic is proxied through our servers;</li> <li>Allow assets to be cached by the browser with cache busting (eit...
<p>Here are the differences in those two approaches:</p> <p><strong>Page instance locking</strong></p> <ul> <li>In 1) the requests for the resources are made to an application scoped resource</li> <li>In 2) the request is to a page scoped resource</li> </ul> <p>In the second case Wicket will lock the access to the p...
Highlighting keywords in string, allowing "at", "in", "on" <p>For each Article there is a list of keywords which are currently highlighted (wrapped in span with class). However, I need to allow for certain prepositions within the keyword ("at", "in", "on"). Each article belongs to an Order which contains the keywords a...
<p>Would it be enough to just create a list of keywords with prepositions concatenated?</p> <pre><code>keywords_with_prepositions = prepositions.flat_map do |preposition| keywords.map do |keyword| [keyword, "#{keyword} #{preposition}", "#{preposition} #{keyword}", "something other in combinatation with your #{ke...
ng-repeat with input text box track by $index <p>I am writing an application where a div hoolds datepicker, 2 timepicker and a input text box. and i have a checkbox outside of div. Each time when i check a checkbox one div of date location will add. My application works fine except my input box value. ng-model is not h...
<p>you have to use $index in ng-repeat or ng-model ... just change :</p> <pre><code>ng-repeat="selecting in selects" (or) ng-model="selecting.configLoc" </code></pre>
Add an image on collection view cell having background colour in iOS <p>i am working on my application in which I have to add an image to collection view cell on selection. Collection view cell is circular and filled with color, so on selection of cell, image of tick should be on that color. </p> <pre><code>- (UIColle...
<ol> <li>Make global variable </li> </ol> <p>int clickedIndex;</p> <p>2 in viewDidLoad assign to clickedIndex</p> <pre><code>clickedIndex=-1; </code></pre> <ol start="3"> <li><p>in collectionView didSelectItemAtIndexPath </p> <pre><code>clickedIndex=(int)indexPath.row; [collectionView reloa...
Xcode debugger hangs in callback function from JavaScriptCore <h1>Update</h1> <p>It is fixed in Xcode 8.0</p> <hr> <h1>Environment</h1> <p>Xcode 7.3.1, iPhone SE, iOS 9.3.5</p> <h1>Problem</h1> <p>I bound C function to JavaScript function by <code>JSObjectMakeFunctionWithCallback</code> with JavaScriptCore framew...
<p>This is a known bug in Xcode 7.3.1, and it should be fixed in Xcode 8.0. If you find that it isn't when you get a chance to upgrade to 8.0, please file a bug with <a href="http://bugreporter.apple.com" rel="nofollow">http://bugreporter.apple.com</a>.</p>
How to auto populate data from DB into textbox using dropdownlist index changed <p>I created a program and one of its function is when you select an item from the dropdownlist, the data from database will automatically populate to the textbox. I was able to populate the data in the textbox but not the way I want it to ...
<p>Below code is what I did:</p> <p>'protected void cbPlan1_CheckedChanged(object sender, EventArgs e)</p> <pre><code>{ string CoverageBenefit1 = "250,000"; string CoverageBenefit2 = "500,000"; string CoverageBenefit3 = "3,750,000"; string CoverageBenefit4 = "125,000"; string CoverageBenefit5 = "625,000"; string Cove...
Win Api Custom credential provider : Dialog box resizing after windows login <p>I have created my custom credential provider to login to windows with smart card. When I insert the smartcard the dialog box for entering pin appears as appropriate size but once I am logged in to the system, every time I lock and unlock th...
<p>I have figured out the root cause for this issue.</p> <p>The default dpi of the system has scaling factor of 150%, i.e. dpi value 144, but GPO setting was overriding the registry value LogPixel to 96 and DesktopDPIOverride to -2(it should be 0 for default). So before login when GPO setting is not applied, applicat...
Qt: How to change Rubberband selection color <p>Qt : I have Subclass the Qgraphicsview and handling mouse events and Set the Dragmode as RubberBandDrag </p> <pre><code>setDragMode(QGraphicsView::RubberBandDrag); </code></pre> <p>I am getting the rubberband selection but I am not able to customize the rubberband sele...
<p>I guess that will take the system color. </p> <p>The cleanest way to do it is by subclassing QRubberBand or, better, create your own rubber band as a QWidget containing a QRubberBand (allows you to customize even more the rubber band).</p> <p>Take look at <a href="http://stackoverflow.com/questions/19066804/implem...
What is the point of using EventHandler like that? <p>What is the use of unregistering event handler that is not added yet in the code below?</p> <pre><code>public class foo { private event EventHandler&lt;boo&gt; booCompleted; public RegisterBooCompletedHandler(EventHandler&lt;boo&gt; newBooCompletedEventHa...
<p>It means that if you call <code>RegisterBooCompletedHandler(handler)</code> multiple times with the same handler, you still only actually subscribe to the event <em>once</em> for that handler.</p> <p>My guess is that <em>actually</em> you've seen this due to someone working round a problem where really they were su...
Scroll TableView inside ScrollView <p>I have a <code>tableView</code> inside a <code>scrollView</code>.</p> <p><a href="http://i.stack.imgur.com/jTiLC.png" rel="nofollow"><img src="http://i.stack.imgur.com/jTiLC.png" alt="enter image description here"></a></p> <p>I want when I scroll <code>tableView</code>, the outer...
<p>//Declare the view which is going to be added as scrolling view, for instance</p> <pre><code>let requiredView = UIScrollView() </code></pre> <p>//Add your required view as subview of tableview backgroundView view like as</p> <pre><code>tableView.backgroundView = UIView() tableView.backgroundView?.addSubview(requ...
Change image of button when pressed, make image of button not change when released <p>When I press the button image changes, but my problem is when I release the button, the image changes again (does not retain images). I am new to Java programming.</p> <p>My layout :</p> <pre><code> &lt;Button android:background...
<p>In your case, you want to change your volume indicator, I think you should do programmatically like this. </p> <pre><code> //At the top of your activity,declare a global variable boolean isVolumeOn = true; volumeButton.setOnClickListener(new View.OnClickListener() { @Override p...
WKWebView load local html5 project witch use sea.js and avalon <p>When I load the local html5 project by WKWebView,it can not works.I use the Safari inspector to check the errors.It lists the errors like this: </p> <pre><code>"XMLHttpRequest cannot load file:///Users....avalon/avalon.me.html. Cross origin requests a...
<p>I see you are trying to load an asset from your local machine (<code>file:///...</code>). XHR requests cannot be loaded from local machines. You need to set up a development server/environment to properly test you XHR requests.</p>
Does Consul key-value store give us any guarantees on ordering of two writes with two different keys? <p>Suppose we have only two nodes A and B.</p> <p>When we issue these two commands on the node A,</p> <pre><code>$ curl -X PUT -d one .../v1/kv/key1 $ curl -X PUT -d two .../v1/kv/key2 </code></pre> <p>(<em>ie.</em>...
<p>Consul claims linearizability. "All servers participate in the Raft consensus algorithm to ensure that transactions occur in a consistent, linearizable manner."</p> <p>If the puts were synced in another order than they were received, you could see them out of order when reading from another node, violating the line...
On upgrade to swift3, getting an error 'cannot override a property with type GKEntity' <p>After updating to swift3, the commented line is returning an error: Property 'entity' with type 'GKEntity!' (aka 'ImplicitlyUnwrappedOptional') cannot override a property with type 'GKEntity?'</p> <pre><code>import SpriteKit ...
<p><code>SKNode</code> already has a property called <code>entity</code> which is defined like so:</p> <pre><code>var entity: GKEntity? </code></pre> <p>Therefore you can not override that with your <code>entity</code> of type <code>GKEntity!</code></p> <p>So, you can either rename your <code>entity</code> to someth...
Upload file with api not working on IIS <p>I want to upload file with api, but also I need to send 'ID'. Same code is working in local, but does not working on IIS.</p> <pre><code> [HttpPost("{id}")] [Route("Upload/{id}")] public async Task&lt;IActionResult&gt; Upload(int id) { ...
<p>I found solution, it is very stupid.</p> <p>On client in TypeScript I had.</p> <pre><code> this.$upload.upload({ url: '/api/transfer/upload/' + this.id, method: 'POST', headers: { 'Content-Type': 'multipart/form-data' }, file: file, fi...
how i can resolve that in c++ using QT <pre><code>QString fileName = QFileDialog::getOpenFileName(bla bla bla); QFile file(fileName); ReadXML Rxml; Rxml.readXML(file); </code></pre> <p>I get the following compiling error:</p> <pre><code>QFile:QFile(const QFile&amp;) is private in definition of macro 'Q_DISABLE_COPY' ...
<p>You can't copy a QFile.</p> <p>Refactor your readXML to accept a QFile* or QFile&amp; instead, or a QIODevice* (the most flexible and common option in qt), and pass a pointer or reference.</p>
Place images outside content containers <p>I'm a little new to all this so my terminology may be a bit dodgy.</p> <p>On this page - <a href="http://www.halfbakedharvest.com/sage-lemon-roasted-chicken-goat-milk-brussels-sprout-pasta/" rel="nofollow">halfbakedharvest.com</a> - there are images that appear at the edge of...
<p>As Nath said, inspecting the elements will reveal they are using absolute positioning. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position" rel="nofollow">MDN absolute positioning</a></p> <p>Absolute positioning takes the element out of the normal flow of the page and positions the element relative t...
why cookies are removed when retrieving embedded resources in JMETER <p>I'm new to JMeter so forgive me if I'm asking the obvious. I am writing a performance test for a site protected by user password, where the authentication is passed as a token in the cookies.</p> <p>I am able to extract the token and add it to the...
<p>I have never heard about cookies removal from the "embedded resources" request, looking into the <a href="http://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree" rel="nofollow">View Results Tree</a> listener the cookies are present on fresh JMeter 3.0 installation</p> <p><a href="http://i.st...
UITabBar on top or any other? <p>I'm new to swift, going to create an UI in that a tabor is being shown in it , As i gone through the <strong>apple's human interface guidelines</strong> , they said not use UITabBar on top. We can use it by custom , but many of them said while submitting in App Store it will get rejecte...
<p>You should use a segmented control in the navigation bar, as in this example form the iOS Human Interface Guidelines:</p> <p><a href="https://developer.apple.com/ios/human-interface-guidelines/ui-controls/segmented-controls/" rel="nofollow">https://developer.apple.com/ios/human-interface-guidelines/ui-controls/segm...
HTML inside SVG foreignobject not visible <p>I am struggling with an SVG, where I embed HTML via <code>foreignobject</code>. Here's a minimal component:</p> <pre><code>val SvgDemoComponent = ReactComponentB[Unit]("Demo") .render { _ =&gt; &lt;.svg.svg( &lt;.svg.foreignobject( &lt;.div("Hello From SVG") ...
<p>Caused by a spelling mistake in scalajs-react: <code>foreignObject</code> requires a capital <strong>O</strong>.</p> <p><a href="https://github.com/japgolly/scalajs-react/pull/305" rel="nofollow">PR</a> submitted.</p>
php5-fpm, killed by HUP Signal: Main Process failed to respawn <p>I had a problem on my main php server, wherein the main <code>php5-fpm</code> process would be killed by an <code>HUP</code> signal. After the main process would be killed it would fail to respawn. Since each child process is allowed only to server a cer...
<p>After searching the internet was finally able to get a solution to this by modifying the upstart script of <code>php5-fpm</code> in <code>/etc/init/php5-fpm.conf</code></p> <pre><code># php5-fpm - The PHP FastCGI Process Manager description "The PHP FastCGI Process Manager" author "Ondřej Surý &lt;ondrej@debian....
EXC_BAD_ACCESS in swift while calling function <p>I know there are many answers about this error but I cannot seem to figure it out. I am receiving the error Thread 1: EXC_BAD_ACCESS (code=257, address=0x200000003) on the line where the function is called. My table cell view controller is as follows.</p> <pre><code>im...
<p>You did not set the class <code>CustomImageView</code> to the <code>postImageView</code> in the IBInspector:</p> <p><a href="http://i.stack.imgur.com/6an28.png" rel="nofollow"><img src="http://i.stack.imgur.com/6an28.png" alt="description"></a></p>
clipboard.js Copy text in side closest <pre> <p>I am using <a href="https://clipboardjs.com/" rel="nofollow">clipboard js</a></p> <p>I would like to be able to copy my <code>&lt;pre&gt;</code> content but not sure how to make it work with the code inside bootstrap panel</p> <p>Here is example what I have tried <a hre...
<p>Read the documentation on <a href="https://clipboardjs.com/" rel="nofollow">https://clipboardjs.com/</a> (of should I say <em>rtfm</em> ?)</p> <p>Your button needs an attribute <code>data-clipboard-target</code> where you specify a selector to the element you want to copy.</p>
Handlebars not rendering template <p>I have been on this issue for more than a couple of hours now and I have no idea why it isn't working. It's a simple {{#each}} block. I will add I am new to Handlebars.js.</p> <p>I thought maybe there was something wrong with my [vanilla] javascript so I translated the code to JQue...
<p>This should do it.</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>var source = document.getElementById('eventList-template').innerHTML; var template = Handlebars.compil...
xslt: Remove one line comment including space <p>I want to transform this</p> <pre><code>&lt;appSettings&gt; &lt;!-- comment1 --&gt; &lt;add key="Value1" value="11" /&gt; &lt;!-- comment2 --&gt; &lt;add key="Value2" value="22" /&gt; &lt;/appSettings&gt; </code></pre> <p>into this using xslt</p> <pre><code>&...
<p>If you really want to do this, you could try removing the <code>indent="yes"</code> option from <code>xml:output</code> and then having a template to match, and ignore, any whitespace only node that immediately precedes the comment.</p> <p>Try this XSLT</p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:x...
Combobox does not dispatch a change event when text is same as previous text <p>If you have a Flex Spark Combobox and enter a value in the text field and press enter a Event.CHANGE event was dispatched. Then if you set the selectedItem to null it erases the value. But if you type in the same value as before and press e...
<p>It appears that ComboBox.previousTextInputText is not being cleared out and that may be the reason it's not dispatching a change event.</p> <p>It appears that setting ComboBox.openOnInput to false achieves the desired behavior. This is not a real fix but seems to work. </p>
Using regex to restrict user input <p>There is a particular field in my application where a user will be asked to enter a time for a job to be run (like HH:MM) for the MM field, I want the user to enter a number in the range 0-59 ONLY. How should I pattern match this with regexp ?</p>
<p>Try using this regex:</p> <pre><code>^[0-5]?[0-9]$ </code></pre> <p>This will allow an optional first digit of <code>0-5</code> followed by any second digit.</p> <p>But I would rather just check the numerical value in your code (JavaScript), since this is much easier to handle there.</p> <p><a href="https://rege...
how to expand - collapse in ui grid Grouping on row click? <p>I am trying to expand and collapse the grouping on row click as it should work with + and - icons in the ui grid.</p> <p>I am trying to call treeButtonClick(row, $event) from the row template like below. but the function in not triggering.</p> <pre><code...
<p>You can use below function to expand all rows, $scope.gridApi.treeBase.expandAllRows(), same way to collapse you can use collapseAllRows. You can add a cellTemplate for that column, where you need '+' and '-' and for that '+' click, you can expand these rows through these functions.</p>
Android Studio HiDPI support for Linux <p>I'm struggling with HiDPI support of Android Studio 2.1.3 for Linux Mint. What I know it should be possible to enable Android Studio's HiDPI support by adding <code>-Dhidpi=true</code> flag to <code>/opt/android-studio/bin/studio64.vmoptions</code> Unfortunately it doesn't cha...
<p>I had the same problem, and I did not manage to "enable" hidpi for Android Studio.</p> <p>Therefore, I run Android Studio like so:</p> <pre><code>$ xrandr --dpi 192; android-studio&amp; </code></pre> <p>Or whatever you prefer instead of <code>192</code>, of course.</p>
decode string from web to c# object - look the content value is incremented depending on count <p>Im having with the content. it is auto increment. the result is static but the content is dynamic.</p> <p>I'm using a hardcoded array in catching the return string from the web. Can anyone json decoder in converting the r...
<p>On site <a href="http://json2csharp.com/" rel="nofollow">json2csharp.com</a> you can generate classes for <code>JSON</code> data. Generated classes needs some improvements and can look like:</p> <pre><code>public class Result { public string count { get; set; } } public class Content { public string messag...
Known pattern match in agda <p>Roughly, I have</p> <pre><code>check : UExpr -&gt; Maybe Expr </code></pre> <p>And I have a test term</p> <pre><code>testTerm : UExpr </code></pre> <p>Which I hope will <code>check</code> successfully, after which I want to extract the resulting <code>Expr</code> and manipulate it fur...
<p>The usual deal is to write something like</p> <pre><code>Just : {X : Set} -&gt; Maybe X -&gt; Set Just (just x) = One -- or whatever you call the fieldless record type Just nothing = Zero justify : {X : Set}(m : Maybe x){p : Just m} -&gt; X justify (just x) = x justify nothing {()} </code></pre> <p>If m computes ...
Long process under Swing GUI : unexpected delay <p>To explain my question here is an MCVE where clicking clicking a <code>JButton</code> on <code>JDialog</code> A opens <code>JDialog</code> B:</p> <pre><code>import java.awt.BorderLayout; import java.awt.Color; import java.awt.FlowLayout; import java.awt.event.ActionEv...
<p>a. <code>showDiag</code> runs on the GUI thread. The GUI will be completely dead while you make the GUI thread sleep.</p> <p>b. Yes, use a <code>SwingWorker</code> for long-running tasks and use <code>SwingUtilities.invokeLater()</code> to submit GUI-updating tasks back to the GUI thread. Alternatively, implement <...
Angular 2, Webpack, Express, HMR <p>I am developing my Angular 2 application using Webpack and HMR. At this stage there is a static application with no interaction with the backend. All data is static dummy data.</p> <p>I am at the point where it is time to start adding the express/node backend so I can interact with ...
<p>Using the <strong>webpack-hot-middleware</strong> plugin it is actually quite straight forward. </p> <p><strong>webpack.express.config.js</strong></p> <pre><code>var webpack = require('webpack'); var HtmlWebpackPlugin = require('html-webpack-plugin'); var ExtractTextPlugin = require('extract-text-webpack-plugin');...
how to differentiate json Response array while building an expandable tableview <p><a href="http://i.stack.imgur.com/SCUEQ.png" rel="nofollow"><img src="http://i.stack.imgur.com/SCUEQ.png" alt="enter image description here"></a></p> <p><a href="http://i.stack.imgur.com/6qTAK.png" rel="nofollow"><img src="http://i.stac...
<blockquote> <p>In the <code>tableViewDelegate</code> implement the following function:</p> </blockquote> <pre><code>- (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath { id cat = categories[indexPath.item]; if (cat.sub_sub_cat) { return 15;...
Remove Auth Filter on one of the Web API's in spring-boot <p>My project has 2 API's. 1st requires Authentication and the 2nd one does not.</p> <p>I was successfully able to added a Token Based Auth Filter for the first API <code>/auth/uploadFile</code></p> <p>Here is the code snippet from the <strong>SecurityConfig</...
<p>You can override/add below method in SecurityConfig class. </p> <pre><code>public void configure(WebSecurity web) throws Exception { web .ignoring() .antMatchers("/noauth/**"); } </code></pre>
Export And Write CSV In Specific Location <p>I am stuck in a logic where I have following below requirement:</p> <p><strong>1-</strong> Generate multiple CSV files.</p> <p><strong>2-</strong> Export CSV files to a specific location.</p> <p><strong>3-</strong> ZIP all the files from that location.</p> <p>Previously ...
<p>I've been try your code, and you should change this part of your code,</p> <pre><code>Response.Clear(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment;filename=HeaderSection.txt"); Response.Charset = ""; Response.ContentType = "application/text"; Response.Output.Write(csvHeader); </co...
Fuzzy identity fingerprinting <p>I have a spreadsheet with values like address, name, IBAN, e-mail and want to identify when a customer last time bought something.</p> <p>The problem is: some fields contain spelling mistakes, others were deliberately entered wrong.</p> <p>On GitHub, several libraries like <a href="ht...
<p>I mentioned it in your other question, but the <a href="https://github.com/datamade/dedupe" rel="nofollow">dedupe python library</a> <a href="http://dedupe.readthedocs.io/en/latest/Matching-records.html#record-by-record-or-field-by-field" rel="nofollow">does what you want</a>. </p> <p>Basically, it calculates the d...
Class field not accessible inside of function <p>I'm fairly stupid when it comes to C++ as I'm from a pure Java background with good Python knowledge, but I am trying to make a simple C++ class with a vector referenced in the header file, and access it in a function in the source file. I can access it fine in the const...
<p>Use <code>simulator::add_object</code> since it's a class method, just like you did for the constructor and destructor already.</p>
Android AsyncTask from Service (started from receiver) unable to resolve host <p>I have an <code>AsyncTask</code>, connecting to my server.</p> <p>When I run it from <code>Activity</code> - everything works good.</p> <p><strong>But when it is started from <code>BroadcastReceiver</code> inside <code>onReceive()</code>...
<p>A <code>BroadcastReceiver</code> has a very short lifetime - just the <code>onReceive()</code> method. After that it will be destroyed (unless it was registered by an <code>Activity</code>.) Even though you are creating a secondary thread to then kick off an <code>AsyncTask</code> via some static instance class, t...
sizeof operator evaluates in which stage of compilation in gcc <p><code>sizeof</code> is a compile time operator. <a href="http://stackoverflow.com/questions/2615203/is-sizeof-in-c-evaluated-at-compilation-time-or-run-time">See here</a>.</p> <p>Compilation has many stages. At which stage is the <code>sizeof</code> ope...
<p>Typically, after the preprocessor runs and produces the preprocessed translation unit (whole header files pasted in the place of <code>#include</code>, <code>#define</code>'s substituted all over the place, inactive branches of <code>#ifdef</code> conditionals completely removed, etc.), the compiler runs. Most moder...
How to generate a polygonal chart <p>I'm developing an android application in which I want to show a set of aptitude's person and a numeric rating associated to each one of them.</p> <p>Currently, my approach is a <code>ListView</code> where each row shows a <code>TextView</code> with the name of the aptitude and a <c...
<p>Checkout <a href="https://github.com/PhilJay/MPAndroidChart" rel="nofollow">MPAndroidChart</a> </p> <hr> <p>it has Radar Chart (spider web chart) which is highly customizable. you get something like this <a href="http://i.stack.imgur.com/dE86X.png" rel="nofollow"><img src="http://i.stack.imgur.com/dE86X.png" alt=...
mongodump showing error: Error parsing command line: too many positional options <p><strong>mongodump:</strong> </p> <pre><code>--host hostname:port -u User -p password--authenticationDatabase admin --dbdb_name --collection collection_name –q {db.getCollection('col_name').find({"statement.context.platform":"abc","st...
<ol> <li>Spaces between arguments are not correct</li> <li><a href="https://docs.mongodb.com/manual/reference/program/mongodump/#cmdoption--query" rel="nofollow">https://docs.mongodb.com/manual/reference/program/mongodump/#cmdoption--query</a> says:</li> </ol> <blockquote> <p>You must enclose the query in single quo...
Variable nil in one function <p>I'm using latest Xcode Version 8.0 (8A218a) and Swift 3.0.</p> <p>I'm working with a UIScrollview (m_scrollView) that is correctly allocated and used.</p> <p>When <code>callbackForceUpdateEvent</code> is called, <code>m_scrollView</code> is OK but right after, when calling <code>showEv...
<p>I tried to rename my variable and it's working fine now. And I understood my mistake: the variable m_scrollview was also declared in the superclass.</p> <p>I don't know why the Swift compiler didn't tell me that. But after renaming back the variable, Swift told me it...</p> <p>Problem solved!</p>
symfony3 & SonataAdmin & Formatter Bundle - Error when using formatter options "target_field" do not exist <p>I'm using symfony <strong>3.1.4</strong> and install SonataAdminBundle, SonataFormatterBundle. I'm having troubles using the Sonata Formatter Bundle.</p> <ol> <li><p>Install SonataFormatterBundle by this <a h...
<p>There are a lot of compatibility problems with symfony 3.1.4, <a href="https://www.bountysource.com/issues/29543399-unfortunately-does-not-work-with-symfony-3-0-1" rel="nofollow">option resolver is one of them</a> . I recommend to try 'formatter-bundle 4.x-dev', where it's fixed among other issues.</p> <p>Also:</p>...
Change the behaviour depending on whether you are in local network or not <p>I am making bash script like this</p> <pre><code>if [ "if I am in local "]; then ssh myuser@192.168.11 else ssh myuser@myserver.com fi </code></pre> <p>How could I get if I am in local or not?</p>
<p>One possibility is to test whether <code>192.168.11</code> is ping-able:</p> <pre><code>if ping -qc1 192.168.11 &gt;/dev/null; then ssh myuser@192.168.11 else ssh myuser@myserver.com fi </code></pre> <p>If <code>ping</code> receives a response from <code>192.168.11</code>, then it exits with return code 0 (suc...