input
stringlengths
51
42.3k
output
stringlengths
18
55k
Pentaho ETL performance issues <p>I have a Pentaho ETL Job/Transformation that reads a text file and inserts some records into a MS SQL Database table. I execute it daily. It take up to 10 minutes to finish. The problem happens when someone else executes it: the time rises up to 40 minutes. All the exections happens ...
<p>There's got to be something different. Are you executing on the same account? In what env? Windows or Linux?</p> <p>Have you tried executing using pan/kitchen? Perhaps it will standardize your environments?</p> <p>If you upload the trasformation etc I'll take a look.</p>
How to update document with dynamic fields in node.js <p>Assume that I have a document in database which has the following structure;</p> <pre><code>id: 1, name: alex, age: 21 </code></pre> <p>There are some updates in client side and the same document with <code>id:1</code> returns as;</p> <pre><code>id: 1, name: a...
<p>If you are saying that you have an updated object:</p> <pre><code>id: 1, name: alex, age: 21, location: usa </code></pre> <p>then I assume that you have some object that has a value of:</p> <pre><code>{ id: 1, name: 'alex', age: 21, location: 'usa' } </code></pre> <p>e.g. as a result of parsing this JSON...
p:datatable filter: cannot validate component with empty value <p>Is there a way to filter a p:datatable column by clicking on the text inside and making this text the filter ? </p> <p>In other words, if I click on a session ID, I would like the datatable to filter this column by the clicked ID, as if I had entered it...
<p>I was able to achieve this by setting <code>widgetVar="myTable"</code> to the data table, using a custom filter field, replacing the cell contents with <code>p:outputLabel</code> (which has <code>ondblclick</code>) and JavaScript it all together:</p> <pre><code>&lt;p:column headerText="Session" filterBy="#{transact...
Issue while retrieving varchar values from Stored procedure in Mule <p>Hi I'm not able to retrieve the varchar values from Stored procedure in to my mule flow. It is always returning NULL values.I have followed the same order while declare the output parameters both in mule and in stored procedure script. Here is my mu...
<p>It may be your syntax in the logger (Note the quotes around the parameters) - Try this :</p> <pre><code>&lt;logger message="#[payload['MSG']],#[payload['CD']]" level="INFO" doc:name="Logger"/&gt; </code></pre> <p>Also please try putting braces around the db call:</p> <pre><code>&lt;db:parameterized-query&gt;&lt;...
Publish word 2016 taskpane add-in manifest in SharePoint 2013 with commands section(VersionOverrides) <p>I am trying to develop a Word 2016 add-in and publish the manifest file to the SharePoint 2013 Add-in Catalog. I use Visual Studio 2015 and Microsoft Office Developer Tools for Visual Studio 2015 and chooses the Vis...
<p>No, it is not possible. The SP Add-in catalog is not a supported method to deploy add-ins with commands. You can try the <a href="https://support.office.com/en-IE/article/Deploy-Office-Add-ins-in-the-Office-365-admin-center-preview-737e8c86-be63-44d7-bf02-492fa7cd9c3f?ui=en-US&amp;rs=en-IE&amp;ad=IE" rel="nofollow">...
Java newSingleThreadExecutor garbage collection <p>Consider the following Java code</p> <pre><code>void doSomething(Runnable r1, Runnable r2){ Executor executor = Executors.newSingleThreadExecutor(); executor.execute(r1); executor.execute(r2); } </code></pre> <p>when I invoke the doSomething method, the executo...
<blockquote> <p>I suppose the executor object will be garbage collected, but I do not know whether it will be also shutdown.</p> </blockquote> <p>Actually <code>Executors.newSingleThreadExecutor()</code> under the wood creates a <code>FinalizableDelegatedExecutorService</code> instance which will call <code>shutdo...
Timing of async callback <p>I want to have a better idea about the timing of the completion block from a intenet download request. In this case firebase. The following code example does not do anything, but it illustrates my questions.</p> <p>Say I have 100 values in keysArray, there would be 100 async request to fire...
<p>If tasks are running concurrently, they may replace each other as the active thing at an opportunity, and may just proceed with genuine concurrency given that all iOS devices since the 4s have multiple cores. There's no reason that any particular <code>for</code> loop will be at any specific point at the time of int...
Univocity Parser: TextParsingException while parsing a line which has a starting double quote(") but does not have an ending double quote(") <p>Getting exception while parsing file:</p> <pre><code>com.univocity.parsers.common.TextParsingException: Length of parsed input (4097) exceeds the maximum number of characters ...
<p>That's how the CSV parser is supposed to work. If a quote is found it is because the content after the quote can contain delimiters, line endings or other (hopefully) escaped quotes. </p> <p>The only way to work around this situation in your case is to do something like this:</p> <pre><code>parserSettings.getForma...
Open any files (.doc, .xls,. pdf. etc.) with related program saved in sql server as varbinary? <p>Is there any way, Open any files (.doc, .xls,. pdf. etc.) with related program saved in sql server as varbinary ?</p> <p>Creating Database in server;</p> <pre><code>create database DEV GO USE DEV GO create Table FileWare...
<p>The problem I see in your code is that you save a file "someRandomName".txt.</p> <p>So when you call Process.Start, Notepad (or whatever else is the default program for txt files) will be launched.</p> <p>You need to save in the db also the original file name (or at least, the original extension, which you already...
Create branch and push it git alias <p>How do I make an alias that creates a local branch and pushes it upstream? I've tried </p> <pre><code>publish = !git checkout -b $1 &amp;&amp; git push -u origin $1 </code></pre> <p>I get</p> <pre><code>Switched to a new branch 'mybranch/test' error: dst ref refs/heads/mybranch...
<p>Your final command turns out to be <code>git checkout -b mybranch/test &amp;&amp; git push -u origin mybranch/test mybranch/test</code> as <code>$1</code> is substituted with the first parameter and the parameter is also added to the end of your command. Either leave out your last <code>$1</code>, so that you have</...
python pandas/numpy quick way of replacing all values according to a mapping scheme <p>let's say I have a huge panda data frame/numpy array where each element is a list of ordered values:</p> <pre><code>sequences = np.array([12431253, 123412531, 12341234,12431253, 145345], [5463456, 1244562, 23452...
<p>Here's an approach that flattens into a <code>1D</code> array, uses <code>np.unique</code> to assign unique IDs to each element and then splits back into list of arrays -</p> <pre><code>lens = np.array(map(len,sequences)) seq_arr = np.concatenate(sequences) ids = np.unique(seq_arr,return_inverse=1)[1] out = np.spli...
Kendo ui scheduler - change date format <p>I'm able to change the format of the dates for a kendo ui scheduler on the column headers using the dateHeaderTemplate property but I need to change the format of the date highlighted in the image below: <a href="http://i.stack.imgur.com/ahp1l.png" rel="nofollow"><img src="htt...
<p>Please try with the below code snippet.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"/&gt; &lt;title&gt;Kendo UI Snippet&lt;/title&gt; &lt;link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.3.914/styles/kendo.common.min.css"/&gt; &lt;link rel="st...
SQLAlchemy: How do you delete multiple rows without querying <p>I have a table that has millions of rows. I want to delete multiple rows via an in clause. However, using the code:</p> <pre><code>session.query(Users).filter(Users.id.in_(subquery....)).delete() </code></pre> <p>The above code will query the results, a...
<p>Yep! You can call <code>delete()</code> on the table object with an associated whereclause. </p> <p>Something like this:</p> <p><code>stmt = Users.__table__.delete().where(Users.id.in_(subquery...))</code></p> <p>(and then don't forget to execute the statement: <code>engine.execute(stmt)</code>)</p> <p><a href="...
AJAX + Flask update server request when filling form <p>On the Flask website there's a tutorial on how to use AJAX and this an example to display the sums of two numbers.</p> <p>This is the python app from flask import Flask, render_template, request, jsonify</p> <pre><code># Initialize the Flask application app ...
<p>Yes. It's wasteful of resources, but you could change </p> <p><code>$('a#calculate').bind('click', function() {</code> to </p> <p><code>$('input[name="a"]').change(function() {</code></p> <p>And do the same for input <code>b</code></p> <hr> <h1>Edit:</h1> <p>And, to test AS YOU TYPE:</p> <p><code>$('input[na...
Operator [] long and short versions <p>What is the advantage of using the longer version <code>(something).operator[]()</code> instead of simply <code>(something)[]</code>?</p> <p>For example : </p> <pre><code>std::array&lt;int, 10&gt; arr1; std::array&lt;int, 10&gt; arr2; for(int i = 0; i &lt; arr1.size(); i++) ...
<p>There is none. The <code>[]</code> is just syntactic sugar for <code>operator[]</code> on user-defined types. You only need the <code>operator</code> syntax when you define these functions yourself. This goes for all operators like <code>operator()</code>, <code>operator[]</code>, <code>operator new</code>, <code>op...
Can't deploy java application in real host. <p>I hava Java WEb application with Servlets and Jsp. Bought ont host and want to deploy in the first time. And then I realize that it will be more easy to deploy Java Web Application like WAR , but my host doesn't offer this opportunity for my "Shared Tomcat". My jsp "ind...
<p>What you should put in the /public_html/WEB_INF/classes/servlet/ folder is not your Servlet.java, it's your <strong>Servlet.class</strong>.</p>
How to compare custom class type <p>Basically i want to compare Custom Class type</p> <pre><code> Public Sub Add(items As SchoolTypes()) Select Case items Case items.GetType() Is GetType(Programme) Case items.GetType() Is GetType(Etudiant) Case Else End Select End Sub </code></pr...
<p>Im an Idiot, my select statement makes no sense</p> <p>here's the awnser:</p> <pre><code> Select Case items.GetType() Case GetType(Programme) Case GetType(Etudiant) Case Else End Select </code></pre>
Perl eval EXPR enclosed by sinlge or double quotes <p>I can see the following from <code>perldoc -f eval</code>:</p> <pre><code> eval EXPR eval BLOCK eval In the first form, the return value of EXPR is parsed and executed as if it were a little Perl program. </code></pre> <p>And I've seen EXPR ...
<p>The quotes are not part of the eval syntax. EXPR means any expression, whether a quoted string, a variable, a function call, the result of some operation, or anything else.</p> <p>Changing to single quotes shouldn't make the program crash, but would not interpolate your variable, producing code that won't eval suc...
Evil DICOM list all elements <p>I would like to list all the tags of a DICOM file in C#.</p> <p>I would like something like what is shown in the link below</p> <p><a href="http://stackoverflow.com/a/7283042/1014189">http://stackoverflow.com/a/7283042/1014189</a></p> <p>I'm assuming this is an older version as when I...
<p>Assuming you could use <a href="http://www.rexcardan.com/evildicom/" rel="nofollow">Evil Dicom</a>:</p> <pre><code>public class DicomManager { public List&lt;Tag&gt; ReadAllTags(string dicomFile) { var dcm = DICOMObject.Read(dicomFile); return dcm.AllElements.Select(e =&gt; e.Tag).ToList(); ...
Parse an XML file to get a full tag by using Python's lxml package <p>I've got the following XML file:</p> <pre><code>&lt;root&gt; &lt;scene name="scene1"&gt; &lt;view ath="0" atv="10"/&gt; &lt;image url="img1.jgp"/&gt; &lt;hotspot name="hot1"/&gt; &lt;/scene&gt; &lt;scene name="s...
<p>Your given XML source contains some errors; I fixed those, see my source below:</p> <pre><code>from lxml import etree source = """ &lt;root&gt; &lt;scene name="scene1"&gt; &lt;view ath="0" atv="10" /&gt; &lt;image url="img1.jgp" /&gt; &lt;hotspot name="hot1" /&gt; &lt;/scene&gt; &lt;scene name="...
Mysql sum column from multiple table in the same id <p>I have 18 table in mysql.</p> <p>All of tables have a column Result (ex a.result, b.result etc..) I need to select the result of 18 table and sum together for all of the id.</p> <p><code>d.id 1 = a.result + b.result + c.result</code> (of id 1 in all of the table)...
<p>Use <code>UNION ALL</code> to get all value from all 18 tables. Then use <code>SUM</code> function.</p> <p><strong>Query</strong></p> <pre><code>SELECT SUM(t.result) FROM( SELECT result FROM table_1 UNION ALL SELECT result FROM table_2 UNION ALL ........................... ....................
Map Object[] with Key Value properties to an object's properties without using a huge nasty switch <p>I've got an object array of Key values.</p> <pre><code>public class KeyValueStore { public string Key {get;set;} public string Value {get;set;} } </code></pre> <p>This array stores the values of an object i am ...
<p>Yes, assuming that the destination type has a parameterless constructor, you could write a generic method that does this:</p> <pre><code>public T CreateAndPopulate&lt;T&gt;(IEnumerable&lt;KeyValueStore&gt; propStore, IDictionary&lt;string, string&gt; mapping = null) ...
How to Remove/Disable Sign Up From Devise <p>I'm trying to remove/disable the 'user/sign_up" path from Devise. I'm doing this because I don't want random people gaining access to the application. I have it partly working by adding the following in routes.rb </p> <pre><code>Rails.application.routes.draw do devise_s...
<p><strong>Solution to removing sign_up path from Devise</strong></p> <p>Enter the following at the beginning of <code>routes.rb</code></p> <pre><code>Rails.application.routes.draw do devise_scope :user do get "/sign_in" =&gt; "devise/sessions#new" # custom path to login/sign_in get "/sign_up" =&gt; "devise...
How to get parameters in the controller using fxml files and flow library? <p>How can I call MoviesSettingsController with a parameter "Settings" object in the constructor where Settings is instancied and initialized in MainController ? I have to pass Settings at SideMenuController and then at MoviesSettingsController ...
<p>OK, I found something which works. If you see a better way, say me :).</p> <p>I created a context like this, in the MainController:</p> <pre><code>ViewFlowContext context = new ViewFlowContext(); </code></pre> <p>I filled it with all the parameters and contents that I wanted to pass to others components via the F...
How to remove duplicated assemblies from the Visual Studio Choose Toolbox Items dialog? <p>I have duplicated assemblies in the .NET Framework Components tab of a Choose Toolbox Items menu item: <a href="http://i.stack.imgur.com/Pkqsf.png" rel="nofollow"><img src="http://i.stack.imgur.com/Pkqsf.png" alt="enter image des...
<p>This situation is caused by the broken toolbox cache.</p> <p>To fix it, try the following:</p> <ul> <li>Close all instances of VS</li> <li>Go do <code>%LOCALAPPDATA%\Microsoft\VisualStudio\NN.N</code>, where <code>NN.N</code> is the version of VS you're using</li> <li>Delete all files with <code>*.tbd</code> exten...
d3.js v4 dynamically add nodes to tidy tree <p>I am trying to do something similar to this question <a href="http://stackoverflow.com/questions/11589308/d3-js-how-to-dynamically-add-nodes-to-a-tree">d3.js how to dynamically add nodes to a tree</a>. However, I'm finding it really difficult to get any kind of solution wo...
<p>There was something odd with the lineage variable (flat array to be turned into hierarchical structure) which I was trying to build my tree up from, when I turned it into a tree it changed the objects within it. I solved this by making a deep copy of the lineage. All of my code is here, I hope it helps someone:</p> ...
FOSUserBundle Unique Entity constraints <p>I want to set up a unique constraint on the fields "username" and "email" but it doesn't work :</p> <pre><code>use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; use FOS\UserBundle\Model\User as BaseUser; use Symfony\Bridge\Doctrine\Valida...
<p>Sadly there is a bug in Symfony's Validation Component concerning <code>UniqueEntity</code> using with inherited classes. It's already reported in 2012: <a href="https://github.com/symfony/symfony/issues/4087" rel="nofollow">https://github.com/symfony/symfony/issues/4087</a></p> <p>I've never tried it, but you can ...
Rails 4: strong parameter with variable key hash <p>I need to be able to permit parameters that contain a <code>hash</code> with a variable key. I've looked at other solutions but none seem to work for me.</p> <p>The parameters are as follows:</p> <pre><code>{"consult_stat"=&gt;{"iter_0"=&gt;{"employee_id"=&gt;"1", ...
<p>You can do this and it will work. But you need to be careful about the values.</p> <blockquote> <p>params.require(:consult_stat).permit!</p> </blockquote> <p>It will permit the hash consult_stat and any subhashes of it. </p>
Which should i choose : iOs/Android or Qt C++ development? <p>What will be the most accurate for mobile native app development ? I want to save time and develop once but in the other time i want the best performances possible and want my app to be 100% native. </p> <p>Thanks to advise me.</p>
<p>It depends on your mobile environment (Java for Android, Objective-C or Swift for iOS). All of them are native. Almost frameworks using HTML/CSS/Javascript are hybrid. You can try <code>React Native</code> for cross-building platform to native android and ios by using javascript. </p>
Python 2.7 What is compared if __ne__ is not defined <p>There is a magic method called <code>__ne__</code> in Python which is triggered on objects <code>!=</code> comparison. </p> <p><strong>Example:</strong></p> <pre><code>class A(object): def __init__(self, a): self.a = a def __ne__(self, other): ...
<p>If you wouldn't use explicit <code>__ne__</code> in your class definition, then <code>__ne__</code> from inherited <code>object</code> will be used. It works like following code (but of course original is written in C):</p> <pre><code>def __ne__(self, other): eq_result = self == other if eq_result is NotImp...
how to clear the field when the ui-select is in a disabled state? <p>Could you please tell me how to clear the field or remove the field in a disabled state? I am using UI-select in this example. I add one condition whenever the user selects <code>Nicole</code> it will deselect the ui-select (the user is not able to se...
<p>The question is not clear. Do you want to enable the ui-select even after selecting "Nicole" or just want to clear the ng-model? </p> <p>If you want to give an option of enabling the ui-select when the user accidentally selects "Nicole" you have to keep a checkbox or any trigger that sets <code>$scope.disabled = fa...
Get the new value from an input with AngularJS <p>I am trying to convert a JQuery website to AngularJS, but I can't figure this one out.<br><br> <strong>In JQuery I used:</strong></p> <pre><code>$('.bet').change(function(e) { // Do someting }; </code></pre> <p>I tried to do multiple things with AngularJS but no ...
<p>From the documentation:</p> <blockquote> <p>Evaluate the given expression when the user changes the input. The expression is evaluated immediately, unlike the JavaScript onchange event which only triggers at the end of a change (usually, when the user leaves the form element or presses the return key).</p> </bloc...
SWT DateTime doesn't take into account the locale <p>Is it possible to change to change the format in which DataTime widget diplays date? The matter is that even though I set the locale to one that uses European format (dd/mm/yyyy) I still have DateTime widget in mm/dd/yyyy format.</p> <p><strong>Edit</strong>: There ...
<p>After running some tests on Linux, I can confirm that the <code>DateTime</code> widget does not appear to be using the OS's locale. This seems to be a bug and you should report it.</p> <p>What you can do in the meantime is use <a href="https://eclipse.org/nebula/widgets/cdatetime/cdatetime.php" rel="nofollow">Nebul...
Maintain php object state <p>My php code creates a "School" object which is (among other functions) able to return several forms which are being ,on submit, handled by php. Thru one of these forms i'm able to add a "SchoolClass" object to a array in the "School" object but it seems that the "School" object is recreate...
<p>OK....i figured it out. I can use the $_SESSION variable to store it.</p> <p>Now i do like this in the start of the page:</p> <pre><code>$school = null; if(!isset($_SESSION["school"])) { $school = new School; $_SESSION["school"] = $school; echo "New school &lt;br&gt;"; } else { $school = $_SESSION["school"]; ...
Cropperjs not working in angular 2 <p>I am trying to use the cropperjs library in an Angular project. The cropper example from the documentation works fine on a normal static web page (simple index.html with <code>&lt;script&gt;</code> tag for the js and a link to the cropper.css file).</p> <p>But for some reason this...
<p>Looking in developers tools, the tags added by cropper.js did not have add the custom attributes Angular uses for styling (the ones that look like <code>_ngcontent-xpk-4</code>), so the cropperjs styling did not work.</p> <p>Just adding the cropper.css (<code>&lt;link rel="stylesheet" href=".../cropper.css"&gt;</co...
jQuery Datatables ASP.NET issue <p>I'm building a report dashboard using C# and JQuery Datatables. One of the reports on the page contains an update panel with a drop down list. When the user changes the selection, the data refreshes based on the ddl selection. Within each block there is also a link that makes a se...
<p>I figured it out. It turns out Sharepoint has a flag to prevent someone from clicking a button twice. I added this code:</p> <pre><code>function setFormSubmitToFalse() { setTimeout(function () { _spFormOnSubmitCalled = false; }, 3000); return true; } </code></pre> <p>and it works fine now.</p>
C#: XDocument adds carriage return when generating final xml string <p>I have a case where I would like to generate xml prior to posting it to an API, containing line breaks (<strong>\n</strong>) but not carriage returns (no <strong>\r</strong>).</p> <p>In C# though, it seems that XDocument automatically adds carriage...
<p><code>XNode.ToString</code> is a convenience that uses an <code>XmlWriter</code> under the covers - you can see the code in the <a href="http://referencesource.microsoft.com/#System.Xml.Linq/System/Xml/Linq/XLinq.cs,1909" rel="nofollow">reference source</a>.</p> <p>Per <a href="https://msdn.microsoft.com/en-us/libr...
Meteorjs Data array not rendered at first template rendered <p>I'm working on a project in Meteorjs, but I have a problem in rendering some data.</p> <p>The problem is: At the first template render, there is no html. Then I switch the template to a 'MAP' view and go back to my 'LIST' view, and now there is the html wi...
<p>Depending on where your function is defined, you can either use a <code>ReactiveVar</code> and set it as data in your <code>data</code> function, <em>i.e.</em> instead of returning <code>data</code>, set the object to your ReactiveVar:</p> <pre><code>Template.foo.onCreated(function() { this.myData = new ReactiveV...
Removing console.log throws an error <p>I have an app which is built using reactjs and react-mdl. There is a tab show info, episodes, and cast. When episode is clicked John, Jane in header should be changed to other text and so 55 episodes plus other content that is beneath the tab. The code that i coded works what i w...
<p>5 expert had already stated the cause of an error in your code with good explanation. Now you are into another trouble which you can overcome with my solution. But i am a learner too. I am sharing this solution for myself to learn from those experts. If i were to solve this problem, my solution would be </p> <pre><...
How to have different fake functions called for multiple calls on a Jasmine spy <p>Say I'm spying on a method like this:</p> <pre><code>spyOn(util, "foo").andCallFake(function() { //some code }); </code></pre> <p>The function under test calls util.foo multiple times.</p> <p>Is it possible to have the spy to call...
<p>Why not wrap an anonymous function around it:</p> <pre><code>var count=0; event.on(function(){ count++; if(count==1){ //at first firstfunc(); }else{ //the rest secondfunc(); } }); </code></pre>
Youtube iFrame API Parameters <blockquote> <p><a href="https://developers.google.com/youtube/player_parameters" rel="nofollow">https://developers.google.com/youtube/player_parameters</a></p> </blockquote> <p>I found this as a resource to develop the following:</p> <pre><code> &lt;iframe src="https://www.youtube.c...
<p>The primary purpose of <a href="https://developers.google.com/youtube/iframe_api_reference" rel="nofollow">IFrame API</a> is to let a user to embed a YouTube video player on your website and control the player using JavaScript.</p> <p>You said that you realized that it only works in Chrome, well that is not true. T...
How to make two django projects share the same database <p>I need to make two separate Django projects share the same database. In <code>project_1</code> I have models creating objects that I need to use in <code>project_2</code> (mostly images).</p> <p>The tree structure of <code>project_1_2</code> is:</p> <pre><cod...
<p>You can simply define the same database in <code>DATABASES</code> in your settings.py. So, if your database is PostgreSQL, you could do something like this:</p> <pre><code># in project_1/settings.py DATABASES = { 'default': { 'NAME': 'common_db', 'ENGINE': 'django.db.backends.postgresql', ...
Prevent die() from removing everything below <p>In my registration code I have several <code>die()</code> "functions", like if the username is empty, or in use, email, password, etc. The point is, every time something goes wrong I use <code>die()</code> but this will cause the page to not render everything below the <c...
<p>Use <code>echo</code> instead. <code>die</code> is equivalent to <code>exit</code>, which would obviously exit your script after executing.</p>
Template function with template arguments or typename <p>I am creating a template class that contains a vector of numerical data (can be int, float, double, etc). And it has one operation, which calls <code>std::abs()</code> on the data. Something like the following code.</p> <pre><code>#include &lt;iostream&gt; #incl...
<p>You can use the return type of <code>std::abs(T)</code> in your declaration.</p> <hr> <p>Example:</p> <pre><code>#include &lt;iostream&gt; #include &lt;complex&gt; #include &lt;vector&gt; #include &lt;cmath&gt; #include &lt;utility&gt; template&lt;typename T&gt; class MyData { public: std::vector&lt;T&gt; dat...
Array Condition within EPA CEP PROTON <p>Using CEP Proton I want to check if, for the events received in a time interval, the id of the second and following events is contained in an attribute of type array coming in the first event. Let's say the first event is coming with the attribute called group that is an array o...
<p>Please share the whole JSON definition of your application. </p> <p>From the information you have provided it is not clear which type of EPA it is (to access a series of events you need a statefull EPA and you need to make sure you write the application in such a way as to be able to distinguish between the first a...
changed wordpress URL and now no access <p>My first time using WordPress and I was asked to make some changes so I made some changes and there was a problem with the redirecting so I went to the settings in the admin page and changed the WordPress URL. As soon as I saved that, it logged me out and I don't have access t...
<p>Try this:</p> <p>Find the IP address of the site in question. You can do this here: <a href="https://www.site24x7.com/ping-test.html" rel="nofollow">https://www.site24x7.com/ping-test.html</a></p> <p>In the results screen, it'll show you the site's IP address.</p> <p>Now, you'll want to add this IP address and wh...
Print 3D array converted into a 2D <p>I am trying to add a given 3D array and print it as D. Moreover, I have to take the array[0] and [1] from a given 3d Array and add their corresponding positions in a 2D Array an add them.</p> <p>For example, if a 3D Array has the following 2D Matrices</p> <pre><code>&gt; Array[0]...
<pre class="lang-java prettyprint-override"><code>for (int j=0; j&lt;b[j].length;j++) { System.out.print(b[i][j]); } </code></pre> <p>Here you are taking <code>b[j]</code> length which can potentially go out of bounds, because you are taking different array later (<code>b[i]</code>). Just do <code>b[i].length</code>...
Rotation Values getting mixed up C# <p>I'm trying to use C# and Unity to create a simple game mechanic, which allows the player to turn <code>45</code> degrees right then set their new rotation to <code>-45</code>. It kind of works:</p> <pre><code>using UnityEngine; using System.Collections; public class Movement : M...
<p>if you change this line : . transform.rotation = Quaternion.Euler(90, 0, 0); for this one . transform.rotation = Quaternion.Euler(90, -45, 0); Should solve you problem.</p> <p>Happy coding!</p>
Meteor - Call function before state loaded using ui-router <p>We're making a meteor app using angular and ui-router to control the states. We want to show a promo site if the user doesn't have access to the main part of the site. There will be a flag on the user's document in the User collection in mongodb as to whethe...
<p>In the route for the protected page (or in my case the parent of a set of protected pages), put this:</p> <pre><code> .state('app', { abstract: true, template: '&lt;mymenu&gt;&lt;/mymenu&gt;', controller: Menu, resolve: { currentUser: ($q) =&gt; { var deferred = $q.defer...
Is it possible to get Object ID in the OAuth Token from ADFS <p>Best reference for my question is <a href="http://stackoverflow.com/questions/27417487/getting-the-user-profiles-from-adfs3-0#">Getting the user profiles from ADFS3.0</a> which shows the token ADFS OAuth is returning. My problem is that there is no GUID in...
<p>There are different end points in Identity server. One of the end point is <code>UserInfoEndpoint</code> which actually contains user information. And also it is not safe to get the user information in the <code>Access Token</code> by itself as the user information can be leaked if the token is used by someone else....
How to get "Long" values without rounding error using influxdb-java.jar? <p>I wrote a data using influx command (CLI) as follows:</p> <pre><code>CREATE DATABASE mydb USE mydb insert test value=1234567890123456789i </code></pre> <p>Then, I read the data using influx command (CLI)</p> <pre><code>&gt; select * from tes...
<p>Unfortunately there is no proper solution for you. This library designed that way.</p> <p>Workaround is to cast to <code>long</code>:</p> <pre><code>System.out.println(series.getColumns().get(0) + "=" + (long)(double)series.getValues().get(0).get(0) + " " + series.getValues().get(0).get(0).getClass().getName()); <...
PHP/SQL prepared statement with double quotes <p>I'm using an HTML input element to accept data from a user and save it in a mySQL database. To do this, I'm using PHP and mysqli to create a prepared statement.</p> <p>This works very well until I try to accept an input string containing a double quote("). If the inpu...
<p>Yes, indeed it's something very obvious. Just look at the <em>generated HTML code</em> and you will immediately get a clue.</p> <p>And then learn by heart that HTML attributes have to be <strong>always</strong> encoded using <code>htmlspecialchars()</code></p>
404 not found on JSF after migration tomcat to wildfly 10 <p>I have a small project on tomcat, it works well, now I decided to migrate to wildfly 10. The deployment is ok but when I want to display my jsf (primefaces)pages, it's return me a 404 not found. I don't know what I have to do because I see any errors on the ...
<p>I found myself where is the problem. My web.xml wasn't good. I post the good one for somebody who will have the same issue than me</p> <pre><code>&gt; &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schema...
Angular 2 routing with Visual Studio & .NET <p>I completed the "Tour of Heroes" tutorial on Angular 2's website and everything is working great. If I click around, the URL changes and when I refresh, it takes me right where I was before, as you would expect with proper routing.</p> <p>I want to now use .NET and C# on ...
<p>Angular 2 uses the HTML5 history API. The urls look just like any other site. When you load <a href="http://example.com/posts/23" rel="nofollow">http://example.com/posts/23</a> the .NET backend will try to handle it and if it can't will return 404.</p> <p>That is not what you want.</p> <p>You want to return the co...
Reverse iterating over a &vec versus vec.iter() <p>This works because <code>Iterator</code> implements <code>rev()</code> where <code>self</code> is a <code>DoubleEndedIterator</code>:</p> <pre><code>let vec: Vec&lt;i32&gt; = Vec::new(); for x in vec.iter().rev() { //Do stuff } </code></pre> <p>However, if I chan...
<p>If you're just looping over the <code>Vec</code>, then <code>&amp;vec</code> is idiomatic. This works because <code>&amp;Vec&lt;T&gt;</code> implements <code>IntoIterator</code>, which is what the for loop uses.</p> <p>However if you want to call <code>Iterator</code> methods such as <code>rev</code>, <code>filter...
Separation of a String into Individual Words (Python) <p>So I have this code here:</p> <pre><code>#assign a string to variable x = "example text" #create set to store separated words xset = [] #create base word xword = "" for letter in x: if letter == " ": #add word xset.append(xword) #add ...
<p>Because when your code reaches the space in <code>x</code> it appends <code>xword</code>. But this only happens when it reaches a space. As there are no spaces after text, the final result is not appended to <code>xset</code> Also, you were not resetting <code>xword</code>:</p> <pre><code>#assign a string to variab...
Android app accessing locked down phone dialler <p>My company has written an android driver app (for making deliveries) from which the driver can select a 'call' button to dial the customer they are delivering to. I know how to change the intent to auto dial the number instead of the user having to manually initiate th...
<p>Is this on their personal phone, or on a device you give them? If its a personal phone, no. If its a device you give them- what you really want is a kiosk app. You could install your own softphone that doesn't allow dialing (although you should probably add a 911 button for emergencies) and block the user from i...
Scala map function to remove fields <p>I have a list of Person objects with many fields and I can easily do:</p> <pre><code>list.map(person =&gt; person.getName) </code></pre> <p>In order to generate another collection with all the peoples names.</p> <p>How can you use the map function to create a new collection wit...
<p>You can use <code>unapply</code> method of your <code>case class</code> to extract the members as <code>tuple</code> then remove the things that you don't want from the <code>tuple</code>.</p> <pre><code>case class Person(name: String, Age: Int, country: String) // defined class Person val personList = List( Per...
UNIX vi parameters <p>A co-worker passed me a snippet of his ".bashrc" file, which includes these 2 lines:</p> <pre><code>alias vi='vi -b -i NONE' alias view='vi -b -i NONE -R' </code></pre> <p>I have searched for "UNIX vi parameters", "UNIX vi command line", and "vi arguments" but have not been successful.</p> <p>W...
<p>Your coworker has set up some handy shortcuts for editing (<code>vi</code>) and reading (<code>view</code>) files.</p> <p>Check <code>man vi</code> for the manual. <a href="https://linux.die.net/man/1/vi" rel="nofollow">https://linux.die.net/man/1/vi</a> mirrors this info:</p> <blockquote> <p><code>-b</code><br>...
Web Scraping : Get graph Coordinates from Webpage <p>I wanted some help with web scraping. I want to retrieve players ranking which are plotted on the graph in this <a href="http://www.icc-cricket.com/player-rankings/profile/sachin-tendulkar" rel="nofollow">link</a></p> <p>Visit the link. Click on Rating, and then hov...
<p>Each <code>circle</code> element has a <code>cy</code> attribute that we can find with the following:</p> <pre><code>var circ = document.querySelector('circle') console.log(circ.getAttribute('cy') // cy= 123.586.... </code></pre> <p>This will give you the y coordinate for the first <code>circle</code> element. You...
Grails webapp not displaying gsp page <p>I am having some issues displaying a .gsp file and I am not quite sure as to why. I have the following code:</p> <pre><code>class UrlMappings{ static mappings = { "/"(controller: 'index', action: 'index') } } class IndexController{ def index(){ rend...
<p>The error you are getting is because of <code>Grails</code> is not able to find out the location of your view.</p> <blockquote> <p>Well avoid the names which have some predefined context in the framework(Just an suggestion not an problem in your case).</p> <p>As you have used the <code>index</code> for contr...
Sass loop output string instead of number <p>I want to make a loop that create 8 different classes with same the same include but a different value. Here's my code: </p> <pre><code>@for $i from 1 through 8 { $baseDelay: 0.4; .fade-in-#{$i} { @include animationDelay(#{$baseDelay}+((#{$i}-1)/2)s); } } </code><...
<p>You can use this code. </p> <p>This is what my mixin looks like</p> <pre><code>@mixin animationDelay($var) { -webkit-animation-delay: $var; animation-delay: $var; } </code></pre> <p>And this is what my for loop looks like</p> <pre><code>@for $i from 1 through 8 { $baseDelay: 0.4; .fade-in-#{$i} { @in...
Creating multiple functions with for loop <p>First, I did find a couple links that appeared to address this problem, but my understanding of javascript (and code in general) is pretty bad, and the solutions/explanations were difficult for me to generalize here. I know it has to do with a closure (which I vaguely unders...
<p>Your problem is that <code>var</code> is hoisted, so you <em>do</em> get ten distinct functions, each one pointing at one <strong>shared</strong> variable ... which points at the last set of checkboxes.</p> <p>The <em>first</em> solution to your problem is to use <code>let</code> or <code>const</code> (if you only ...
style d3 axis with js rather than CSS <p>Is there a way to style a d3.js chart axis with js similar to this: </p> <pre><code> svg.append("text") .attr("x",xPos) .attr("y",yPos -3) .attr("font-family", "sans-serif") .attr("font-size", "10px") .attr("font-weight", "bold") .attr("fill", "bla...
<p>I'd always advocate styling using CSS if you can - it's what it's designed for, but yes you can also style things manually if you wish.</p> <p>For example if you want to style the axis line, you would take your "container" or element in which you added the axis to (I'll assume an <code>svg:g</code> in this case) an...
UiViewControllers are not loaded from tab bar item in swift after using objective c <p>I am writing an application in swift 3 where I have several views connected by segues for different tab bar item.I imported a rotary wheel project from Github using bridging header and dropped all the objective c files inn my project...
<p>I was running right. I don't know exactly meaning of "other views",Is it write in your SMViewController ? Can you upload your code in GitHub , I could help you more.</p> <hr> <ol> <li>set your ViewController's Nav "is Initial View Controller"</li> <li>set your ViewController's Class</li> <li>remove code you added ...
TypeScript 2.0 throws errors from excluded files? <p>I have a nodeJS project based on <a href="https://github.com/vladotesanovic/angular2-express-starter" rel="nofollow">this</a> seed project. It has two <strong>tsconfig.json</strong> files which look like this:</p> <pre><code>{ "compilerOptions": { "targe...
<p>I noticed the <strong>Duplicate identifier</strong> problem before with my project. What I did by accident was I installed a package in a subdirectory of my project via npm. I had to delete the generated subdirectory of <code>node_modules</code> there to fix it.</p> <p>Also your errors seem similar to this post I f...
ggplot anotate when x values are characters <p>I would like to 'annotate' a text on the top right hand corner of ggplot2 bar chart that has character for x axis and numeric for y axis. All the documentation I see is that, to annotate a text, both x and y coordinates have to be given numeric value.</p> <p>Here is an...
<p>You should be able to do it just putting the location inside of <code>aes()</code>. This worked for me (unless I am misunderstanding your intent):</p> <pre><code>ggplot(data = df2, aes(p, v, label = v)) + geom_bar(stat = "identity", position = "dodge") + geom_text(position = position_dodge(.9), vjust = -1, fon...
Cannot put a text value in a xls file using aspose.cell for android <p>I use an Edittext in android to fill a cell of xls.file by using aspose-cell for android API. But when i put some text in the edittext, the displayed value in the xls. file is always the same : 2131492965 !! and not the text of the edittext.</p> <p...
<p>@Krukiou, A similar inquiry of yours have already been replied in Aspose.Cells support forum. Please check the following piece of code as well as <a href="http://www.aspose.com/community/forums/thread/787644/cannot-put-a-value-of-an-editext-in-a-xls-file.aspx" rel="nofollow">this</a> thread for details. </p> <p>Re...
GCDAsyncSocket client/server not working over iOS access point <p>I have a very simple TCP client/server implementation using <a href="https://github.com/robbiehanson/CocoaAsyncSocket" rel="nofollow">GCDAsyncSocket</a> (7.5.0) and I'm using <code>NSNetService</code> for service discovery. It's used only on a local wifi...
<p>It sounds like to me, that your problem lies in connection from the cellular network. When connected to cell network, it causes issues with ip address. Refer to this discussion from the <a href="https://github.com/robbiehanson/CocoaAsyncSocket/issues/330" rel="nofollow">Cocoaasyncsocket Github page</a>.</p>
Code doesn't work <p>I'm trying to make an APK that saves passwords with the site using two different ArrayLists. This way, I can get the right indexnumber of the site and get the password based on this indexnumber. In the beginning of MainActivity, I add two random Strings to the ArrayLists, so that I don't have to wo...
<p>When you exit an Activity, all the data on it is lost. You have to persist your ArrayList in <code>SQLite</code> or use <code>SharedPreferences</code> instead.</p> <p>SharedPreferences: <a href="https://developer.android.com/reference/android/content/SharedPreferences.html" rel="nofollow">https://developer.android...
Organizing a list of of strings based on a list of integers c# <p>I have an array of integers organized from greatest to least, however, I want the numerical values to be associated with a name string entered by the user and ordered from greatest to least based on that numerical value. The array is organized like this:...
<p>Since you are taking the strings from textboxes, you can build the textbox name dynamically by using the numbers. I assume that the int array contains the indexes of the strings from 1 to 8 in the desired order.</p> <pre><code>string[] textArray = intArray .Select(i =&gt; Controls("nameBox" &amp; array[i]).Text...
checkbox filters not working as desired in AngularJS <p>I have a requirement to filter some properties using check boxes. Here what I wrote:</p> <p>js code:</p> <pre><code>app.controller("filterCtrl", function ($scope, $http) { $http({ method: 'GET', url: contextPath + '/properties' }) .then(function (re...
<p>i think its filter 1 time 50/100 item 2 time 20/50 remaining 50 witch already filter so you need on every check box click first bind grid then filter it.</p>
Need assistance in Xamarin Development Environment setup <p>I have installed VS 2015 for the purpose of learning Xamarin Development. But, look what is happening is that I am not even getting right templates to create an Android application. Please find below the screenshot of my VS:</p> <p><a href="http://i.stack.img...
<p>Like Himanshu mentioned in the comments. You may not have selected the Xamarin during the installation.</p> <p>Follow the steps mentioned in the link here <a href="https://msdn.microsoft.com/en-in/library/mt613162.aspx" rel="nofollow">https://msdn.microsoft.com/en-in/library/mt613162.aspx</a></p>
Different Css for different page elements <p>i have to ask if i have two html pages page1 and page2 and both share the same Css file called default.css because both pages have some things identical like header and footer area then we don't need to create css for each page. but my question is that for example if i am ad...
<p>just use one css file, then add a unique <code>class</code> or <code>id</code> to your slider items.</p>
How to fix Sublime text highlighting for react-tutorial? <p>I recently started the <a href="https://facebook.github.io/react/docs/tutorial.html" rel="nofollow">official reactjs tutorial</a> and noticed that the sublime text highlighting is completely screwed.</p> <p><a href="http://i.stack.imgur.com/XlpVV.png" rel="no...
<p>Installing the following sublime package should fix those problems: </p> <p><a href="https://github.com/babel/babel-sublime" rel="nofollow">https://github.com/babel/babel-sublime</a></p>
Javascript counting the frequency letters of a string <p>I've been trying to come up with an answer to this exercise, but there has to be a mistake where I can't see it. I'll share the description of the exercise, my code and finally my output. </p> <p>DESCRIPTION:</p> <p>Now we are going to save the longest length o...
<p>Two problems</p> <ul> <li><p>use an object</p> <pre><code>var array_lengths = {}; // object </code></pre></li> <li><p>return that object without sorting and other stuff</p> <pre><code>return array_lengths; </code></pre></li> </ul> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-...
how to show notification when app is not running <p>My Scenario is to show Greeting notification to my users even they are not using the app. Below code is working fine if the open is opened or minimized. But, I want to show the notification in morning even though the user did not open the application.</p> <p>Main Act...
<p>A few things you need to do here. If the user force closes the app, you need to ensure that you start your service with <a href="https://developer.android.com/reference/android/app/Service.html#START_STICKY" rel="nofollow">START_STICKY</a> so that the service restarts when the app is force closed.</p> <p>In order t...
How can i remove textarea of CKEditor and only use its toolbar? <p>I want to implement CKEditor for my web application. I don't need it on every textarea, I want only one CKEditor toolbar on my navigation panel. so for that I need to remove default textarea from CKEditor, all I am saying is how can i only use toolbar o...
<p>Most probably you are looking for the shared space plugin, see the example here: <a href="http://sdk.ckeditor.com/samples/sharedspace.html" rel="nofollow">http://sdk.ckeditor.com/samples/sharedspace.html</a></p> <blockquote> <p>The optional Shared Space plugin makes it possible to share the same editor toolbar an...
React Node and Stripe <p>I'm kind new to react, but I kinda got it now. I wrote a functioning frontend webapp without a backend, its all working perfect. BUT now I want to integrate stripe, therefore I need a backend, probably Node would be the best for that?</p> <p>But I have no idea how it works. So far I have writt...
<p>This basically amounts to "I've got a frontend, how do I write a backend". Welcome to full stack development :) This is probably a bit too big of a question to be answered on stack overflow, but I can give you a few notes which you can use to look up the information you need.</p> <p>If you have written a frontend w...
Difference between computer names and dnshostname in PowerShell cmdlets? <p>I write script that need to be used in different active directory forests.</p> <p>In one forest I am able to use simple computer names that are the same as the computer samaccountname value.</p> <p><code>mycomputername</code></p> <p>In anoth...
<p>If you want to connect to a remote host by name you must be able to resolve the name (be it a hostname or FQDN) to an IP address. Whether you can resolve a hostname or need an FQDN depends on the search domains that are configured (or not configured) on a computer's network adapter.</p>
send an array via PHP (WP plugin) to a front-end JS variable, then replace href links on the page (if exists) <p>I have a custom WordPress plugin that I've developed, it's partially completed, It uses a customer number that's pulled from a separate plugin. Then I take the customer #, pass it through a PDO connection to...
<blockquote> <p>How do I pass the Array over to JavaScript from the WP plugin?</p> </blockquote> <p>WordPress HeartBeat API is great for features like this. Since you did not provide sample code, I will use my own example. Also, check out this tutorial: <a href="http://code.tutsplus.com/tutorials/the-heartbeat-api-g...
Using SaveFileDialog in c# Winforms <p>I'm basically just trying to get a file path to save a file to but my SaveFileObject won't let me access the SelectedPath. I've checked the other forums and can't figure out why it won' tlet me, here's my code;</p> <pre><code>SaveFileDialog filePath = new SaveFileDialog(); Dialo...
<p>You actually want the file name from the FileName property from your SaveFileDialog. This will give you the full path and file name for the file your user wants to save.</p> <pre><code>SaveFileDialog saveDialog = new SaveFileDialog(); DialogResult result = saveDialog.ShowDialog(); if (result == DialogResult.OK) { ...
Adding an Analytics Event to the Google Classroom Share button <p>I recently added the Google Classroom share button to my website. I'm looking to fire off a Google Analytics event every time this share button is clicked. I've tried using a javascript onClick to do it, but that didn't work. I think it might be because ...
<p>You should try to use the <a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/debugging" rel="nofollow">debug</a> version of the analytics.js library, that logs detailed messages to the Javascript console as it's running. These messages include successfully executed commands as well as ...
How to set various attribute of DOM element from variable angular 2? <p>In my app I have variable of String. Which is have in string name of attribute to add.</p> <pre><code>ngOnInit() { this.colAttibute = 'width-50'; } </code></pre> <p>or it can be equal to 'width-100'. My app is get device width and set the ...
<p>You can set the width like this:</p> <pre><code>&lt;ion-col [attr.width-70]="flag"&gt; </code></pre> <p>Where flag is a boolean value indicating whether to apply this attribute or not. Unfortunately, you will need to list all the available attributes in order to support all of them dynamically.</p>
Is it possible to create a search engine with PHP and HTML? <p>I have recently ben working on a site where users can post whatever they want. Let's pretend 100'000 article get posted every month, it would be a pain to find what you need. This is why we have search bars on sites. Here's the part I understand: I know how...
<p>To retrive related data for users' search from database you can use "like" in the query:</p> <p>=》select * from posts where like '%$user_query%'</p> <p>To show limited amount of results per page use 'pagination'. Search for pagination techniques. </p>
Custom UnmodifiableSetMixin Fails in Jackson 2.7+ <p>I'd like to be able to deserialize an <code>UnmodifiableSet</code> with default typing enabled. To do this I have created an <code>UnmodifiableSetMixin</code> as shown below:</p> <p><strong>NOTE</strong>: You can find a minimal project with all the source code to re...
<p>It turns out that this is a regression in Jackson. I created <a href="https://github.com/FasterXML/jackson-databind/issues/1392" rel="nofollow">https://github.com/FasterXML/jackson-databind/issues/1392</a> which acknowledges the bug.</p> <p>A workaround that uses a custom deserializer was provided to me via <a href...
How to create an "Open in Google Sheets" button <p>I already have an "export to CSV" button on my site. But I'd like to have an "Open in Google Sheets" button, which opens the CSV directly into Google Sheets.</p> <p>That'll save the user a few steps, so they will no longer have to (1) download the CSV, and (2) import ...
<p>If you wanted to avoid the full API . . . </p> <p>Use Google Script to import the CSV into a Google Sheet and set the script trigger to run on a sensible schedule (every, minute, hour, day etc.). </p> <pre><code>//adapted from http://stackoverflow.com/a/26858202/3390935 function importData() { var ss = Spreadsh...
My Solution to the Largest Palindrome of the product of two 3 digit numbers needs work <p>The answer I'm getting is not the correct one (correct answer is 906609). Please help me understand where I am going wrong. I want the while loop to go from 100 to 999 while multiplying itself against the current <code>i</code> va...
<p>You're going to have to sort the array in ascending order if you want the last one to be the highest:</p> <pre><code>pali.sort(function(a, b){return a-b}); </code></pre> <p>Using that, I get 906609.</p>
Trying Cybersource with Hybris 6.1 <p>Hi i am new to hybris &amp; i have hybris 6.1, Now i want to use Cybersource integration with my hybris. But it needs b2ccheckout addon which is not included in hybris package. I have commented the " -->" in cybersourceaddon/extensioninfo.xml.\,but while ant clean all it gives the ...
<p><em>Cybersource</em> extension is not part of the SAP Hybris commerce distribution anymore. Where did you find this extension ?</p> <p>Deleting dependencies is not how you are going to fix this.</p> <p>Have a look at the <a href="https://help.hybris.com/6.1.0/hcd/8ad0893686691014bd38f4e952a38e29.html" rel="nofollo...
Using a suppression file with Dr.Memory <p>I've had a look at <a href="http://www.drmemory.org/docs/page_suppress.html" rel="nofollow">the Dr. Memory documentation on suppressing errors</a></p> <p>but am still unclear on the finer points of using a suppression file. For example, if I use the following suppression file...
<p>I'm not 100% sure about this, but the documentation says: <code>A "*" matches any number of characters of any kind.</code>. Therefore, I think a suppression like </p> <pre><code>UNINITIALIZED READ name=Error #1 (ICU errors) sbicuuc53_32.dll!* </code></pre> <p>should suppress any errors that have a call stack whos...
Convert Unicode characters to hex causes extra bytes <p>Here is the code that I use for escaping muti-bytes unicode characters.</p> <pre><code>let sample = '1F3C4-1F3FB-200D-2640-FE0F'; //🏄🏻‍♀️ let characters = String.fromCodePoint(...sample.split('-').map(code =&gt; parseInt(code, 16))); let codes = '...
<p>Apparently, the <code>codePointAt</code> function gives "a number representing the code unit value of the character at the given index". However, the index is the same as for <code>charCodeAt</code>, so if that index is in the middle of a surrogate pair (such as <code>\uD83C\uDFC4</code> for <code>\u{1F3C4}</code>),...
Send Notification Update when firebase database is updated <p>I am new to android Firebase and I want that when any new value is added to Firebase then I get any notification like your database is updated or so.. How can I do that.. Please help</p>
<p>You can do this by using Push Notification , During Registration, get the generated token and save it your database along with user details .<br> whenever a key/child is updated fire up the Event to that tokenID</p> <p>you should have a broadcast Receiver in you application which monitors the incoming fireba...
Laravel Live Search Box <p>I'm using Laravel 5.3. I have an array of objects that presents data onto a blade template. My objective now is to create a live search box to filter the data. Here is an example of my data:</p> <pre><code>array(2) { [0]=&gt; object(SimpleXMLElement)#196 (6) { ["id"]=&gt; string(1) "1"...
<p>In your template you will need to use AJAX that will respond when a user types into a search box. The ajax will call a php function that performs searches on the fly, passing back the results to the ajax, which then in turn shoves the results into your html.</p> <p>There are a lot of tutorials online for creating ...
String replace using SED/AWK <p>I want to replace a part of string in a file, i.e. replace <code>NFIN=4</code> to <code>W=4N</code>. Please note that in the numeric part of <code>NFIN=4</code>, the number can be any int or float value; if the input was <code>NFIN=3.0</code>, the output should be <code>W=3.0</code>. The...
<p>With GNU sed:</p> <pre><code>sed -r 's/NFIN=([^ ]*)/W=\1N/' file </code></pre> <p>If you want to edit your file "in place" use sed's option <code>-i</code>.</p>
Why does switching the order of two time zones that are the same time in mysql convert_tz make a difference? <pre><code>SELECT CONVERT_TZ('2020-06-30 23:59:59','America/Caracas','US/Eastern'); </code></pre> <p>This returns '2020-07-01 00:29:59' which is strange because EST and Venezuela actually share the same time.</...
<p>The most likely explanation for the observed behavior is incorrect or outdated time_zone info.</p> <p>For Caracus, Venezuela</p> <p>From '2007-12-01' to '2016-06-01', timezone offset is UTC-04:30</p> <p>Beginning '2016-06-01', timezone offset is UTC-04:00</p> <hr> <p>We don't know whether MySQL timezone tables ...
What is enumerate in Python mean? <p>What is <code>&lt;enumerate object at 0x000000000302E2D0&gt;</code> mean?</p> <blockquote> <p><code>&gt;&gt;&gt; my_list = ['apple', 'banana', 'grapes', 'pear']</code><br> <code>&gt;&gt;&gt; enumerate(my_list)</code><br> <code>&lt;enumerate object at 0x000000000302E2D0&gt;</c...
<p>It returns an <em>enumerate object</em>, which is an iterator. It does not actually show you what it contains until you specifically ask it to. One way to do this is to force it to be a list.</p> <pre><code>&gt;&gt;&gt; my_list = ['apple', 'banana', 'grapes', 'pear'] &gt;&gt;&gt; a = enumerate(my_list) &gt;&gt;&gt...
QTableView not showing properly on differrent machines <p>I have a problem with deploying qt application. When i deploy it on my machine (Win 8) QTableView shows normally (columns and rows, header and all) <a href="http://i.stack.imgur.com/2AVqW.png" rel="nofollow">On my machine</a>, but when i try to run it on differe...
<p>So, I found out what was wrong. QSqlTableModel was not able to access sqldrivers directory because they are supposed to be in root of application not in plugins directory. Everything works fine now.</p>
Skew a diagonal gradient to be vertical <p>I have a not-quite linear gradient at some angle to the horizontal as an image. Here's some toy data:</p> <pre><code>g = np.ones((5,20)) for x in range(g.shape[0]): for y in range(g.shape[1]): g[x,y] += (x+y)*0.1+(y*0.01) </code></pre> <p><a href="http://i.stack....
<p>You can intepolate to determine the skewness and interpolate again to correct it. </p> <pre><code>import numpy as np from scipy.ndimage.interpolation import map_coordinates m, n = g.shape j_shift = np.interp(g[:,0], g[0,:], np.arange(n)) pad = int(np.max(j_shift)) i, j = np.indices((m, n + pad)) z = map_coordinate...
Component not showing when swipeable container is swiped using code <p>I have a swipeable container with a button exposed when you swipe it.<br> It works when you use your mouse to swipe, but it doesnt seem to work when you use code to perform the same action. </p> <pre><code> Form hi = new Form(new BoxLayout(BoxLa...
<p>Thanks for the code, it seems to be a regression in the component. I've fixed it and it should be available for the coming update which is on October 7th 2016</p>
Using TcpClient/TcpListener, what is the best method to receive an unknown amount of separate messages? <p>My current <code>ClientHandler</code> method receives a <code>TcpClient</code>, opens up a <code>NetStream</code> on said client, and starts pulling data from it like this:</p> <pre><code> try ...
<p>Keep the <code>TcpClient</code> object and its <code>netstream</code> somewhere you can use it over and over again. Then call <code>netstream.Read()</code> (non-blocking) as often as needed. <code>DataAvailable</code> will tell you when there is data to read. </p> <p>Notice: incoming TCP data is added to a big buf...