input
stringlengths
51
42.3k
output
stringlengths
18
55k
Get a specific element in AngularJs <p>I have the following code:</p> <p>angular.element('div');</p> <p>which returns an object of all the <code>div</code> elements on the page. How can I get the index of a specific <code>div.one</code> in this object?</p> <p>I've tried <code>indexOf()</code>, but it doesn't work on...
<p>You can try </p> <pre><code>angular.element(document.querySelector('.one')); </code></pre> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var myApp = angular.module('myApp'...
Git svn clone: Is it possible to resume after error Malformed XML: no element found? <p>I'm attempting to do a one-way from subversion to Git migration of a large subversion repository using <code>git svn</code> with the following command (IMPORTANT after the migration only Git will be used):</p> <pre><code>git svn cl...
<p><code>git-svn</code> is <strong>not</strong> the right tool for one-time conversions of repositories or repository parts. It is a great tool if you want to use Git as frontend for an existing SVN server, but for one-time conversions you should <strong>not</strong> use <code>git-svn</code>, but <code>svn2git</code> w...
WPF set dataGrid witdth to 30% of screen or parent's width <p>What I want to do is next, I have a MainWindow with 3 dataGrids, whichs are contained in StackPanel, and what I want to do here, I want to resize datagrid width to: for example 30% of screens, because there are 3 datagrids it will be 90% of screen width spac...
<p>Use <code>Grid</code> columns. Width="<em>n</em>*" means to set the width proportionally: 3 + 3 + 3 + 1 == 10, so in this case a column width of "3*" will be three tenths of the total width. They'll resize appropriately as you stretch the parent. </p> <pre><code>&lt;Grid&gt; &lt;Grid.ColumnDefinitions&gt; ...
Display a value from MySql on a label <p>How can I display a value from MySql on a label?</p> <pre><code>MySqlConnection conn = null; string strConn = @"Server=localhost;Database=locadora;Uid=root;Pwd='';Connect Timeout=30;"; conn = new MySqlConnection(strConn); conn.Open(); string mSQL = "SELECT cliente_codigo FROM c...
<p>Depending on what you want, </p> <pre><code>lbl_cliente_codigo.Text = dt.Rows[row number]["column name" | column ordinal]; </code></pre> <p>so </p> <p>for the first row and the first column (using the ordinal position) in the datatable it would be like this</p> <pre><code>lbl_cliente_codigo.Text = dt.Rows[0][0];...
Parse all NS* variables in source using regex <p>I'm trying to extract the names of all variables within an objective-c .m file. I thought regex might be a good way to do this. Let's say I have something like this in my source:</p> <pre><code>- (void)testMethod:(NSString*)param1Name param2:(NSString*)param2Name{ N...
<p>Since you want to match specific occurrences of NS* variables (those at the start of the lines), you may use</p> <pre><code>(?m)^[ \t]*NS\w+\s*\*\s*(\w+) </code></pre> <p>See <a href="https://regex101.com/r/iL4nC6/3" rel="nofollow">this regex demo</a></p> <p>The value you need will be inside Group 1.</p> <p><em>...
Check if there's any string after a character <p>I want to find out, how can i see if there's any character/string after a specific string part from a string. My question sounds ambiguous but here's my real example:</p> <p>I can have 2 urls : <a href="http://domain/classAdd?itemId=1123123" rel="nofollow">http://domain...
<p>check if this</p> <pre><code>window.location.href.substring(window.location.href.indexOf('classAdd?itemId=') + 16) </code></pre> <p>gives you the itemId</p>
GCloud Appengine download_app Module(service) <p>I would like to download the source code of a module I recently deployed to Google Cloud Appengine. Currently, I am only able to download the default application.</p> <p>Does anyone know any how i specify a module / service (google re-named recently)</p> <p>I have trie...
<p>Use:</p> <pre><code>appcfg.py download_app -A &lt;your_app_id&gt; -M &lt;module_name&gt; -V &lt;your_module_version&gt; &lt;output-dir&gt; </code></pre> <p><strong>Make sure you specify your module/service version otherwise it will not work.</strong></p> <p>You can find the module/service version in the console u...
TabItem doesn't load immediately <p>I have a MVVM setup with <code>TabControl</code> and an <code>ObservableCollection&lt;ViewModel&gt;</code> of tabitems.</p> <p>I open a file and load the model made of that file in a <code>TabItem</code>:</p> <pre><code>var model = new ViewModel(data, filename); ViewModels.Tabs.Add...
<p>This is due to virtualization. As with any <code>Selector</code> subclass, only the visible items actually exist. And in a <code>TabControl</code>, the only visible item is the selected one. I don't think that was an ideal design choice for most common uses of a tab control, but here we are. </p> <p>The best fix I'...
Multi-line syntax in to_s with reference to an object <p>I have a problem constructing the to_s method.</p> <pre><code>class Personne attr_accessor :prenom, :nom, :email, :telephone, :adresse def initialize @prenom = @nom = @email = @telephone = "" @adresse = Adresse.new end def to_s ...
<blockquote> <p>I do not understand the issue, since address object has it's own print method.</p> </blockquote> <p>You are passing an instance of class <code>Adresse</code> as an argument to <code>+</code> method, called on string, it throws an error, because it expects an instance of <a href="https://ruby-doc.or...
Node.js Socket.io socket.brodcast is undefined <p><code>brodcast.emit</code> to send a message to all without socket, and when I do that the node instance crashes and says that socket.brodcast is undefined . </p> <p>here is my node code:</p> <pre><code>var express = require('express'); var app = express(); var http ...
<p>your code contains a typo for starters...</p> <pre><code>socket.brodcast.emit("newChild",maindata.getDataPoint(newChildID)); </code></pre> <p>should be </p> <pre><code>socket.broadcast.emit("newChild",maindata.getDataPoint(newChildID)); </code></pre>
How to cancel a running async function in xamarin forms <p>I called async function in my code , which call rest service and populate a data structure. But somehow i need to cancel that function before its completion , how can i achieve this. </p> <pre><code>getAdDetails(ad.id,ad.campaign_type); private async void get...
<p>There is something called "CancelationToken" which is supposed to be for such stuff. Another way to do so is by throwing an exception when you want to cancel the process . Another way is by having a flag which can be named "ShouldExecute" , and in the method you keep monitoring it. </p> <p>I also tend to ignore t...
Value On UITextField Changes On Scroll <p>Before asking this question I have googled a lot and not able to find a suitable answer.</p> <p>I have a tableView with <code>Three</code> sections and <code>n</code> number of columns. The no. of rows in each section is also not fixed. The last two columns contains a <code>UI...
<p>As you scroll your cell's off view they are deallocated. Each time the cell scrolls back into view it's re-initialized. If you want to retain the value of the textfield I'd save it's contents when you can and hold onto that value.</p> <p>I have done this before by holding on to a dictionary of Strings that contain ...
Notification using AWS SNS for Android. Always getting message with "default" string prefix <p>I am trying to send notification from SNS to Android app using FCM API key and token. </p> <p>On my webapp, I am using PHP and calling publish function on snsClient as below -</p> <pre><code>$snsClient-&gt;publish(array('Me...
<p>Firebase Cloud Messaging has server-side APIs that you can call to send messages. See <a href="https://firebase.google.com/docs/cloud-messaging/server" rel="nofollow">https://firebase.google.com/docs/cloud-messaging/server</a>.</p> <p>Sending a message can be as simple as using curl to call a HTTP end-point. See <a...
Apply function on each element in two Dataframes using R <p>How do I apply a function on each elements over two Dataframes?</p> <p>In the following example I want to prevent the double for-loop:</p> <pre><code>for(m in 1:nrow(DF1)) { for(n in 1:ncol(DF1)) { mySeq &lt;- seq(DF1[m,n], DF2[m,n], 0.01) # Do ...
<p>I'm not sure what function you are trying to apply on the elements but I have used the sweep() function for something similar in the past. For example:</p> <pre><code>df = data.frame(x = 1:10, y = 1:10, z = 1:10) sweep(df, 1:2, 1) </code></pre> <p>Here sweep goes through every element of df and subtracts 1 but you...
How can I serve Ionic app on a different port? <p>I'm trying to run the ionic project on browser but the default port 8000 is already in use.</p> <p>I need to change the port</p> <p>I'm using this command:</p> <pre><code>ionic run browser --port 8002 </code></pre> <p><strong>but its not working.</strong></p> <p>T...
<p>Try <code>ionic platform add browser</code> before, or <code>ionic serve -p 8002</code> instead...</p>
MapKit.framework linking error <p>Strange error happening on Xcode 8 with iOS 10. An app uses MapKit. I was working with simulator and all was fine. And I wanted to run on a device. And I was getting these errors. After that, I restarted my Mac, and now I'm unable to run even on simulator.</p> <p>OSX: El Capitan, Xcod...
<p>Check your Project's Capabilities and turn Map - ON. Check Your Build Phases if you have MapKit framework imported. If you already have the framework try to remove and re add .</p> <p>Good luck :) </p>
Is it possible to automatically restart killed erlang applications? <p>I have an application, my_app. It has some other applications it depends on.</p> <p>my_app.app:</p> <pre><code>{application, my_app, [ {description, "My App"}, {vsn, "0.0.1"}, {registered, []}, {applications, [some_dep1, ...
<p>If an application is started as a "permanent" application, the entire Erlang node will go down if the application crashes. This is the default when generating a release, but if you're using <code>application:start</code> or <code>application:ensure_all_started</code>, the default type is <code>temporary</code>, whi...
cross products with einsums <p>I'm trying to compute the cross-products of many 3x1 vector pairs as fast as possible. This</p> <pre><code>n = 10000 a = np.random.rand(n, 3) b = np.random.rand(n, 3) numpy.cross(a, b) </code></pre> <p>gives the correct answer, but motivated by <a href="http://stackoverflow.com/a/2091...
<p>You can bring in matrix-multiplication using <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.tensordot.html" rel="nofollow"><code>np.tensordot</code></a> to lose one of the dimensions at the first level and then use <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.einsum.html" re...
App Crash - <filename unknown> <p>I have a pretty simple app. It consists of a viewpager which has 2 pages, within the two pages they have fragments which are custom listviews, these are pre-populated on app load and kept "alive" by using:</p> <pre><code>_viewPager.OffscreenPageLimit = 2; </code></pre> <p>The listvie...
<p>Going by the stack trace, the <code>Count</code> method in the <code>UserListViewAdapter</code> is throwing a null reference exception. Since you are only accessing the list of users, I guess it's a possibility that the list is null. I'd probably change that property to...</p> <pre><code>public override int Count {...
PHP refresh site after post <p>I make some changes on my db with php. The result i want to see after sending the formular. The side refreshes but the changes are not there. If i put f5 everything ist fine. Is there a solution to fix it?</p> <pre><code>&lt;form action="" method="Post"&gt; ........ if(isset($_POST...
<p>Try changing the url with <code>header</code>.</p> <pre><code>header("Location: yoururl.php?success=true"); </code></pre> <p>Maybe try it like this:</p> <pre><code>if (isset($_GET['success'] &amp;&amp; $_GET['success']=="true") { echo "Your data has changed."; } </code></pre>
restore checkpoint in order to retrain new class <p>I have a checkpoint which is trained with 11 classes. I added one class to my dataset and trying to restore it in order to retain the CNN but it gave me an error related to shape because the previous one was trained with 11 classes and actually have 12 classes, did i ...
<p>I believe the problem is you need to remove this one from w_b then save it then restore it as you're doing.</p> <p>Remove this:</p> <pre><code>'weight_4': tf.Variable(tf.random_normal([num_hidden, num_labels], stddev=0.1)), </code></pre> <p>Then it should work. Main reason is that you're changing number of label...
Script to create an insert SQL <p>I'm trying to create a script that concatenate various values that in the end it creates a insert script,i'm already made one.</p> <pre><code>INSERT INTO #SCRPTS SELECT getdate(), 'INSERT WKF_TpProcesso VALUES (''' + Des_TpProcesso + ''',' + cast(Cod_Func as Varchar(8)) + ',getdat...
<p>your case expression needs an <code>END</code></p> <pre><code>CASE WHEN DT_Alteracao IS NULL OR DT_Alteracao = '' THEN 'NULL' ELSE '''''' END </code></pre>
CSS override, first loaded style sheet taking precedent <p>I have a very strange issue I cannot quite figure out with my css style sheets. I have 2 stylesheets, one is from a cdn, one is minified then injected onto my index.html (locally) on my local dev server right now. So just for a quick reference, in my header I h...
<p>I'm really not sure what caused the behavior you describe (If you have the exact same "priority" of css rule - the latter will win), however a simple way to fix your problem is to duplicate the class in your css definition. If you want the <code>styleThis</code> class to take over you can use:</p> <pre><code>.style...
How do I determine what zone is already loaded? <p>I have an angular final app that loads lots of routes and modules. I started getting a "Zone is already loaded" error in the console and now I'm getting it twice. </p> <p>I've looked at the zone object to try and figure out what is going on, but that is almost imposs...
<p>I assumed that this error meant that some given zone was already loaded. It appears that this means that "zone.js" had already been loaded. When I switched to Angular-cli, its already loaded in the angular-cli-build.js. So removing it from the index.html solved the problem.</p> <p>I'm posting this in case anyone...
PHP: How do I print the key from array only once and every value for each item? <p>So here's my code:</p> <pre><code>foreach ($result-&gt;devices as $device) { $flag = false; foreach ($device as $key =&gt; $value) { if(!$flag){ var_dump($key); $flag = true; } var...
<p>So, I suppose, your data looks kind of like this?</p> <pre><code>$result = (object)[]; $result-&gt;devices = [ ['deviceId' =&gt; 1, 'description' =&gt; 'desc1', 'status' =&gt; 'status14'], ['deviceId' =&gt; 2, 'description' =&gt; 'desc2', 'status' =&gt; 'status15'], ['deviceId' =&gt; 3, 'description' =...
Data from Android Notification of WhatsApp or any other Application <p>I want to take data of <strong>whatsapp message</strong> coming in my Android from Notification bar Is it possible to get this</p>
<p>You need to create a service to listen to incoming notifications by extending <code>NotificationListenerService</code> in which, you'll have a method call back :</p> <pre><code>@Override public void onNotificationPosted(StatusBarNotification sbn) { .... } </code></pre> <p>Where you'll get all the data inside...
Javascript variable, set to HTML object, always returns null <p>I need to display a dialog box based on user input, and I'm implementing the Zebra dialog plug-in to help with this.</p> <p>I can get a generic dialog to show up when the user clicks a button, but no matter what I do, I can't get the Javascript to see the...
<p>You element is a input so innerText will not work.</p> <p>Instead of </p> <pre><code>var myInputElement = document.getElementById("myTyping"), myInput = myInputElement.innerText; </code></pre> <p>try</p> <pre><code>var myInputElement = document.getElementById("myTyping"), myInput = myInputEle...
How to forward URLs in TomCat <p>We are moving a website from IIS to TomCat. For HTTPS, IIS uses port 443, but we are told that TomCat uses port 8443. Can you tell TomCat to use port 443 or do we need to do a redirect from port 443 to port 8443? Ultimately, we want to allow the user to be able to enter the following:</...
<p>If ports 80 and 443 are not still in use, you can change the default ports 8080 and 8443 in [Tomcat]/conf/server.xml:</p> <pre><code>&lt;Connector port="80" protocol="HTTP/1.1" redirectPort="443" connectionTimeout="20000"/&gt; &lt;Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="443" ma...
scala.. parse a message into various fields <p>In Scala, I want to parse each message (of length=20) into individual units. The message will be appended to the end of previous message without a newline character. I tried the below, but any optimizations and improving performance are welcome</p> <pre><code>/* Length.. ...
<p>You can do this quite nicely with a regular expression:</p> <pre><code>val messages = "101Jim Portland990Y102JamesHouston 990X103John Boston 880Y" val RecordPattern = """(\d{3})(.{5})(.{8})(\d{3})(.)""".r val records = messages.grouped(20).map { case RecordPattern(id, name, city, port, ind) =&gt; (id, name, c...
Kafka cluster unavailable if a node in Zookeeper cluster dies <p>I am configuring a Kafka cluster of 3 brokers. The cluster makes use of a Zookeeper cluster of 3 nodes.</p> <p>Using Docker, this is how I started my 3 Zookeeper nodes:</p> <pre><code>docker run --net=my_network --name zoo1 -d -e ZOO_MY_ID=1 -e ZOO_SERV...
<p>As the exception says, the host names may not be resolvable from where you are running create topic command. Try ping to zoo1, zoo2, zoo3 to check if they are resolving to correct IPs.</p> <p>I don't think it is a Kafka problem. But Zookeeper host name resolution may not be happening correctly. I would suggest fir...
image disappears when styling class to make a round image <pre><code>class RoundImage: UIImageView { override func awakeFromNib() { super.awakeFromNib() setupView() } ... func setupView() { self.layer.borderWidth = borderWidth self.layer.borderColor = borderColor ...
<p>When this code gets run the view hasn't been sized yet, so the width is incorrect. Try putting a listener on frame:</p> <pre><code>override var frame : CGRect { didSet { layer.cornerRadius = frame.size.width / 2 } } </code></pre>
how to launch event on specific cell in datagradview <p>The <code>datagridview</code> has an event that will be lunched on <code>CellLeave</code> any cell within the <code>datagridview</code> what I really need is to lunch on <code>CellLeave</code> on specific cell</p> <p><strong>Example</strong> </p> <p>I have <code...
<p>I don't believe you can have the event handled for only specific cells. What you will have to do is just have the CellLeave event for each cell and then in the event handler only do the processing for the cells you want.</p> <pre><code>void datagridview1_CellLeave(object sender, DataGridViewCellEventArgs e) { /...
JS - My loop and if statements print out the wrong string? <p>My loop seems to print out the wrong string. I need 15 to print out fizzbuzz. To me it seems that it should. </p> <pre><code> var numbers = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]; for (i=0; i &lt; numbers.length; i++) if (numbers[i]%3 =...
<p>That's because you wrote <code>numbers % 5</code> instead of <code>numbers[i] % 5</code> at line 4.</p> <p>As a general rule, it's important to store your iterator in a variable, to avoid this (and cache the value instead of retrieving it every time). Use <code>for..of</code> ES6 syntax if you can, it makes things ...
Reactjs onClick: how to set state of clicked buttons in a list <p>I have a list of buttons and I'm trying to figure out how to get <code>state</code> of each button that was selected like so (so at any one time I know which button(s) has/have been clicked):</p> <pre><code>// this.state.selectedTransport: { car: true, ...
<p>The main idea is to have the <code>handleClick</code> function in a parent component, and then you call it in your child component to update your parent's state and then pass it as props to your different children. I followed your existing structure and it resulted in something like this: <a href="http://jsbin.com/b...
Laravel Auth - Redirect on Login <p>I have a small Laravel 5.2 project that I'm working on. I've used the built in auth package to handle the login for this proof of concept. However when I login it redirects me to the <code>/</code> route even after setting the following.</p> <pre><code>protected $redirectTo = '/spec...
<p>Add below line to AuthController</p> <blockquote> <p>Auth/AuthController.php</p> </blockquote> <pre><code>protected $redirectPath= '/specialRoute'; </code></pre> <p>This redirect path will be used for successful login and successful register.</p> <p>Overriding the postRegister function should work too. You wou...
How to do INSERT INTO SELECT and ON DUPLICATE UPDATE in PostgreSQL 9.5? <p>I'm trying to to do the following in PostgreSQL</p> <pre><code>INSERT INTO blog_sums ( blog_id, date, total_comments) SELECT blog_id, '2016-09-22', count(comment_id) as total_comments_update FROM blog_comments WHERE date = '2016-09-...
<p>You cannot access the column aliases from the select in the <code>DO UPDATE SET</code> clause. You can use the <code>excluded</code> table alias which includes all rows that failed to insert because of conflicts:</p> <pre><code>INSERT INTO blog_sums ( blog_id, date, total_comments) SELECT blog_id, '2016-09-22',...
Writing a table with values for several years as a dictionary? <p>I have a table I want to write as a Python code, but I'm stuck and can't figure out how to do it.</p> <p>I have a table with data for two years (1991 and 1992), and different values for each year (men: 35 (1991) and 42 (1992), women: 38 (1991), 39 (1992...
<p>I would suggest something like the following:</p> <pre><code>people = {'1991':{'men':35, 'women':38, 'children':15}, '1992':{'men':42, 'women':39, 'children':10}} </code></pre> <p>Then you can access specific example data using:</p> <pre><code>print(people['1991']['men']) </code></pre> <p><strong>EDIT<...
ssrs percentage of a total with column groups <p>I apologize in advance if this is not enough info or if it is confusing (This is my first post to the forum and it's a little hard to explain what i'm trying to do). I have been researching this for a couple days now. This article comes really close to what i need, but...
<p>Try:</p> <pre><code>=CountDistinct(Fields!ID.Value) / CountDistinct(Fields!ID.Value, "Company") </code></pre> <p>I removed the <code>Primary_Payor</code> scope leaving the function calculate the count in the cell scope <code>Primary_Payor</code> and <code>DOS_YrMo</code>.</p> <p><strong>UPDATE:</strong></p> <pre...
How do I format a scientific number into decimal format in Python? <p>I'm having trouble trying to convert the results of my "def pricing(question)" function into decimal values instead of scientific.</p> <p>I tried converting the result to a string but that didn't work and I can't see anyway of formatting the pricex ...
<p>You need to use a formatting string.</p> <pre><code>&gt;&gt;&gt; import math &gt;&gt;&gt; print(math.pi) 3.141592653589793 &gt;&gt;&gt; print("{:.2f}".format(math.pi)) 3.14 </code></pre>
CodeFluent vs Interop.MSScriptControl.dll <p>We had a 32 bits service that we are trying to migrate to 64 bits.</p> <p>We were using <code>Interop.MSScriptControl.dll</code> to evaluate vb script written by users.</p> <p>Since there is no 64 bits version of the <code>MSScriptControl</code>. I created a process that w...
<p>I made it work by passing the parameters to the function instead of using the <code>SetNamedItem</code> function.</p> <pre><code>public class VBScriptEvaluator { public static dynamic Evaluate(string key, string script, IDictionary&lt;string, object&gt; parameterValuePair = null) { try { ...
Symfony fixtures - is it possible to 'dummy' create dates? <p>I have fixtures that I am trying to create that are dependent on other entities createDT stamps. However, I'm unable to 'spoof' these as I use <code>@prepersist</code> to populate the createDT fields in my entities. I have quite a lot of entities that are in...
<p>One solution could be assign the date in <em>constructor</em> method:</p> <pre><code>public function __construct() { $this-&gt;createDT = new \DateTime(); } </code></pre> <p>Thus, when your fixtures are loaded this date is overridden.</p>
Laravel 5.2 Cron Job Doesn't Work Automatic <p>This is my kernel : </p> <pre><code>protected $commands = [ Commands\AdvertiseTasks::class, ]; protected function schedule(Schedule $schedule) { $schedule-&gt;command('advertise:delete')-&gt;everyMinute(); } </code></pre> <p>This is my Command Handle</p> <pre><...
<p>You need to actually register the cronjob. All you're doing is running it once.</p> <p>It's always worth checking the documentation, as your solution is actually in it:</p> <p><a href="https://laravel.com/docs/5.2/scheduling" rel="nofollow">https://laravel.com/docs/5.2/scheduling</a></p>
protractor :how to select an element using xpath <p>i have this HTML <a href="http://i.stack.imgur.com/ZkQMQ.png" rel="nofollow">Html</a></p> <pre><code>&lt;span aria-controls="APInvoicePaymentTerms_listbox"&gt; </code></pre> <p>and i'm trying to click on this element using this code :</p> <pre><code> ele...
<p>The logic is correct. There is a typo</p> <pre><code> element(By.xpath("//span[@aria-controls='APInvoicePaymentTerms_listbox']")).click(); </code></pre>
How do I use Swift 2.3 to build my project instead of Swift 3 in Xcode 8? <p>I recently updated my <code>Xcode</code> and because of this I can't build my app. I googled a couple of solutions and found out that I need to install a toolchain to use <code>Swift 2.3</code> instead of <code>Swift 3</code>. And to install a...
<p>Your project is in Swift 2.2, not Swift 2.3. When you go to the convert menu, you'll have the option of a choosing between Swift 2.3 and Swift 3. Pick Swift 2.3 and run the conversion. </p>
Android Studio - Error:Unable to load class 'org.slf4j.LoggerFactory' <p>I'm new in the Android world. I opened studio Android 2.2 and, after creating a new project, I get this error message:</p> <blockquote> <p><strong>Failed to sync Gradle project '...'</strong></p> <p>Error:Unable to load class 'org.slf4j.Lo...
<p>I solve this by following steps</p> <pre><code>1. download the newest version of gradle in this site: [http://download.csdn.net/download/fallingwind/9604349][1] 2. replace folder "disk-label://android-studio/gradle" with the download file(unarchive first). 3. restart AS 4. if it doesn't work, you can change t...
Backpropagation not working for XOR <p>I've been learning about backpropagation the last two weeks, did the math behind it and thought that I understand the topic well enough for my own implementation (without any linear algebra packages etc). Apparently, I was wrong. Below you can find the most simple example network ...
<p>I've taken another look and the code, and played around with some parameters, and it turns out that all of the code is actually correct.</p> <p>The problem is, with only 2 hidden nodes, this problem is rather difficult to learn, and the number of epochs you used (1000) combined with the learning rate you used (0.1)...
AngularJS scope variable not being set within promise <p>I have this code that I'm using with CartoDB. It's suppose to run a query using their JS library and then return some data. I'm adding up some results <em>and it works inside the done() function</em>. Though the second I try use/set the result as a scope variable...
<p>Anything you want to do with the data returned from your DB call must be done INSIDE the done function. I think you understand that, but what you are missing is the order of operations. Use a debugger to see the actual order in which the code is executed:</p> <pre><code>var sql = new cartodb.SQL({user: 'wkaravites'...
bash script to create folders and move files <p>I have many files created from a simulation.<br> Like this: res_00001.root through res_09999.root. </p> <p>I would like to create a series of folders that move in batches of 1000 files in sequence to a newly created folder based on the filename we are moving. e.g. fol...
<p><strong>Updated Answer</strong></p> <p>You can run this little script if you can't find the <code>rename</code> program - make backup first!</p> <pre><code>#!/bin/bash shopt -s nullglob nocaseglob for f in *.root; do n=$(tr -dc '[0-9]' &lt;&lt;&lt; $f) ((d=(10#$n/1000)+1)) [ ! -d folder$d ] &amp;&amp; mkd...
JQuery AJAX - Populating a textbox and dropbown box <p>This is my first time using JQuery AJAX so I’m not very familiar with the syntax. Right now I’m pulling a set of values from a database and populating a dropdown box. What I need AJAX to do is populate three other fields with hardcoded information when they mak...
<p>"success" is for passing in a callback handler. You can implement the handler with either an anonymous function or a named function. The syntax you have is illegal and does neither.</p> <p>Read up on anonymous functions: <a href="http://www.w3schools.com/js/js_function_definition.asp" rel="nofollow">http://www.w3sc...
Socket comunication between Java web app and C++ Server <p>I need to talk to a C++ application running as a server on a given port. It exposes a binary API(Protocol Buffer) for better performance. My RESTful service is developed in Spring MVC and Jersey and would like to use this new feature. I have been able to consum...
<p>After great pain I was able to resolve the issue. The class which was handling the read/write to the socket was defined as prototype. So once a reference to the socket was retrieved it was not cleared up(managed by Tomcat). As such subsequent calls to the socket gets queued up, which then times out and the object is...
How to return java list in HSQLDB stored procedure? <p>I am trying to return custom list from my stored procedure in hsqldb Below is the sample code, can anyone please help how to return java list in HSQLDB stored procedure?</p> <pre><code>CREATE TYPE list EXTERNAL NAME 'java.util.List' LANGUAGE JAVA; CREATE PROCEDUR...
<p>You cannot return a <code>java.util.List</code> from a procedure.</p> <p>Define the OUT parameter as <code>OUT out_column_name VARCHAR(100) ARRAY</code> or any array of a supported HSQLDB type (excluding LOB types).</p> <p>The <code>com.mypackage.name.getList</code> must then return a java.sql.Array object. You ca...
How to use custom templates with Angucomplete-alt? <p>I'm working on a front-end application with ES6 and Angular. I'm trying to create a searchbox with autocomplete, and I want to use a custom template for the options list using <a href="https://github.com/ghiden/angucomplete-alt" rel="nofollow">Angucomplete-alt</a>.<...
<p>I have solved it. I copied the template's code from the html code of the examples page:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="angucomplete-ho...
ggplot mixture model R <p>I have a dataset with numeric values and a categorical variable. The distribution of the numeric variable differs for each category. I want to plot "density plots" for each categorical variable so that they are visually below the entire density plot. </p> <p>This is similiar to components of ...
<p>Do you mean something like this? You need to change the scale though.</p> <pre><code>ggplot(iris, aes(x = Sepal.Width)) + geom_density(aes(y = ..count..)) + geom_density(aes(x = Sepal.Width, y = ..count.., group = Species, colour = Species)) </code></pre> <p>Another option may be</p> <pre><...
Loop local storage object in javascript <p>I'm developing a shopping cart with local storage, I declare the local storage</p> <p><code>var cart = {}; cart.products = []; localStorage.setItem('cart', JSON.stringify(cart));</code></p> <p>and add the products with AJAX from a data array with products details on a <cod...
<p>Result from <code>localStorage</code> data you expect is an array which is the value of "products" property of returned object.</p> <p>For this reason, I would try:</p> <pre><code>$.each(retrievedData.products , function (i, item) { ... }); </code></pre>
knockout 3.4 select bootstrap selectpicker <p>Why initial value selectPicker doesn't work with Knockout version 3.4? With Knockout 3.0 works.</p> <pre><code>&lt;select data-bind="selectPicker: teamID, items: teamItems, optionsText: 'text', optionsValue : 'id'"&gt;&lt;/select&gt; &lt;div&gt;Selected Value(s) &lt;d...
<p><em>Updated answer</em>:</p> <p>Instead of wrapping all the options binding functionality, you can just use the <code>options</code> binding, which will do all of that correctly:</p> <pre><code>&lt;select data-bind="selectPicker:true, options:teamItems, value:teamID,optionsText:'text',optionsValue:'id'"&gt;&lt;/se...
cython: run prange sequentially (profiling/debugging) <p>I have a meanwhile pretty large code base written mostly in Cython. Meanwhile, I've started parallelizing it by replacing "range"s by "prange"s. (So far more or less at random, as I still have to develop a gut feeling as to where I really profit from this and whe...
<p>There's at least three very easy ways:</p> <ol> <li><p><code>prange</code> takes a <code>num_threads</code> argument. Set that equal to 1. This gives you local control.</p></li> <li><p>If you compile without OpenMP it'll still still run, but not in parallel. Remove <code>extra_compile_args=['-fopenmp']</code> and <...
Warning message running Play - activator eclipse <p>I downloaded play framework from here:</p> <p><a href="https://www.playframework.com/download" rel="nofollow">https://www.playframework.com/download</a></p> <p>And I chose the Offline Distribution download.</p> <p>I set the path environment variable and added this:...
<p>You will need to add <code>sbteclipse</code> for that to work. In your <code>project/plugins.sbt</code> file, add the following:</p> <pre><code>addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0") </code></pre> <p>Then compile your app first (<code>compile</code> in the activator shell). Then yo...
TensorFlow's perceptron gives unexplaineble output <p>I'am new to TF: I took perceptron's code from this tutorial on MNIST(actually, its not necessary to follow this link) :<a href="https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/multilayer_perceptron.py" rel="nofollow">https:...
<p>Your code is notably messy, so I've removed a lot of redundant pieces:</p> <pre><code>from __future__ import print_function import numpy as np import tensorflow as tf X_train = np.array([[ 10.], [ 10.], [ 11.], [ 6.], [ 8.], [ 9.], [ 22.], [ 14.], [ 6.], [ 8.], [ 11.], [ 9.], [ 13.], [ 7.], [ 13.], [ 7.], [ 13....
Angular2 Forms disable control in component with a data-bound value <p>I am disabling controls when the user is not in edit mode.</p> <pre><code>this.theForm = this.builder.group({ name: [{ value: this.model.name, disabled: !this.isEditMode}, Validators.required], }) </code></pre> <p>When they change to edit mode ...
<p>You can subscribe to the control change and update it there, something like this (off the top of my head):</p> <pre><code>ngOnInit() { for (let nut of this.userSettings.nutrientData) { this.foodSettingsForm.controls[nut.abbr].valueChanges .subscribe(v =&gt; { this.completeValueCha...
How long do IBM-Graph authorization tokens last for? <p>In IBM-Graph, in order to avoid excessively long authorization for each request we request a session token first, and send that along in the headers of any subsequent requests. Exactly as explained in the documentation.</p> <p>In order to persist this single tok...
<blockquote> <p>How long do these session tokens last for?</p> </blockquote> <p>IBM Graph tokens are intended to last for a long while - you should expect somewhere around a day, though it's subject to change. It shouldn't ever be shorter than an hour.</p> <blockquote> <p>Is our current method of distributing thi...
how to debug javascript element (like a button) <p>It sound like a simple debug question but I cannot find the solution. </p> <p>On a web browser like chrome, in the dev panel, I would like to inspect an element (like a button) and then ask chrome to find the corresponding javascript events on the page / file (in orde...
<p>go to sources, on the right side you'll see a dropdown called Event Listener Breakpoints, expand Mouse Events and select click, when you click on your Dom button, dev tools will go into debugging mode inside the first function called after the click event, you can also choose more events other than click</p>
How Can I add a div to the right of my responsive divs? <p>I basically want the label "div 1" to show on the right of the divs I have no matter what but to remain responsive. Is there a good way to do this?</p> <p>I can't see to get a wrapper that still retains the responsiveness I want.</p> <p><div class="snippet" d...
<h1>Solution 1: Float</h1> <p>Instead of using flexbox, consider using <code>display: inline-block</code> to order your divs. This has two advantages: </p> <p>1) it has slightly better cross-browser support than flexbox (see: <a href="http://caniuse.com/#search=flexbox" rel="nofollow">caniuse on flexboxes</a>), in th...
Regex Search in Python: Exclude port 22 lines with ' line 22 ' <p>My current regex search in python looks for lines with <code>' 22 '</code>, but I would like to exclude lines that have <code>' line 22 '</code>. How could I express this in <code>Regex</code>? Would I be <code>'.*(^line) 22 .*$'</code></p> <pre><code>i...
<p>You current requirement to find a line that <em>contains</em> <code> 22 </code> but does not contain <code>line 22 </code> can be implemented without the help of a regex. </p> <p>Just check if these texts are <code>in</code> or are <code>not in</code> the string inside list comprehension. Here is a <a href="http:/...
inject utility services to jasmine test <p>This question is not about including a service to test or to provide a mock that replaces a service.</p> <p>Situation:</p> <p>The Factory I'd like to test is about parsing a set of properties and provide this information via getter functions. The following pseudocode describ...
<p>If your UtilService is a factory, you can inject the service into every test with the before each</p> <pre><code>beforeEach(function() { module('app'); var UtilService; inject(function(_UtilService_) { UtilService = _UtilService_; }); }); </code></pre> <p>The way jasmine sets up tests, ...
Dynamic parameter for bit field on where clause in SQL Server stored procedure <p>Trying to write a SQL Server stored procedure that accepts an input parameter for a bit column that is used in the <code>WHERE</code> clause. </p> <p>Based on the parameter sent to the stored procedure, I want the procedure to be able t...
<p>Try this:</p> <pre><code>CREATE PROC TESTSP @inputParm BIT = NULL AS BEGIN Select field1 ,field2 ,field3 From table1 WHERE (field1 = @inputParm OR @inputParm IS NULL) END </code></pre>
How to tell the version number of RxJS <p>How to tell the version of the installed RxJS from the code? For example:</p> <pre><code>var Rx = require('rxjs/Rx'); console.log(Rx.rev); // undefined console.log(Rx.version); // undefined </code></pre> <p>Second question: How to tell if it's rxjs5 ?</p>
<p>You could do something like:</p> <pre><code>const package = require('rxjs/package.json'); const is5 = /^5\./.test(package.version); console.log(package.version); console.log(is5); </code></pre>
Parsing Coldfusion JSON using javascript function - Uncaught ReferenceError: WddxRecordset is not defined <p>I am attempting to parse Coldfusion JSON data to make it look "normal" ColdFusion json:</p> <p><code>{"ROWCOUNT":3,"COLUMNS":["ROWID","REL","DATE","FOA","TITLE","APPRECEIPE","OPENING","KEYWORDS","DOC","PURPOSE"...
<p>Have you considered converting the ColdFusion JSON data back to a ColdFusion Query object and then reconverting it back to json using <a href="https://github.com/CFCommunity/jsonutil" rel="nofollow">JSONUtil</a>?</p> <p>JSONUtil has better JSON support for CF7-2016 with "strictMapping" &amp; "serializeQueryByColumn...
Txt to 2 different arrays c++ <p>I have a txt file with a lot of things in it. The lines have this pattern: 6 spaces then 1 int, 1 space, then a string. Also, the 1st line has the amount of lines that the txt has.</p> <p>I want to put the integers in an array of ints and the string on an array of strings.</p> <p>I ca...
<p>Just to start I'm going to provide some tips about your code:</p> <ul> <li><p><code>int size = size();</code> Why do you need to open the file, read the first line and then close it? That process can be done opening the file just once.</p></li> <li><p>The code <code>string words[size];</code> is absolutely not lega...
Select checkbox from array values in AngularJS <p>I have created a page which contains some text boxes, radio buttons and check boxes. I am using this page to save new data or edit the existing one. I am able to save new data but for editing the data, the page should show some predefined values that it is getting from ...
<p>As "activity" is an object, indexOf is not right way to find the index. I have made few changes to your code</p> <p><strong>html</strong></p> <pre><code> &lt;input type="checkbox" ng-true-value="activity" ng-checked="checkInSelectionList(activity)" ng-click="toggleSelection(activity)"/&gt; ...
Apache Lucene FileNotFoundException on startup due to bad process stop <p>Answered</p> <p>Client was not able to start the application after doing maintenance; either a deployment of a new WAR or a simple update of properties. On start during the bean initialization, they would receive the following:</p> <pre><code>...
<p>Determined root cause was the way the client developed their application stop shell script, which was issuing a SIGKILL/"kill -9" which terminated the application server while Lucene was in the middle of updating the index.</p> <p>Instead, using SIGTERM/"kill -15" to signal the application is how we were doing it i...
Extract values from nested list of summary(aov()) into a dataframe <p>I am running a simple one-way ANOVA across multiple groups within a single data frame.</p> <p>Dataframe available here: <a href="https://www.dropbox.com/s/6nsjk4l1pgiwal3/cut1.csv?dl=0" rel="nofollow">https://www.dropbox.com/s/6nsjk4l1pgiwal3/cut1.c...
<p>You can use the package <code>broom</code> in combination with <code>dplyr</code> to apply <code>Anova</code> by <code>Measurement</code>, and assign the output to a <code>data.frame</code> in a tidy format.</p> <pre><code>library(broom) library(dplyr) summaries &lt;- cut1 %&gt;% group_by(Measurement) %&gt;% ...
How to defer background images without jQuery or lazy loading <p>Based on Patrick Sexton <a href="https://varvy.com/pagespeed/defer-images.html" rel="nofollow">tutorial</a>, I would like to defer background images in the same way I do here with <code>img</code>:</p> <pre><code>&lt;img src="data:image/png;base64,R0lGOD...
<p>You can just do the same idea but instead of source you change the background in the init function</p> <pre><code>&lt;div id='my-div' style="" data-src="your-image-here"&gt;&lt;/div&gt; &lt;script&gt; function init() { var backgroundDefer = document.getElementById('my-div'); if(backgroundDefer.getAttribute('da...
Code faster with unnecessary conditional? <p>I have the following java function, to count common elements in two sorted arrays. Note the line with the question mark.</p> <pre class="lang-java prettyprint-override"><code>public static int overlap(int[] a, int[] b) { int i = 0, j = 0; int res = 0; while(i ...
<p>Possibly JIT swapping order of "if"s to get best performance but cannot swap order of just "else"(without an "if") with another "if" at the beginning, so when you added "if" after "else", it tried it as a first check, and if array overlapping is like %90, then it could keep that last "if" at the first place.</p> <p...
SSL: :certify: ssl_handshake.erl:1507:Fatal error: certificate expired <p>Trying to update dependencies on a phoenix app by running: <code>mix deps.get</code></p> <p>The only STOUT is:</p> <pre><code>07:20:21.642 [error] SSL: :certify: ssl_handshake.erl:1507:Fatal error: certificate expired 07:20:21.674 [error] SSL...
<p>Since the certificate for repo.hex.pm is not expired in reality but is very recently issued the error message might be cause by a wrong time on your computer. Thus make sure that you have the current time on your system and try again.</p>
How do I make a Notification stay open until the user closes it? <p>Is there a setting that will allow me to keep a Notification open until a user clicks it? </p> <pre><code> if (("Notification" in window)) { Notification.requestPermission(function() { ...
<p>According to the docs there is a boolean <code>requireInteraction</code>:</p> <blockquote> <p>A Boolean indicating that on devices with sufficiently large screens, a notification should remain active until the user clicks or dismisses it. <a href="https://developer.mozilla.org/en-US/docs/Web/API/notification" r...
Shifting Math.ceil in Java <p>I want to perform a ceiling function on a number (33.1504352455) so that it returns 33.16. When using ceiling, of course, it returns 34.0. How would I shift the character that the ceiling is acting on so that it returns 33.16?</p>
<p>You could try</p> <pre><code>number = Math.ceil(oldnumber * 100) / 100.0; </code></pre> <p>But this could be subject to the vagaries of floating point math. </p>
gson field with same name but different type ie Object and Array <p>I want to parse a json like below using GSON.Please guide how to achieve this using GSON as the student field is used as a object as well as array,how should i define my pojo and how to parse this type of json.</p> <pre><code>{ "school": [ { ...
<p>You can easily generate POJO java classes with this service: <a href="http://www.jsonschema2pojo.org/" rel="nofollow">http://www.jsonschema2pojo.org/</a></p> <p>For your json it generates:</p> <pre><code>-----------------------------------com.example.School.java----------------------------------- package com.exam...
The email address is badly formatted Firebase <p>hi i am working on a android project where i am using firebase as back-end and i am building a signup and login form . When ever i sign up the code is working well and . When i try to retrieve it using "<code>signInWithEmailAndPassword</code> i am getting the fallowing e...
<p>Your code to set <code>email</code> is incorrect. You are setting <code>email</code> to the value of the <code>EditText</code> for <code>password</code>.</p> <p>In method <code>CheckLogin()</code>, change:</p> <pre><code>String email = mloginPassField.getText().toString().trim(); </code></pre> <p>to:</p> <pre><...
error incorporating a select within a IFNULL in MariaDB <p>I'm creating a view in MariaDB and i'm having trouble making it work for a couple of fields. Currently this is working:</p> <pre><code> ( SELECT DISTINCT IFNULL(grades.`grade`,'No Grade') FROM `table` grades WHERE userinfo.`id` ...
<p>This looks like a subquery:</p> <pre><code>(SELECT DISTINCT IFNULL(grades.`grade`, SELECT IF( EXISTS (SELECT * FROM `another_table` WHERE userid = 365 AND courseid = 2 ...
SystemJS vs Webpack for Angular 2 applications <p>We are starting a new Angular2 SPA and I am looking into whether to use SystemJS as described in the Angular Quickstart tutorial (<a href="https://angular.io/docs/ts/latest/quickstart.html" rel="nofollow">https://angular.io/docs/ts/latest/quickstart.html</a>) or Webpack...
<p>I'm using angular-cli for 6 months now, and the change to webpack was the best decision they could make. It builds faster, is so much easier to work with than SystemJS (almost no configuration on my part), supports bundling, tree-shaking, lazy-loading and so much more.</p> <p>The tool is getting better every month...
Nesting ember acceptance test helpers in "andThen" <p>I've always written ember tests like this:</p> <pre><code>test('should add new post', function(assert) { visit('/posts/new'); fillIn('input.title', 'My new post'); click('button.submit'); andThen(() =&gt; { assert.equal(find('ul.posts li:first').text(...
<p>Some of the reasons you would nest are</p> <ul> <li>If the tests that follow are dependent on the initial tests</li> <li>If a particular sequence is needed </li> </ul> <p>I personally prefer nesting along with <code>assert.async()</code></p> <p>Eg:</p> <pre><code>test('should add new post', function(assert) { ...
Display radio-buttons created in Js as a list-item (vertical list) <p>I cannot figure out how to display vertically the radio-buttons with labels I have created dynamically with javascript. My radio-buttons appear in-line. Here is my code... CSS / display: list-item; does not work... Thanks for you help !</p> <pre><co...
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>function addradiobutton() { var result="" for(i=0;i&lt;3;i++){ result+="&lt;label&gt;" + i + "&lt;/label&gt;&lt;input type='ra...
Handler from a non-Activity class <p>Can we execute</p> <pre><code>handler.postDelayed(runnable,400) </code></pre> <p>from a non-<code>Activity</code> class?</p> <p>I have a controller class, assume it as an adapter. Can we use <code>Handler</code> there?</p> <p>I tried by debugging my app using break points, but t...
<blockquote> <p>Can we execute <code>handler.postDelayed(runnable, 400)</code> from a non-<code>Activity</code> class?</p> </blockquote> <p>Yes, you can.</p> <p>Any <a href="https://developer.android.com/reference/android/os/Handler.html" rel="nofollow"><code>Handler</code></a> is associated with a <a href="https:/...
"Missing closing paranthesis" MySQL error <p>I am trying to run a query that will show the rounded average to two decimal places. This is my code and I don't know why I keep getting the error.</p> <pre><code>SELECT ROUND(AVG (Scholarship, 2)) AS 'Average Scholarships' FROM student; </code></pre>
<p>You are passing <code>Scholarship, 2</code> to the <code>AVG</code> function, which only expects one argument.</p> <p>What you meant to do was pass <code>AVG (Scholarship)</code> and <code>2</code> to <code>ROUND</code>, like this:</p> <pre><code>SELECT ROUND(AVG (Scholarship), 2) AS 'Average Scholarships' FROM st...
Save color of the System.cmd output in placing it to IO in elixir <p>I have a pretty simple mix task, actually it wraps <code>npm</code> command and returns it output to the command line:</p> <pre><code>defmodule Mix.Tasks.JsLint do use Mix.Task @shortdoc "Runs javascript lint" def run(_args) do System.cmd(...
<p>The problem here is that most terminal applications use <code>isatty</code> (or equivalent) to check if stdout is an interactive shell, and disable colored output if it is, so that the escape sequences to change colors don't end up in your log files etc. I don't know of any simple way to spawn a process and make tha...
jQuery not working in a looped form <p>I have a looped form and each one has a submit button and i added javascript that when i clicked, it will not redirect to other page</p> <p>But when i try to submit javascript isn't working it redirected to other page I hope someone can help me</p> <p>These are my code from my l...
<pre><code>$(".&lt;?php echo $product-&gt;id; ?&gt;").click(function(event){ event.preventDefault(); $.post( $(".&lt;?php echo $product-&gt;prodname; ?&gt;").attr("action"),$(".&lt;?php echo $product-&gt;prodname; ?&gt; :input").serializeArray(),function(sv){alert(sv);}) clear(); }); </code></pre> <p>This ...
TCP Flow control Error <p>I am trying to implement one tcp stack. Following steps I have followed:</p> <ol> <li><p>TCP open:</p> <p>a. Client sent 'SYN' with a initial sequence no "C" and Ack no as "0" to server.</p> <p>b. Server responded with SYN + ACK with seq no "S" and ack no "C+1".</p> <p>c. Client send ACK+P...
<p>If you receive a segment with a sequence number higher than the next sequence expected, you should resend the last <code>ACK</code>. This tells the sender that some of the segments were lost, and it should immediately retransmit all the segments that are waiting for acknowledgement.</p> <p>A better solution would b...
youtube-dl python script postprocessing error: FFMPEG codecs aren't being recognized <p>My python script is trying to download youtube videos with youtube-dl.py. Works fine unless postprocessing is required. The code:</p> <pre><code>import youtube_dl options = { 'format':'bestaudio/best', 'extractaudio':True,...
<p>This is a bug in the interplay between youtube-dl and ffmpeg, caused by the lack of extension in the filename. youtube-dl calls ffmpeg. Since the filename does not contain any extension, youtube-dl asks ffmpeg to generate a temporary file <code>mp3</code>. However, ffmpeg detects the output container type automatica...
Webpack2 can't resolve file in pathname <p>I have having a strange issue I can't seem to resolve.</p> <p>I am getting this error:</p> <pre><code>Error: Can't resolve 'store/configureStore' in '/Users/samboy/company/oh-frontend/app' </code></pre> <p>My webpack file looks like this:</p> <pre><code> name: 'browser',...
<p>I'm guessing because you didn't post your app file, but can you change the import statement in the app file to "./store/configureStore"?</p>
Dockerized Node js app does not start <p>After dockerizing my demo Express js app and starting the container, I am unable to access the service due to a <code>"Connection Timeout"</code></p> <p>Url for the for project before dockerizing (<strong><em>Which produced "Hello world!" on the browser</em></strong>):</p> <pr...
<p>The <code>EXPOSE</code> instruction informs Docker that the container listens on the specified network ports at runtime. <code>EXPOSE</code> does not make the ports of the container accessible to the host.</p> <p>To do that, you must use either the <code>-p</code> flag </p> <p>Your <code>docker run</code> command ...
Locust result summary. How to understand Avg, Min and Max? <p>I use Locust, a load testing framework, and the following is the summary of a test result. </p> <pre><code>Name # reqs # fails Avg Min Max | Median req/s -------------------------...
<p><a href="https://github.com/locustio/locust/blob/master/locust/stats.py" rel="nofollow">Looking at the source</a>, it appears to refer to the response time</p>
h:panelGrid inconsistent allocation of cells <p>My page: ---</p> <p>Something is causing panelGrid to create an empty cell in several rows. </p> <p>I'd like to have a visible two column table, first column a label, second column an inputText element or a selectMenu with a tooltip.</p> <p>My workaround was this, crea...
<p>Thank you Kukeltje for this answer:</p> <p>h:panelGrid columns="3" signify "start new row after each third element"</p> <p>Thus, either put the watermarks (and other invisible elements) outside h:panelGrid, or use h:panelGroup to groups things that should only occupy one cell in the table: </p> <pre><code>&lt;p:r...
Convert JSON string date to JavaScript (Google Apps Script) <p>I am trying to convert a JSON string date (in Google Apps Script) to JavaScript date object and then check to see if that date is after another date but I can't get it to work.</p> <p>I tried using the suggestion <a href="http://stackoverflow.com/questions...
<p>First of all, if that is a copy of your json then your parse will not work because there are missing <code>,</code> in it.</p> <p>After correcting your json, then you can use the Arrays filter to get the flights after a certain date.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" ...
command line replacement with new value not working <p>I am very new to the perl Here is what I am doing I have input line like this I want to substitute the value of each line that matches with the string by passing variable name,variable value and replace value as input argumen...
<pre><code>$eachline=~/^$variable_name/ and /$variable_value/ </code></pre> <p>should be</p> <pre><code>$eachline=~/^$variable_name/ and $eachline=~/$variable_value/ </code></pre> <p>When the bind operator (<code>=~</code>) is not used explicitly to the left side of a regular expression, Perl implicitly binds it to ...
Oracle - Inconsistent datatype error when checking for null Date <p>I'm trying to write a case for when a <code>Date</code> is null but I keep getting this error:</p> <pre><code>ORA-00932: inconsistent datatypes: expected CHAR got DATE 00932. 00000 - "inconsistent datatypes: expected %s got %s" *Cause: *Action: <...
<p>Here the issue is with the return values from the <code>case when</code> statement</p> <pre><code>cr.COMPLETED_DATE is null then '--' </code></pre> <p>returns <code>string datatype</code> and</p> <pre><code>else cr.COMPLETED_DATE </code></pre> <p>returns a <code>date datatype</code>, hence the error </p> <block...
Binding of event in DataTemplate of WPF's TabItem's WebBrowser, MVVM <p>Question is: How to bind any event of WebBrowser to ICommand property in my View Model inside of ItemTemplate?</p> <p>When i am trying to do this using the Expression blend interactivity libraries in normal for MvvmLight way, an exeption ocurs:</p...
<p>Have foud an answer how to bind event in template or when using Expression blend interactivity libraries is impossible</p> <p>Attached property of ICommand type is other way through which you can achieve the same functionality.</p> <p>This answer can also be used for binding to not Routed events</p> <p>In my case...
Rails4 - validates_format_of :user_name.downcase not working <p>So in a model I'm validating new users and attempting to downcase their user name before it's saved.</p> <p>I thought this would work:</p> <pre><code> validates_format_of :user_name.downcase,:with =&gt; /\A[0-9a-zA-Z]*\z/ </code></pre> <p>Unfortunately ...
<p>I would go with a custom setter</p> <pre><code>def user_name=(value) self[:user_name] = value.downcase end </code></pre> <p>that way you are sure that you will always have a downcased string in user_name when you assign any string to it</p> <p>What's wrong in your code is that :user_name.downcase is actually th...
Dynamic Form with Dependent drop down <p>Hey Developers i'm building a application form where the user input data into the different fields. One part of the application is a dynamic form from <a href="https://github.com/wbraganca/yii2-dynamicform" rel="nofollow">https://github.com/wbraganca/yii2-dynamicform</a>. Now in...
<p>Updated for your case.</p> <p>What I did was I declared global variable in JS file <code>var i</code> and assigned <code>0</code>. After the first event is fired, I increase variable <code>i</code> by one. Now it contains 1 in memory. Next time it will take 1 and add 1 again. And so on: </p> <pre><code>var i = 0; ...
Im getting E/RecyclerView: No adapter attached; skipping layout and not returning the data, what am i doing wrong? <p>trying to make a searchview works, with php and mysql. user enters search query into search view/search bar to search for particular information, the query is sent to php file and result from php file i...
<p>Is there any chance that you are getting an exception while decoding the JSON and go directly to catch block, which skips the adapter initialization?</p> <p>If you'd like to avoid that I'd suggest you to create an empty adapter set it to the recycler view when the UI initializes(in onCreate() for example), after th...
PowerShell Convert output to hashtable array (data type conversion) <p>This a data type conversion issue.</p> <p>I am trying to get the names of computers out of SCCM and feed it into SCCM Report. The report commandlet receives hashtable where the variable must be named "Computer Name". The value is the computer name...
<p><code>Select-Object</code> will always output a <code>PSCustomObject</code>, not a hashtable.</p> <p>Just construct the hashtable inside the <code>ForEach-Object</code> body before calling <code>Invoke-CMReport</code>:</p> <pre><code>Get-CMDevice -CollectionName "My Collection Computers" |Select-Object -ExpandProp...