input
stringlengths
51
42.3k
output
stringlengths
18
55k
Create html charts generator <p>I have got the mission do develop "Charts Generator" which will be able to generate <strong>.html</strong> files with the specific (pie, column etc.) chart and save it on the server. </p> <p>The main challenge is to find JS framework which will be able satisfy the up mentioned needs. Fr...
<p>There is a library called <a href="https://parall.ax/products/jspdf" rel="nofollow">jsPDF</a>, that allows you to generate static pdf files from html. Also you could achieve it with a server-side language, that would create these files on user ajax request.</p>
EventEmitter: simultaneous events blend, how to prevent this? <p>To receive events from multiple child components in one parent component I pass event channel from parent (ProjectsComponent) to each child component (ProjectHeaderComponent)</p> <p>projects.component.ts</p> <pre><code> projects: Project[]; editing =...
<p>One of hacks - events about open must arrive after close</p> <pre><code> set editing(data: boolean) { /*on close*/ if (!this._editing) { this._editedService.changeEdited(this._editing); } else /*on open*/ { setTimeout(() =&gt; this._editedService.changeEdited(this._editing), 0); ...
PHP:- In multidimensional array <p>I use two array with multidimensional.</p> <p>I want to need remove same value with all remove element, but without use any function.</p> <p>See below my code for multidimensional array.</p> <pre><code>&lt;?php $a=array("0" =&gt; "test_3","1" =&gt; "test_4"); $b=array('test'=&gt...
<pre><code>foreach ($b as $j =&gt; $inner) { foreach ($inner['value'] as $k =&gt; $value) { if (in_array($value['value'], $a)) { unset($b[$j]['value'][$k]); } } } </code></pre> <p>You need to use unset on the top level of array (<code>$b</code>) with correct keys. </p>
Instagram API: get all media and sort by date created asc <p>According to the Instagram API endpoints, we could do this:</p> <pre><code>https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN </code></pre> <p>But the above query returns the most recent media posted by a user. Now I want to...
<p>There is no API param to sort by date ascending, you have to do it manually by getting all posts using pagination and then flip the order.</p>
Column as variable IN DATA STEP <p>i have a problem with choosing a column in depend on variable. For example, I have columns A1, A2, A3,....,A48 and I have index i. I'd like to choose A1 if i=1, A2 if i=2,...,A48 if i=48. If has to work in DATA STEP. Has anyone an idea how I can do it?</p>
<p>That is what the <code>ARRAY</code> concept is for in SAS. Let's assume you have dataset with the 49 variables A1-A48 and I and you want to create NEWVAR such that when I=1 then NEWVAR=A1, etc.</p> <pre><code>data want ; set have ; array a a1-a48 ; newvar=a(i); run; </code></pre>
StreamWriter not working Xamarin Forms <p>Got a bit of a strange issue with a bit of code in Xamarin Forms:</p> <pre><code>public void GetSettings() { var assembly = typeof(SettingsPage).GetTypeInfo().Assembly; Stream stream = assembly.GetManifestResourceStream("FishBike_GPS.config.txt"); try { ...
<p>Question was answered by SushiHangover</p>
How to prevent resending data after it sent once in Express <p>I have this route that sends an email after a user fill out the contact form.</p> <pre><code>var express = require('express'); var mailRouter = express.Router(); var Mailgun = require('mailgun-js'); var api_key = 'key-xxxxxxxxxxxx'; var domain = 'xxxxxxxx...
<p>A common fix for this is to redirect the user to a different URL once the action has been completed. That way, if they reload the page, they reload the new page instead of submitting the form data again.</p> <p>For example:</p> <pre><code>mailgun.messages().send(mailOptions, function(err, body){ if (err){ re...
Circuit diagram to html <p>I have requirement to do convert below image to HTML page</p> <p><strong>Note:</strong> We should not use images. <a href="http://i.stack.imgur.com/dgd4U.png" rel="nofollow"><img src="http://i.stack.imgur.com/dgd4U.png" alt="enter image description here"></a></p> <p>I am new to this kind of...
<p>You can use the <a href="http://www.fusioncharts.com/charts/drag-node-charts/" rel="nofollow">DragNode chart</a> of FusionCharts to achieve it.</p> <pre><code>&lt;div id="chart-container"&gt;FusionCharts will render here&lt;/div&gt; </code></pre> <p>Here is a <a href="http://jsfiddle.net/fusioncharts/4B6M4/" rel="...
Decimal number Regular expression including +, - sign <p>I need a regular expression that validates a decimal number which includes +, - sign as well. For Example: </p> <blockquote> <p>+.12</p> <p>-0.13</p> <p>0.+</p> <p>45.-</p> </blockquote> <p>But following are invalid Decimal numbers :</p> <bloc...
<p><a href="https://regex101.com/r/iD1uM7/1" rel="nofollow"><code>/^[-+]?(?:0|[1-9]\d*)?\.\d*[+-]?$/gm</code></a></p> <p>Flags: "g" (global) matches the entire regex as many times as it can. "m" (multiline) matches the start and end of a line with <code>^</code> and <code>$</code>.</p> <ul> <li><code>^</code> Start o...
Regex to extract part of string between parenthesis <p>I have below string and I want to extract only <code>List((asdf, asdf), (fff,qqq))</code> from the string, line has many other characters before and after the part I want to extract.</p> <pre><code>some garbage string PARAMS=List((foo, bar), (foo1, bar1)) some gar...
<p><strong><em>regex <code>.*List\((.*)\).*</code> works</em></strong></p> <p>Using Scala regex and pattern matching together and then split with any of <code>( , )</code> and then <code>group</code></p> <p>regex contains extractors</p> <pre><code>val r = """.*List\((.*)\).*""".r </code></pre> <p>pattern matching u...
Elastic search 2.3 wildcard query not returning results for exact match <p>I want to use wildcard search using elastic search 2.3 using its official PHP client.</p> <p>I am facing a issue which is like this:</p> <p>Case 1. When i search for word <strong>wood</strong>, it returns the words which are having woodman, ho...
<p>Elasticsearch supports <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html" rel="nofollow">wildcard queries</a> only on <code>not_analyzed</code> fields</p> <p>So if you would like to use the wildcard capability you could either use it under the <code>query_string<...
Deepstream not working <p>First, sorry for my bad english.</p> <p>I trying the last two days deepstream to run. The server startet but i can't connect from browser.</p> <pre><code>INFO | logger ready INFO | deepstream version: 1.1.0 INFO | messageConnector ready INFO | storage ready INFO | cache ready INFO | authenti...
<p>You can't use <code>require</code> within <code>index.html</code> directly.</p> <p>Try:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src="https://cdn.rawgit.com/deepstreamIO/deepstream.io-client-js/master/dist/deepstream.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;inp...
How to return final url to the delegator in swift? <p>I know how to capture the final url of a redirected url, but I don't know how to return the final url to the delegator.</p> <p>That is </p> <pre><code>func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse...
<p>If I understand our question correctly, you are looking for a way to set up a task based on the request passed back by this delegate function.</p> <p>The way I have handled this in the past is to initiate a new task with the newRequest object. In my case it was a download task so, in the body of the willPerformHTTP...
SurveyMonkey Webhooks - Request Type <p>When registering a webhook via the SurveyMonkey API, one of the parameters is a <code>subscription_url</code>. My question is: when SurveyMonkey fires the webhook, is it making <code>GET</code> or <code>POST</code> request to this URL?</p>
<p>I can confirm that SurveyMonkey will <code>POST</code> to your API endpoint. My issue was that SurveyMonkey will do a <code>HEAD</code>, before the <code>POST</code>, to ensure your API responds. So, to fix my issue, I had to add a <code>GET</code> endpoint that simply responds with a <code>200</code>.</p>
How to disable chromium's Certificates Pinning ? <p>Hi when I try to access some webpages, especially github.com my chromium puts below error</p> <p><code> Attackers might be trying to steal your information from github.com (for example, passwords, messages, or credit cards). NET::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN ...
<p>If you are behind a corporate firewall which does SSL interception you should install the proxy CA used for SSL interception as trusted. Once you've done this the browsers will disable certificate pinning as long as the certificate is signed by this explicitly trusted CA.</p>
msbuild 14 doesn't work without full .net framwork installation <p>I have a build machine with visual studio 2010 and multiple build targets. all the other targets that I use works as expected and for some reason the new build of version 14 for .net 4.6.1 doesn't work.</p> <p>when I'm executing the build from command ...
<p>You should install the correct SDK of the .NET Framework (and probably Windows) to be able to compile for .NET 4.6.1.</p> <ul> <li>You can find the .NET 4.6.1 SDK <a href="https://www.microsoft.com/en-us/download/details.aspx?id=49978" rel="nofollow">here</a>.</li> <li>The latest Windows SDK can be found on <a href...
Calculate the remaining distance to destination programming android google map API V2? <p>I am trying to show calculate the remaining distance to destination to display to the user with bellow code :</p> <pre><code>public class MyService extends Service { private LocationManager locManager; private LocationLis...
<p>Try using <code>distanceTo</code> method</p> <pre><code>Location locationOne = new Location("point First"); locationOne.setLatitude(latA); locationOne.setLongitude(lngA); Location locationTwo = new Location("point Second"); locationTwo.setLatitude(latB); locationTwo.setLongitude(lngB); float distance = locati...
Multiple double quotes and back slashes throwing SQL error: "The column delimiter for column was not found" <p>How can I import data from a 2 GB CSV to microsoft SQL Server 2016 when column 2 in CSV has a text: "Fixed in \"next\"" in some rows? The data looks like this </p> <pre><code>17690,2491303,"0 - Backlog" 17695...
<p><code>{LF}</code> stands for <code>line-feed</code>. which typically follows a <code>{CR}</code> (carriage return). it basically means that the last column is separated by a new line, like when hitting the enter/return key.</p> <p>I'm guessing that <code>{LF}</code> alone is not the delimiter. I would try <code>{CR...
SONAR asking to Make "UserProfile" serializable or don't store it in the session <p>I have the following piece of code in my program and I am running SonarQube 5 for code quality check on it after integrating it with Maven.</p> <p>However, Sonar is asking to Make "UserProfile" serializable or don't store it in the ses...
<p>Web containers may need to serialize session content. One example is to transfer sessions to another physical machine when you run several instances of the container.</p> <p>For this reason, all objects put into a session should be serializable (i.e. implement the interface <code>java.io.Serializable</code>).</p> ...
Not able to upload a file in code igniter. <p>I'm trying to upload an image with code igniter but it does not show any success of failure message. Please help.</p> <p><strong>This is a file upload form</strong><br> <strong>view- Upload_form.php</strong> </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta c...
<p>your upload_path might be incorrect, so here's the code I'm using:</p> <p>1.add this at the top of your controller to declare the upload_path:</p> <pre><code>function __construct() { parent::__construct(); $this-&gt;uploadPath = realpath(APPPATH . '../uploads'); } </code></pre> <p>2.change $config upload_p...
Angular ng-table header rowspan if no filter <p>How to add a rowspan to ng-table-dynamic header for non-filterable columns? </p> <p><a href="http://i.stack.imgur.com/K6V62.png" rel="nofollow"><img src="http://i.stack.imgur.com/K6V62.png" alt="enter image description here"></a> This example code can be found at <a href...
<p>I managed to do this with jQuery but it looks like a hack:</p> <p>custom filter template:</p> <pre><code>&lt;script type="text/ng-template" id="/filters/rowspan"&gt; &lt;filter-row-span&gt;&lt;/filter-row-span&gt; &lt;/script&gt; </code></pre> <p>and a directive:</p> <pre><code>.directive('filterRowSpan', fu...
Python - text file with all values 0 to 2^24 in HEX <p>I am trying to create a file with all possible values for 0 up to 2^24 in HEX.</p> <p>This is what I have so far:</p> <pre><code>file_name = "values.txt" counter = 0 value = 0x0000000000 with open (file_name, 'w') as writer: while counter &lt; 16777216: ...
<p>just use the format method from string when writting:</p> <pre><code>writer.write("{:#X}".format(data_to_write)) </code></pre> <p>Example:</p> <pre><code>&gt;&gt;&gt; "{:#x}".format(123324) '0x1e1bc' &gt;&gt;&gt; "{:#X}".format(123324) '0X1E1BC' </code></pre>
PHP array from database <p>In my database I got 3 rows. Product, quantity, and rate.</p> <pre><code>$rate = implode(",", $_POST["myrate"]); </code></pre> <p>This is the rate. Which means one row can be "rate1, rate2, rate3" and so on. But it's the same with product and quantity.</p> <pre><code>"product1, product2, ...
<pre><code>$quantity = array("q1","q2","q3","q4"); $product = array("p1","p2","p3","p4"); $rate = array("r1","r2","r3","r4"); for ($i = 0; $i &lt; count($quantity); $i++) { $new_data[] = array($quantity[$i],$product[$i],$rate[$i]); } </code></pre> <p>Get all of them in the loop and dump values into one array.</p>...
Best technologies to create a single page new application <p>Can you please suggest the best technologies to create single page NEWS application. It will be similar to this site: <a href="http://www.dailyhunt.in/" rel="nofollow">http://www.dailyhunt.in/</a></p> <p>I am planning to use: </p> <p>1.jQuery</p> <p>2.Rest...
<p>It depends on how complex your page should be. I found AngularJS more difficult to learn then JQuery and there are a few more things to be aware of at the beginning. So if you want to finish soon, I think that JQuery would be a better choice. However on the long term you will be able to create more generic and compl...
Can not run the java file sample in android studio, any one can help me? thx <p>I just download the sample file in android developers site(<a href="https://developer.android.com/training/multiscreen/index.html" rel="nofollow">https://developer.android.com/training/multiscreen/index.html</a>), then open this using andro...
<p>Try to set "app" or similar on here:</p> <p><a href="http://i.stack.imgur.com/jZpmT.png" rel="nofollow"><img src="http://i.stack.imgur.com/jZpmT.png" alt="one"></a></p> <p><strong>UPDATE1</strong> (Maybe it's the problem)</p> <p>That project it's not a new gradle project then maybe you imported wrong, you must im...
How to draw GMSPolyline slowly and smoothly in iOS? <p>I'm able to draw GMSPolyline on GoogleMaps with array of locations like this</p> <pre><code>GMSMutablePath *path = [GMSMutablePath path]; for (int i = 0; i &lt;anotherArray.count; i++) { NSString *string1 = [anotherArray2 objectAtIndex:i]; NS...
<p>Check on this <a href="https://www.appcoda.com/google-maps-api-tutorial/" rel="nofollow">tutorial</a>. It states how to draw the route lines on the map using the <code>GMSPolyline</code> class. From this <a href="http://stackoverflow.com/questions/19115293/how-to-smoothly-move-gmsmarker-along-coordinates-in-objectiv...
Datagrid, hide zero values with StringFormat <p>I know it's a question already posted, and believe me, I tried different way to format the string without success. I am with a datagrid, this is my pieces of code:</p> <pre><code>&lt;DataGridTextColumn.Binding&gt; &lt;Binding Path="Valmax" StringFormat="#"&gt; ...
<p>Ok, I see that, if 'Valmax' is of type byte (my case, but probably with integral), stringFormat works fine, when you set cell to 0, on loose focus, it will clear as aspected. Question remain open if 'Valmax' is string type.</p>
PowerShell Script not able to determine file paths if launched from c# code <p>I am running a PowerShell script using C#. The build is not able to determine the different file path written in the script but if I run script from command line it is working fine. </p> <p>Here is my code for the running script:</p> <pre>...
<p>Use the <code>$MyInvocation</code> variable to determine the current script directory and combine the path using the <code>Join-Path</code> cmdlet:</p> <pre><code>$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition . (Join-Path $scriptPath 'build\include.ps1') </code></pre>
MULE example: Sending a CSV file through Email using SMTP <p>Hej, I'm new in MULE, I try to learn "how to" following examples from Mule's sida: <a href="https://www.mulesoft.com/exchange#!/sending-csv-email-smtp?searchTerm=email" rel="nofollow">https://www.mulesoft.com/exchange#!/sending-csv-email-smtp?searchTerm=email...
<p>Use the following <strong>mimeType</strong> in your DataWeave :- <code>&lt;dw:input-payload doc:sample="list_csv.csv" mimeType="application/csv"/&gt;</code></p> <p>So, the full code will be some thing like as follows:- </p> <pre><code> &lt;smtp:gmail-connector doc:name="Gmail" name="Gmail" validateConnections="...
How to make the message idempotent when we use Google Cloud PubSub and Fluentd subscribers? <p>I'm trying to make log data flow with Google Cloud PubSub and Fluentd subscribers. The architecture is that, first, a group of web servers send their access log to the same PubSub endpoint, and second, Fluentd servers pull lo...
<p>Setting big number to ackDeadlineSeconds seems enough to avoid from logs duplicated in common case. <a href="https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/create" rel="nofollow">https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/create</a></p>
Deleting data by clicking DELETE button which is in table heading <p>I am fetching 10 records in table, now i have one table column heading named DELETE, below which there are checkboxes now i want to delete checked records on single click of that DELETE button.Pls tell how to do it in php codeigniter </p> <pre><code>...
<pre><code>&lt;form method='post' action='&lt;?php echo site_url('User1/delete/'); ?&gt;' &gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Id&lt;/td&gt; &lt;td&gt;Name&lt;/td&gt; &lt;td&gt;Car&lt;/td&gt; &lt;td&gt;Address&lt;/td&gt; &lt;td&gt;Phone Number&...
How to fetch content via shortcode in Ajax <p>I am using a shortcode to get content of a page. The shortcode runs well when added in the wp editor but it does not seem to work or better I say it's not parsed when it comes via ajax. </p> <p>I have a popup on the site which displays WooCommerce product info via Ajax. Th...
<p>For product "Product Short Description" is not content of the product if you want to get that field then add below code.</p> <pre><code>/* If you want content of page, post or product */ $output = apply_filters('the_content', get_post_field('post_content', $id)); /* If you want excerpt of page, post or product */ $...
Magnific Popup - start gallery from second array item <p>I'd like to learn how to modify Magnific Popup code to control the array of images created to start a gallery not from item 0 (first image of the gallery) but from 1 (second image of the gallery). I need to make small change of the logic in the gallery. The curr...
<p>Use <code>beforeOpen</code> callback , get instance and call <code>next()</code> on the instance</p> <pre><code>callbacks: { beforeOpen: function() { var mfp = $.magnificPopup.instance; // instance of magnificPopup mfp.next(); } } </code></pre> <p>UPDATE: If the first item should not be displayed then...
Url Rewriting using htaccess <p>Currently i'm working on this. I would like to change my url from </p> <pre><code>http://www.demo.com/userhome.php?view=prsnl_pge&amp;pge_id=12 </code></pre> <p>to</p> <pre><code>http://www.demo.com/(value of page id) </code></pre>
<p>Specifically for your condition please try it like this in root .htaccess,</p> <pre><code>RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([\w-]+)$ userhome.php?view=prsnl_pge&amp;pge_id=$1 [L] </code></pre>
Twilio creating confrence <p>Having trouble in creating conference. i need to achieve where when the agent is having conversation with a client the agent can add another person in the room. I research some documentation but it's just transferring the caller to the conference and the conference creator is not in the con...
<p>Twilio developer evangelist here.</p> <p>The best thing to look at will be <a href="https://www.twilio.com/blog/2015/09/warm-phone-call-transfers-with-python-flask-and-twilio-voice.html" rel="nofollow">this blog post on warm transfers using Twilio</a>. It is in Python, but the theory is the same.</p> <p>The basic ...
Error when trying to install PyCrypto <p>I'm using Mac with latest OS X update. I've trying to install PyCrypto over Terminal but I'm getting error which is shown on image below. The command I used is <code>sudo pip install pycrypto</code>. Can you please help me with this issue? How do I resolve this? Thanks for your ...
<p>You need to install the Python development files. I think it will work. Try </p> <pre><code>apt-get install autoconf g++ python2.7-dev </code></pre> <p>Or</p> <pre><code>sudo apt-get install python-dev </code></pre> <p>Either one of the above and then this below one </p> <pre><code>pip install pycrypto </code>...
Shuffling a matrix <p>I need to randomly fill a matrix with a given number of a certain value. (For some reason I have a <code>C</code> 2D array). The simple solution I found was to interpret the 2D array as a 1D array: (please ignore the hard coded constants and ad hoc random objects):</p> <pre><code>int m[10][10] = ...
<p>Say your 2d array is of dimensions <em>m X n</em>, it is initialized, and you'd like to do an in-place random shuffle. </p> <p>It is very easy to modify the <a href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm" rel="nofollow">Durstenfeld variant of the Fisher-Yates Shuffling algo...
How to check double condition smarty <p>I want to check if the variable $nvTb is 1 or 2. </p> <p>I'm doing this but not working</p> <pre><code>{if (($nvTb eq 1) or ($nvTb eq 2)) } </code></pre> <p>to achieve something like this</p> <pre><code>&lt;a role="tab" {if (($nvTb eq 1) or ($nvTb eq 2)) } id="fichaScroll" {e...
<p>I'm guessing that TPL was meant to be for <code>smarty</code> templates judging by the syntax which you can get the full documentation from here: <a href="http://www.smarty.net/docs/en/" rel="nofollow">http://www.smarty.net/docs/en/</a></p> <p><code>eq</code> is an alias of <code>==</code> which you can see here: <...
Express read body and debug output <p>I'm developing this node application on a windows machine.</p> <p>Here is my <code>index.js</code>:</p> <pre><code>process.env.NODE_ENV = 'development'; var express = require('express'), app = express(), server = require('http').Server(app), httpDebug = require('debu...
<p>You need to run inedx.js with <code>DEBUG</code> variable, like this:</p> <pre><code>$ DEBUG=http node index.js </code></pre> <p>See the docs: <a href="https://www.npmjs.com/package/debug" rel="nofollow">https://www.npmjs.com/package/debug</a></p> <p>E.g. if you have multiple debug labels, like <code>api</code>, ...
I want to load a get.php file in iframe on index.html once the Submit button is pressed <p>Ok so I'm facing this problem here I've got 2 files :</p> <ol> <li><code>index.html</code></li> <li><code>get.php</code></li> </ol> <p>On <code>index.html</code> I've got a form :</p> <pre><code>&lt;form method="POST" action="...
<p>You could set iframe content using following snippet. The data are send using ajax and you need to prevent <code>form</code> submit behaviour. Try e.g:</p> <pre><code>$(function() { // document ready handler $('form[action="get.php"]').on('submit', function(e) { e.preventDefault(); $.post(this.action, $(t...
Is there a way to pass strings like this in C? <p>I have a function which accepts a character array (ie, string) as argument.</p> <p>But an integer variable's value should also be printed as part of string.</p> <p>For example, If I have a function like this:</p> <pre><code>int var=10; void printStr(char str[]) { ...
<p>It seems that you need the function <code>sprintf</code>/<code>snprintf</code> for generation of the string.</p> <p>Try something like this:</p> <pre><code>char tempStr[30]; snprintf(tempStr, sizeof(tempStr), "The value of var is %d", var); printStr(tempStr); </code></pre> <p>Is it what you need?</p>
What does "[::]:port number" mean? <p>I am running netstat -an command in cmd. For some records I am getting [::]:port number in place of ip address. What does it mean ?</p> <p><a href="http://i.stack.imgur.com/T2m51.png" rel="nofollow"><img src="http://i.stack.imgur.com/T2m51.png" alt="enter image description here"><...
<p>It means listening in all interfaces for those ports.</p>
Truncate video with MediaCodec <p>I've used Android MediaCodec library to transcode video files (mainly change the resolution <a href="http://stackoverflow.com/questions/29943121/mediamuxer-video-compression-change-resolution">Sample code here</a>)</p> <p>Another thing I want to achieve is to truncate the video - to o...
<p>I am not sure if this is the source of the error or not, but i think it is not safe write <code>EOS</code> to decoder buffer at arbitrary point.</p> <p>The reason is when the input video is using H264 Main Profile or above, pts may not be in increasing order (because the existence of B-frame) so you may miss sever...
Doctrine 2 : ManyToOne cascade remove causes the referenced entity to be deleted <p>I have a setup where I have product feeds, and each feed has many products. The very simplified setup looks something like this:</p> <p>Feed model:</p> <pre><code>/** * Class Feed represents a single feed as supplier by a supplier *...
<p><strong>Feed Model :</strong> </p> <pre><code> /** * Class Feed represents a single feed as supplier by a supplier * @package App\Model * @Entity @Table(name="feeds") */ class Feed { /** * @var int * @Id @Column(type="integer") @GeneratedValue */ ...
Is there a way to manually calculate entity length from a dxf file? <p>This is my Entities section of a project which had only one entity,an ellipse.</p> <pre><code>0 SECTION 2 ENTITIES 0 ELLIPSE 5 4D 100 AcDbEntity 8 0 6 ByLayer 62 256 370 -1 100 AcDbEllipse 10 52.75 20 65 30 0 11 0.25 21 -44.25 31 0 40 0.50884136610...
<p>234.607 seems to be the area, not the length. </p> <p>In your DXF file, codes 10 to 30 are the coordinates of the center (52.75, 65), codes 11 to 21 the coordinates of the end point of the major axis (0.25, -44.25) and code 40 is the ratio minor radius/major radius (0.508841366102777).</p> <p>With these informatio...
Setting another Date forma in MEANjs with md-datepicker <p>I am using the md-datepicker directive from angular-material, however i would like to typ in the date, not only choose it from the datepicker. I found the following example code:</p> <pre><code> angular.module('MyApp') .controller('AppCtrl', functio...
<p>If you're having trouble loading the md-datepicker files and get it to be loaded into MEAN.JS check out <a href="http://stackoverflow.com/questions/34985274/mean-js-and-adding-external-dependencies/34988797#34988797">this answer</a>.</p> <p>However if you are already correctly loading your files into your app and y...
SyntaxError: unterminated string literal with whitespace only <p>I try to launch parameters from javascript function, but it seems to be a problem with quote when I've a white space.</p> <p>This is the error of Mozilla</p> <blockquote> <p>SyntaxError: unterminated string literal</p> </blockquote> <p>And this is my...
<p>Why you did not use pg_escape_string? <a href="http://php.net/manual/en/function.pg-escape-string.php" rel="nofollow">http://php.net/manual/en/function.pg-escape-string.php</a></p> <pre><code>$requete = pg_query($dbconnect,"SELECT '".pg_escape_string("&lt;table ... &lt;/table&gt;")."' AS fiche FROM table"); </code>...
There Was No Endpoint Listening At net.pipe://localhost/MyService <p>I have one WCF service in which I have some methods. One method name is KilProcess(), which kills the Windows process created and it contains the code</p> <pre><code>public void KilProcess() { Process.GetCurrentProcess().Kill(); } </code></pre> ...
<p>First, you have to know that net.pipes are for interprocess communication only (2 process on the same machine). You also have to tell us more details about what you are trying to do. In your explications, it looks like you are using two different machines, right? Then net.tcp insteed of pipe is what you are looking ...
Visual Studio 2015 Update 3 doesn't open .cs files <p>After I installed IntelliJ IDEA (Jetbrains) and JDK 1.8.0_102 my Visual Studio isn't able to open .cs Files with my user account. It always show the error message "The document cannot be opened. It has been renamed, deleted or moved.". On rightclick -> "open with" -...
<p>My solution was to delete the local user profile. After that, Visual Studio works fine again.</p>
What are the alternatives to OR'ing multiple value options in an IF clause? <p>Is there any c# syntax that would make this if statement cleaner/shorter?</p> <pre><code>if (token == "(" || token == ")" || token == "+" || token == "-" || token == "*" || token == "/") { //do something } </code></pre>
<p>Like this:</p> <pre><code>// create a string with the valid chars var tokens = "()+-*/"; // this will call the Contains method of the String class if(tokens.Contains(token)) { //do something } </code></pre> <p>Or with an array: <em>(This way you can validate on multiple chars within a match. (not included on...
Move description under image <p>How can I move the short description under the image on the single product page? <a href="https://yithemes.com/themes/plugins/yith-woocommerce-booking/" rel="nofollow">Here</a>'s an example.</p>
<pre><code>remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 ); add_action( 'woocommerce_product_thumbnails', 'custom_single_product_short_description', 40 ); function custom_single_product_short_description(){ the_excerpt(); } </code></pre> <p>Would you please try abo...
Phonegap Build IOS App not showing Is ICON/Launch Image <p>My IOS application is created with phonegap build which was not showing its Icon/Launch Image. I have include icon image in res/icon/ios folder with size <code>57*57, 114*114, 40*40, 80*80, 120*120, 50*50, 100*100, 60*60, 120*120, 180*180, 72*72, 144*144, 76*76...
<p>You have that icons names will match icons names in info.plist file </p>
matches patterns in vector with strings in data frame <p>I have a data frame that contains two types cols and vector with names. How select some rows in data frame matches with vector strings.</p> <pre><code>name = c("p4@HPS1", "p7@HPS2", "p4@HPS3", "p7@HPS4", "p7@HPS5", "p9@HPS6", "p11@HPS7", "p10@HPS8", "p15@HPS9") ...
<p>We can use <code>paste</code> with <code>collapse</code> on the 'nam', use it as <code>pattern</code> argument in <code>grep</code>, get the index and subset the 'dataset'</p> <pre><code>dataset[grep(paste(nam, collapse="|"), dataset$name),] </code></pre> <hr> <p>If we are using the OP's code, wrap the 'name' col...
how to configure a Akka Pub/Sub to run on same machine? <p>I am following the Distributed Publish Subscribe in Cluster example in Akka. However, I would like to run all the actor (publisher and subscribers) on the same node (my laptop). I am not sure if I understand how to configure that, could somebody help me? is it ...
<p>Your error is telling you what the problem is. In your application.conf you should set <code>akka.actor.provider = "akka.cluster.ClusterActorRefProvider"</code>. If you want to use a 1 node cluster on your laptop you should also set <code>akka.cluster.min-nr-of-members = 1</code>.</p>
Send json in posturl webview <p>How can i send <code>JSON</code> post data in <code>WebView</code> to call a webservice with raw data?</p> <p>This is my code,</p> <pre><code>fb.loadData(base64, "text/html; charset=UTF-8", "base64"); </code></pre>
<p>Try </p> <pre><code> webView.postUrl("url", data.getBytes("UTF-8")); </code></pre>
Preventing fedora from installing mariadb <p>I'm running Fedora 24, with kde plasma, having recently decided to try it after mostly being on Ubuntu. </p> <p>This morning while trying to update, I ran into a conflict between mariadb and percona. I had installed percona from rpms (since I couldn't install 5.7 from repos...
<p>Had to go back to gnome 3 and uninstall kde, then the problem disappeared. Guess the issue was kde.</p>
Displaying Json data on view ( LARAVEL ) <p>I am working in laravel project and i want to display my json data from url into the view dashboard.blade, And this is the sample json data:</p> <blockquote> <p>{"response":{"result":{"Contacts":{"row":[{"no":"1","fl":[{"val":"CONTACTID","content":"144120000000079041"},{"v...
<p>Use <code>return view('dashboard')-&gt;with('leads', $contact);</code> if you want to iterate <code>$leads['row']</code> in the view.</p> <p>Otherwise, you can just use <code>return view('dashboard')-&gt;with('leads', $data);</code> and iterate <code>$leads</code> in the view this way <code>@foreach($leads as $rows...
"TypeError: obj.indexOf is not a function" error when writing a selenium test script <p>I'm currently making an automated test script using Selenium Webdriver and Cucumber for my company's website. To do this I have used <a href="https://github.com/Matt-B/cucumber-js-selenium-webdriver-example" rel="nofollow">Matt-B's ...
<p><strong>indexOf is Array Property and not of object</strong></p>
Quickest way to check which property inside an object holds value? <p>Probably a dumb question, Assume i have an object like below,</p> <pre><code>{"Country":"country","Continent":"continent","Province":"","District":"","State":"state","City":""}" </code></pre> <p>What is the quickest way to check which properties ho...
<pre><code>var a = {"Country":"country","Continent":"continent","Province":"","District":"","State":"state","City":""}; Object.keys(a).filter( prop =&gt; a[prop] ); </code></pre> <p>It also depends on how you want to handle the <code>0</code>, <code>null</code>, <code>undefined</code> values. </p>
how to make logging.logger to behave like print <p>Let's say I got this <a href="https://docs.python.org/2/library/logging.html" rel="nofollow">logging.logger</a> instance:</p> <pre><code>import logging logger = logging.getLogger('root') FORMAT = "[%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s" logging.basi...
<p>Alternatively, define a function that accepts <code>*args</code> and then <code>join</code> them in your call to <code>logger</code>:</p> <pre><code>def log(*args, logtype='debug', sep=' '): getattr(logger, logtype)(sep.join(str(a) for a in args)) </code></pre> <p>I added a <code>logtype</code> for flexibility...
Show date after split it in Crystal Reports <p>How can I concatenate this a date in Crystal Reports after split it.</p> <p>I have this formula:</p> <pre><code>global numberVar d :=toNumber(mid({BAQReportParameter.Option01},4,2)); global numberVar m:= toNumber(left({BAQReportParameter.Option01},2)); global numberVar ...
<pre><code>global stringvar d :=(mid({BAQReportParameter.Option01},4,2)); global stringvar m:= (left({BAQReportParameter.Option01},2)); global stringvar y:= (right({BAQReportParameter.Option01},4)); Global stringVar datetxt:= ToText(d + "/" + m +"/" + y); </code></pre> <p>Do this simple changes it will work!! </p>
Python: slow nested for loop <p>I need to find out an optimal selection of media, based on certain constraints. I am doing it in FOUR nested for loop and since it would take about O(n^4) iterations, it is slow. I had been trying to make it faster but it is still damn slow. My variables can be as high as couple of thous...
<p>From the comments, I got that you're working on a problem that can be rewritten as an <a href="https://en.wikipedia.org/wiki/Integer_programming" rel="nofollow">ILP</a>. You have several constraints, and need to find a (near) optimal solution.</p> <p>Now, ILPs are quite difficult to solve, and brute-forcing them qu...
Creating dynamic lambda using helper method <p>I have a main method that creates a basis search criteria for a given entity. In this method i consequently check for default values before applying it to the query.</p> <p>E.g.</p> <pre><code> if (!string.IsNullOrEmpty(value)) qry = qry.Where(x =&gt; ...
<p>You have to transform the method into an Expression and then include it as the body of the lambda.</p> <p>So, starting from your boiler code, after the above changes it should look like</p> <pre><code> IQueryable&lt;T&gt; Test&lt;T, TV&gt;(IQueryable&lt;T&gt; qry, Expression&lt;Func&lt;T, TV&gt;&gt; prop, strin...
Using arg parser in python in another class <p>I'm trying to write a test in Selenium using python,</p> <p>I managed to run the test and it passed, But now I want add arg parser so I can give the test a different URL as an argument.</p> <p>The thing is that my test is inside a class, So when I'm passing the argument ...
<p>Put the <code>parser = argparse.ArgumentParser(...)</code> and <code>parser.add_argument()</code> outside <code>if __name__ == "__main__":</code> so that it always gets created but not evaluated. Keep <code>args = vars(parser.parse_args())</code> inside <code>__main__</code>.</p> <p>That way you can import it from ...
Is it possible to upgrade a sticker pack into an iMessage app? <p>Would it be possible, at a later point, to upgrade/convert an existing sticker pack into a fully fledged iMessages app?</p>
<p>According to Apple, the answer to that is yes:</p> <blockquote> <p>Can I update my standalone sticker pack into a standalone iMessage app?</p> <p>Yes, you may submit a sticker pack to the App Store for iMessage, and later submit an iMessage app as an update to the existing app. Before doing this, be sure to ...
Retrieve parts of text inside <li> <p>I have HTML like this</p> <pre><code>&lt;li class="in-ttl-b"&gt;(a) kanji; a Chinese character [ideograph] &lt;ul class="list-data-b-in"&gt;&lt;li class="text-jejp text-c"&gt;&lt;span class="ex"&gt;漢字で書く&lt;/span&gt;&lt;/li&gt;&lt;li class="text-jeen text-c"&gt;write...
<p>You can get that by selecting the first <em>text node</em> that is child of the outer <code>li</code> element. For example, assuming there can be more than one instance of <code>li</code> with <code>class="in-ttl-b"</code> :</p> <pre><code>Dim lis = HTMLDoc.DocumentNode.SelectNodes("//li[@class='in-ttl-b']") For Ea...
After Swift 3 conversion, I can't get rid of error: "Ambiguous use of 'indexOfObject(passingTest:)'" <p>I'm using <code>NSArray</code>'s indexesOfObjects(passingTest:), but after I converted my code to Swift 3 I get the error: "Ambiguous use of 'indexOfObject(passingTest:)'". My code below worked fine with Swift 2.3.</...
<p>In Objective-C, the two <code>indexesOf</code> methods are distinct two methods:</p> <pre><code>- (NSIndexSet *)indexesOfObjectsPassingTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0); - (NSIndexSet *)indexesOfObjectsWithOptions:(NSEnumerationOptions)opts pass...
How to inherit DialogFragment <p>First question asked so comment if you need more details.</p> <p>I'm been working with Xamarin for some months now, and I have this problem that I can't inherit <code>DialogFragment</code>. I've watching some videos with Joe Rock, but now i'm stuck with this problem.</p> <p>I have the...
<p>You should override <code>OnCreateDialog</code> and specify what actually you wanna do with your new custom list.</p> <p>Possible solution might look like this</p> <pre><code>using System.Collections.Generic; using System.Linq; using Android.App; using Android.OS; using SupportDialogFragment = Android.Support.V4.A...
dynamic adding images in wordpress theme <p>i am working with my footer to add many images in my wordpress theme, I want it to be dynamic in my dashboard. In my code i have many image src with an id of divimg where i added my images static.</p> <p>all i want is to make the image something like a loop or any to have a ...
<p>You can use widget to put image in footer from back-end, For your template directory url you have to create a short-code like: [template-url] then use as: </p> <pre><code>&lt;img id="divimg" src="[template-url]/images/atlanta.png" /&gt; </code></pre> <p>in text Widget.</p>
stylecop with VSTS build defnition <p>I'm using VSTS with git. I'm creating a build definition for one of the projects and I want to run stylecop rules as part of build definition. I have a custom stylecop.settings file. I came across <a href="https://marketplace.visualstudio.com/items?itemName=richardfennellBM.BM-VST...
<p>You can also <a href="https://stylecop.codeplex.com/wikipage?title=Setting%20Up%20StyleCop%20MSBuild%20Integration&amp;referringTitle=Documentation" rel="nofollow">setup StyleCop MSBuild Integration</a> to run automatically whenever the code is built.</p>
Unable to cache icon warning, when building notification <p>I'm using notification in my app that displays progress, and i have build a class the can easily handle the notification update for me.</p> <p>For the constructor i pass a context, in order to be able to build the notification. Here is the method for updating...
<p>you are use a phone with cyanogenMod?</p>
XPath in scrapy returns elements which don't exist <p>I am creating a new scrapy spider and everything is going pretty good, although I have a problem with one of the websites, where response.xpath is returning objects in the list which doesn't exist in html code:</p> <pre><code>{"pdf_name": ["\n\t\t\t\t\t\t\t\t\t", "...
<p>Whitespace is part of the document. Just because <em>you</em> think it is unimportant does not make it go away.</p> <p>A text node is a text node, whether it consists of <code>' '</code> (the space character) or any other character makes no difference at all.</p> <p>You can normalize the whitespace with the <code>...
STL vector.clear() cause memory double free or corruption <p>Here is code snippet: </p> <pre><code>pthread_mutex_lock(&amp;hostsmap_mtx); for (int i = 0; i &lt; service_hosts[service].size(); ++i) poolmanager-&gt;delPool(service, service_hosts[service][i].first); service_hosts[service].clear(); for (int i = 0; i ...
<p>Double frees are very easy to diagnose using valgrind (or any other similar tool you have access to). It will tell you who freed the memory you are accessing which will lead you to the root of the problem. If you have problems reading the valgrind output post it here and we can help you out.</p>
Adding a class to body when a Hyperlink tag is clicked which is in the child ul of li tag using jquery <p>I want to add a class to body when a link is clicked. This is easily done when the link is in the parent ul, but my problem is that i want to do that for the the link present in the child ul of parent li. Whenever ...
<p>Try with <code>on('click',...)</code>, may be your Navigation will generate dynamically after load page so you have to use delegated event binding</p> <pre><code> $(document).ready(function () { $(document).on('click','ul.treeview-menu a.links',function () { $("body").addClass("sidebar-collapse"); ...
Why error is showing on click of button? <p>Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates when I am using UIActionsheet on click of button in ios? Why?</p> <pre><code>- (IBAction)btnAbo...
<p>Use <code>alertController</code></p> <pre><code>UIAlertController *alert = [UIAlertController alertControllerWithTitle:confirmText message:@"" preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction *achievment = [UIAlertAction actionWithTitle:@"Achievment" ...
"log4j.properties was unexpected at this time" while trying to start Zookeeper in windows <p>I am using kafka stream download from Confluent (<a href="http://www.confluent.io/product/kafka-streams/" rel="nofollow">http://www.confluent.io/product/kafka-streams/</a>). </p> <p>I am following the instructions to run Zooke...
<p><a href="https://github.com/renukaradhya/confluentplatform" rel="nofollow">https://github.com/renukaradhya/confluentplatform</a> </p> <p>This above GIT repo contains modified windows batch scripts.</p>
Google fonts web site works with special char, but web site is not <p>When I check a font in Google Fonts preview page all special chars are working as expected, but when the font is used in a web site some chars are printed with the default font. Is there any trick to get the font working to the fullest in the browser...
<p>A colleague found that my characters are not part of latin and the font didn't support them. The Google Fonts preview will try another font in the background and that's why it looks like it is working. By manually defining the font I got the "Kahako A" as I wanted.</p> <p><a href="http://codepen.io/anon/pen/yaapKw"...
Cordova file upload not working on android <p>using cordova media-capture and file-transfer plugin I try to make an app to record video and upload on server. After recording video I call the upload function and it showing the success message in success callback function. But no file uploaded in server. Here my code.</p...
<p>You have to create a <code>FileUploadOptions</code> object</p> <pre><code>var options = new FileUploadOptions(); options.fileKey = "file"; options.fileName = name; </code></pre> <p>then use it on the upload function</p> <pre><code>ft.upload(path, "http://myserver.com/test.php", func...
How to display array data in custom table? <p>I created a custom table to display some key-value-pairs. It works fine for simple examples with 2 Strings but there are also pairs with an array as value. The entries should get listed one below the other in the same table row. It should look something like this:<br> <a hr...
<p><code>Array.isArray(data[attr.id])</code> won't do the trick. </p> <p>Instead You can put <code>angular.isArray</code> on the <code>scope</code> like below.</p> <pre><code>$scope.isArray = angular.isArray; </code></pre> <p>and use it inline as </p> <pre><code>&lt;div ng-show="isArray(array)"&gt;&lt;/div&gt; </co...
Find all distinct path possibilities from php array <p>I'm trying to get all possibilities from a decision tree in PHP, my input looks like this : </p> <pre><code>array( (int) 61 =&gt; array( (int) 257 =&gt; '62' ), (int) 62 =&gt; array( (int) 258 =&gt; '63', (int) 259 =&gt; '63', ...
<pre><code>&lt;?php public function getNextScenes($sceneId, &amp;$nextDialogsArray) { global $array; foreach($array[$sceneId] as $dialogId =&gt; $nextSceneId) { $nextDialogsArray[$dialogId] = []; if (!empty($nextSceneId)) { $this-&gt;getNextScenes($nextSceneId...
How to Lighten or Darken a specified TColor in Inno Setup Pascal Script? <p><strong>I need to make color of my Status Bar (it is a <code>TPanel</code>) change (Lighten or Darken) automatically according to user's current System Specifications which is displayed in my <code>wpInfoBefore</code> Wizard Page.</strong></p> ...
<p>You have to convert the color to <a href="https://en.wikipedia.org/wiki/HSL_and_HSV" rel="nofollow">HSL or HSV</a> and change the lightness (L) or value (V) and convert back to RGB.</p> <p>The following code uses the HSL (L = lightness).</p> <pre class="lang-pascal prettyprint-override"><code>function GetRValue(...
How I can create build file with Node.JS script? <p>How I can do it with Node.js(<strong>script file not in cmd consol</strong>):</p> <ol> <li>go to the folder with the project</li> <li>do <em>npm i</em> </li> <li>do <em>webpack -p</em> ?</li> </ol>
<p>Create a bash script with all you want to do:</p> <p><strong>yourbash.sh:</strong></p> <pre><code>cd /yourdirectory npm i webpack -p </code></pre> <p>then just spawn this process in your node</p> <pre><code>const spawn = require('child_process').exec spawn('sh yourbash.sh', [], function (err, stdout, stderr) { ...
Unable to read remote system event logs <p>I am trying to query event logs through WMI Tester but the result is empty</p> <p><a href="http://i.stack.imgur.com/otKIH.png" rel="nofollow"><img src="http://i.stack.imgur.com/otKIH.png" alt="enter image description here"></a> </p> <p><a href="http://i.stack.imgur.com/krucH...
<p>Can you try to run the query locally at ptpc88 and check if it is yielding results. And retry with Authentication as <strong>Packet</strong>.</p> <p>And if possible try providing <strong>FQDN</strong>.</p>
How can I finish pyspark unit tests gracefully withou `py4j.java_gateway:Error`? <p>How can I finish pyspark unit tests gracefully without see this annoying error when the test ends? It seems like the python client is losing communication with the spark context or something like that. </p> <blockquote> <p>ERROR:py4j...
<p>how did you run those tests? </p> <p>what happened when you run </p> <pre><code>sc.stop() </code></pre> <p>at end of the test?</p>
How to see call stack in Android Studio? <p>I read <a href="http://stackoverflow.com/questions/21071960/android-studio-where-can-i-see-callstack-while-debugging-an-android-app">other</a> posts but can not reproduce. So how can I see during debugging the call stack and see which method called the recent method?</p> <p>...
<p>In <code>Debug Mode</code> click on <code>Restore Layout</code> and you can navigate through <code>Frames</code> panel as shown below:</p> <p><a href="http://i.stack.imgur.com/GwJiq.png" rel="nofollow"><img src="http://i.stack.imgur.com/GwJiq.png" alt="enter image description here"></a></p>
Query RavenDB for child property collection that contains certain value <p>I have this class, let’s call it ”Device”. This class has several properties, among one which is a collection property (of string values). </p> <p>In RavenDB there could be 5000 instances of “Device”, where each of them CAN have a lis...
<p>Create an index which will contain the data from MyStringValues. It can contain multiple values in an array for each record.</p> <p>Then you can create an index query and filter only records which contain a given value using <code>.Where(x =&gt; x.MyStringValues.Contains(filteredValue))</code>.</p> <p>Then load al...
Add User to Visual Studio Team Services (Previously Visual Studio Online) <p>On the Users tab I'm trying to add a new user but the prompt says "Select user from directory" and when typing an email address to invite it just says "No identities found". This is a newly created account with default settings not linked to a...
<p>According to the screenshot you provided, your VSTS account is backed by an Azure Active Directory which requires that all users are directory members before they can get access to your Team Services account. So you need to add the user to your AAD first.</p> <p>"External guest access" is used for external users wh...
Hibernate does not insert field which is part of composite FK <p>I have hibernate entity with two many-to-one associations and composite foreign keys, each with 3 fields. Two fields are common for both keys. There are mapping:</p> <pre><code>&lt;class dynamic-insert='true' dynamic-update='true' entity-name='...' table...
<p>try by changing update value to true &amp; by removing insert='false' in the XML.</p> <pre><code>&lt;many-to-one name='Shift' class='TimeShift' update='true'&gt; </code></pre>
python def creation within a .py <p>I am trying to create a def file within a py file that is external eg.</p> <p><code>calls.py</code>:</p> <pre><code>def printbluewhale(): whale = animalia.whale("Chordata", "", "Mammalia", "Certariodactyla", ...
<p>What you're trying to do here seems a bit of a workaround, at least in the way you're trying to handle it.</p> <p>If i understood the question correctly, you're trying to make a python script that takes input from the user, then if that input is equal to "new", have it be able to define a new animal name.</p> <p>Y...
How to populate grid view from an SQL table <p>I am trying to populate a grid view from a query I have in an SQL table through a connection string yet somehow I receive the following error. Realistically as I am a beginner I think this is going to be an extremely simple error with the code so don't assume anything!</p>...
<p>I believe you should send it to a DataTable first before being able to bind it.</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection("data source=.; database=Richard2016DB; integrated security=SSPI"); SqlCommand cmd = new SqlCommand("Select * from dbo.t...
Typical issue: css Element not found <p>I have a typical problem with selenium Ide: [error] = * css Element not found.</p> <p>I looked in the forum and I have seen very similar questions (eg, selenium-IDE-2.9.0 - [error] = li.xspPickerItem.xspPickerItemHover css Element not found), have tried to solve the problem with...
<p>From the code you've posted you don't need the '.active' on the end of the locator, it should just be 'css=input.select-dropdown' However if you have multiple dropdowns this may not be the most efficient way of targetting them if they'd all have the same class. If you have control over the code you may want to add i...
Gulp src glob : multiple files patterns not matching <p>I am creating a build script for a Node app.</p> <p>I had created a Powershell (PSake) script, but now I need to port it to Gulp because I need to run it on Mac.</p> <p>Basically, I copy the sources somewhere and clean them up (remove all unnecessary files like ...
<p>I have replaced the glob by a <a href="https://github.com/jprichardson/node-fs-extra" rel="nofollow">fs-extra</a> <code>walk</code> call, but it doesn't really answer why the glob does not work.</p> <pre><code>var fs = require('fs-extra'); gulp.task('cleanupapp', [ 'build' ], function(done) { fs.walk(path.join...
Can't Download/Retrieve Email from Gmail account with Delphi (SSL3_GET_RECORD:wrong version number) <p>I Can't Download/Retrieve Email from Gmail with Delphi + Indy!</p> <p>For several weeks I can not read e mail from Gmail. </p> <p>Before the Code below works fine.</p> <p>Now, I always get this Error Message:</p> ...
<p>The following test code works fine for me to login to Gmail via POP3:</p> <pre><code>procedure Test; var IdPOP3: TIdPOP3; IdSSL: TIdSSLIOHandlerSocketOpenSSL; begin IdPOP3 := TIdPOP3.Create(nil); try IdPOP3.Host := 'pop.gmail.com'; IdPOP3.Port := 995; IdPOP3.Username := MyGmailUsername; IdPO...
How to partially remove content from cell in a dataframe using Python <p>I have the following dataframe:</p> <pre><code>import pandas as pd df = pd.DataFrame([ ['\nSOVAT\n', 'DVR', 'MEA', '\n195\n'], ['PINCO\nGALLO ', 'DVR', 'MEA\n', '195'], ]) </code></pre> <p>which looks like this:</p> <p><...
<p><a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.replace.html" rel="nofollow"><code>df.replace</code></a> and some regex.</p> <pre><code>In [1]: import pandas as pd ...: df = pd.DataFrame([ ...: ['\nSOVAT\n', 'DVR', 'MEA', '\n195\n'], ...: ['PINCO\nGALLO ', 'D...
Crossfilter on aggregated results <p>I am using Crossfilter (DC.JS and hence D3) to visualize large volumes of data. I like the interactive nature of the library, but my data is quickly becoming far too large. The best way I see fit to deal with this, is to pre-aggregate my data if it is too large. I am having difficul...
<p>This question is pretty broad*, but here goes.</p> <p>There are several ways to handle this problem in Crossfilter. I'll list them more or less in order of complexity:</p> <ol> <li>Shrink you records by using tokens for keys and values. For example, <code>{"date":"01-01-2016","food": "apple", "gender": "M", "count...
Unable to see Add Schedule button on Jasper Server 6.2.1 <p>I am unable to see 'Add Schedule' button on jasper server 6.2.1 for old or new reports. Earlier, on right clicking a report and choosing schedule option, opened a page that lists the scheduled jobs for the selected report. This page also had a 'Add Schedule' ...
<p><strong>Administrative view</strong></p> <p>When using login, view -> repository, selecting reports under organization:</p> <p>This is the repository where you set user rights or change settings in the report. No possibility to change schedules (at least in v6.2.1).</p> <p><strong>Schedule view</strong></p> <p>I...
Naming conventions for Python scripts without classes <p>I've searched around for an answer specific to my use case, but can't find one, so apologies if this specific case has been answered before.</p> <p>I run a number of isolated scripts which perform different functions, like assessing specific data from APIs and s...
<p>This is the only reference I know about module names (scripts are themselves modules so it applies to them too):</p> <blockquote> <p>Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability.</p> </blockquote> <p><a href="https://www.python.org/dev/pe...
iOS make UIScrollView paging enabled only for one direction <p>As the question title says, is it possible to enable paging in <code>UIScrollView</code> only for one direction?</p> <p>I have a <code>UIScrollView</code> that scrolls in both x and y directions, but I want only one direction to be paginated, is this possi...
<p>You should implement <code>scrollViewWillBeginDecelerating delegate method of</code>UIScrollview`.</p> <p>You should store current <code>content offset</code> somewhere.</p> <p>then compare <code>y</code> of your scrollview's current <code>content offset</code> and last stored with <code>content offset</code>. If...
Springboot Maven Application jar not running <p>I am using springboot to build a restful application with maven it run on eclipse ,but not using jar file and cmd giving me this exception: <code>C:\restapi\BvmtRestApi\target&gt;java -jar BvmtRestApi-0.0.1-SNAPSHOT.jar Exception in thread "main" java.lang.ClassNotFound...
<p>Below are the steps to run from jar</p> <ol> <li><p>Add below maven build plugin.</p> <pre><code>&lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt; &lt;/plugin&gt; &lt;/plugins&gt...
301 redirect apache shows wrong url <p>it turns out that for different reasons have had to change my website URL, the url old are indexed in Google and I want you to go through them, the new content is displayed with the new url.</p> <p>I added this:</p> <pre><code>Redirect 301 /library/books/pitz-lower.php http://ww...
<p>There are 2 issues:</p> <ol> <li>Mixing <code>mod_rewrite</code> rules and <code>mod_alias</code> rules (i.e. <code>Redirect</code> directive) is not good as these 2 modules run at different times.</li> <li>Keep <code>301</code> redirect rules before internal rewrite ones.</li> </ol> <p>Your modified .htaccess sho...