input
stringlengths
51
42.3k
output
stringlengths
18
55k
Show Dialog, on Fragment working <p>I have a Fragment and at its onStart(), I made a lot of BD querys, that are long for 15 seconds. I want to show a Progress Dialog, with a "loading circle". My app, has just one Activity, the Main. This, starts the first Fragment, and from this, I jump to other Fragment, and the same...
<p>You should try showing the dialog in <code>onCreateView()</code> since this is where the UI components are displayed in a <code>Fragment</code></p>
Where i should put data managers <p>What is good practice for put data persisters in one place. For now i put model.save() in every controller when i save this object. But i think it is not good resolve, because it can make code duplicates. I found in ember we have services <a href="https://guides.emberjs.com/v2.8.0/ap...
<p>Have you tried extending some base controller or maybe extending controllers with a mixin containing the actions and the logic? I think mixins would be the way to go for that. </p>
WPF TreeView "autowidth" over several items? <p>What is the right way to display columns in a tree view, that auto align their width to the width of the content. The problem that I see is, that each TreeViewItem is independent and therefor I don't know how to tell that eg the date column in every TreeViewItem shall hav...
<p>Use a <code>SharedSizeGroup</code></p> <pre><code>&lt;TreeView Name="treeView" Grid.IsSharedSizeScope="True" TreeViewItem.Expanded="TreeViewItem_Expanded" AutomationProperties.IsColumnHeader="True" AutomationProperties.IsRowHeader="True" AllowDrop="True" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStac...
A font with all the characters the same <p>I'm looking for a font which displays a  or a * for every character, in the same way. A totally unreadable font.</p> <p>Despite my efforts I couldn't find one on the internet. Is there a system font like this ? Or do you know one ?</p>
<p>As I doubt that such a font exists, an alternative could be to do your own <code>select</code>. Using the <code>data-*</code> attribute provided by <a href="http://www.w3schools.com/tags/att_global_data.asp" rel="nofollow">HTML5</a>, you can attach any additional information to any element. So, you can develop a sel...
Need help creating a somewhat odd Excel formula <p>I'm trying to create a formula that takes C2-B2 and uses the result to determine which cells to add together. So if the result is 2 it takes AA2 and AB2, adds them together, and displays the result. In other words, it counts cells stemming from a point and adds them, w...
<p>This doesnt sound recursive the way you describe it.</p> <p>Put this formula somewhere on the sheet and see if this is what you want:</p> <p><code>=SUM($AA$2:INDEX($AA$2:$XFD$2, 1, SUM($B$2:$C$2)))</code></p>
Best method to check from (JS) client side, if you are connected to server <p>We are making an application in React, and would like to check after xxx seconds from client end, that if we are connected to our server (WEB API's). I would like to know what is the best way to achieve this? The instant approach comes to m...
<p>Your approach sounds good. But, as I understand it, a web API is meant to be called asynchronously and is mostly stateless. Thus, trying to know if you are connected to your API feels weird to me.</p> <p>It would make more sense if you were connected to your server using a websocket, which pseudo real-time. Then, y...
How to scroll div-element acting as a chat window to its bottom? <p>I have prepared a <a href="https://jsfiddle.net/afarber/40wgdL8w/" rel="nofollow">jsFiddle</a> for my question:</p> <p><a href="http://i.stack.imgur.com/96QyA.png" rel="nofollow"><img src="http://i.stack.imgur.com/96QyA.png" alt="screenshot"></a></p> ...
<p>Following line is not giving height</p> <pre><code>var h = $('#chatDiv').attr('scrollHeight'); </code></pre> <p>Replace above line of code with </p> <pre><code>var h =$('#chatDiv').prop('scrollHeight'); </code></pre> <p>Rather than using input event you can put one condition on button click</p> <pre><code>$(doc...
CloudFront Invalidation doesn't work <p>I have the following image in an S3 bucket.</p> <pre><code>/images/thumbnails/654-thumb2.jpg </code></pre> <p>In my C# code, I've created an invalidation for that specific path. The validation runs as I verified it via the console and I see the following object path in the inva...
<p>Either you've missed something, or you've uncovered a bug!<br> Double check your origin and behavious to make sure you're pointing at the S3 path you think you are, then raise it with AWS support.</p>
xml to svg dynamically <p>I have been searching for months now about this subject, but I can't find anything about it. What I'm looking for: I have sheetmusic on my screen, which is xml converted to svg with javascript. Now I want to make buttons with which I can manipulate the SVG that's displayed on the screen. For ...
<p>I am currently working on a similar project. You have 2 approaches:</p> <ol> <li>Directly modify SVG (hmmm not cool if you have complex objects)</li> <li>Find out which SVG element is to be modified, find the corresponding id in the XML structure, modify the XML node, "recompile" XML to SVG.</li> </ol> <p>As a mor...
+= operator not working with string <p>I'm trying to produce a program that outputs the user's input in a form like this:</p> <p>input: word</p> <p>w</p> <p>wo</p> <p>wor</p> <p>word</p> <p>This incremental build-up doesn't seem to be working. </p> <pre><code>import java.util.*; public class SpellMan { public st...
<p>You are declaring <code>bword</code> inside the loop, so in each iteration you attempt to concatenate the current character to an uninitialized <code>String</code> variable.</p> <p>Try :</p> <pre><code>String bword = ""; for(int i = 0; i&lt; word.length();i++) { bword += word.charAt(i); System.out.println...
How to pass array list between activities <p>I have this array list and i parsing list item from json like this ,</p> <pre><code> List&lt;String&gt; imageUrls; imageUrls = new ArrayList&lt;&gt;(); JSONArray imageArray = response.getJSONObject(feedKey).getJSONArray(entryKey).getJSONObject(i).getJSONArray(i...
<p>You should implement <a href="https://developer.android.com/reference/android/os/Parcelable.html" rel="nofollow">Parcelable</a> in your class.</p> <p>Check this best <a href="https://www.amedeobaragiola.me/blog/2014/04/25/how-to-pass-customobjectarraylist-from-one-activity-to-another-using-parcelable/" rel="nofollo...
Is there a nullValue satisfy [nullValue] == []? <p>I have such program:</p> <pre><code>foo x = if x == 0 then [] else [x] </code></pre> <p>But I try to make it this way:</p> <pre><code>foo x = (:[]) $ if x == 0 then nullValue else x </code></pre> <p>I ...
<p><code>:</code> is the constructor for non-empty lists. Its result can never be an empty list, no matter which operand you apply it to.</p>
SELECTING DISTINCT values from two different COLUMNS of the same table <p>I have a sql table looks like this.</p> <pre><code>id name cname 1 Ash abc 2 Ash abc 3 Ashu abc 4 Ashu xyz 5 Yash xyzz 6 Ash xyyy </code></pre> <p>I want user to select a v...
<blockquote> <p>You may not need a 2nd Query and all those complexities if you do things a little differently. This means, you could achieve your goal using one single Query. The Code below demonstrates how. <strong>Note:</strong> This Solution uses JQuery to make things simpler. </p> </blockquote> <p><strong><em>To...
Why isn't there any cache for Image on iOS with RN 0.33 <p>I remember that RN has cache for Image component. I just find out that RN 0.33 has no cache for Image on ios at all...... the testing code is very simple.</p> <pre><code>import React, { Component } from 'react'; import { AppRegistry, Image } from 'react-nat...
<p>This is a bug that surfaced recently and is being fixed. Follow <a href="https://github.com/facebook/react-native/issues/9581" rel="nofollow">this issue</a>.</p>
Regex - replace word having plus or brackets <p>In Python, I am trying to do</p> <pre><code>text = re.sub(r'\b%s\b' % word, "replace_text", text) </code></pre> <p>to replace a word with some text. Using <code>re</code> rather than just doing <code>text.replace</code> to replace only if the whole word matches using <c...
<p>Just use <a href="https://docs.python.org/3/library/re.html#re.escape" rel="nofollow"><code>re.escape(string)</code></a>:</p> <pre><code>word = re.escape(word) text = re.sub(r'\b{}\b'.format(word), "replace_text", text) </code></pre> <p>It replaces all critical characters with a special meaning in regex patterns w...
Get time that all query finished <pre><code>function runAll(){ for (var i = 0; i &lt; Math.random(); i++) { pool.connect(function(err, client, done) { client.query("update box set gamer_id=null where box_id=$1; ", [i], function(err, resultUpdate) { if(err) ...
<p>try this,</p> <pre><code>function runAll(cb){ var total = Math.random() for (var i = 0; i &lt; total; i++) { pool.connect(function(err, client, done) { client.query("update box set gamer_id=null where box_id=$1; ", [i], function(err, resultUpdate) { i==total-1 &amp;&am...
How to create Twitter like profile layout? <p>I am trying to create Twitter like profile layout in React Native. Although many apps use this pattern. My current JSX setup is something like this.</p> <ul> <li>Header (profile)</li> <li>ViewPagerNav (custom)</li> <li>ViewPager <ul> <li>Tab with ListView</li> <li>Tab wit...
<p>There is actually a really good example of this in the <a href="http://makeitopen.com/" rel="nofollow">F8 app</a>. The 3 files you want to look at are here:</p> <p><a href="https://github.com/fbsamples/f8app/blob/master/js/tabs/schedule/MyScheduleView.js" rel="nofollow">https://github.com/fbsamples/f8app/blob/maste...
Does Vivado 2015.2 support SV dynamic queing? <p>I am using Xilinx Vivado 2015.2 64 bit.</p> <p>While running the following simulation I am getting the following error:</p> <p>FATAL_ERROR: Vivado simulator Kernel has discovered an exceptional condition from which it cannot recover. Process will terminate.</p> <p>Now...
<p>I believe simulator support of SystemVerilog is limited to a synthesizable subset. <a href="http://www.xilinx.com/support/answers/59002.html" rel="nofollow">http://www.xilinx.com/support/answers/59002.html</a> </p>
Deserialize a generic class instance accessible through an interface reference using Gson <p>I'm using the <a href="https://ujmp.org/" rel="nofollow">Universal Java Matrix Package</a> and it's working really great but I can't get it to play nice with Gson - serialization seems to work fine but that is the easier part, ...
<p>Using an <a href="https://google.github.io/gson/apidocs/com/google/gson/InstanceCreator.html" rel="nofollow"><code>InstanceCreator</code></a> allows you to tell Gson how to create instances of a specific type.</p> <p>Here you can tell it to create a <code>DefaultDenseGenericMatrix2D&lt;Square&gt;</code> each time i...
Controlling a driverless USB Audio Device <p>I have a USB audio device (Scarlett Focusrite 18i6) which does not require a driver, so I assume it uses the USB HID Audio Class standard.</p> <p>It works on everything from Windows and Mac to Linux and iOS.</p> <p>But on Mac and Windows, it has a control application which...
<p>You could try running the control application using <a href="https://www.winehq.org/" rel="nofollow">Wine</a> instead of reverse engineering it. However, if it's accessing USB devices then there is a good chance it might be using an API not supported by Wine.</p> <p>To reverse engineer it, you should find a way to...
Asp.Net Mvc 5 image not displaying <p>I have same images in <strong>Content</strong> and <strong>Views</strong> folders. I am trying to display images as below:</p> <pre><code>&lt;img src="~/Content/Images/download.png" alt="Content folder" /&gt; &lt;br /&gt; &lt;br /&gt; &lt;img src="~/Views/Home/download.png" alt="V...
<p>Unless you changed the default configuration, folder <code>Views</code> contains file <code>Web.config</code> that has settings for restricting access to files in this folder:</p> <pre><code>&lt;system.webServer&gt; &lt;handlers&gt; &lt;remove name="BlockViewHandler"/&gt; &lt;add name="BlockViewHand...
How can i implement this class for new class in Activity? <p><strong>PostData</strong></p> <pre><code>public class PostData { @Expose private String text; @Expose private Point point; public class Point implements Serializable { @Expose private double longitude; @Expose ...
<p>Rather than using inner class , separate <code>PostData</code> and <code>Point</code> Class</p> <pre><code> public class PostData { @Expose private String text; @Expose private Point point; public PostData(String text, Point point) { this.text = text; ...
default thumbnail for wordpress site <p>I'm trying to modify my custom wp theme and add related post block. I want to add default thumbnail for posts which doesn't have it. Below code is working fine but i can't archive how to add default img.</p> <pre><code>$args = array( 'numberposts' =&gt; '4','post__not_in' =&gt; ...
<p>In order to print the default thumbnail if the posts featured image is not found you have to print the default image that you have in your images folder.</p> <pre><code>&lt;?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } else { ?&gt; &lt;img src="&lt;?php bloginfo('template_directory'); ?&gt;/images/defa...
Implement Custom Search Plugin for Joomla <p>I would like to implement a Custom Search Plugin for Joomla 3.5.1. I am new to Joomla and still busy getting my feet together.</p> <p>I recently implemented a plugin that adds custom/extra fields (5 fields, free text inputs) to an article in Joomla 3.5.1. I followed their t...
<p>I don't think that this might be done without modifying core 'search' task. My advise is to advise search view and include extra filtering, then write own 'search' task which allow you to read this data and provide additional results.</p> <p>By writing just search plugin you can only extend search results by data w...
How to stream an mp3 file using a temporary file? <p>I am working an Mp3 streamer. To stream mp3 file from url, I want to use a temporary file. But trying to read and write the same file throws <code>IOException</code> for <code>File.ReadAllBytes</code> because the file is in use. How can I get throught this problem?</...
<p>I have found an answer by myself by searching so much. This answer contains NAudio to control the Mp3 and it is RAM friendly by reading stream partially. I am sharing it for other people who has the same problem.</p> <pre><code> WaveOut waveOut; AcmMp3FrameDecompressor decompressor; BufferedWaveProvider ...
Unable to read a character from the user <p>I have written the code to create a <code>LinkList</code> of characters. So I am inserting characters one by one from the user. But I am only able to insert the character only once.</p> <p>My code is:</p> <pre><code>import java.io.*; class Node { char a; Node next;...
<p>After <code>a = (char) System.in.read();</code> add the following</p> <pre><code>System.in.read(); System.in.read(); </code></pre> <p>Why is this?</p> <p>When you type <code>a</code> and press <code>Enter</code>,there are 3 characters read. 1 for <code>a</code> and 2 for <code>Enter</code>.(<code>\r</code> and <c...
Fortran code delivers wrong result when called from Python <p>In order to improve speed of execution for a finance problem, I coded the core numerical parts in Fortran, doing only file access etc in Python. I compiled using f2py, and call the subroutine <code>fit</code> (see lower down in my post)</p> <pre><code>vec=n...
<p>This is by no means a solution, BUT - when you see values in the order <code>10e300</code> (or results that are not reproducible for that matter) in FORTRAN it usually means that the values of a variable (or array etc.) are not initialised. Depending on compiler settings etc. a declared variable in FORTRAN receives ...
How to force stops one or more services that is in a state of 'stop pending' <p>I want to stop a Windows service and it's hung or stuck with a status of <code>Stopping</code>. We are using mixed operating systems such as Windows 2008/2012R2.</p> <pre><code>$ServerList = 'C:\Powershell\SCXAgentDSC\list.txt' $SCXAgent...
<p>If a service hangs after receiving a stop request the only way to "force-stop" it is killing the process, as <a href="http://stackoverflow.com/questions/39556860/powershell-how-to-force-stops-one-or-more-services-that-is-in-a-state-of-stop#comment66424770_39556860">@autsvet</a> already mentioned. Use the PID to iden...
how to get the public ip address of the user of openerp? <p>I want to control the sign_in for openerp by the public ip address of the user, for that I tried to compare the IP user by an existant IP</p> <p>The code below is showing the public IP:</p> <pre><code>my_ip = urlopen('http://ip.42.pl/raw').read() </code></pr...
<pre><code>from openerp.http import request public_ip = request.httprequest.remote_addr </code></pre> <p>The request object contains the remote address. You should be able to access this and use it for your needs.</p>
JQuery stringify not working <p>Simply, I'm trying to parse a List of composite objects passed from Spring controller via ModelAndView object as the following</p> <p>Spring part </p> <pre><code>ModelAndView view = new ModelAndView("my view"); List&lt;ActionHistory&gt; histories = myService.getListData(); view.addObje...
<p>Check you contentType in ajax function it should be.</p> <pre><code>contentType: "application/json" </code></pre> <p>Also your Spring controller which is handling this mvc call should configure be configired with</p> <pre><code>produces=MediaType.APPLICATION_JSON_VALUE </code></pre> <p>e.g. something like </p> ...
Python: Does 'kron' create sparse matrix when I use ' from scipy.sparse import * '? <p>For the code below, Mat is a array-type matrix,</p> <pre><code>a = kron(Mat,ones((8,1))) b = a.flatten() </code></pre> <p>If I don't import scipy.sparse package, <code>a</code> is an <strong>array-type matrix</strong>, <code>b</cod...
<p><code>from module import *</code> is generally considered bad form in application code, for the reason you're seeing - it makes it very hard to tell which modules functions are coming from, especially if you do this for more than one module</p> <p>Right now, you have:</p> <pre><code>from numpy import * # from scip...
How can send http post request using Almofire with http header .and authentication? <p>These are my input </p> <p>1.parameters </p> <pre><code>let parameters: Parameters = ["username ": "Henry","password":"xxxx","key"="ewq2356"] </code></pre> <p>2.http header</p> <pre><code>let headers = [ "Authorization": "Basic Q...
<p>Sample api -></p> <pre><code>func someFunction() { Alamofire.request(.POST, "apiName", parameters:["Key":"Value"], headers: ["Content-type application":"json"]) .authenticate(user: "userName", password: "Password") .response { request, response, data, error in if err...
".int" vs ".byte" for creating an array on gnu assembler <p>I am at odds to understand why after initializing an integer array using <code>.int</code> doesn't work with <code>movl</code> however doing it with <code>.byte</code> works flawlessly</p> <p>P.S. I'm using AT&amp;T syntax just so that it is clear from the be...
<blockquote> <pre><code> movb CharArray, %eax </code></pre> </blockquote> <p><code>movb</code> moves one byte. <code>eax</code> is a doubleword register, you can't move a byte to a doubleword register with <code>mov</code>. Either use <code>movzbl</code> or <code>movsbl</code> to do a zero extending or sign extendin...
Comparing datetimes in eval to hours <p>I've got a datetime and I want to check if there is 24 hours difference between those two. I just don't know how to do that. So far I've got this:</p> <pre><code>&lt;%# (DateTime.Now - Convert.ToDateTime(Eval("new_date"))) &lt; 24 ? "Today" : Eval("new_date") %&gt; </code></pr...
<p>The difference between 2 <code>DateTime</code>s is a <code>TimeSpan</code>, which has a <code>TotalDays</code> property you could compare to <code>1.</code>.</p>
Isotope Packery layout makes an irregular gutter space <p><strong>Problem</strong></p> <ul> <li>For some viewport width, Isotope makes an irregular gutter between grid items.</li> <li>This happens when page reload. After that, when I resize window browser, Isotope has a good behaivor.</li> </ul> <p><strong>Example wh...
<p>Finally, I got it. The problem was solved with <code>imagesLoaded()</code> (I was trying it without install imagesLoaded library and, obviously, it didn't work. I didn't know it was a library separated of Isotope). After install the library, all works.</p> <p><a href="http://codepen.io/aitormendez/pen/YGWoaP" rel="...
PostgresSQL entry to table violates foreign key constraint <p>I'm using <code>sequelize</code> to define my tables and their relations, and after that inserting some entries to the tables.</p> <p>I've got three tables : </p> <ul> <li><strong>BankAccounts</strong> : pk - accountNumber</li> <li><strong>Businesses</stro...
<p>Thanks to @wildplasser comment, I found on <a href="http://docs.sequelizejs.com/en/v3/docs/transactions/#managed-transaction-auto-callback" rel="nofollow">sequelize transaction docs</a> how to force commit of some inserts.</p> <p>Ended up doing as follows:</p> <pre><code>Connection.transaction((t)=&gt; { retu...
Stream video from web camera using UWP app in C# <p>I am trying to stream video from my webcam (audio and video) from .NET UWP IOT application.</p> <p>I tried this WebCamApp sample from <a href="https://github.com/ms-iot/samples" rel="nofollow">https://github.com/ms-iot/samples</a> and it works perfectly. Now I would ...
<p>I don't have a complete solution, but what you're looking for is real time streaming. and I recommend using WebRTC. WebRTC is a project built by google to support real time communication, you can play around with the sample from this website: <a href="https://www.webrtc-experiment.com/" rel="nofollow">https://www.we...
Authentication with JWT Lumen without password <p>I am using JWT in lumen and am unable to get token without password only With Email and i am using this code form <a href="http://stackoverflow.com/questions/33028630/authentication-with-jwt-laravel-5-without-password">stack overflow</a> --</p> <pre><code> $user=User:...
<p>The issue is caused by this <code>use</code> statement in your UsersController.</p> <pre class="lang-php prettyprint-override"><code>use Tymon\JWTAuth\JWTAuth; </code></pre> <p>When you call <code>JWTAuth::fromUser($user)</code> you are not referencing the Facade (that contains an instance of <code>JWTAuth</code>...
Today Extension (macOS) can't reach any server <p>I'm currently developing a small Today Extension for macOS that downloads some text from a server.</p> <p>The problem is that no matter how I perform a HTTPS request (either with my own framework or with <code>URLSession</code>), I can't reach any server.</p> <blockqu...
<p>What you're trying to do is illegal, which is why you're being stopped from doing it. Today extensions do not fetch data. It is your <em>app</em> that fetches the data, and communicates it to the today extension.</p>
Jenkins GUI to set time - is there a way to pass parameters from the "build with parameters" screen to the a schedule <p>I have a couple of jobs with parameters, that let developers choose params from the "build with params" screen. </p> <p>Now these jobs need to run nightly. BUT -</p> <ol> <li>The nightly parameters...
<p>I ended up giving the dev team a multijob that's built periodically, runs the jobs with predefined parameters, and is editable by the devs. </p> <p>That gives them an not-really-GUI-place in which to set params and a schedule to the jobs without editing the jobs themselves. Doesn't look like much but it solves my p...
Cannot instantiate the type in java <p>I was trying to run this code:</p> <pre><code>public class inventory { private static item[] inventory; static java.util.Scanner scanner = new java.util.Scanner(System.in); private static int noOfItems; public static void main(String[] args) { ...
<p>There are several issues in your code:</p> <h3>1. The Constructor return type</h3> <p>A constructor <strong>has no return type</strong> so simply remove <code>void</code> in <code>public void Item(String item_name,String barcode,double price)</code> otherwise it won't be seen as constructor but as a normal method....
Execute instructions over network <p>I was wondering if is there any network protocol which deals with the transmission of executable instructions.</p> <pre><code>Host1 Host2 SEND(instructions) ---------------&gt; EXECUTE(instructions) </code></pre> <p>Furthermore, is there any software ...
<p>Yes. What you're looking for are <a href="https://en.wikipedia.org/wiki/Remote_procedure_call" rel="nofollow">RPC (Remote Procedure Call)</a> protocols. Some of which, like <a href="https://en.wikipedia.org/wiki/SOAP" rel="nofollow">SOAP</a> are open and are implemented by a bunch of different libraries in various l...
When i create a hadoop conf object, is code executed in Hadoop environment, even if it is a standalone Java Code? <p>I need to understand that if i use Hadoop conf object in my code, is all the code executed in the Hadoop environment or in the normal environment , even if there are no hadoop operations in my code. I ha...
<p>Code with just hadoop jar in its classpath does not execute on a Hadoop environment (which can be cluster, pseudo-distributed or local); even if you have a cluster and have provided proper config (and you can use an Empty config object). The points of entry to hadoop environment are HDFS operations and running jobs....
Xerces "fixed" element attribute in XML Schema <p>I have an XML schema element defined as follows:</p> <pre><code>&lt;xsd:element name="Test"&gt; &lt;xsd:complexType&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="ElementFixed" fixed="SomeFixedValue"/&gt; &lt;/xsd:sequence&gt; &lt;/xsd:comple...
<p>I was able to work it out. Turns out I needed to call getConstraintType() on the XSElementDeclaration, which returns either XSConstants.VC_NONE, VC_DEFAULT, or VC_FIXED. Then, if the Constraint Type is <em>not</em> none, the value is accessed by calling getValueConstraintValue().getActualValue(). For example:</p> <...
Model of the QTableView dosent view values as desired <p>I have a QTableview with model. I populate dummy data in the model using this code </p> <pre><code>horizontalHeader.append("Name"); horizontalHeader.append("Type"); horizontalHeader.append("Unit price"); horizontalHeader.append("qty"); item00 = new QStandardIte...
<p>You are inserting the same <code>QStandardItem</code>s a 100 times, this should result in the following warning for every insert operation, starting from the second:</p> <pre><code>QStandardItem::insertRows: Ignoring duplicate insertion of item 0xxxxxxxxx </code></pre> <p>So, in your code, all insert operations (s...
How to make a BindingSource aware of changes in its DataSource? <p>I have a:</p> <pre><code>someBindingSource.DataSource = someDataSource; </code></pre> <p>And I also do:</p> <pre><code>someDataSource = foo(); </code></pre> <p><code>foo()</code> does <code>new</code> for another data source with different data.</p>...
<p>If the data source implements <a href="https://msdn.microsoft.com/en-us/library/system.componentmodel.ibindinglist(v=vs.110).aspx" rel="nofollow"><code>IBindingList</code></a> inteface, then the <code>BindingSource</code> will be informed of adding or removing items to the data source. A good implementation to use i...
Graphics, UIColor created with component values far outside the expected range <p>I got xcode 8, and folder with images. I habe replace all images with specific filter in photoshop, pixalate... and when I run my project got error,</p> <pre><code>[Graphics] UIColor created with component values far outside the expected...
<p>You might have something like this somewhere : </p> <pre><code>UIColor(red: 255, green: 255, blue: 255, alpha: 1.0) </code></pre> <p>need to be changed like this now : </p> <pre><code>UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) SO : UIColor(red: 255/255, green: 255/255, blue: 255/255, alpha: 1.0) </code>...
Bootstrap Modal Submit form <p>I've been searching all over and trying different combinations. I will try to explain exactly what I need. I have a table populated with SQL data, last column is an Edit button to open a bootstrap modal. I've been able to populate the table and create the edit button to pass the row id in...
<p>I just found the problem thanks to <strong>Fred -ii</strong> tips:</p> <p>So here is the previous code block:</p> <pre><code> &lt;/form&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class...
Extract data from multiple bracket string in Pandas and create new table <p>I am trying to build a 2 x 24 table in pandas with the following data below: </p> <pre><code>d.iloc[0:2] = [[0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 0L, 0L, 0L], [0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, ...
<p>I think you can use <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.from_records.html" rel="nofollow"><code>DataFrame.from_records</code></a> with apply <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.str.strip.html" rel="nofollow"><code>str.strip</code></...
Facebook Connect error code 191 <p>I've looked and tried so many things but unfortunately I have been unsuccessful in fixing the Facebook Connect on my forum (IP.Board 3.4). It worked before but for some unknown reason stopped working. Now I get an error (code 191)... I'm pretty sure I've got everything set up properly...
<p>For login via the website platform, you need to add an according Valid OAuth Redirect URI. (Because in that case, the address will not be <code>apps.facebook.com/something</code>)</p> <p>The Valid OAuth Redirect URIs field must contain the exact value of the redirect_uri parameter in your login dialog call.</p>
getInitialState() replacing existing state. How to pass existing state in React? <p>I'm making some buttons that will show a certain class depending on the status from the database. </p> <p>I've passed my API results through an emitter and into my state using the below: </p> <pre><code> constructor(props) { supe...
<p>The problem is that you're trying to access the state of a different component. Your'e addressing <code>this.state.tickets.status</code> where ticket state is not declared in AssignButton</p> <p>You've got two components. TicketBoard &amp; AssignButton. Your setting the tickets state in TicketBoard and you're tryi...
avoid same value to appear again using math.random() <pre><code>animations = ['fadeIn','fadeInDown','slideInUp','flipInY','bounceInLeft']; </code></pre> <p>Imagine I generate random effect whenever user click something, so to achieve best experience, I would want the user to have same effect. But with </p> <pre><code...
<p>Two ways that i can suggest.</p> <ol> <li>First shuffle the array and go one by one from index 0 to 5 and then loop as much as you like.</li> <li>Pick a random element and slice it out up until the array is empty and then refresh your array from a back up. (be careful not to back up with a reference or your backup ...
How to get the elementwise day of the year from an numpy datetime array? <p>Do you have an idea, how I can get the elementwise day of the year from an numpy datetime array? With my code I can only receive the day of the year for one element in the array.How can I get the day of the year for each element in the array? H...
<pre><code>import numpy as np import pandas as pd #date values in an numpy array as int data_int = np.array([[20131001, 20131001, 20131001], [20131002, 20131002, 20131002], [20131002, 20131002, 20131002]]) #transform the data_int array in a datetime list data_list = [pd.to_datet...
Javascript: why is 2 && 3 gives 3? <p>I was reading some tricky javascript output question and found that </p> <pre><code>console.log(2 &amp;&amp; 3) is 3 </code></pre> <p>There is no explanation for the same. Shouldn't it be <code>true</code>?, as value of both the numbers being non zero should be type casted as <co...
<p>It's just the way the language works. It is well documented.</p> <p>Per <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators" rel="nofollow">MDN</a>:</p> <blockquote> <p>Logical AND (expr1 &amp;&amp; expr2) Returns expr1 if it can be converted to false; otherwi...
how can i compare a variable that is passed to a function with a string in CLIPS? <p>when I tried to compare a variable with a string gives me error. I tried to compare it with <code>(= ?a "s")</code></p> <p>full code example that give the error:</p> <pre><code>(deffunction cierto (?a) (if (= ?a "s") then ...
<pre><code>(deffunction cierto (?a) (if (eq ?a "s") then (printout t TRUE crlf) else (printout t FALSE crlf) ) ) </code></pre> <p><strong>(= )</strong> is for comparing numbers (INTEGER or FLOAT) for equality.</p> <ul> <li>(= 3 3.0) is TRUE</li> <li>(= 3 3) is TRUE</li> <li>(= s s) ERROR, s i...
Anaconda install pyipopt: libipopt.so.1 <p>I'm completely new to Python and most aspects of compiling C.</p> <p>My default python interpreter is the anaconda interpreter for python 2.7. I'm trying to install pyipopt following these instructions: <a href="https://github.com/xuy/pyipopt" rel="nofollow">https://github.co...
<p>The guide you've provided guides the user to install using <code>sudo</code>. When one does that, the packaged is installed in the system. And since you are using python from Anaconda and not from the system, Anaconda cannot find <code>pyipopt</code>, since it is not on its path.</p> <p>I suggest that you try insta...
Header errors in CLion <p>I met an annoying problem in Clion which is that there are always header errors in my project.<br> Here is my <code>CmakeLists.txt</code>:</p> <pre><code>cmake_minimum_required(VERSION 3.6) project(geometry) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(PROJECT_SOURCE_DIR geo) se...
<p>As mentioned in the comments, you should use: </p> <pre><code>include_directories("${PROJECT_SOURCE_DIR}") </code></pre> <p>Instead of:</p> <pre><code>include_directories("${PROJECT_BINARY_DIR}") </code></pre> <p>From the documentation of <a href="https://cmake.org/cmake/help/latest/variable/PROJECT_SOURCE_DIR.h...
Programming pseudo terminals communication by termios. Parity bit option doesn't works <p>I need to make a chat using serial ports. I emulate pty by socat: </p> <blockquote> <p>socat -d -d PTY PTY </p> </blockquote> <p>Next I wrote small demo. That's how I initialize termios structure: </p> <pre><code> int t...
<p>I have read pty's man page and found that termios'es c_cflag flags dont supported by pseudo terminal at all.</p>
CSS Alignment (Margins not lining up with top right corner) <p>I am having difficulty lining up the borders of my div to the top right corner of the container. </p> <p>Link: <a href="https://joshuagrant.github.io/Test/module2/" rel="nofollow">https://joshuagrant.github.io/Test/module2/</a></p> <p>Can anyone help me f...
<p>You have extra padding on <code>section</code> tag try to add </p> <pre><code>section{ padding: 0 0 5px 5px; } </code></pre>
Clojure XML zipper walk and prune <p>I am walking a html/xml data structure. I walk through it using <code>clojure.zip</code>. Once I find a node at which I want to <code>cut</code> (prune), I cannot find a way to remove all children and right nodes.</p> <p><strong>Example:</strong></p> <p>Let's say I have this tree ...
<p>Firs of all, i would rephrase your task the following way:</p> <p>The goal is to find some node, and then remove it and everything to the right of it from it's <em>parent</em>.</p> <p>Stated this way, the <code>cut</code> function can be easily implemented with the help of <code>clojure.zip/edit</code> for parent:...
How to pass error without try catch in Python-Selenium? <p>In my python-Selenium code, i should use many <strong>try-catch</strong> to pass the errors, and if i don't use it, my script doesn't continue. for example if i don't use try catch, if my script doesn't find <code>desc span</code> i will have an error and i can...
<blockquote> <p>is there an alternative method for passing error?</p> </blockquote> <p>Yes, To avoid <code>try-catch</code> and avoid error as well try using <code>find_elements</code> instead which would return either a list of all elements with matching locator or empty list if nothing is found, you need to just c...
Snapkit 3.0 can't get correct frame after call layoutIfNeeded <p>I updated <strong>Xcode 8</strong> and <strong>SnapKit 3.0</strong> to test auto layout. I can get frame correct after call <code>layoutIfNeeded</code> before i update to <strong>SnapKit 3.0</strong>. But i get <code>frame.origin.x</code> and <code>.y</co...
<p>You need to call <code>layoutIfNeeded</code> on <code>view</code> rather than <code>signUpView</code> as it is the container that needs to do the layout pass.</p>
I have created a dynamic checkbox using php, but when i use .checked() to check it, only first radio button is checked. how to check the rest? <pre><code>&lt;div id="pop2" class="box2" style="display: none"&gt; &lt;form action="" method="post"&gt; &lt;div class="second" style="margin-top:3px;margin-left:10...
<p>Having the same <code>id</code> attribute for all the checkboxes can cause these kinds of issues. I would suggest using a commom class instead and iterating the checkboxes using the <a href="http://www.w3schools.com/jsref/met_document_getelementsbyclassname.asp" rel="nofollow">getElementByClassName</a> function to c...
What should I define in the setContentView in MainActivity.java file? <p>I want to know what should come in the bolded part below.It shows me two options:</p> <p>1.toolbar(The xml I created to add the code for the google appbar)</p> <p>2.activity_main</p> <p>The both seems to show no errors that why I want to know w...
<p>As Bansal mentioned correctly, you must use activity_main in setContentView.</p> <p>Your activity_main.xml will contain the toolbar. Inside the toolbar tag you must call the toolbar layout. It uses your toolbar.xml layout for your toolbar.</p>
Laravel ajax login empty fields <p>I'm using Laravel 5.2 and its Auth scafolding.</p> <p>I'm trying to make the default login form, to work with Ajax (without reloading page).</p> <p>I'm using reqwest.js for ajax requests. </p> <p>Here's my ajax code:</p> <pre><code>&lt;script data-cfasync="false" type="text/javasc...
<p>Sorry, I'm stupid, I figured out the reason it returns empty array.</p> <p>In my ajax request I had <code>contentType: 'application/json',</code> but my form data was not in JSON format but string params format.</p>
System.Import in Typescript not overriding the default path <p>I am a newbie to Typescript and Angular2.I have an <code>app</code> folder where I am creating ts files and I am trying to generate transpiled 'js' files to another folder built. 'Js' files are being generated successfully but when I try to <code>import</co...
<p>You need to change mapping of <strong>app</strong> to <strong>built</strong> as shown,</p> <pre><code>map: { // our app is within the app folder app: 'built', //&lt;-----changed 'app' to 'built'... ... ... } </code></pre>
Getting Array of duplicate object instead of single object <p>I am writing a rather simple crud app, however, i seem to be stuck on the edit (Edit Controller) portion code. i have a list of student, i select one for update . but i get the error "Expected response to contain an object but got an array". </p> <p>When i ...
<p>You are returning array of object from server.</p> <p>So,you should add <code>isArray : true</code> in resource defination.</p> <pre><code> $resource('/api/Student/:id', { id: '@id' }, { update: { method: 'PUT',isArray : true} }); </code></pre> <p>Or </p> <p>you can return obje...
How can I load my Aurelia app from an index.html which is not located in the same folder as the rest of the application? <p>How can I load my app from an <code>index.html</code> which is not located in the same folder as the rest of the application?</p> <p>I’m currently using <code>jspm</code> (which I’m new to). ...
<p>You need to use the <a href="http://web2py.com/books/default/chapter/29/04/the-core?search=router#Pattern-based-system" rel="nofollow">web2py pattern router</a>, something like this in the router definition should work:</p> <pre><code>routes_in = ( ('/appname/default/index', '/appname/static/aurelia_app/index.htm...
jQuery set select box to empty option <p>This is the jQuery code that I am using which helps me in getting the values for a select box I need when I change the first select box.</p> <pre><code>$(document).ready(function () { $("#select1").change(function(){ $('.quantity').val(''); $('#trblock').fadeIn(...
<p>Add <code>$('#select2').val('')</code> at the last of <code>select1</code>'s change event like following.</p> <pre><code>$("#select1").change(function () { $('.quantity').val(''); $('#trblock').fadeIn(); if ($(this).data('options') == undefined) { $(this).data('options', $('#select2 option').clo...
Collapsing Toolbar layout setTitle doesn't work <p>I'm trying to do a nestedScrollview with collapsing toolbar but when I call in my activity collapsingToolbar.setTitle("my title") it doesn't work. Here is my xml:</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;android.support.design.widget.Coordi...
<p>I suspect what is happenning, is that your is showing up when your toolbar is collapsing...</p> <p>Remove this code for starters (then maybe refactor differently for your needs): </p> <p></p> <pre><code> &lt;RelativeLayout android:layout_width="wrap_content" android:layout_height="...
Group Concat having giving weird results <p>I have this SQL query :</p> <pre><code>SELECT v.*, group_concat(distinct(vi.interest_id)) as interests, group_concat(distinct(vs.skill_id)) as skills, vc.date_from FROM `vacancies` as v LEFT JOIN `vacancy_interests` as vi on v.vacancy_id = vi.vacancy_id LEFT JOIN `vacancy_s...
<p>Your <code>HAVING</code> clauses are the wrong way to check for presence of a condition. Instead of using the concatenated value, just use:</p> <pre><code>HAVING MAX(vi.interest_id IN (17)) &gt; 0 </code></pre> <p>When you do:</p> <pre><code>HAVING interests IN (17) </code></pre> <p>Then you are comparing a str...
Accordion links in Firefox broken? <p>coding newbie here. I have been trying to create links within an accordion format using css, javascript and html. However, the links work for all browers except firefox. What am I doing wrong?`</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-b...
<p>Try to use JQuery accordion instead of basic Javascript.</p> <p>Here is an exemple that works in differents browsers: </p> <pre><code>&lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;jQuery UI Accordion&lt;/title&gt; &lt;link rel="stylesheet" href="https://code.jquery.com/ui/1.12...
Insert to a table using a string that is created in a separate function <p>I'm trying to insert using a string that is created in a separate function but it does not appear to be working.</p> <p>I know I should be using a switch statement or something for this but it is purely for testing at the moment.</p> <pre><cod...
<p>i had an extra ' at the start that was not needed after doing the debugging that u_mulder helped me with</p>
If statement not firing <p>This code does a recursive bisection search for a character in a string. </p> <p>When the <code>print</code> statements are not commented out, it seems to work well with the recursion and bisection, but the <code>if</code> statement that returns <code>True</code> does not seem to fire.</p> ...
<p>You need to return the result of each recursive call.</p> <p>This is a very common mistake, for some reason.</p>
Asp.Net web application deployment <p>I have developed an Asp.net application using visual studio 2015. Can i deploy my web application like a windows application in vb.net.My problem is that in my windows application i need the debug folder only to install my client machine, That contains the exe files to run the whol...
<p>There are many options for packaging and deploying ASP.Net web applications. Based on the build configuration you've selected, you may choose to include the resources necessary for debugging.</p> <p>I'd suggest you start here: <a href="http://www.asp.net/aspnet/overview/deployment" rel="nofollow">http://www.asp.n...
Check if multiple lists contain multiple items <p>I have a list of lists in my python code, and I want to check if <em>any</em> of those lists contains a certain two items.</p> <pre><code>f1=['a','b'] f2=['c','d'] f3=['e','f'] f4=['g','h'] f5=['i','j'] f6=['k','l'] flist=[f1,f2,f3,f4,f5,f6] </code></pre> <p>I want s...
<p>You can use <a href="https://docs.python.org/2/library/functions.html#any" rel="nofollow"><code>any</code></a> with <code>issubset</code>:</p> <pre><code>if any({'a', 'b'}.issubset(sublist) for sublist in flist): print "a and b were found" </code></pre> <p>By using <code>any</code>, the search is called off as...
How to prevent implicit initialization in Delphi <p>I am using Delphi`s record and I wrote a constructor for it</p> <pre><code>TNullableDateTime = record IsNull: Boolean; Value: TDateTime; constructor Create(IsNull: Boolean; Value: TDateTime) end; </code></pre> <p>the problem is that I want to prevent creating ...
<p>It can't be done. If you want to force the members to be initialized by the use of the constructor, you need a reference type (a class). </p>
Event for reclicking local anchor <p>Clicking on a link to a local anchor can be detected via <code>window.onhashchange()</code> <em>if</em> it involves a change to the URL hash.</p> <p>However, I notice at least in Chrome (I have not checked this with other browsers), if you then scroll around the page and select a l...
<p>There's no event for this, but since the page isn't reloaded it is possible to use a timeout in an <code>onclick</code> handler for the link to wait until after the page has moved, e.g., </p> <pre><code>link.onclick = function () { setTimeout ( function () { // Do whatever after the jump. ...
What are the build errors that are in this program? <pre><code>#import &lt;Foundation/Foundation.h&gt; </code></pre> <p>// --------@interface section -----</p> <pre><code>@interface Fraction : NSObject { int numerator ; int denominator; } -(void) print; -(void) setNumerator : (int) n; -(void) setDenominato...
<p>You must declare your local variables, you cannot simply introduce them by name. So:</p> <pre><code>myFraction = [Fraction alloc]; </code></pre> <p>is wrong and should at least be:</p> <pre><code>Fraction *myFraction; // declare variable myFraction = [Fraction alloc]; // allocate </code></pre> <p>whic...
How to vlookup in text files with Powershell <p>I have 2 txt files:</p> <p>ConfigurationFile:</p> <pre>ABC_LKC_FW_PATH: \\PathToABCFolder QWE_LKC_MW_PATH: \\PathToQWEFolder DEF_BKC_FW_PATH: \\PathToDEFFolder ERT_BKC_MW_PATH: \\PathToERTcFolder</pre> <p>and the other with parameters</p> <p>ChoosenConfig:</p> <p...
<p>Whenever you need to look up some value by another value the datastructure of choice is a <a href="https://technet.microsoft.com/en-us/library/ee692803.aspx" rel="nofollow">hashtable</a>. Split your input at colons followed by whitespace (<code>:\s*</code>) and fill the hashtable like this:</p> <pre><code>$configs ...
Blob SAS WCF and perfomance <p>This <a href="https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-shared-access-signature-part-1/" rel="nofollow">link</a> talks about performance and bypass the portal. To me a WCF service that authenticates is similar to a portal. </p> <blockquote> <p>A lightwe...
<blockquote> <p>Is it over optimization to use SAS for file upload and download?</p> </blockquote> <p>I don't think so. Uploading/downloading files using SAS makes complete sense to me.</p> <blockquote> <p>The other option is to upload and download the files via the WCF service. What would be some gotcha for on...
Permutation between two array with limited items <p>Suppose I have two arrays/vectors like:</p> <pre><code>A[4]={4,6,9,7}; B[4]={12,4,9,3}; </code></pre> <p>I have to take exact two items from those two arrays and not will be the same index (if I take A[0], then I can't take B[0]) and the sum of that combination will...
<p>Just generate (in a loop) all permutations of a vector <code>perm</code> containing 4 elements <code>[0,1,2,3]</code> with <a href="http://en.cppreference.com/w/cpp/algorithm/next_permutation" rel="nofollow"><code>std::next_permutation</code></a>. Then from <code>A</code> take <code>A[perm[0]]</code> and <code>A[per...
Automatically generating UI initializations in Android Studio <p>There was an Android Studio plugin that enabled the user to right click and generate XML UI initializations automatically , I cannot find it now and I cannot find any replacement for it , is theres an alternative to writing the initializations of buttons ...
<p>if you dont like all the glue code just use <a href="https://developer.android.com/topic/libraries/data-binding/index.html" rel="nofollow">Android Databinding library</a> or some annotation library like <a href="http://jakewharton.github.io/butterknife/" rel="nofollow">Butterknife</a> both are great to keep clean th...
How to force device rotation in Swift? <p>I want to force a device rotation in Swift.<br> I've read, that this code is supposed to work but it doesn't:<br> <code>let value = UIInterfaceOrientation.LandscapeRight.rawValue UIDevice.currentDevice().setValue(value, forKey: "orientation")</code></p> <p>Is that maybe an...
<p>The <em>only</em> supported way to force a device rotation is to do a presented view controller whose supported orientations are limited to the one(s) you want.</p> <p>Whatever other hacky stuff you may read on this topic (such as setting the device orientation in the code you gave) is wrong and unsupported.</p>
Serving dynamic assets with Slim and Twig <p>I am trying to link images without using the extension because it makes it much easier for me to maintain all my client files.</p> <p><code>assets/images/client</code> should resolve to <code>assets/images/client.png</code> when the browser renders the page.</p> <p>In Slim...
<p>Consider returning those images using Slim, it retains control in your hands: you can change the route or containing folder anytime you wish. Also you can set additional headers e.g. for caching.</p> <pre class="lang-php prettyprint-override"><code>$app-&gt;get('/assets/images/{pathToClientImage}', function($reques...
I'm searching a TYPO3 Extension for a easy picture gallery under v7.6 <p>I'm searching a easy lightbox-picturegallery Extension for typo3 v7.6 which one would you prefere?</p> <p>Thanks for your help</p> <p>BR</p>
<p>You do not you need an extension. This can easily archived without one.</p> <p>Put the following in your constants:</p> <pre><code>styles.content.textmedia.linkWrap.lightboxEnabled = 1 </code></pre> <p>Put the following in your setup:</p> <pre><code>page.includeJSFooterlibs { lightbox = fileadmin/templates/P...
Remove the first lines till the occurence of a regular expression in a column <p>I have some lines that I get in order using following </p> <pre><code>grep ENSG00000006114 File | sort -V chr17 35874900 35879174 ABCD0000006114:I25 - chr17 35874901 35879174 ABCD0000006114:I25 - chr17 35875548 358...
<p>Assuming the grep+sort are useful in that order due to your input file being enormous, all you need from awk is:</p> <pre><code>grep ENSG00000006114 File | sort -V | awk '$4~/:E/{f=1} f' </code></pre> <p>and if the file isn't huge you can lose the grep:</p> <pre><code>sort -V File | awk '!/ENSG00000006114/{next} ...
is there any difference between the design patterns for 3.0 and 4.5 .net framework? <p>I would like to start learn about the design pattern in C#. i have a book named C# 3.0 Design Patterns written by Judith Joseph published by O'Reilly, Now my concern is, there any difference between the design pattern for frame work ...
<p>There are, but not a book's worth. The main addition is IReadOnly* collections which should be used when passing a collection to something that is not going to modify it.</p>
How are command buffers ordered, for barriers' purposes, within a single vkQueueSubmit call? <p>Vulkan specification (1.0.27) says (in section <strong>6.5. Pipeline Barriers</strong>):</p> <blockquote> <p>Each element of the pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers arrays specifies two halves ...
<p>In accord with the annotation <a href="https://github.com/KhronosGroup/Vulkan-Docs/issues/300" rel="nofollow">specified in the bug report</a> (ie: the fix for it), barriers affect everything that happened on that queue before the barrier, and everything that happens after it.</p> <p>Thus, the only question is how y...
Map integration in MEAN STACK <p>I want to integrate a google map in my page. That it should be able to find the user's current location and send the data back. Since am using node I didn't get any good reference for that! </p> <p>So kindly suggest me some best solutions or good refernce</p>
<p>since your are using angular , you can find plenty of google map modules in gihtub . angular Ui is a set of modules that will speed up your developement process, it already includes google map directive and other directives which you can use in your app</p> <p>here is how to use it : <a href="http://angular-ui.gith...
MySQL get string(s) between two # / multiple pairs of # <p>How can I find string between two # or multiple pairs of #. </p> <p>An example text to search: This is #important# and needs to elaborated further. Remember to buy #milk before coming home#.</p> <p>I want results to be:</p> <p>important</p> <p>milk before c...
<h2>Edit 1</h2> <pre><code>create table t91 ( id int auto_increment primary key, thing varchar(1000) not null ); insert t91(thing) values ('This is #important# and needs to elaborated further. Remember to buy #milk before coming home#'), ('This is #important# and needs to elaborated further. Remember to buy #mil...
how to redirect with js and alert if turn in previous page? <p>i want to redirect to a php page for example <code>example.php</code> and make possible not to turn back to the first page,if try to turn i must alert the user.i dont want do delete the page from hisotry. Any of that insrtuction:</p> <pre><code> window...
<p>In Javascript you can use <code>location.replace()</code> to assign a new url - it forgets the previous location ( removes from history ) </p> <pre><code>location.replace( 'example.php' ); </code></pre> <p>For reference, try <a href="https://developer.mozilla.org/en-US/docs/Web/API/Location/replace" rel="nofollow"...
How to convert digit month to the full name of month in C# console <p>I want to convert digit month that is inputed by User to the name of month. I find it easily to use if else condition, but is there any function I can use without using condition? It's take me to write alot of code. Note : Just month!</p> <pre><code...
<p>There are two reasonably simple options:</p> <ul> <li><p>Construct a date using that number as the month, and then format it with a custom format, e.g.</p> <pre><code>DateTime date = new DateTime(2000, month, 1); string monthName = date.ToString("MMMM"); </code></pre></li> <li><p>Use <a href="https://msdn.microsof...
jquery datepicker not accepting dateformat <p>I have the following code in my view:</p> <pre><code>&lt;input type="text" class="form-control" id="date-from" name="date-from" value="" placeholder="Van" data-class="datepicker" /&gt; </code></pre> <p>I would like to retrieve the value of this field via AJAX for filterin...
<p>Here is an example of a datepicker that outputs in <code>yyyy-mm-dd</code> Does that help? </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>$(function() { $('#datepick...
Racket - Applying a Boolean to a list of lists <p>I have a function that utilizes a Boolean to replace the first number in a list with 1, regardless of its value:</p> <p>f({(0, 1, 0), (0, 0, 1), (1, 0, 0), ...}) = {(1, 1, 0), (1, 0, 1), (1, 0, 0), ...}</p> <p>So far I have</p> <pre><code>(define (procB set) (map (...
<p>It looks to me like you're missing an <code>if</code>. In your <code>lambda</code> in the <code>map</code>, <code>(number? (first lst1))</code> will resolve to <code>#t</code>. It will then try to apply the procedure <code>#t</code> to <code>(cons 1 (rest lst1))</code> which gives you the error you're seeing. I susp...
C - Dynamically allocate an array of char <p>What is the size of dynamic memory allocated for array? for example we have to print an array of len = 4</p> <pre><code>int i, n, len = 4; char *s = malloc(len * sizeof(char)); strcpy(s, "aaabbcc"); n = strlen(s); printf("%d", n); </code></pre> <p>The output should be <cod...
<p>In C, you have to allocate fixed size buffers for data. In your case, you allocated <code>len * sizeof(char)</code>, where <code>len = 4</code> bytes for your string. </p> <p>From the documentation on <a href="http://www.cplusplus.com/reference/cstring/strcpy/" rel="nofollow">strcpy</a>: </p> <blockquote> <p>cha...
Slow compiling swift source file - Xcode 8 swift 3 <p>I have just updated my project to <code>Xcode 8</code> and <code>Swift 3</code>. My problem is that my app is very very slow to compile a specific class, the following:</p> <pre><code>var dict: Dictionary&lt;String, AnyObject&gt; { return [ "bo...
<p>The method is so slowly and so I have found the solution. The <code>timestamp</code> NSNumber will be cast as <code>String</code> and so the method works perfectly again.</p> <pre><code> var dict: Dictionary&lt;String, String&gt; { return [ "book_key": book_key, "book_title": book_t...
Initial view controller unresponsive with no errors in console <p>Title says it all... The initial view controller that I am using is the login/signup view controller and it is unresponsive/crashes with no errors in the console.. The project builds flawlessly with no errors or warnings in the initial view controller. ...
<p>You haven't accidentally unselected <code>User Interaction Enabled</code> for any of your <code>views</code>? </p> <p>This will cause the appointed <code>view</code> and any of its <code>subviews</code> to ignore any incoming <code>touch events</code>.</p> <p><a href="http://i.stack.imgur.com/R9yVU.png" rel="nofol...
OutOfRangeException after changing from local to global variable <p>This code:</p> <pre><code> int[] LinkId = new int[1600]; string[] LinkValue = new string[1600]; int count = 0; private void button1_Click(object sender, EventArgs e) { for (int i=0; i&lt;40; i++) { ...
<p>Probably because your dtLinks contains rows from previous calls to getLinks(). MSDN says that DataAdapter.Fill <a href="https://msdn.microsoft.com/en-us/library/377a8x4t(v=vs.110).aspx" rel="nofollow">Adds or refreshes rows in the DataSet to match those in the data source.</a> So Try to <a href="https://msdn.microso...
Django : Update ImageField from OneToOne relation <p>After several hours to try to update a ImageField in the views.py, I need your helps :</p> <p><strong>MODEL :</strong></p> <pre><code>class ImageTeam(models.Model): image = models.ImageField(upload_to="imageTeam/", null=False) team = models.OneToOneField(Te...
<p>I think problem here is that <code>imageForm = form.cleaned_data["name"]</code>. ImageForm is not 'image'. If you want to store file, you need to get the file. <code>form.cleaned_data['image']</code> is what you need here. Also, I don't see any form field <code>name</code> so for sure the save is not going to work....