input
stringlengths
51
42.3k
output
stringlengths
18
55k
Tutorial for creating connector on WSO2 ESB <p>i am looking for a tutorial which guides us on how to create a custom connector on top on WSO2 ESB platform. The situation is we have 2 companies which has restful APIs available to use and we want to build a bridge to transport information between them.</p> <p>Any help ...
<p>You can refer <a href="https://docs.wso2.com/display/ESBCONNECTORS/Writing+a+Connector">here</a> to generate the connector archetype and you can refer here to <a href="https://docs.wso2.com/display/ESBCONNECTORS/Types+of+Connectors#TypesofConnectors-REST-basedconnectors">call rest API</a> sample is provide to <a hre...
Use one scrollbar for all page content <p>I'm creating a one page website with three screens, each one has a title section on the left and a content section on the right. </p> <pre><code> &lt;article class="first" &gt; &lt;aside class="left_first"&gt; &lt;h4 class="title"&gt;Title&lt;/h4&gt; &lt;/asi...
<p>made a snippet below or > <a href="https://jsfiddle.net/mvhu8cd5/" rel="nofollow">https://jsfiddle.net/mvhu8cd5/</a> </p> <p>Explanation : </p> <p><strong>CSS</strong> . i <code>floated</code> the <code>aside</code> and the <code>section</code> giving them <code>20%</code> and <code>80%</code> ( that's purely my c...
e.onreadystatechange is slow in internet explorer <p>I'm working on a big website for a even bigger company and the issue is that a javascript:history.back() takes to long to load in internet explorer, in all the other supported browers the performance is acceptable except for internet explorer. If you check the perfor...
<p>I found this to be related to recent IE slowdown. Timeout and promises were not being handled properly. However, IE within the last week (of this post) updated IE to work properly. <a href="https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/" rel="nofollow">https://jakearchibald.com/2015/tasks-mic...
Using Maven with spring boot - parentID <p>I'd like to use spring boot to build jar as a part of a bigger project, which means I already have defined <code>&lt;parentID&gt;</code> section. And now I have to somehow plug springboot into my project, this is what I came up with: </p> <pre><code>&lt;project xmlns="http://...
<p>Try putting the dependency for spring-boot-dependencies under dependencyManagement instead of directly under dependencies.</p>
Removing an element from Magento menu <p>I'm trying to remove this terrible "BUY THEME" link on our website: <a href="https://www.minxny.com" rel="nofollow">https://www.minxny.com</a></p> <p>In case you're concerned, yes we legally purchased this theme through a 3rd party contractor who is no longer working with us. I...
<p>Add in CSS.</p> <pre><code>.level0.ext.first { display: none; } </code></pre>
Cassandra Query fails after data load of 5m rows - Cassandra failure during read query at consistency LOCAL_ONE <p><strong>The Problem</strong></p> <p>Simple CQL select failing when I have a large data load.</p> <p><strong>Setup</strong></p> <p>I am using the following Cassandra schema: </p> <pre><code>CREATE KEYSP...
<p>For the amount of records that you want to retrieve, it will be worthy to use <a href="https://datastax.github.io/python-driver/query_paging.html" rel="nofollow">pagination</a>, to retrieve smaller chunks. </p> <p><strong>Edit</strong></p> <p>As explained <a href="http://stackoverflow.com/questions/32689856/cassan...
Android cropping and decreasing video size <p>we are going to start an app that captures videos or picks videos from gallery. The videos will be exactly 30 seconds, so users can crop or trim videos like video editor.</p> <p>At this point, we got 2 main problems. The first one is video size. You know the video size cou...
<p>I don't know what problems you have with ffmpeg. But it is definetely the best and the fastest library available for video editing,creating etc. Use <a href="http://androidwarzone.blogspot.am/2011/12/ffmpeg4android.html" rel="nofollow">ffmpeg4android</a> if size is important for you. The library is about 6 megabytes...
Verilog: Illegal redeclaration <p>I am attempting to generate a programming file useing ISE 14.7 for some of the benchmarks provided on Trust-Hub.org. I am working with AES-T100 which contains a series verilog files. I have never worked with verilog and haven't touched VHDL in years.</p> <p>In theory the verilog code ...
<p>Declare like this and remove <code>reg [63:0] load;</code></p> <pre><code>////////////////////////////////////////////////////////////// module TSC( input rst, input clk, input [127:0] key, output reg[63:0] load ); </code></pre>
CASE expression in WHERE clause selecting rows that are not NULL <p>I'm trying to write a query that when passed two variables, the first set is numbers 1-4 and the second set of number is 1-2. I want to select only the rows that meet the conditions. I've come up with this so far and am now a little lost on how to call...
<p>What you want is the eternally simple AND/OR:</p> <pre><code>DECLARE @Task INT DECLARE @Status INT SET @Task = 1 SET @Status = 1 SELECT Pics ,Title ,Photos ,Reports FROM DATES WHERE @Status = 1 AND ( (@Task = 1 AND Pics IS NOT NULL) OR (@Task = 2 AND Title IS NOT NUL...
Spyder 3.0 won't let me run file <p>Spyder 3.0, Windows 10 64-bit</p> <p>Hello everyone, I used to be able to write code and run the files in Spyder without a problem but now the button to run the code is greyed out and I can't run the file. Not even using F5 or clicking Run from the Run menu tab.</p> <p><a href="htt...
<p>I'm having the exact same problem. Once I save my code turns white (I have a "skin" which is why its different) And it wouldn't let me run the file. I noticed that the saved file was in a different format which is probably be the cause. But I just did a simple factory reset and it works for me now.</p>
How to share image and text in objective c ios <p>I want to share image and text in all <code>ActivityController</code> but the following code is not work for me:</p> <pre><code>NSString *theFileName = [[fileNameOfImage lastPathComponent] stringByDeletingPathExtension]; // [BDGSharing shareUsingActivityController...
<p>Let's review your code. First- </p> <pre><code>NSString *st = [NSString stringWithFormat:@"%@.jpg",theFileName]; NSData *imageData2=UIImagePNGRepresentation(_imageview1.image); </code></pre> <p>You are saving a .jpg image with PNG representation, shouldn't you use jpeg representation instead?</p> <pre><code>UIIma...
Doctrine select entities with relation condition <p>Given two tables:</p> <p><strong>notification</strong></p> <pre><code>id (int PK) title (varchar(255)) date (datetime) </code></pre> <p><strong>notification_seen</strong></p> <pre><code>id (int PK) notification_id...
<p>Basically you just want to query the db for <code>Notifications</code> that have no related <code>NotificationSeen</code>:</p> <pre><code>public function getUnreadNotification(User $user): array { return $this-&gt;createQueryBuilder('n') -&gt;join('n.seenBy', 'ns') -&gt;where('ns.id IS NULL') ...
SQL Server Management Studio 2008 add in <p>I am trying to create a SSMS 2008 add in using the Visual Studio Add In project template with VS.NET 13. I have followed the instructions in <a href="http://www.codeproject.com/Articles/1073839/Create-SQL-Server-Management-Studio-Addin" rel="nofollow">this tutorial</a> from C...
<p><strong>.addin</strong> file in not needed for SSMS 2008. The proper registry key you created and the corresponding CLSID registration should be enough.</p> <p>This is what I used in my Tabs Studio add-in (msi, wix, current user installer):</p> <pre><code> &lt;Component Id="TabsStudioSSMS2008Component" Guid="986C...
How can I call method that has a delegate parameter using reflection? <p>How can I call the method below using reflection?</p> <pre><code>namespace Awesomium.Core { public delegate JSValue JavascriptMethodHandler(object sender, JavascriptMethodEventArgs e); public class JSObject { public void Bind...
<p>The bulk of your question is answered in <a href="http://stackoverflow.com/q/2202381/60761">this SO post</a>. I will use that as the basis.</p> <p>The point that remains is how to set up the <code>object[] parametersArray</code> with a delegate instance.</p> <p>To do this, you need to create a MethodInfo for your ...
Moment.js Date not working on tablet <p>I am working with my script of just displaying the date and I'm using duda platform for it however the tablet version is not working while the desktop and the mobile is just fine. My script is pasted in the end of body and I'm using moment.js</p> <pre><code>&lt;script src="https...
<p>In your HTML example the span is not closed</p> <pre><code>&lt;h4&gt; The date today is :&lt;span id="dateToday"&gt;&lt;/span&lt;/h4&gt; &lt;h4&gt; The date today is :&lt;span id="dateTodayTab"&gt;&lt;/span&lt;/h4&gt; </code></pre> <p>It should be like this:</p> <pre><code>&lt;h4&gt; The date today is :&lt;span i...
"Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<C3S.Models.Permission>' to 'bool'." <p>I'm trying to code a Home screen so that a given user sees Menu Options depending on their Permissions. Basically, going through each Menu Option, seeing what permissions are need to see it, and then checking...
<pre><code>mo.Permissions.Intersect(userPermissionList, new PermissionComparer()) </code></pre> <p>is returning an IEnumerable but Where requires boolean logic.</p>
Table with two cells with CSS? <p>I want to get this result, but with no tables (with pure CSS):</p> <p><a href="http://i.stack.imgur.com/XxzZ6.png" rel="nofollow"><img src="http://i.stack.imgur.com/XxzZ6.png" alt="enter image description here"></a></p> <p>With tables I can do something like this with one 'tr' and tw...
<p>You can use <code>Flexbox</code> and set <code>align-items: center</code> on flex container.</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>.content { display: flex...
How to change the maximum size of the file uploaded Java Post <p>I take back the program of a colleague.</p> <p>He did the method (This program allows to upload a file on a server):</p> <pre><code>protected String uploadFile(File inputFile, String uuidFile) throws IOException, ClientProtocolException { Ht...
<p>To resolve the error as of now Check your web.xml for the below configuration in the servlet. Increase the size and check. </p> <pre><code> &lt;multipart-config&gt; &lt;max-file-size&gt;68142301&lt;/max-file-size&gt; &lt;max-request-size&gt;68142301&lt;/max-request-size&gt; &lt;file-size-threshold&gt...
C# dataGridView from XML file <p>I know there are lots of resources that show how to bind dataGridViews to XML files or populate from XML, but the XML i'm using as source is a bit more complex than any example I've seen used and I'm struggling. (although it really shouldn't be difficult)</p> <p>I basically need to run...
<p>Try this :</p> <pre><code>using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Xml; using System.Xml.Linq; namespace WindowsFormsApplication11 { public partial class F...
ggplot geom_bar() customize by linetype and fill <p>I am using ggplot2 and geom_bar() to plot some statistics. Is there a way to customize the fillings in the bar, and the line type for each of the bars? I would like to highlight two key features: There are five bars overall and the numbers they represent are produced ...
<p>Here is an example with three arbitrary (and arguable) classifications. Note use of <code>dplyr</code> to define the groups first to make the legends more easily. I am assuming that in most use cases, you would have (or could construct) columns similar to mine here with your data of interest.</p> <p>I am note sure ...
Python Case Matching Input and Output <p>I'm doing the pig latin question that I'm sure everyone here is familiar with it. The only thing I can't seem to get is matching the case of the input and output. For example, when the user enters Latin, my code produces <code>atinLay</code>. I want it to produce <code>Atinlay</...
<p>What you need is <a href="http://docs.python/3/library/stdtypes.html#str.title" rel="nofollow"><code>str.title()</code></a>. Once you have done your piglatin conversion, you can use <code>title()</code> built-in function to produce the desired output, like so:</p> <pre><code>&gt;&gt;&gt; "atinLay".title() 'Atinlay'...
Laravel 5.2 add params to url <p>I need to pass a value from a form(dropdwon) and append this value to a url.</p> <p>My Routes are:</p> <pre><code>Route::get('menues/{city?}', 'PagesController@menue'); Route::post('/', 'PagesController@menue'); </code></pre> <p>I have a simple form:</p> <pre><code>{!!Form::open(arr...
<p>You need to change your form <code>method</code> attribute to GET, then in your controller you can do follow:</p> <pre><code>public function menue(Request $request) { $city = $request-&gt;city; // bla-bla-bla if ( ! is_null($city) &amp;&amp; &amp;&amp; ! is_null(User::where('city', $city)-&gt;first()) { ...
property value overridden by parent even though set explicitly <p>When I have a control <code>A</code> that contains a control <code>B</code>, there are properties <code>Prop</code> that are inherited. That means, <code>B.Prop</code> will automatically take the value of <code>A.Prop</code> <strong>if <code>B.Prop</code...
<p>If you disable a control, its children are disabled. Since a <code>StackPanel</code> is not interactive, there is no reason to disable it other than to disable its interactive children. </p> <p>If you want to enable a control A while its parent B is disabled, you can't do that. B cannot be the parent if you want to...
Click button on row of the table and show values in modal-window <p>I make a web site with bootstrap and bootstrap table. To add element into boostrap-table I using php. The problem is when I click to the edit button doesn't show on modal-window the values of the row that I clicked.</p> <p>I think that the problem is ...
<p>The click event should be associated with button not the table : </p> <pre><code>$('.btn-edit').click(function() { var $row = $(this).closest("tr"), $tdata = $row.find("td"); console.log($(this).text()); $.each($tdata, function(index, value) { aler...
Most recent record from Elasticsearch Rails based on Multiple indices <p>I have two models in my Rails application: Share and Rent.</p> <p>I'm starting to use ElasticSearch in my application and wanted a way to bring the models rent and share most recent.</p> <p>I tried the following: </p> <pre><code>@response = Ela...
<p>Elasticsearch allows you to <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html" rel="nofollow">sort</a> according to a field, I'm not familiar with Rails but I guess you should try this:</p> <pre><code>@response = Elasticsearch::Model.search query: { "indices": {...
ZAP Proxy Java Lib - Is it still usable and maintained? <p>I have found this link about OWASP ZAP Proxy: <a href="https://www.owasp.org/index.php/Category:OWASP_Proxy" rel="nofollow">https://www.owasp.org/index.php/Category:OWASP_Proxy</a></p> <p>And find it very interesting.</p> <p>I have the need to write a (mitm) ...
<p>I'm afraid thats not the ZAP code, and ZAP does not use it in any way.</p> <p>The ZAP code lives in <a href="https://github.com/zaproxy/zaproxy" rel="nofollow">https://github.com/zaproxy/zaproxy</a> and is very well maintained :)</p> <p>However I probably wouldnt recommend using the ZAP code as a basis for a long ...
Where do margins come from in this QML sample? <p>I've looked at tons of questions on SO about content margins in QML but all of the answers point to missing <code>spacing: 0</code> properties. I've done all that, but still get weird spaces that I cannot eliminate. Can anyone explain why this QML code:</p> <pre><code>...
<p>This answer is short:</p> <p>Set the property <code>padding</code> to 0 for your panes, and there won't be no margins left.<br> You can also set all paddings seperately (leftPadding ...) Those properties are inherited from <a href="https://doc-snapshots.qt.io/qt5-5.8/qml-qtquick-controls2-control.html" rel="nofollo...
Exception propagation in React Native <p>Here is a function <code>geolocate()</code> that calls geolocation service asynchronously in React Native.</p> <p>The problem is that once an error is thrown inside <code>geolocationError()</code>, it does not get propagated to the parent <code>geolocate()</code>, but the red e...
<p>The <code>Promise.reject()</code> seems to do the trick, but I still get an unhandled promise rejection.</p> <pre><code>[warn][tid:com.facebook.react.JavaScript] Possible Unhandled Promise Rejection (id: 0): Location services disabled. </code></pre>
Conditional formatting in google sheets to inherit formatting from other cell <p>I've been trying to figure out how to apply conditional formatting to the background of a cell. I've searched the internet but haven't been able to find anything related to this.</p> <p>I am interested in formatting a cell conditionally, ...
<p>This is not possible with plain conditional formatting, you'll need an onEdit function.</p> <pre><code>function onEdit(e) { var r = e.range; if (e.value.length &gt; 0) { var reference = e.source.getActiveSheet().getRange(r.getRow(), r.getColumn()-2) var color = reference.getBackground(); r.setBa...
how to check how many pooled connection we have at a specific time in MemSQL <p>How can i tell that i have reached the maximum number of queries that my cluster can handle at a time? </p> <p>If the connection pool size is too small for the workload then we have to adjust the max_pooled_connections configuration vari...
<blockquote> <p>How can i tell that i have reached the maximum number of queries that my cluster can handle at a time?</p> </blockquote> <p>There isn't a hard limit on the number of queries you can send other than max_connections (100k), but at some point the cluster will not execute them all at once and will sche...
Add custom header to an iframe asp.net <p>There is a legacy .net application. In its content page , I need to open a MVC application. So I am using Iframe and opening the MVC application .</p> <p>I am stuck as to how to send parameters to the MVC application via custom headers. I cant use query string as the paramter ...
<p>Don't know what you mean by passing data via "custom headers." Typically headers are for metadata, not data. If you have a significant amount of data to pass, the traditional way is via form/post. Here's one way to do it:</p> <p>In the legacy app (the one that contains the iFrame):</p> <pre><code>&lt;asp:Conten...
Flatten MATLAB structure using dynamic structure reference in single line <p>I have the following structure:</p> <pre><code>myStruct.A.var = 'abc'; myStruct.B.var = '123'; myStruct.C.var = 7; ... </code></pre> <p>I am looking for a compact (1-2 lines) way of flattening the structure in order to get all the values of ...
<p>A simple loop is more than adequate:</p> <pre><code>% Set up data myStruct.A.var = 'abc'; myStruct.B.var = '123'; myStruct.C.var = 7; % Extract data substructs = fieldnames(myStruct); % Get substructure names nsubs = numel(substructs); % Get number of substructures flatteneddata = cell(nsubs, 1); % Preallocate ...
Exporting a AWS Postgres RDS Table to AWS S3 <p>I wanted to use AWS Data Pipeline to pipe data from a Postgres RDS to AWS S3. Does anybody know how this is done.</p> <p>More precisely I wanted to export a Postgres Table to AWS S3 using data Pipe Line. The reason I am using Data Pipe Line is I want to automate this pro...
<p>There is a sample on github. <a href="https://github.com/awslabs/data-pipeline-samples/tree/master/samples/RDStoS3" rel="nofollow">https://github.com/awslabs/data-pipeline-samples/tree/master/samples/RDStoS3</a></p> <p>Here is the code: <a href="https://github.com/awslabs/data-pipeline-samples/blob/master/samples/...
DataFrame/Dataset join not producing correct results in Spark 2.0/Yarn <p>We have a cluster running Apache Spark 2.0 on Hadoop 2.7.2, Centos 7.2. We had written some new code using the Spark DataFrame/DataSet APIs but are noticing incorrect results on a join after writing and then reading data to Windows Azure Storage ...
<p>This issue was fixed by the pull request submitted in <a href="https://issues.apache.org/jira/browse/SPARK-17806" rel="nofollow">https://issues.apache.org/jira/browse/SPARK-17806</a></p>
Microsoft O365 REST Graph API does not get all mails <p>I get the mails from the code below after getting the security token. My problem is that in my test account, there are 22 mails (in the inbox) and the returned JSON contains only the first 10 emails.</p> <pre><code>var json = JObject.Parse(await response.Content....
<p>10 is the default page size, so this is expected. You can expand the page size using <code>$top</code> up to 50. After that you need to request subsequent pages. There should be an <code>@odata.nextLink</code> included in the response which contains a URL to get the next page.</p>
Google Dataflow trigger firing before elementCountAtLeast reached <p>I was planning on using Google Dataflow to coordinate human-in-the-loop form completion, checking for conflict after 3 forms have been completed. I have setup Google PubSub for both Dataflow source and sink and want to simply have the trigger fire and...
<p>Without a <code>GroupByKey</code> nothing is being triggered. Both windowing and triggering only affect grouping (and combining) operations.</p>
volatile vs threadLocal in java <p>Lets take SimpleDateFormat as an example since it is not thread safe.</p> <p>I could allow each thread to have its own copy of SimpleDateFormat using threadLocal like this:</p> <pre><code> private static final ThreadLocal&lt;SimpleDateFormat&gt; formatter = new ThreadLocal&lt;Simple...
<blockquote> <p>the volatile keyword guarantees that a thread will have the most recent copy of the variable</p> </blockquote> <p>Of the volatile variable <em>only</em>, not its fields.</p> <p>Also, <code>volatile</code> is only useful if you need to change the value of the variable. In your use case, <code>final</...
Regex Syntax Misuse <p>I am running this query:</p> <pre><code>Select column_name from table where column_name ~ '%[A-Za-z]%' group by column_name </code></pre> <p>but I am not getting any results. What am I doing wrong?</p> <p>Goal: This is a column that includes phone numbers. I am trying to find any values that c...
<p>According to <a href="https://www.regexbuddy.com/" rel="nofollow">RegexBuddy</a>, the correct syntax for the <code>WHERE</code> clause is:</p> <pre><code>WHERE mycolumn ~ $$[A-Z]$$ </code></pre>
Memory for fields of class <p>I have such class:</p> <pre><code>class Job{ public: string name; double age; Job(string name, double age){ this-&gt;age = age; this-&gt;name = name; } }; </code></pre> <p>If I create object of this class by this way:</p> ...
<blockquote> <p>The new Job(..) object will be stored at heap</p> </blockquote> <p>This means that all members of class <code>Job</code> will be stored there, so to answer your question, on the heap.</p> <p>Note that the standard doesn't ever talk about the "heap", the appropriate term is the "free-store".</p>
Music is not resuming from where it was closed <p>Please check my code .My music restarts instead of resuming from where it was left.Also please give the solution to this. My requirement:The music should pause when the home button is pressed and it should start again from where it closed on opening it from recent acti...
<p>I can't comment so I'll put this in an answer. There's nothing wrong with your code, runs fine for me. Try overriding <code>onStop()</code> to check if it's being called when you're pressing the home button or at some other time.</p> <pre><code>@override protected void onStop(){ super.onStop(); Log.v("test...
Float value behaviour in Python 2.6 and Python 2.7 <p>I have to convert string to tuple of float. In Python 2.7, it gives correct conversion, but in Python it is not same case.</p> <p>I want same behaviour in Python 2.6 </p> <p>Can anyone help me why this is not same in Python 2.6 and how to do in Python 2.6.</p> <p...
<p>In order to get the same result in Python 2.6, you have to explicitly do:</p> <pre><code>'%.12g' % float_variable </code></pre> <p>Better to create a custom function to do this as:</p> <pre><code>def convert_to_my_float(float_value): return float('%.12g' % float_value) </code></pre> <hr> <p>As per <a href="...
CSS floated columns with negative margin on parent div are stacking <p>Trying to replicate Bootstrap columns without all the extra code that ships with the html framework. </p> <p>Simple html and css that I have done before but for the life of me I can't figure out why these won't float and sit side by side. </p> <p>...
<p>The Padding of the boxes is adding to their width.</p> <pre><code>.form-group { -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ -moz-box-sizing: border-box; /* Firefox, other Gecko */ box-sizing: border-box; /* Opera/IE 8+ */ } </code></pre> <p>This prevents that from happe...
Msys MinWG GTK-3 error not found Program Files <p>I am install <strong>msys2</strong> and <strong>mingw64</strong> and <strong>mingw64-GTK3</strong> in D:\Program Files\msys. <br> my packages installed is mingw-w64-x86_64-gtk3 ,mingw-w64-x86_64-make, mingw-w64-x86_64-gcc and ... <br> I want to compile <strong>main.cpp<...
<p>You should not install MSYS2 in a directory that has spaces. Most people install it to C:/msys64.</p>
Does a VoIP APNS Push Payload Contain the SIP Invite? <p>I am looking to integrate APNS for VoIP into our app and the part that I cannot seem to find anywhere is whether or not you are supposed to pass the SIP INVITE in the payload for the APNS Push. This seems like how it would happen especially since they give you do...
<p>No, VoIP apple push is nothing to do with SIP or SIP invite.</p> <p>In reality when end-user device gets push, device needs just to register to remote server and after this to receive a call. Below you can find full steps:</p> <p>1) A calling B via SIP. SIP Invite from A received by PBX/sip proxy or server. </p> ...
How to get value greater than 0 from table in Sqlite <p>Hye,</p> <p>I have table Client</p> <pre><code> date idClient nameClient OpenBal open Payable dr cr comPay close 2016-10-5 CL-MK Kashif CL-MK 9000 33134 0 5000 0 0 0 2016-10-5 CL-MK Kashif CL-MK 0 33134...
<p>I believe you need to use a having clause AFTER your group by. Something like:</p> <pre><code>SELECT idClient,nameMemb,min(OpenBal)as OpenBal,sum(open) as open,(min(openBal)+sum(open))as able,sum(re)as re ,sum(cr) as cr,sum(comPay)as comPay,(min(openBal)+sum(open)-sum(re)-sum(cr)+sum(comPay))as close from Add...
storing values into a integer variable <p>I have a question about storing a value into a integer variable. Is it possible to store different id into the same variable ? This is my problem, I would like to use a collection_select to save many id's. My code is actually working for one variable, like this :</p> <p>My co...
<p>pin_maker is user ? if so: (IMO): you need a n-to-n associations and a table users_pins. </p> <blockquote> <pre><code>Logic: One user has many pins One pin may be made by many users </code></pre> </blockquote> <p>On Rails:</p> <p>Model User:</p> <pre><code>has_many pins, :through =&gt; :users_pins </code></pre>...
Angular2 app structure <p>Within the next few month I'm going to rewrite one big app from angular 1 to angular 2. I don't really know well angular 1, and I just finished angular2-guide on their oficial site. It'll be SPA so I'll have routing with a help of Router and RouterModule. But as I've understand I can make rout...
<p>In the end, when I read <a href="https://angular.io/docs/ts/latest/guide/ngmodule.html#!#shared-module" rel="nofollow">https://angular.io/docs/ts/latest/guide/ngmodule.html#!#shared-module</a> I found out that my assumption about one module per app was just noobish and wrong. </p>
Print Number of occurences of each word in a File <p>How to Print number of occurrences of each word of a text file along with the word by reading the file.</p> <p>For example, A file with name "test.txt" having some contents suppose, "Lion is the king of Forest. Lion runs slower than a tiger"</p> <ol> <li><p>first ...
<ol> <li>Read a line: <a href="http://stackoverflow.com/questions/1096621/read-string-line-by-line-in-java">Read String line by line in Java</a></li> <li>Split each line using a space character: <a href="http://stackoverflow.com/questions/14414582/java-split-string-to-array">Java split string to array</a></li> <li>The ...
C# Code first foreign key. The foreign key refers to the non valid column in table with references <p>I'm creating a <code>code first</code> project.</p> <p>I have some entities, the "incriminated" ones are the following:</p> <p><strong>City</strong></p> <pre><code>public class City { [Key] public int CityId...
<p>Looking at the <code>Update-Database</code> log, one can notice that the PK of both tables are named <code>Id</code> (rather than <code>ProvinceId</code> and <code>CityId</code> implied by the model):</p> <blockquote> <p>[<strong>Id</strong>] [int] NOT NULL IDENTITY,</p> </blockquote> <p>That's why the foreign k...
Python Pyramid url replacement variable restrictions <p>I'm developing in Pyramid 1.7 and running into an interesting scenario where some URL dispatch replacement variables match the route, while others do not. These variables are numbers, which may not be best practice or even be allowed from what I can tell in the d...
<p>I made a test case which passes fine with your examples. Feel free to play with this until it reproduces your issues, but until then I'm not sure how to help.</p> <pre><code>from pyramid.config import Configurator from webtest import TestApp config = Configurator() config.add_route('my_route', '/path/more_path/{nu...
Animate dynamic elements with delay in Polymer <p>I got an iron-ajax call who retrieves x amount of elements that are displayed with a dom-repeat. I would like to for example run scale up animation on each of the elements but I want to do this sequential, i.e wait for the element to finish its animation before drawing ...
<p>Two ways in which i think this can be achieved using <code>neon-animation</code> are</p> <ol> <li>Use <code>timing</code> object to set <code>delay</code> and <code>duration</code></li> <li>Manually play the animations using <code>playAnimation</code> function</li> </ol>
Angular-material md-button automatic hover effect <p>I'm using Angular-material as a main style framework for my website and I'm trying to remove the <strong><em>md-focused</em></strong> class added by default in the confirm dialog primary button.</p> <p>After spend some time searching in the internet, i have found an...
<p>You just have to override every style you want with the keyword <code>!important</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>.md-button.md-focused { backg...
Rails - Radio button change image based on checked, hover and focus <p>I have a label with an image and a checkbox. I want to change the image based on hover in/out and checkbox status.</p> <p>I have several radio buttons, and two images for each : "image-active" and "image-inactive".</p> <p>I want to show the "activ...
<p>This is probably far easier with CSS than with JS.</p> <pre><code>&lt;label&gt; &lt;input type="radio"&gt; &lt;img class="active" src="active_img_src"&gt; &lt;img class="inactive" src="inactive_img_src"&gt; &lt;/label&gt; label input:checked ~ img.inactive, label:hover input:not(:checked) ~ img.inactive { ...
XCode8: UICollectionView edge-to-edge, Editing constraints in One Trait Variation (Size Class) breaks other Trait Variations <p>I am having an infuriating issue with Xcode interface builder. I have a storyboard where one view controller has a UICollectionView that's edge to edge to the View Controller's Root View. The...
<p>I found a cheap and easy solution. My problem was: my Leading and Trailing constraints were to the Margin, and not to the superview directly. The margin is what differs across size classes. So I modified my 2 constraints: Leading and Trailing, disabling the "Relative to Margin" option on each. Instructions her...
should I use a js function other than console.log(message)? <p>I would like to use console.log(message) to write out some information to the browser console. However, I came across this url which seems to recommend against it:</p> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Console/log" rel="nofollow...
<p>I agree with Mike C above-- <code>console</code> is generally available in most browsers, but you should probably remove <code>console</code> logs before a site gets pushed to production.</p> <p>Additionally, some older browser might <em>not</em> have the <code>console</code>, and if you <em>did</em> accidentally l...
How do I draw an arrow between two points in d3v4? <p>I have created a custom path renderer that draws an arrow between the nodes in my d3 graph as shown in the snippet. I have one last issue I am getting stuck on,</p> <p>How would I rotate the arrow portion so that it is pointing from the direction of the curve inste...
<p>I ended up doing what @Mark suggested in the comments, I calculate the point that is the height of the curve away along the normal midway between the two points, then calculate the unit vectors from the start point to the mid point and again from the midpoint to the end. I can then use those to get all the required...
using sysdate in table causing error in not a valid month <p>so I was doing my homework and the table is </p> <pre><code>Create TABLE Book ( bookID number(2,0) not null, title char(50) not null, catID char(2), copyrightYear number(2,0), isbnNumber char(50), publisherID char(2), purchasePrice number(4,2), coverType ch...
<p>You can use <a href="https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm" rel="nofollow">official documentation</a> for your homework, it isn't considered cheating (not at least more than asking in Stack Overflow):</p> <blockquote> <h2>Format Models</h2> <pre><code>Element Specify in TO_...
Wanting to get an output and run a programme together with Tkinter <p>What I want to be able to do is run a list of MIDI files, I have the programme to list them out and play them...</p> <pre><code>import os,fnmatch,pygame pygame.mixer.init() List = [] Song = 0 def Update(): List = [] for file in os.listdir('....
<p>Nevermind, I discovered how to run both a tkinter window and music at the same time, however a new problem is that the tkinter window is blank.</p> <p>New question is "<a href="http://stackoverflow.com/questions/39976875/why-is-the-tkinter-window-blank">Why is the tkinter window blank?</a>"</p>
Python subprocess not returning <p>I want to call a Python script from Jenkins and have it build my app, FTP it to the target, and run it.</p> <p>I am trying to build and the <code>subprocess</code> command fails. I have tried this with both <code>subprocess.call()</code> and <code>subprocess.popen()</code>, with the ...
<p>Ok, I go it. No comments or answers so far, but, rather then delete the question, I will leave it here in case it helps anyone in future.</p> <p>I Googled further and found <a href="https://www.webcodegeeks.com/python/python-subprocess-example/" rel="nofollow">this page</a>, which, at 1.2 says </p> <blockquote> ...
Why is an array variable equal to its address? <p>I am new to C programming, and there is a question that bothers me. Let's see the following piece of code:</p> <pre><code>int main() { int arr[3]={1,2,3}; printf("%d\n", arr); printf("%d", &amp;arr); } </code></pre> <p>If I run this code, it gives the same re...
<p>Your confusion here has to do with the equivalency of arrays an pointers. Namely, arrays are not pointers but in some contexts an array <em>decays</em> into a pointer.</p> <p>An array <strong>does not</strong> hold the address to the first element, but is a contiguous set of elements of the base type. The address...
do while loop in SAS macro <p>folks.</p> <p>here is my code:</p> <pre><code>%macro loop; %let var1=10; %do %while (&amp;var1.&gt;x); counter=&amp;var1.; yy=1/(1+x); end; %let var1=%eval(&amp;var1.-1); %end; %mend loop; data tmp; input x; datalines; 1 2 3 ; run; %let num=1; data y; set tmp; %loop; ...
<p>You're confusing <code>%do</code> and <code>do</code>. </p> <p><code>%do</code> is if you want to repeat a section of code over and over again, as if you'd typed it a bunch of times. The arguments for continuing/ending a <code>%do</code> loop must be known before the dataset is opened - they must be text, or they...
TIBCO BPM Pausing a process and resume later programmatically <p>I am currently developing in TIBCO BPM, I am wondering if there is a way to programmatically pause a specific process when it arrives at a certain stage.</p> <p>and then later again programmatically resume the process. So the resume process will happen m...
<p>You can use BPM API to pause/resume particular workflow by workflowId. </p> <p>Check documentation about BPM API to find the exact service that you need.</p>
Firebase Cloud Messaging with Node.js server <p>I'm trying to send push notifications with FCM between individual devices using a node.js server and <strong>Swift</strong> <strong>2.2</strong> (based on Frank van Puffelen's <a href="https://firebase.googleblog.com/2016/08/sending-notifications-between-android.html" rel...
<p>Found the answer: I had to change the <code>sendNotificationToUser</code> function by replacing <code>title</code> to <code>body</code> in my <code>notification</code> object and set the <code>priority</code> to high. </p> <pre><code>function sendNotificationToUser(username, message, onSuccess) { request({ ur...
Apache proxying Multiple Tomcat Instances with Mod_JK <p>I have an Apache server, which is suppose to redirect all the requests to two Tomcat instances: "geonetwork" and "geoserver".</p> <p>They are both accessible from the Apache server, but somehow I cannot make the redirection work.</p> <p>My hosts file looks like...
<p>I think you may forgot to include the mod_jk configuration prior to do the JkMount in each virtual host:</p> <pre><code># Load mod_jk module LoadModule jk_module modules/tomcat-connector/mod_jk.so # Add the module (activate this lne for Apache 1.3) # AddModule mod_jk.c # Where to find workers.properties JkWork...
Showing which month had the lowest rainfall amount- arrays java <pre><code> double rainfall[] =new double[6]; String months[]={"January", "February", "March", "April", "May", "June"}; double total =0; for(int i=0;i&lt;rainfall.length;i++){ rainfall[i] = Double.parseDouble(JOptionPane.showInputDialog("Please en...
<p>You can find the minimum rainfall month by getting the index of minimum rainfall amount and as the rainfall amount is sequentially mapped to the months you can get the lowest rainfall month as below...</p> <p>Your code</p> <pre><code>double min = rainfall[0]; for(int i=1;i&gt;rainfall.length;i++){ if(rainfall[...
Unhandled Exception not caught by AppDomain.UnhandledException <p>We have a .NET 3.5 assembly (dll) being executed by a VB6 "Agent" (exe) via COM interfaces. The VB6 code does call:</p> <pre class="lang-vb prettyprint-override"><code>' Ensure that no system dialog comes up when we GPF. PreviousErrorMode = SetErrorMode...
<p>It is an impossibly broad topic, at breakneck speed. No, you are never going to observe an UnhandledException event when your code is called from VB6. Passing exceptions across an interop boundary is strictly <em>verboten</em>.</p> <p>The CLR complies, it uses a catch-em-all exception handler in the CCW to catch ...
Simple solution for testing spring boot and angular2 app? <p>I have built a simple web application that uses Spring Boot for server side operations (with REST endpoints) and Angular2 for the front end. The applications are separate (e.g. not in the same directory structure). if I launch the spring boot app on, say, 808...
<p>Yes, it's absolutely possible to run spring-boot enabled app and angular2 on the same machine. As you mentioned they both are running on different ports, a request sent by angular2 is treated as <a href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing" rel="nofollow">CORS</a> since it has different domai...
Number.isInteger method and Node.js version <p>Using Node.js 4.5.0 I got the expected behaviour</p> <pre><code>&gt; console.log(Number.isInteger(42)) true </code></pre> <p>but using Node.js 0.10.36 I got the error</p> <pre><code>&gt; console.log(Number.isInteger(42)) TypeError: Object function Number() { [native cod...
<p>As they recommend to look after in their <a href="https://nodejs.org/en/docs/es6/#which-features-ship-with-which-node-js-version-by-default" rel="nofollow">docs</a>, <code>Number.isInteger</code> is <a href="http://node.green/#Number-properties" rel="nofollow">supported</a> in version 0.12.16. Though that's not th...
Does the Java 9 Module system support optional dependencies? <p><strong>Background</strong></p> <p>In maven, an artifact can declare a dependency with</p> <pre><code>&lt;optional&gt;true&lt;/optional&gt; </code></pre> <p>which means that the dependency is not required, but can be used if present.</p> <p><a href="ht...
<p>There is currently <a href="http://mail.openjdk.java.net/pipermail/jpms-spec-experts/2016-June/000306.html">a proposal</a> for that exact use case:</p> <blockquote> <p>Extend the language of module declarations to allow the <code>static</code> modifier to be used on a <code>requires</code> directive, with the fol...
How to make a python program that lists the positions and displays and error message if not found <p>I did this code:</p> <pre><code>sentence = input("Type in your sentance ").lower().split() Word = input("What word would you like to find? ") Keyword = Word.lower().split().append(Word) positions = [] for (S, subword)...
<p>Your code is having multiple errors. I am pasting here the sample code for your reference:</p> <pre><code>from collections import defaultdict sentence_string = raw_input('Enter Sentence: ') # Enter Sentence: Here is the content I need to check for index of all words as Yes Hello Yes Yes Hello Yes word_string = ra...
my shared pref to store data of list view and retrieve it back doesn't work <p>I use shared pref to store my array list of lamps as i use these data to put it into list view with custom array adapter but every time it crashes at the line where i transform the data into json to be saved in shared pref </p> <p>String js...
<pre><code>buildTypes { debug{ minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } </code></pre> <p>Add this lines to build.gradle file and learn proguard</p>
How to correct my code so it doesn't give errors after being minified? <p>My angular code works just fine before it is minified: </p> <pre><code>angular.module('starter', ['ionic', 'ionic.contrib.ui.tinderCards2']) .config(function($stateProvider, $urlRouterProvider) {}) .directive('noScroll', function($document) ...
<p>Add injector annotations. </p> <p>There are a few ways to do this. When using the prototype pattern you can easily just add <code>$inject = [...]</code> to your prototypes.</p> <p>Since you are not using this pattern, the inline array annotations would be the easiest path. </p> <p>Example:</p> <pre><code>.direct...
JAVAFX: Popup dialog appearing on primary monitor when application is on extended monitor <p>JAVAFX: I have an application which generates a modal popup dialog which I have created on a stage and given my application's stage as the owner to the new popover stage . When I run the application and move it to my extended m...
<p>The <code>setX()</code> and <code>setY()</code> methods of <code>Stage</code> are expecting coordinates specified in the <em>screen</em> coordinate system. You are passing in coordinates from the current <em>scene</em> coordinate system.</p> <p>Replace</p> <pre><code>Bounds currentMouseLocation=control.localToScen...
Glue div to bottom of other div (not bottom of window) <p>So I want a div to always be on the bottom of another div it's in. I've used bottom:0, position: absolute. This works as long as the window is the same size as the main div (which is the size of the windows too), but the main div has a min-height set, when the w...
<p>You can use flexbox for that:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>.parent { width: 50%; height: 200px; border: 1px solid grey; margin: 1em auto...
Initialize VueJs after opening new tab <p>At the moment I use php to collect data needs to be printed in one pdf and open pdf in new browser tab. The problem is that it generate to much traffic as soon as I've a lot of users and a lot of docs to be printed in a same time. So I'm looking for a way to collect everything ...
<p>When you specify a selector for your <code>el</code>, Vue will look in the current document for it. The new tab will not be part of the current document.</p> <p><a href="http://stackoverflow.com/a/3204034/392102">Save a reference when you open the tab</a>. <a href="http://stackoverflow.com/a/169843/392102">Write th...
PyObject_CallObject failing on bytearray method <p>In the following code I create a pointer to a PyObject, representing a bytearray, using the Python C API. I then extract the method "endswith" from the bytearray and try to call it on the original bytearray itself, expecting it to return <code>Py_True.</code> However,...
<p>If you add the line <a href="https://docs.python.org/2/c-api/exceptions.html" rel="nofollow"><code>PyErr_PrintEx(1)</code></a> it helpfully tells you:</p> <blockquote> <p>TypeError: argument list must be a tuple</p> </blockquote> <p>This is confirmed by <a href="https://docs.python.org/2/c-api/object.html" rel="...
How to pull a text from a table but the table has the same name as other tables? VBA, excel <p>I've made a code that would go to a website and pull their investment criteria. But I only need one cell in that table and the table class name is the same for multiple tables.</p> <p>I need to get the EBITDA, which is on th...
<p>You need to get the <em>third</em> instance of that ClassName, so, instead of looping the collection of matching ClassName elements, try this:</p> <pre><code>Dim tblEle Set tblEle = objIE.document.getElementsByClassName("cTblListBody")(2) </code></pre> <p>Then, I think you can you get the cell value from that elem...
Group by array or shared value <p>My invoice report pull due dates depending on the selection of Payment Plan Code on UI (either semi, monthly, quarterly, annually, or even 18 installments.) It also accordingly pulls gross premium per due date. I need to pull this table per due date and the sum of the gross premium if ...
<p>You don't need array for this purpose.. using array complicates the report instead you can manipulate grouping like below:</p> <p>Create a formula like below and use this formula to group.</p> <pre><code>if parameterselection = "monthly" then Month(duedate) else if parameterselection = "yearly" then Year(duedate) ...
codeigniter how to load dynamic content with fix header and footer <p>how to load dynamic $content depend on get url in codeigniter with this php structure </p> <pre><code> &lt;?php include_once "header.php"; $content ='index-1.php'; if(isset($_GET['p'])){ switch($_GET['p']){ ...
<p>Bellow controller function :</p> <pre><code>&lt;?php public function index() { //$data['page']['content'] = 'room'; $data['page']['content'] = $this-&gt;input-&gt;get('page_name'); //like page name is "room" $this-&gt;load-&gt;view('welcome', $data); } ?&gt; </code></pre> <p>and then <code>welcome.php...
LOCALECODE in paypal express checkout not working <p>In using paypal express chackout via "NVP http api" and I need to customize the gateway page locale. Following the <a href="https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECCustomizing/?mark=LOCALECODE#id0864A0Q60Y4" rel="nofollow">doc</...
<p>I don't know why but now it works, the correct LOCALECODE is the "full locale" so:</p> <pre><code>LOCALECODE=es_ES </code></pre> <p>I can only think that there is some kind of latency on sandbox.. after 3 tries, with "es_ES" finally the gateway is in spanish.</p>
How to wrap text on two rows having equal amount on each? <p>I'm creating item boxes on a website (CodeIgniter, Bootstrap, jQuery included if it matters) where the title is usually longer than the box itself. I'm wrapping the text inside the box so it goes on multiple rows. The problem is that it still looks ugly in so...
<p>I've developed a somewhat <a href="https://jsfiddle.net/tz6umu65/1/" rel="nofollow"><strong>working solution</strong></a> - it isn't perfect, but it will find the middle space and split there. That being said, a better solution might involve the total character count to find the space that is closest to the <em>true...
How to show previously selected values in jsp <p>I have a jsp page which hyperlinks to another jsp page. If we click on "Update Preferences" from below shown image, then it opens the 2nd image:</p> <p><a href="http://i.stack.imgur.com/DmkeZ.png" rel="nofollow">image1</a></p> <p><a href="http://i.stack.imgur.com/CNLly...
<p>I believe dp_monitor.jsp is your first jsp.</p> <p>You need to read, preserve and transmit data between jsps.</p> <p>To read the data you've to use <code>request.getParameter("refresh")</code></p> <p>To preserve the data you can use a hidden element inside the form element of the dp_monitor.jsp page</p> <pre><co...
Making a variable change with keydown <pre><code>var x = 50; var y = 50; document.addEventListener("keydown", checkKey, false); function checkKey(e) { if (e.keyCode == "37") { x = x--; } } document.getElementById("test").innerHTML = x; </code></pre> <p>When I do this, pressing the left arrow doesn't change x. T...
<p>It most certainly changes the variable, you're just not updating the HTML. </p> <p>Place the <code>innerHTML</code> line <strong>inside</strong> the event handler, so it updates when someone presses a button, and not just on pageload</p> <pre><code>var x = 50; var y = 50; document.addEventListener("keydown", chec...
Join three tables using conditional joins in MySQL <p>I'm trying to modify and existing query to work with a conditional JOIN. </p> <p>I have three tables: <code>invoices</code>, <code>companies</code> and <code>clients</code>. </p> <p>The application logic is this: first there's a bill of quantities which gets creat...
<p><code>LEFT JOIN companies co ON co.company_id=IFNULL(i.invoice_company_as_id, i.invoice_company_id)</code></p> <p>And if you have more specific test cases:</p> <p><code>LEFT JOIN companies co ON co.company_id=IF(i.invoice_company_as_id IS NULL OR i.invoice_company_as_id = 0, i.invoice_company_as_id, i.invoice_co...
Assignment of Property Default Values in a Null Object Javascript <p>I have this object <code>TrSet</code> that takes in nodes from the dom. Sometimes those dom elements can be null, and I want to handle properties of the nodes, unfortunately, I can't figure out how to use null conditional assignment on <code>undefined...
<blockquote> <p>I don't understand how either of these is failing. If it's null or undefined, it should evaluate to true for the empty string and set it equal to that.</p> </blockquote> <p>Not quite: the statement <code>txt || ""</code> will <em>return</em> the value of <code>txt</code> or <code>""</code>, whichever...
Hotcakes Commerce Extending the DrillDown ViewModel <p>I'm using v 1.10.3 of HC and I'm trying to extend the ViewModel for the drilldown view. I want to add a new boolean property to the products so that I can check it and add some html to the view as necessary. So inside of Category.js I thought I'd loop through the d...
<p>What you're running into is simply a tiny learning curve with how KnockoutJS works. Since it's a framework with a lot of bindings and other things working, you need to work with it. Oftentimes, this means a raw JS snippet may not work as expected.</p> <p>To be honest, I rarely touch this view myself, because I'm ...
Reporting a huge volume of data <p>We run a SAAS product. One of our customer is an enterprise client and while others generate 8-10,000 rows of data for a bill report for 6 months. They generate about 300,000 rows of data. Each row has 30 columns. So when they try to goto our reporting module and export their 6 months...
<p>Replicate your production database into a "end-user's sand-box database", serve your end-users' reporting from there, where they can slow down the DB to a crunching halt, if they need to.</p> <p>Such large exports shouldn't be done from a production system.</p>
How to avoid encoding parameter when opening file in Python3 <p>When I am working on a .txt file on a Windows device I must save as either: ANSI, Unicode, Unicode big endian, or UTF-8. When I run Python3 on an OSX device and try to import and read the .txt file, I have to do something along the lines of:</p> <pre><cod...
<p>Call <code>locale.getpreferredencoding(False)</code> on your OSX device. That's the default encoding used for reading a file on that device. Save in that encoding on Windows and you won't need to specify the encoding on your OSX device.</p> <p>But as the <a href="https://www.python.org/dev/peps/pep-0020/" rel="no...
Python check if string got a certain word (or combination of characters) <p>Ok so I have this string (for example):</p> <pre><code>var = "I eat breakfast." </code></pre> <p>What i would like to do is to check if that string has the letters "ea", and I wanted to be able to put those values into a list.</p> <p>I tried...
<p>Use <code>word in sentence</code>. For example:</p> <pre><code>&gt;&gt;&gt; 'el' in 'Hello' True &gt;&gt;&gt; 'xy' in 'Hello' False </code></pre> <p>For your reference, check: <a href="http://kracekumar.com/post/22512660850/python-in-operator-use-cases" rel="nofollow">python <code>in</code> operator use cases</a><...
Ember 1.13, class names order in a component <p>I've created a simple component to render icons from SVG sprite. This component should have a default CSS class to manage it's styles globally (.svg-icon). Also, I want to have a possibility to add some context dependent styles via class names through 'class' attribute.</...
<p>Try this,</p> <pre><code>{{svg-icon name="facebook" classNames="social__icon" width="14" height="14"}} </code></pre> <p>The above will work but it is not using class attribute. so its not matching your requirement.</p> <p>but if that does not align with your requirement, you can try setting classNames manually in...
Xpath Expression for assertion in SOAP UI : How can we handle special symbols like apostrophe for node values such as Abc's work <p>How can we check value for value inside node retun i.e </p> <p><strong>Hurricane's Grill Darling Harbour</strong></p> <p>Actually, i am not able to pick apostrophe sign with below code ...
<blockquote> <p>i am not able to pick apostrophe sign with below code exists(//ns1:name[text()='Hurricane's Grill Darling Harbour']).</p> <p><em>Getting error message</em>: <strong>RuntimeException:net.sf.saxon.trans.XPathException: XPath syntax error at char 33 on line 2 in {...name[text()='Hurricane's Gr...}...
How to implement quaternary search? <p>I know this algorithm is no better than binary search, but it's an interesting thought experiment for understanding recursion. I haven't been able to get very far on this though(way too much recursion for my brain to handle.). Anyone know how to actually implement this?</p> <p>...
<p>How is this solution ? </p> <pre><code>#start = 0 #first_quarter = int(len(a_list)/4) - 1 #mid_point = int(len(a_list)/2) - 1 #third_quarter = int(len(a_list)*3/4) - 1 #end = len(a_list) - 1 def search(a_list, elem): return search_recur(a_list, elem, *generate_quartets(a_list, 0)) def generate_quartets(a_list...
Protractor change size of element <p>I can give the size of the element with the <code>getSize</code> method but I can't figure how to change the <code>height</code> (for instance) of that element. </p> <p>Just to provide some more context I want to test if the end user can resize a <code>textarea</code> element. Sho...
<p>You can use <code>browser.executeScript()</code> to modify height of an element in Protractor.Something like below should work for you </p> <pre><code> browser.executeScript('$("div").height(500)').then(function(){ $("div").getSize().then(function(eleSize){ console.log('element size: '+eleSize...
Plottng Error Vector Must Be Same Length <p>So I'm Having Trouble graphing this SSB signal after I modulated it. I keep getting the Vector Length error.</p> <pre><code>function SSB = SSBMOD %Setting Up Variables amplitude = 1; % Defining Amplitude tau_in = 0.010; %Defining Tau t_in = -0.010:0.0001:0.010; % Defining T...
<p>t is only made up of 201 elements; setting SSBff(k) to zero from k = 1000 to 1800 increases the size of SSBff to 1800 elements. 1800 =/= 201. You should either increase your definition of t so you have more elements, or change what portions of SSBff you're setting to zero</p> <p>As an aside, your for loop can also ...
SMTP mail server (sendgrid) error on submission <p>I have an app that sends email with image attachments thru an SMTP server(sendgrid)</p> <p>When the application launches it intitilaizes a Socket connection and authenticates the user(application. I see the following message returned from Sendgrid</p> <pre><code>SG E...
<blockquote> <p>So this suggests to me that I must change the order of sender and recipient in my SMTP module. </p> </blockquote> <p>The order of your commands is correct. Instead, you should look at the first error message for the real cause of the problem:</p> <pre><code> error 1 550 Unauthenticated senders not ...
Android - Reacting to assist request <p>I am programming a tiny app which opens the camera as it is opened via assist-request. In the onCreate method, it simply opens the camera via intent. But if the app is opened "the regular way" I'd like to display a little instruction instead of the camera.</p> <p>Is there an eas...
<p>If you want to determine which sort of <code>Intent</code> was used to start <code>MainActivity</code>, use <code>getIntent().getAction()</code> and compare it to the possible values (e.g., <code>Intent.ACTION_MAIN</code>).</p>
Using Data Layer to track event based rule <p>This is kind of confusing. suppose i have implemented a data layer with page details. The page has 2 articles, both gets redirected whenever clicked. Now suppose the tracking goes like this, Once the User clicks on the card, the name of card (h1) name will be reported in th...
<p>As others have mentioned, the only way to know which <code>h1</code> value is relevant is to capture it during the click event. </p> <p>As I mentioned in the <a href="http://stackoverflow.com/questions/39777917/looking-for-custom-script-in-adobe-dtm-data-element?noredirect=1#comment66974440_39777917">comments of yo...
Rails ActionMailer - Attaching text file causes email body to be sent as attachment <p>When I try to attach a text file (with <code>.txt</code> extension) to an email, the email is sent with no body and with an additional attachment: <code>noname.html</code>. This file contains what I expected to get in the email's bod...
<p>I fixed this by attaching text files with mime type <code>text/x-diff</code>:</p> <pre><code>mime_type = ... # Get mime type, e.g.: Paperclip::ContentTypeDetector.new(attachment_file_name).detect mime_type = mime_type == 'text/plain' ? 'text/x-diff' : mime_type attachments[attachment_file_name] = { content: File.re...
Grant access to gitlab-ci runners <p>I have 2 projects in gitlab. For the examples purpose lets call them <code>foo/main</code> and <code>foo/dep</code>.</p> <p>In <code>foo/main</code> I am using gitlab-ci with a docker-runner running on another machine to execute automated tests and builds.</p> <p>As <code>foo/dep<...
<p>As stated by <a href="http://stackoverflow.com/questions/36571673/gitlab-ci-runner-cant-access-other-repository">GitLab CI runner - can&#39;t access other repository</a> you could expose your own .ssh-keys to the docker-container via the <code>gitlab-runner/config.toml</code>.</p> <p>I hope that is not the only sol...
Python: UserWarning: This pattern has match groups. To actually get the groups, use str.extract <p>I have a dataframe and I try to get string, where on of column contain some string Df looks like</p> <pre><code>member_id,event_path,event_time,event_duration 30595,"2016-03-30 12:27:33",yandex.ru/,1 30595,"2016-03-30 12...
<p>At least one of the regex patterns in <code>urls</code> must use a capturing group. <code>str.contains</code> only returns True or False for each row in <code>df['event_time']</code> -- it does not make use of the capturing group. Thus, the <code>UserWarning</code> is alerting you that the regex uses a capturing gro...