input
stringlengths
51
42.3k
output
stringlengths
18
55k
What does the '@@' symbol mean in the output of nm command? <p>I'm looking at the output of 'nm' command for a shared lib in Linux. I see this</p> <pre><code>U stderr@@GLIBC_2.0 </code></pre> <p>Does that mean stderr is hardlinked the glibc2.0? The reason I'm asking this we have a set of libraries (let's say a1.so, a...
<p>The <code>@</code> allows specifying a version for a symbol. When multiple definitions of a symbol exist, they'd have different versions. To indicate the default version, <code>@@</code> is used. The default version is chosen if no explicit version is specified.</p> <p>More details can be found in the <a href="http...
Unable To Share Text On Xamarin Form <p>Hello Everyone I want to share the Text on Xamarin Form using Library plugin.share. I have successfully implemented the library and on android i can able to share the text but in iOS it returns me nothing. i have done the share code on button click event so when i click on button...
<p>You want to take a look at <code>UIActivityViewController</code>, you can find the documentation here <a href="https://developer.xamarin.com/api/type/MonoTouch.UIKit.UIActivityViewController/" rel="nofollow">https://developer.xamarin.com/api/type/MonoTouch.UIKit.UIActivityViewController/</a></p> <p>And Xamarin.Form...
Fixed table layout with auto width <p>According to spec, <strong>Fixed table layout</strong> won't work with <code>width</code> set to <code>auto</code>:</p> <blockquote> <p>17.5.2.1 Fixed table layout</p> <p>With this (fast) algorithm, the horizontal layout of the table does not depend on the contents of the...
<p>Just assign a percentage width to the <code>td</code> - you don't need any CSS rule for <code>table</code> itself then (see snippet)</p> <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false"> <div class="snippet-code snippet-currently-hidden"> <pre class="snippet-code-css ...
Camera.open works on Android 4.2.2, but fails on 6.0.1 <p>I have 2 devices to test my app : an Acer v370 running Android 4.2.2, and a Samsung Galaxy S6 on 6.0.1</p> <p>The app works fine on the Acer, but crashes instantly on the S6. I'm using <code>_camera = Camera.open(0);</code> and debugging says it crashes at thi...
<p>For Checking permission I created a separate class as below:</p> <pre><code> public class MarshMallowPermission { public static final int RECORD_PERMISSION_REQUEST_CODE = 1; public static final int EXTERNAL_STORAGE_PERMISSION_REQUEST_CODE = 2; public static final int CAMERA_PERMISSION_REQUEST_CODE = 3...
How i can select class? <p>How can I find certain class using jquery? This is my code</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>$('#reg').click(function() { $(".re...
<p>Is this what you want - to position the <code>.reg-auto</code> to top of the page when <code>#reg</code> is clicked</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>$('#re...
Rest Template - No buffer space available (maximum connections reached?) <p>I'm using <code>RestTemplate</code> to execute concurrent HTTP requests. After some time, I start getting </p> <blockquote> <p>java.net.SocketException: No buffer space available (maximum connections reached?)</p> </blockquote> <ol> <li>I...
<p>Connections are pooled based on a route. Since you have at least 2 routes, total number of connections should be at least 2 times of max connections per route. See also other related <a href="http://stackoverflow.com/questions/31869193/using-spring-rest-template-either-creating-too-many-connections-or-slow">post</a>...
What is a difference between pyWorkPage and pyWorkCover page in Pega? <p>The page displayed on Clipboard <code>pyWorkPage</code> and <code>pyWorkCover</code>.</p> <p>Can you tell me the difference between them? And let me from where I will get complete data to read about the Clipboard.</p>
<p>Harness forms are displayed with the standard activity <code>@baseclass.Show-Harness</code>. This activity expects to find (by convention) objects on the page names:</p> <ul> <li><p><code>pyWorkPage</code> - conventional name for the page that contains a work item. This page usually has a class derived from the <co...
Where not like in laravel mongodb <p>How to write <strong>WHERE NOT LIKE</strong> in laravel with mongodb ? I found this one but don't know how to use it in laravel -</p> <pre><code>db.tbl_users.find( { first_name: { $not: /^M.*/ } } ) </code></pre> <p>Please help , thanks.</p>
<p>From the <strong><a href="https://github.com/jenssegers/laravel-mongodb" rel="nofollow">documentation</a></strong>:</p> <p>The <code>regex</code> operator selects documents where values match a specified regular expression.</p> <pre><code>User::where('first_name', 'regex', new \MongoDB\BSON\Regex("/^M.*/"))-&gt;ge...
Camel simple expression language - How to get property value dynamically <p>I am new to Camel and using simple expression to get value from property file in Java DSL.</p> <p><code>.setProperty("PortalUrl", simple("properties:Portal.url"))</code></p> <p>Property file value -<br> <code>Portal.url=abc.com/example</code>...
<p>Have you tried with the <code>${body}</code> function in the simple language:</p> <pre><code> .setProperty("PortalUrl", simple("${properties:Portal.url.${body.customerName}}")) </code></pre>
Cannot get value from PHP to Javascript <p>So in my PHP file I create a JSON Object which I need to get to my Javascript file for processing. I can't seem to transfer anything however, not even with a simple string like this:-</p> <p><em>index.php</em></p> <pre><code>&lt;?php $cookie= "blueberry cake"; ?&gt;; </cod...
<p>The external js file will not be parsed as php meaning that you cannot access that variable. You can save your js as php (NOT RECOMMENDED). alternatively a)</p> <p>include that function at the bottom of the bottom of the php page:</p> <pre><code>&lt;?php $cookie= "blueberry cake"; ?&gt;; //js further down th...
Groovy: How Closure works in sort() <p>I found a code segment like:</p> <pre><code>def l1 = ["hello","hi","hey"] l1.sort{new Random()} </code></pre> <p>I could not figure out how a Random class object is being usd to sort/shuffle the list items? How Random class object is returning Comparable/Comparator object to...
<p>I suspect that the intent here is that a random value is used as the <code>Comparable</code> for each entry (i.e. using the single-argument closure variant of <a href="http://docs.groovy-lang.org/latest/html/groovy-jdk/java/lang/Iterable.html#sort%28groovy.lang.Closure%29" rel="nofollow"><code>Iterable.sort(Closure ...
Keyboard and Popup window closes on BackPress <p>I am working on an android application. In an activity at the bottom of the page, I am showing a popupWindow and replaced the keyboard with this popupwindow. This popupWindow is having a searchview inside it, so when searchview will be in focus the keyboard will be shown...
<p>add code to hide keyboard inside key listener using onKeyDown() mehod.</p> <pre><code> boolean isKeyboardHidden=false; @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_DOWN) { switch (event.getKeyCode()) { ...
Match rows from two dataframes with closest values <p>Hope anyone can assist me with this one. I am working on measuring branches. I have two datasets: <code>df.ref</code>(reference) and <code>df.tst</code> (modelled). The reference states that there are three branches <code>df.ref$ID</code> with values for width and l...
<p>One approach you could use would be to measure all pairwise euclidean distances between the data points using the <a href="https://stat.ethz.ch/R-manual/R-devel/library/stats/html/dist.html" rel="nofollow">dist</a> function:</p> <pre><code>&gt; dist_mat &lt;- as.matrix(dist(combined[,c('length', 'width')])) &gt; di...
Cassandra get more than 10k rows <p>I am getting stuck with Cassandra <code>all()</code> query.</p> <p>I am using the Django platform. My query is to get all rows from Cassandra table. But, CQL has some limit to 10k rows at a time.</p> <p>Before, I have less than 10k rows in Cassandra table. But, now the count has...
<p>CQL have a <em>default</em> limitation to 10k rows. That means there's an <em>implicit</em> limit to 10k when you perform any <code>SELECT</code>. If you want you can override that by specifying a new <code>LIMIT</code> value, eg:</p> <pre><code>SELECT * FROM mytable LIMIT 500000; </code></pre>
How to put button inside line? <p>What i want is to have something like this :</p> <p>-------------------button------------------</p> <p>I know how to put text inside line but when i put button it not looks good. Any suggestion?</p>
<p>You can try to add line with using <code>after</code> and <code>before</code>.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>button { padding: 0 100px; overflow...
Group list by given occurrence in Scala <p>I have a list of strings that I'm trying to split into separate lists sequentially, grouping the 4th occurrence i.e. this list: </p> <pre><code>val data = List("1", "2", "3", "4", "5", "6", "7", "8") </code></pre> <p>should be grouped as </p> <pre><code>val list1 = List("1...
<p>You can use <code>.transpose</code> on the list <code>.sliding</code> generates:</p> <pre><code>scala&gt; val data = List("1", "2", "3", "4", "5", "6", "7", "8") data: List[String] = List(1, 2, 3, 4, 5, 6, 7, 8) scala&gt; data.sliding(4, 4).toList res1: List[List[String]] = List(List(1, 2, 3, 4), List(5, 6, 7, 8)...
CloudKit iOS how could I set World Write Permission <p>How could I set World Write Permission on the iCloud Dashboard cause now it's disabled, and really need it</p> <p><a href="http://i.stack.imgur.com/dYUQq.png" rel="nofollow"><img src="http://i.stack.imgur.com/dYUQq.png" alt="enter image description here"></a></p...
<p>Short answer: You can't.</p> <blockquote> <p>For a running CloudKit app, a container’s public database is always readable, even when the user is not signed in to their iCloud account on the device. Saving records to the public database and accessing the private database requires that the user be signed in. If y...
Frameworks with Swift 2.3 are unable to run in Xcode 8 <p>I am from <code>Objective-C</code> background but I am using some libraries which are written in <code>Swift</code> .As long as I use xcode 7.3 I am not facing any issues. But after upgrading to Xcode 8 I am prompted to convert to Swift 3.0. I chose later, but ...
<p>For <code>ObjectMapper</code> framework with <code>swift3</code> compatibility update pod with <code>pod 'ObjectMapper', '~&gt; 2.0'</code>, Then clean &amp; re-build, should resolve your problem for <code>swift3</code>. :)</p>
Spring Data Mongo: How to save batch ignoring all duplicate key errors? <p>I have the following domain object:</p> <pre><code>@Document class Foo { @Id private final String bar; private final String baz; // getters, setters, constructor omitted } </code></pre> <p>Which is inserted as follows:</p> <pr...
<p>I searched through spring data mongo documentation and other resources, but didn't find expected answer.</p> <p>Seems like Mongo inserts batch docs until unique key constraint is met, and it's up to DB to decide.</p> <p>So for example if you need to insert 100 docs and document on position 50 already exists in DB ...
Angular $scope object showing $scope.data but when I try to use it, the says undefined <p>I have this controller that takes info from a service. </p> <p>When I return the data to the controller I am using $scope to let the view have the data. </p> <p>I have a few console.logs and the ones inside the then function wor...
<p>Angular is asynchronous, that's why you can't console it outside service response</p> <p>Try to print the data this way..</p> <pre><code>function TableController(service, $scope) { $scope.data = {}; service.getListFromUrl(apiTableUrl).then(function(data) { $scope.data = data; printData(); }); fun...
Curried closures in Swift3? <p>Why</p> <pre><code>let arr = [1,2,3,4,5] let filtered = arr.filter { $0 &lt; 3 } </code></pre> <p>and why not?</p> <pre><code>let filtered = arr.filter(&lt;3) </code></pre> <p>if I can use operator function:</p> <pre><code>[1,2,3].sorted(by: &gt;) </code></pre>
<p>The signatures of <a href="http://swiftdoc.org/v3.0/protocol/Sequence" rel="nofollow"><code>Sequence</code></a>:s <code>filter(...)</code> and <code>sorted(...)</code> are as follows</p> <pre><code>func filter(_ isIncluded: (Self.Iterator.Element) throws -&gt; Bool) rethrows -&gt; [Self.Iterator.Element] func sort...
Pass data to ionic2 menu <p>I am having a menu whose html i have written in app.html-</p> <pre><code>&lt;ion-menu [content]="mycontent"&gt; &lt;ion-toolbar class = "menuUserName"&gt; &lt;ion-title&gt;{{userName}}&lt;/ion-title&gt; &lt;/ion-toolbar&gt; &lt;ion-content&gt; &lt;ion-list&gt; ... &...
<p>Your problem is passing data between pages. I think you should use <a href="http://ionicframework.com/docs/v2/api/util/Events/" rel="nofollow">Ionic Events</a></p> <p>for sending and responding to application-level events across your app.</p> <p>For example: put it in app.ts</p> <pre><code>function createUser(use...
Slidetoggle and changing glyphicon <p>This is my first project and my first post here so go easy on me ;)</p> <p>jQuery is what I'm struggling on. I want to have a button with an arrow pointing down to allow the user to slide out more informations, and when i click it, it should change that glyphicon to point up. So t...
<pre><code>use &lt;i class=""&gt; &lt;/i&gt; and css #hidden_content {display: none;} for hide your content </code></pre> <p><a href="https://jsfiddle.net/tjbaezid/89mgy3mv/2/" rel="nofollow">Live FIDDLE</a></p> <pre><code> $(document).ready(function() { $("#button").click(function() { $("#hidden_co...
Convert string to Datetime <p>I've received a flat file and after parsing and inserting it in a table. I've a column which has dates in a format <strong>yyyyMMddhhmmss</strong></p> <p>Here, <strong>yyyy</strong> is year, <strong>MM</strong> is month, <strong>dd</strong> is day, <strong>hh</strong> is hours, <strong>mm...
<p>You can use select DATETIMEFROMPARTS ( year, month, day, hour, minute, seconds, milliseconds )</p> <pre><code>declare @dt nvarchar(25) = '20150121190941' select datetimefromparts(left(@dt,4), substring(@dt,5,2), substring(@dt,7,2),substring(@dt,9,2), substring(@dt,11,2), substring(@dt,13,2), '000') </code></pre>
How to move scroll of ListView on to the new data added in ListView in Android <p>I am developing an app in which I have a listview in which 5 data are visible to user.when I scroll bottom of listview and a progress bar at the bottom of listview is visible to me and server request is send at this point and 5 more data ...
<p>Following code will help you to maintain the scroll position of your listview:</p> <p>First off all you have to get the current child position of listview from below code:</p> <pre><code>// this code should be written before updating adapter in your listview int lastViewedPosition = listView.getFirstVisiblePositio...
Analyzing 3 Dimensional data in MS Excel <p>Need help</p> <p>I have to analyze traffic violations data with respect to place, month, and type of violation in MS Excel.</p> <p>I can plot graph of Month vs Count of Violation in a place that gives me place where maximum violations took place in a month </p> <p>and Mont...
<p>3D graphs are really hard for people to read and interpret. You might consider making a series of graphs by month (1 graph per month) if you really want to highlight monthly changes. If you just want to find the troublespots, you could graph place by violation and be done with it. </p> <p>But if you are sold on a...
Image not appending in Javascript <p>I am new to javascript, I am trying to append a img tag inside a div tag. but it is not concatinating with already existing elements inside the div.</p> <p>This is my HTML code:</p> <pre><code> &lt;div class="ce_label"&gt; &lt;span&gt;some text&lt;/span&gt; &lt;sp...
<p>This line</p> <pre><code>x[i].appendChild = commentHtml; </code></pre> <p>tries to assign a string to the element's <code>appendChild</code> property, which refers to a function you can't overwrite.</p> <p>If you want to replace the element's content with that HTML, assign to <a href="https://developer.mozilla.or...
How to get columns to break into rows with flexbox? <p>I have this form with four input elements in a row (in desktop view).</p> <p>Can anybody tell me how to get those four input elements to break into rows when the screen width gets below, say, 680px?</p> <p><div class="snippet" data-lang="js" data-hide="false" dat...
<p>Use a media query with a breakpoint of 680px and <code>flex-direction:column;</code></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>form { display: flex; } @media...
This site requires a DHE-based SSL cipher suite. These are deprecated and will be removed in M52, around July 2016 <p>I've found this error in Chrome (Version 52.0.2743.82 (64-bit)) "This site requires a DHE-based SSL cipher suite. These are deprecated and will be removed in M52, around July 2016"</p> <p><a href="htt...
<p><strong>Solved</strong>. In apache2 virtual host, you must <strong>aggregate</strong> all these to <strong>SSLCipherSuite</strong></p> <pre><code>SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES12...
How can I specify the bin width for just one histogram? <p>How can I specify the bin width for just one histogram?</p> <pre><code>library(GGally) data(tips, package="reshape") library(ggplot2) ggpairs(data=tips, # data.frame with variables columns=1:3, # columns to plot, default to all. title="tips da...
<p>As <a href="http://stackoverflow.com/questions/39508920/how-can-i-specify-the-bin-width-for-just-one-histogram#comment66334413_39508920">@user2957945 mentioned</a>:</p> <pre><code>library(GGally) data(tips, package="reshape") library(ggplot2) gg &lt;- ggpairs(data=tips, # data.frame with variables columns=...
Multi-tenant application with pre-consent cannot call graph API <p>I'd like to make an app automatically available for all tenants we have in our partner account that doesn't require any user credential.</p> <p>For that, I created a web app in azure that is multitenant and has access to application permissions over "M...
<p>It seems that it was a problem with the consent. Whether or not I use a new tenant, I have to go to <a href="https://login.windows.net/common/oauth2/authorize?response_type=code&amp;client_id=%7B0%7D&amp;prompt=admin_consent" rel="nofollow">https://login.windows.net/common/oauth2/authorize?response_type=code&amp;cli...
Unable to read form inside uib-tabset <p>I am trying to read a <strong>form</strong> from my controller. But I am getting undefined error. Here is my sample code.</p> <p>HTML - </p> <pre><code>&lt;uib-tabset name="tabMain" id="tabMain1"&gt; &lt;uib-tab heading="SomeTabName" name="tab1" id="tab1X"&gt; &lt;form nam...
<p>The form only registers itself with the $scope of the controller after the controller has initially run. Therefore the $scope will return undefined even if everything is setup correctly.</p> <p>In your example to react to the presence of theForm, you can setup a watcher on theForm to set debug text depending its pr...
postgresql - compare two tables grouped by a column <p>i don't know if my title for this question is correct, but here is my question</p> <p>I have two tables (TB1 and TB2) both have same columns, here is the structure..</p> <pre><code>TABLE_NAME | COLUMN_NAME | DATA_TYPE </code></pre> <p>then I want to compare ...
<p>I think you want a <code>full outer join</code>:</p> <pre><code>select coalesce(tb1.table_name, tb2.table_name) as table_name, tb1.column_name, tb2.column_name, coalesce(tb1.data_type, tb2.data_type) as data_type from tb1 full outer join tb2 on tb1.table_name = tb2.table_name and tb1...
SVM Scikit-Learn : Why prediction time decrease with SVC when increasing parameter C? <p>I’m trying to evaluate the influence of the # of features &amp; parameter C (SVM regularization) on the prediction time. I am using a modified version of <a href="http://scikit-learn.org/stable/auto_examples/applications/plot_pre...
<p>Having a larger C will lead to smaller values for the slack variables. This means that the number of support vectors will decrease. When you run the prediction, it will need to calculate the indicator function for each support vector. </p> <p>Thus; smaller C -> more support vectors -> more calculations -> slower pr...
iOS Native app does not cache web content <p>We have an iOS app, which is a wrapper (<code>UIWebView</code>) for our mobile site with some additional functionality (push etc).</p> <p>When the site is loaded in Safari, most of it is cached, so reload is very quick (around 3s).</p> <p>However, in the app, the content i...
<p>You can use cache policy of <code>NSURLRequest</code> like this</p> <pre><code> NSURLRequest *req1 = [NSURLRequest requestWithURL:loadUrl cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:1]; [self.wbViewInfoDtl loadRequest:req]; </code></pre> <p>Hope it helps</p>
How to pass additional variable to a listener in .addEventListener <p>I'm looking for a away to pass a variable to the function (besides the notification e):</p> <pre><code>window.addEventListener("message", function(e)); </code></pre>
<p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind" rel="nofollow">bind</a> function </p> <pre><code>document.getElementById('btn').addEventListener('click', add.bind(this,10,11)); function add(a,b){ console.log(a,b) } </code></pre>
Hibernate Query - Entities that are NOT a child entity of another entity <p>I have a somehow recursive structure of entities: The entity <code>Goal</code> has a property <code>subgoals</code> which is a list of <code>Goal</code> entities themselves.</p> <pre><code>@Entity @Table( name = "GOAL" ) public class Goal { ...
<p>Here is what worked for me</p> <pre><code> DetachedCriteria subQuery = DetachedCriteria.forClass(Goal.class,"goalx") .createAlias("goalx.subgoals", "subgoalsx") .setProjection(Projections.property("subgoalsx.id")); Criteria query = session.createCriteria(Goal.class) .add(...
How can I take the element that appear with toggle <p>Suppose to have a html page. In this html page there is a button and when I click on the button it appear a toogle where there are a button:</p> <p>(In the toggle code)</p> <pre><code>&lt;button id="new"&gt;New&lt;/button&gt; </code></pre> <p>I need to remove thi...
<p>Please put button remove code in <code>document.ready</code> as below. Because of it your code will be executed after page loaded get completed.</p> <pre><code>$(document).ready(function(){ $('#new').remove(); }); </code></pre>
Make the div show depending on the options selected in both select tags <p><a href="http://i.stack.imgur.com/EDaVK.png" rel="nofollow">pic of code code was not available on this computer</a></p> <p>sorry for the picture i codes on my other computer i need to find away so that the div appears depending on a combination...
<p>Depending on the combination of two select values selected you want to show the div or hide.</p> <p>You can get the selected value for select using </p> <pre><code>document.getElementById("getFname").value </code></pre> <p>Compare two select values and apply the styling depending on it rather than sending this...
PFObject values may not have class: _SwiftValue <p>We are trying out <code>Parse server</code>, and we have never used Parse SDK before. As part of learning we tried <code>Facebook login with Parse</code>, that worked good. Next we wanted to save the retrieved user information and we are stuck at saving the <code>Profi...
<p>That happens when you pass Optional something to <code>Any</code>.</p> <p>Try this:</p> <pre><code> if let picture = PFFile(data: imageData! as Data) { PFUser.current()?.setObject(picture, forKey: "profilePicture") PFUser.current()?.saveInBackground() } </code></pre> <p>Or simply this, if y...
Zend framework - how to add CSS and JS only one time in the header without duplication? <p>In ZF2, i am trying to load CSS and JS file one time only. </p> <p>But when i render the page they are loaded twice or three time and causing the site to be extremely slow.</p> <p>In real page i have bootstrap.css 2 time, style...
<p>You are echoing the object on each line; remove all <code>&lt;?=</code> and replace with just one call to echo.</p> <pre><code>&lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;?= $this-&gt;headTitle(); ?&gt; &lt;?= $this-&gt;headMeta(); ?&gt; &lt;!-- CSS --&gt; &lt;?php $headLink = $this-headLink(...
Not able to update columns in database <p>This is my userprofile.php.I have update button in this page.When I will click on this button the table will hide and form will show.But the ajax.php when i click on update profile button it will redirect me to this page without running update query in ajax.php page.</p> <pre>...
<p>please add a new line in your form</p> <pre><code> &lt;div class="tab-content"&gt; &lt;div class="tab-pane active" id="horizontal-form"&gt; &lt;form class="form-horizontal" action="" method="post"&gt; &lt;input type="hidden" name="updatenew"...
ImportError: No module named 'Crypto.HASH' but pycryto installed <p>I am trying to load pycrypto module. When I do </p> <pre><code>import Crypto </code></pre> <p>I get no error but when I do from <code>Crypto.HASH import SHA256</code> , I am getting <code>ImportError</code></p> <pre><code>&gt;&gt;&gt; import Crypto ...
<p>You are misspelling it, the correct module name is <code>Crypto.Hash</code>:</p> <pre><code>&gt;&gt;&gt; from Crypto.Hash import SHA256 &gt;&gt;&gt; h=SHA256.new() &gt;&gt;&gt; h.update(b"Hello") &gt;&gt;&gt; h.hexdigest() '185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969' </code></pre>
Save replacement variables in TinyMCE, but show replaced content in visual editor <p>I'm looking to add some more flexibility to content in our CMS.</p> <p>I'd really like to be able to use a replacement variable in TinyMCE behind the scenes, like this (massively simplified):</p> <pre><code>Check out my cool image [i...
<p>When you have the content in TinyMCE you need it to be valid/well-formed HTML if you want images to be rendered. </p> <p>What I think you need to do is simply intercept the content when you get ready to save it in your application and replace the real image tags with the square bracketed version from your example....
How to preserve kendo Ui Grid filters on next time page load <p>I want to store(preserve) kendo UI grid filters for next time page load, </p> <p>For ex: On 1st time page load i have filter with value x and then i move to other page and again come back to grid page then by default my page load with value x filter which...
<p>you cant do on page reload as kendo is just a frontend component and is entirely dependent on is javascript file so when you reload the page you lose all the data stored in javascript so you can retain filter on grid reload but if you want to retain after page reload you have to use <code>session storage</code> or <...
WPF Trigger CollectionViewSource Refresh From Another Property Changes <p>I have a CollectionViewSource that binds to a custom ObservableDictionary which is in the format of:</p> <pre class="lang-cs prettyprint-override"><code>ObservableDictionary&lt;int, List&lt;Waypoint&gt;&gt; </code></pre> <p>A waypoint instance ...
<p>You cannot bind. Because they are not <code>DependencyObject</code>(DO). But if this <code>another property</code> is a DO/DP. Then you can force refresh using <a href="https://msdn.microsoft.com/en-us/library/system.windows.data.collectionview.refresh%28v=vs.110%29.aspx?f=255&amp;MSPPError=-2147217396" rel="nofollo...
AngularJS define component's controller <p>Angular version 1.5.8.</p> <p>Here is simplified code of my HTML page:</p> <pre><code>&lt;body&gt; &lt;div ng-app="identicaApp"&gt; &lt;div id="navbar_wrapper"&gt; &lt;navbar-component&gt;&lt;/navbar-component&gt; &lt;/div&gt; &lt;div ...
<p>It may be the case that module 'identicaApp.registration.player' is not inlcuded in your main controller as a input. For Exmaple. angular.module('identicaApp', ['identicaApp.registration.player'])</p> <p>Try this and refresh your page , it should work fine. </p>
Change Tracking Entity framework <p>i make table for property name that changed and value before and value after<br> How i can use Change Tracking to store changed in this <strong>table</strong>? </p>
<p>You can track the operation, the changed columns and the new values by using Change Tracking. However getting the old Value out of Change Tracking is not possible. SQL Server 2016 offers the new feature "Change data capture", which gives you the needed Information about the old value before the update/delete happene...
How to check if AHCI or IDE is enabled from the operating system using batch file <p>Suppose In BIOS, SATA Configuration is set to AHCI or IDE Enabled, then is there anyway to check if AHCI or IDE is enabled from the operating system(Windows XP,7) through a batch file ?</p>
<p>I don't know if this script can help you or not,but anyway you can give a try and tell us the results that you will get after its execution :</p> <pre><code>@echo off Title Generate a text report for Devices manager Mode con cols=80 lines=3 cls &amp; color 0A &amp; echo. Set "LogFile=DeviceManager.txt" Set "AHCI_L...
How to convert asciimath to latex <p>i am developing a maths portal at some point i need to convert <strong>asciimath</strong> format expression to <strong>latex</strong> format expression. how it will possible ? I am using <strong>mathjax</strong>.</p>
<p>There is a PHP and JS script available in the asciimath repository (under <code>/asciimath-based</code>), see <a href="https://github.com/asciimath/asciimathml/tree/master/asciimath-based" rel="nofollow">https://github.com/asciimath/asciimathml/tree/master/asciimath-based</a>.</p> <p>But there's no integration of t...
moodle : How is parent/child mentor/mentee role relationship stored? <p>How or where does moodle store how a parent/mentor is related to a student. I don't see how the system is tying the user and role assignment and whatever else it's using (context, etc). I jut want to be able to query for a list of users who have ...
<p>I assume you have configured the parent role as defined here: <a href="https://docs.moodle.org/en/Parent_role" rel="nofollow">https://docs.moodle.org/en/Parent_role</a></p> <p>If so, the connection is as follows:</p> <p>Each user has a 'context' record, related to their userid. This can be retrieved via context_us...
Does python perform tasks on lists in parallel by itself? <p>I stumbled upon this piece of work:</p> <pre><code>def getChild(self, childName): for child in self.children : if(childName == child.data['name']): return child return None </code></pre> <p>As far as ranting is concerned this cod...
<p>No, there is no automatic parallelization. Python is about writing your code efficiently, but not about making it computationally efficient. And there is a bigger problem: the GIL - Global Interpreter Lock. That means that only one thread at a time is executed. So there is no big point in parallelization of CPU inte...
How group values in Mysql query? <p>I have query:</p> <pre><code>SELECT p.`obj_id` , p.`alt_name` , o.`name`, p.`id`, oc.`text_val`, oc.`float_val` FROM `cms3_hierarchy` p LEFT JOIN `cms3_objects` o ON p.`obj_id` = o.`id` LEFT JOI...
<p>Conditions on the right table of a <code>LEFT JOIN</code> should be specified only inside the <code>ON</code> clause, when they are in the <code>WHERE</code> clause, the join automatically turns into an <code>INNER JOIN</code> because of <code>NULL</code> comparison. <br>Also, use <code>IN()</code> to compare the s...
Substitute wildcard characters (? and *) in Excel 2010 vba macro <p>Using a macro in Excel 2010, I am trying to replace all "invalid" characters (as defined by a named range) with spaces.</p> <pre><code>Dim sanitisedString As String sanitisedString = Application.WorksheetFunction.Clean(uncleanString) Dim valid...
<p>Since there are onlyl two wildcards to worry about, you can test for those explicitly:</p> <pre><code>Dim character As String For pos = 1 To Len(sanitisedString) character = Mid(sanitisedString, pos, 1) If character = "*" Or character = "?" Then character = "~" &amp; character If WorksheetFunction.Count...
how can i link the boost library to my project? <p>i've written the code</p> <pre><code>#include &lt;iostream&gt; #include &lt;boost/thread/thread.hpp&gt; using namespace std; void f1() { cout &lt;&lt;"Hello world, I'm a thread1!"&lt;&lt;endl; } int main() { boost::thread t1(&amp;f1); return 0; } </code></p...
<pre><code>LIBS += -L/usr/lib/x86_64-linux-gnu -lboost_system -lboost_thread </code></pre>
How to implement an async/await version of the System.IO.Directory.CreateDirectory method? <p>I wonder how I can implement an <code>async/await</code> version of the <a href="https://msdn.microsoft.com/en-us/library/54a0at6s(v=vs.110).aspx" rel="nofollow"><code>Directory.CreateDirectory</code></a> method in the <code>S...
<p><code>CreateDirectory</code> is an odd scenario. It would be ideal to have an asynchronous version built-in, particularly for opening/creating directories on a network drive.</p> <p>Normally, you would be able to P/Invoke an asynchronous Win32 API if the BCL doesn't support async directly. However, in this case, th...
View didn't return a response <p>I am working on a python django web app in which I want to implement internationalization and auto translate the whole app into french or chinese.</p> <p>I took reference from this site <a href="https://www.metod.io/en/blog/2015/05/05/django-i18n-part-1/" rel="nofollow">https://www.met...
<p>This is why you should really practice more defensive programming. Though you insist that the request method is POST and it is ajax and the action is sale_chart_data one of the three isn't what you expect it to be.</p> <p>Your function really should be like follows. It's plain old good practice.</p> <pre><code>def...
Number of entries in DB PHP <p>I am creating a function to show how many users are online now. This is based on who has opened a page within the last 5 min. Each page load is saved to my DB, below:</p> <p><a href="http://i.stack.imgur.com/w5vfD.png" rel="nofollow"><img src="http://i.stack.imgur.com/w5vfD.png" alt="Dat...
<p>use <code>DISTINCT</code> keyword</p> <pre><code> $query = mysql_query("SELECT DISTINCT(user_id), timestamp FROM user_actions WHERE timestamp &gt; date_sub(now(), interval 5 minute)"); $onlineUsers = mysql_num_rows($query); </code></pre>
return a list in a column in data.table <p>I have a data.table in R, and I'm looking to calculate a list based on row values using data.tables. I've currently tried the following code as an example</p> <pre><code>library("data.table") dt &lt;- data.table (data.frame(name = c("A","B","C")), num = c(10,20,30)) dt [,seq...
<p>Thanks to @Frank and @David, the answer is </p> <pre><code>dt [,seq2 := list(list(replicate(5,num))), by = 1:nrow(dt)] </code></pre> <p>primarily cause by = .I silently does nothing.</p> <p>Alternatively, you can do the following, as it is better to not do row wise operations. </p> <pre><code>dt[, res := transpo...
Can we set or edit the content of a com.google.android.gms.vision.text.Text.TextBlock? <p>As per Google Documentation of OCR <a href="https://developers.google.com/android/reference/com/google/android/gms/vision/text/TextBlock" rel="nofollow">TextBlock</a> it contains these methods.</p> <ul> <li><p>getBoundingBox()</p...
<p>No. OCR is engineered to extrapolate text from image content -- it's not intended to recreate text in an image space. </p> <p>You can always overlay your own textbox though, depending on your use case.</p>
Typo3 Multiple addresses for Powermail <p>I have a custom extension with 20 records.</p> <p>Each record has a field of E-Mail.</p> <p>How can I add all email address in powermail as the recipient.</p> <p>This example gives me only one E-Mail address of this record in the details page.</p> <pre><code>plugin.tx_power...
<p>so <code>GP:tx_myext_list|example</code> is an comma separated list of uids from your models? Otherwise it return only one. If it a comma separated list, <code>intval = 1</code> will make it to only one integer and remove the list.</p> <p>Also <code>insertData = 1</code> is not needed because you use <code>data =</...
Jquery .click does not work in combination with PrettyPhoto <p><a href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/" rel="nofollow">PrettyPhoto</a> gallery script.</p> <p>I want to load only first 3 photos of each gallery. If user starts viewing these first photos, the script must l...
<p>Replace the way you attach the event with this:</p> <pre><code>$('.loadimgs').click(function(ev){ var gallery_id=$(this).attr("data-gallery"); $('.load_more_images').load("/more-images.php?gallery_id="+gallery_id); alert("It works" + gallery_id); }); </code></pre> <p>You also have a quote that cause a ...
Removing branch merged in history? <p>How could I remove a branch I had merged into master in the past ?</p> <p>From something like :</p> <pre><code>master ... a---&gt; b ---&gt; c ---------&gt; d -----&gt; e ---&gt; f ---&gt; g ---&gt; h \ / x ---&gt; y ------&...
<p>You either need to:</p> <ul> <li><code>rebase --interactive</code> (which would allow you to drop "<code>e</code>", the merge commit), </li> <li>or <code>git revert -m 1 e</code> (see "<a href="https://git-scm.com/blog/2010/03/02/undoing-merges.html" rel="nofollow">Undoing Merges </a>"), which creates a new commit ...
Imagemagick create rectangles <p>I am trying to create rectangles like this:<a href="http://i.stack.imgur.com/yiD4u.png" rel="nofollow"><img src="http://i.stack.imgur.com/yiD4u.png" alt="enter image description here"></a></p> <p>I tried following command: </p> <pre><code>convert -size 720x567 xc:black -stroke white -...
<p>Not sure why you expect to get blue boxes with a white stroke? I think you want something more like this:</p> <pre><code>convert -size 720x567 xc:black -stroke blue -strokewidth 5 \ -draw "rectangle 50,300 230,450" \ -draw "rectangle 250,300 430,450" \ -draw "re...
Calculate commission with amount threshold <p>I have different schemas for different kind of commission over the sales. From 0 to 10.000€ its pay a commission of 2%, from 10.001 to 20.000 the commission is 2.5%, 20.001 to 30.000 is payee a commission of 3% and so until the commission is 5% or more. The threshold amou...
<p>Try something like this</p> <pre><code> decimal totalAmount = 35; decimal commission = 0.0M; decimal commissionAmount = 0.0M; Dictionary&lt;decimal,decimal&gt; commissions = new Dictionary&lt;decimal,decimal&gt;() { { 0, .02M}, ///2% { ...
Null pointer exception when getsystemservices gets called from a class to a fragment <p>I have a class, which has a method that uses the connectivity manager. This method from this class is called by a fragment to check connectivity. But when I do this, Null pointer exception occurs. </p> <p>I have tried using getAct...
<p>You have to respect the android lifecycle. This is a common issue for android beginners. You can not put this here</p> <pre><code>public class NoInternetConnection extends Fragment { Common_Tasks commonTasks = new Common_Tasks(getActivity()); </code></pre> <p>Since the <code>Fragment</code> at this point is not at...
AngularJS: Show Textfield depending on Select Option <p>I have a Dropdown with Differnt Options (Numbers). If a number was selected, an amount of textfields should be shown depending on the number that was selected before.</p> <p>Example:</p> <p>User selects number = 2 There should be two time a textfield called "nam...
<p>You ve a fixed number of options so you can use limitTo</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 app = angular.module("app", [])</code></pre> <pre class="snip...
gulp, browser-sync: external javascript files doens't executed <p>I want to give the extension "browser-sync" a chance but I do not get it to run. Maybe someone can give me a hint, what is wrong with my config / installation. </p> <p>At first, the browser reload works like expected, but javascript code inside external...
<pre><code>&lt;!-- NOT WORKING--&gt; &lt;script src="scripts/notworking.js" type="javascript"&gt;&lt;/script&gt; </code></pre> <p><strong>type="javascript"</strong> is no valid mime-type</p> <p>use <strong>type="text/javascript"</strong></p>
GroupByKey returns no elements in Google Cloud Dataflow <p>I'm new to Dataflow, so this is probably an easy question.</p> <p>I want to try out the Sessions windowing strategy. According to the windowing documentation, windowing is not applied until we've done a GroupByKey, so I'm trying to do that.</p> <p>However, ...
<p>A <code>GroupByKey</code> fires according to a triggering strategy, which determines when the system thinks that all data for this key/window has been received and it's time to group it and pass to downstream transforms. The default strategy is:</p> <blockquote> <p>The default trigger for a PCollection is event t...
declaring a function in polymer <p>I'm trying to use a function within another, but even though I declared it beforehand, polymer says it isn't. I don't get it. any clue?</p> <pre><code>Polymer({ is: 'x-foo', //some other code here, including the properties.... computeRange: function (offset, limit, nodeRangeStart, ...
<p>You're attempting to call <code>computeRange()</code> as if it were a global function, but it's actually part of your constructor object. You'll need to use <code>this</code>:</p> <pre><code>this.computeRange(...) </code></pre>
Member function template selection and SFINAE <p>I've been trying to understand the way C++ selects templates. Namely, consider the following code sample:</p> <pre class="lang-cpp prettyprint-override"><code>template &lt;typename R&gt; class Curious { public: template &lt;typename T, typename std::enable_if&lt;std...
<ul> <li><p>With default value removed, for test1, you have:</p> <pre><code>template &lt;typename T, typename std::enable_if&lt;std::is_const&lt;T&gt;::value, int&gt;::type&gt; void test1(); template &lt;typename T, typename std::enable_if&lt;!std::is_const&lt;T&gt;::value, int&gt;::type&gt; void test1(); </code></pr...
Remove a data frame row in R with a match over multiple Rows <p>I have data frame which looks like this:</p> <pre><code>content ChatPosition This is a start line START This is a middle line MIDDLE This is ...
<p>Using <code>grep</code>. You can compare this solution with your for loop on the real dataset for speed</p> <pre><code>start_indices = grep("START",ChatPosition) end_indices = grep("END",ChatPosition) match_indices = sapply(end_indices,function(x) tail(start_indices[(start_indices-x)&lt;0],1) ) match_indices # [1]...
How to Show toast when I switch Tab from BaseAdapter? <p>I want to Show a Tabbed based inside Dialog so for this I use <a href="https://github.com/ashishbhandari/AndroidTabbedDialog" rel="nofollow">This Library.</a></p> <p>I am able to populate my Dialog and also Tab is switching from Tab_1 to Tab_2. But when I am cli...
<p>Actually from the link, you have provided, They are passing the <strong>MainActivity.this</strong> where you are passing <strong>context</strong> and there is a problem. So as per my suggestion just implement these callbacks in your <strong>MainActivity.java</strong> class instead of <strong>Adapter</strong> class.<...
Suggest local storage for angularJs app <p>I am developing app for android, Using angularJs. Please suggest a good local Storage i need to save around <strong>2M</strong> data.</p> <p>Thanks</p>
<p>You can check ngStorage, but it has limit 5m I also personnally always use this one.</p>
Get the height of a web view in iOS 10 <p>I need to get UIWebView height. in method webViewDidFinishLoad I have </p> <pre><code>CGFloat height1 = [[webView stringByEvaluatingJavaScriptFromString: @"document.body.scrollHeight"] floatValue]; CGFloat height2 = [[webView stringByEvaluatingJavaScriptFromString: @"document....
<p>From Apple forums, your problem seem to have a solution</p> <p>You can use the javascript func scrollHeight to find what you need.</p> <pre><code>NSString *heightStr = [webView stringByEvaluatingJavaScriptFromString:@"document.body.scrollHeight;"]; </code></pre> <p>You just need to convert it in a usable float va...
extract data from website using python <p>I recently started learning python and one of the first projects I did was to scrap updates from my son's classroom web page and send me notifications that they updated the site. This turned out to be an easy project so I wanted to expand on this and create a script that would...
<p>If you look closely at the source of the page (I just used <code>curl</code>) you can see this block</p> <pre><code>&lt;script type="text/javascript"&gt; // &lt;![CDATA[ var dataPath = '../../'; var json_filename = 'data/json/games/lottery/recent.json'; var games = new Array(); var sessions = ne...
Dialog not closing <p>I have a popup window where you can add something to a database. However, I get errors in the console when you click in the Name-field, saying:</p> <pre><code>VM247 1:1 Uncaught TypeError: Cannot set property 'result' of undefined </code></pre> <p>If you still enter text/numbers in the boxes and...
<p>Since you're using a property of an object inside you template logic, the object itself must exist in the time of referring to its members. When you focus into input you're creating it using <code>onfocus</code>. initialize it before or try change the expression in your <code>ngShow</code> to use the object itself ...
Google Map Api Return Zero Results <p>I want to know why this request return zero result <a href="http://maps.googleapis.com/maps/api/geocode/json?latlng=34.1279625,74.8343285&amp;sensor=true" rel="nofollow">http://maps.googleapis.com/maps/api/geocode/json?latlng=34.1279625,74.8343285&amp;sensor=true</a></p> <p>It sho...
<p>That is a "disputed area": <a href="https://en.wikipedia.org/wiki/Jammu_and_Kashmir" rel="nofollow">https://en.wikipedia.org/wiki/Jammu_and_Kashmir</a></p> <p>Reverse geocoding doesn't work in disputed areas.</p> <p>See the related <a href="https://code.google.com/p/gmaps-api-issues/issues/detail?id=8783" rel="nof...
Swift 3.0 UITableViewDelege Objective-c method does not match the requirement's selector <p>I recently converted a project to Swift 3 with Xcode 8.0 and I got a error on a function which I don't understand very well. On these lines:</p> <pre><code>extension HomeTableViewController : UITableViewDelegate { func t...
<p>You are adopting the incorrect protocol in your extension. The <code>tableView:commitEditingStyle:forRowAtIndexPath:</code> method is part of the <code>UITableViewDataSource</code> protocol. Change your extension to adopt the <code>UITableViewDataSource</code> protocol instead of the <code>UITableViewDelegate</code>...
CSS not being applied as soon as we resize the window. It's only applied on scroll <p>I am using angular way to apply css but it doesn't get applied whenever resize the window. canvas height is changed on resize window but table height only being applied when we scroll the window. I want to set the same height of canva...
<p>I think you need another timeout to wait for the render.</p> <p>Maybe like this:</p> <pre><code>angular.element(window).on("load resize scroll", function() { updateHeight(); }); function updateHeight(){ $timeout(function(){ var canvasHeight = angular.element('#chartCanvas').height(); table_height(canv...
Entity Framework not claiming datetime.now is null <p>Here is my code:</p> <pre><code>UVCUpdate update = new UVCUpdate(); update.CurrentDate = DateTime.Now; _context.UVCUpdates.Add(update); _context.SaveChanges(); </code></pre> <p>Now I am getting an inner exception though saying this:</p> <blockquote> <p>Cannot ...
<p>It almost always happens when there is mismatch between so called "store generated pattern" between EF model and database. If model column has store generated pattern of Identity or Computed - that means EF will be sure those values will be automatically provided by database on insert or update, and there is no need...
getJSON subset from API to display on a web <p>I'm trying to scrape some data from an API and turn data into my own website.</p> <p>The API get request: <a href="http://api.reliefweb.int/v1/jobs?preset=latest&amp;filter[field]=status&amp;filter" rel="nofollow">http://api.reliefweb.int/v1/jobs?preset=latest&amp;filter...
<p>Your code will currnently show <code>undefined</code> as <code>title</code> is a property of the objects in the <code>data</code> array. You need to loop through that array and create the elements you need. Try this:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"...
Is stringA in StringB in MATLAB <p>Is there a way to check if a string exists within another string in MATLAB. In python this is done easily with a in b. I do not want indexes or anything like that. I just want to check if its true or not. The answers that I find is "strcmp" or "strfind" and also regexp. regexp returns...
<p>The answer is indeed strfind. You have to be careful with the order of the parameters which at first seems unusual - the pattern is the <em>second</em> argument, not the first. The following code demonstrates:</p> <pre><code>a='ac'; b='bc_gh_ac'; strfind(b,a) </code></pre> <p>If you simply want to test whether t...
PHP Curl - Parse Request <p>I am trying to take the POST fields and parse them without having to hard code the string elements (like find 'amount' find the next comma, pull out the value in between). The ....php code on the receiving end is using </p> <pre><code>$data = file_get_contents('php://input'); </code></pr...
<ol> <li>Remove the comma in the last item of an JSON array, i found 3 occurences </li> <li>you can not use single qoutes for encapsulation, use double qoutes</li> <li><p>Use <a href="http://jsonlint.com" rel="nofollow">http://jsonlint.com</a> to validate your JSON data</p> <p>'version': '1.0' ,</p> <p>'FacilityName...
Why sun.management.OperatingSystemImpl is package visible? <p>This class has really helpful methods. I can call them by reflection. But why I forced to do it?</p> <p>I would like to cast OperatingSystemMXBean to OperatingSystemImpl and call them normal way.</p> <p>Thanks in advance.</p>
<p>can you explain why you would like to cast <code>OperatingSystemMXBean</code> to <code>OperatingSystemImpl</code> since <code>OperatingSystemImpl implements OperatingSystemMXBean</code>.</p> <p>you can use it </p> <pre><code> java.lang.management.OperatingSystemMXBean os = java.lang.management.ManagementFactory...
How to change normal urls to sparkPost Custom URL in SparkPost API using PHP? <p>Im trying to send a email template along with a URL whose click count should be tracked using SparkPost Api's? example if i give www.google.com its has to change to <a href="http://go.sparkpostmail1.com/f/a/EgvUoS2LdGPzMx-AURKwZA~~/AABUGAA...
<p>To enable "click tracking", set <code>options.click_tracking=true</code> field in your request. You have already done this but it looks like your links in the <code>content.html</code> are not HTML anchors (<code>&lt;a&gt;</code> tags) but just plain text links. </p> <p>SparkPost will only track HTML anchors so I...
How to get "Outcome" value and manage rule to move document to another folder in Alfresco? <p>I want to create a rule in a folder which monitoring the (final) Outcome task of a workflow and move the document to another folder. I use the modified basic template of Pooled review which found in Repository > Data Dictionar...
<p>You should read and work through <a href="http://ecmarchitect.com/alfresco-developer-series-tutorials/workflow/tutorial/tutorial.html" rel="nofollow">this tutorial</a> on advanced workflows.</p> <p>One of the examples included in that tutorial is how to run an action on every document in a workflow package. The cod...
how to save stream as mp4 and play it? <p>I need to play a live stream of my computer screen with a play that knows only to play MP4 files any ideas for how to save the stream to MP4 file and play is in the player ?</p>
<p>VLC is the only tool you need to capture your screen and save it to MP4 file. Then you can play it wherever you want.</p> <p>Everything you want to do is well described here: <a href="http://www.howtogeek.com/120202/how-to-record-your-desktop-to-a-file-or-stream-it-over-the-internet-with-vlc/" rel="nofollow">http:/...
Cannot run app on NS 2.3.0 <p>I'm using NS 2.3.0 and when I start <code>tns run android</code> (and iOS too), there is an error that says:</p> <p><code>Processing node_modules failed. SyntaxError:/Users/ledinh/Smarp/node_modules/npm/node_modules/read-package-tree/test/fixtures/empty/node_modules/foo/package.json: Unex...
<p>I suspect it's because the platforms / tns-core-modules packages in your app have a lower version than what's specified in package.json.</p> <p>Can you try following <a href="https://docs.nativescript.org/releases/upgrade-instructions" rel="nofollow">these instructions</a>? So:</p> <p><code> $ tns platform remove ...
Can I use Google Places API to return residential addresses? <p>We have an application where users can report incidents and want to allow searches by keyword. The Google Places API (I've tried nearby search, text search, and autocomplete) only returns businesses, but sometimes the user may be on a residential street. H...
<p>Does using autocomplete with <code>type=geocode</code> or <code>type=address</code> do what you want (<a href="https://developers.google.com/places/web-service/autocomplete#place_types" rel="nofollow">link to docs</a>)?</p> <pre><code>https://maps.googleapis.com/maps/api/place/autocomplete/json?&amp;key=[YOUR=KEY]&...
Angular it taking the old parameter when clicking button <p>I am trying to add a button which when clicked, calls a function which takes a parameter and sends it to my server. So far it looks like this:</p> <pre><code>&lt;table class="table table-hover"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Id&lt;/th&...
<p>Many things that could solve this:</p> <ul> <li>Try using <a href="https://docs.angularjs.org/api/ng/directive/ngHref%20ngHref" rel="nofollow">ngHref</a> instead of just href when you have variable part of your url</li> <li>Try passing the <code>interview.id</code> as a parameter to your <code>addParticipant()</cod...
Exception when getting attribute constructor arguments with multiple enum arrays <p>I was playing with attributes and reflection when I found a strange case. The following code gave me an exception at runtime when I try to get constructor arguments of custom attributes.</p> <pre><code>using System; using System.Reflec...
<p>This has to do with the <a href="https://www.simple-talk.com/blogs/anatomy-of-a-net-assembly-custom-attribute-encoding/" rel="nofollow">structure of the blob where the custom attribut</a>e is specified.</p> <blockquote> <p>Array values start with an integer indicating the number of elements in the array, then t...
asp.net c# need to redirect to another page with value <p>I have a page that has a gridview control that lists item info and has options to view the items in detail, and also to open a page to edit the item and save the result as a "clone". This works fine, but now I want to add a button to the detail view page to clon...
<p>I see a couple of issues.</p> <pre><code>OnClientClick='redirect(&lt;%#Eval("QuestionID") %&gt;; return false' </code></pre> <p>has a parentheses missing after > </p> <pre><code>OnClientClick='redirect(&lt;%#Eval("QuestionID") %&gt;); return false' </code></pre> <p>Also </p> <pre><code>location.href = '~/Submit...
Return value of kill -9 $pid <p>Suppose if I am running a kill -9 $pid option on a process, and it throws an "Operation not permitted" exception. </p> <p>Is there a way I could identify this and handle the situation?</p> <p>eg: </p> <pre><code>return_id=`kill -9 992` </code></pre>
<p>Operation is not permitted, is exit code 1-- but that's probably not unique to that error. You could always check the error message.</p> <pre><code>response=$(kill $pid 2&gt;&amp;1) if [[ $response =~ "Operation not permitted" ]]; then error_handling_function fi </code></pre>
How does DataTables output a table with server side processing? <p>I am using DataTables server side (<a href="https://datatables.net/examples/server_side/" rel="nofollow">https://datatables.net/examples/server_side/</a>) to create a paginated table from a MySQL table.</p> <p>I have created a simple table using DataTa...
<p>It doesn't matter what you are putting in td</p> <p>Just add these classes and <code>&lt;thead&gt;</code> tag, it works </p> <pre><code>&lt;table class="table table-bordered table-condensed table-striped" id="data_show"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; $('#data_show').DataTable(); </...
No Provider for ChangeDetectorRef <p>I am in the process of upgrading my Angular 2 app from RC4 to RC6, which transitions to the use of NG Modules. The new set up is correct and compiles successfully, but I am getting an error in the browser when the App is bootstrapped that there is <em>No provider for ChangeDetectorR...
<p><code>ChangeDetectorRef</code> is not option to use here. It is looking for changes in a given component and its children.</p> <p>In your case It would be better to use <code>ApplicationRef</code>:</p> <pre><code>import {Injectable, ApplicationRef } from '@angular/core'; @Injectable() export class MyService { p...
Finding the maximum value in an array but must be lower than a certain value <pre><code>int array[] = new int[]{10, 11, 88, 2, 12, 9}; public static int getMax(int[] inputArray){ int maxValue = inputArray[0]; for(int i=1;i &lt; inputArray.length;i++){ if(inputArray[i] &gt; maxValue){ maxValue = in...
<p>If you use <code>Integer</code>s you can do it using a <code>TreeSet</code></p> <pre><code>Integer[] values = new Integer[]{10, 11, 88, 2, 12, 9}; NavigableSet&lt;Integer&gt; integers = new TreeSet&lt;&gt;(Arrays.asList(values)); System.out.println(integers.lower(88)); System.out.println(integers.lower(2)); System...
Timer.schedule api: Why the timer task executes even the first time has passed <p>I have set firstTime as today 15:35 but and then once per day. But when I start the application today even after 15:35, it starts the task immediately . I don't want that.</p> <pre><code> public void scheduleTimerTask() { int ta...
<p>As per Gustav suggestion:</p> <pre><code>public void scheduleTimerTask() { int taskStartTimeInSec = 56100; Timer timer = new Timer(); Calendar today = Calendar.getInstance(); today.set(Calendar.HOUR_OF_DAY, 0); today.set(Calendar.MINUTE, 0); today.set(Calendar.SECOND...
CFMessagePort is not receiving the messages <p>I am looking at example <a href="https://developer.xamarin.com/samples/mac/NSPortExample/" rel="nofollow">https://developer.xamarin.com/samples/mac/NSPortExample/</a></p> <p>I am trying to recreate the Obj-C code into c# but I am not having any success.</p> <p>Below is m...
<p>Make sure you set the <code>kCFRunLoopCommonModes</code> via <code>CFRunLoop.ModeCommon</code>:</p> <pre><code>static CFMessagePort localPort; static void Main(string[] args) { NSApplication.Init(); localPort = CFMessagePort.CreateLocalPort("com.example.app.port.server", (int type, NSData data) =&gt; { ...
ZK 8 MVVM Binding Properties of Child object - No change notification? <p>Let's assume a simple zul in zk 8...</p> <pre><code>&lt;div width="100%" height="100%" viewModel="@id('vm') @init('com.example.MyVM')"&gt; &lt;div visible="@load(vm.child.isElementVisible)"/&gt; &lt;div visible="@load(not vm.child.isElementV...
<p>Ah, it seems that @NotifyChange does not support child properties like...</p> <pre><code>@NotifyChanges({"child.elementVisible", "someotherproperty"}) </code></pre> <p>Instead we have to use something like this...</p> <pre><code>BindUtils.postNotifyChange(null, null, child, "elementVisible"); </code></pre> <p>.....