input
stringlengths
51
42.3k
output
stringlengths
18
55k
Multiple sets of radio button with ng-model and ng-repeat <p>I'm very new to Angular and I have some issues with setting the default option on my radio buttons. I have already checked the other answers and using <code>$parent</code> does not solve my issue or I'm using it wrong.</p> <p>I have a group of radio button w...
<p>You seem to have mixing many things. I copied your code created a plunker and found that the name for the radio group is not actually form_id_{{$index}} but it has whole object as string. I have changed the code hope it helps you. See the code <a href="https://plnkr.co/edit/caJZXe9nkMuJYIRQbH6v?p=preview" rel="nofol...
Marklogic: Skipping xml document while performing queries <p>I'm running XQuery in MarkLogic. The number of xml documents in the database is 764. The number of documents that the query returns results for is 382, which is the half of the number of documents available in the database. I've tried a simple code to make su...
<p>This is a re-posting of your question- </p> <p><a href="http://stackoverflow.com/questions/39610209/marklogic-how-to-know-the-number-of-records-returned-by-an-xquery">Marklogic: How to know the number of records returned by an xquery?</a></p> <p>You have provided a little more information, I guess, so that's good....
Use same instance of fragment in multiple activites <p>I have a non-UI persistant fragment to keep track of bluetooth devices in my app (so all pairings aren't lost as soon as the user turns the phone).</p> <p>I now need to access the data in this fragment from several activites and other fragments. Suffice to say it'...
<p>From google developers: "A fragment must always be embedded in an activity and the fragment's lifecycle is directly affected by the host activity's lifecycle. For example, when the activity is paused, so are all fragments in it, and when the activity is destroyed, so are all fragments."</p> <p>Meaning it's not poss...
React native drawer (for iOS & Android) disable/drawerLock mode not working <p>I am new in React native development,I have completed drawer functionality using following tutorial and github example:-</p> <ul> <li><a href="https://github.com/caroaguilar/NavigationDrawerExample" rel="nofollow">Drawer Git hub link</a></l...
<p>check <a href="https://facebook.github.io/react-native/docs/drawerlayoutandroid.html#props" rel="nofollow">react native documentation</a> and find '<strong>drawerLockMode</strong>'</p>
How to sort in group for infragistics ultragrid? <p>I have a problem about Ultragrid group and sort.</p> <p>My data.</p> <pre><code>"1" "19" "2" "3" </code></pre> <p>I want sort data: </p> <blockquote> <p>"1" , "2" , "3" , "19"</p> </blockquote> <p>How to sort and group that ?</p> <pre><code>e.Layout.Bands[0].S...
<p>UltraGridColumn has <a href="http://help.infragistics.com/Help/Doc/WinForms/2016.1/CLR4.0/html/Infragistics4.Win.UltraWinGrid.v16.1~Infragistics.Win.UltraWinGrid.UltraGridColumn~SortComparer.html" rel="nofollow">SortComparer</a> property. This property allows you to assign your own comparer. So, go ahead, implement ...
How to report file progress to clients using SignalR? <p>I have written a component that gets and excel file and stores its data into a database. Since I wanted this class to support different environments (for example using it inside a console app) So I decided to create some events:</p> <pre><code>public interface I...
<p>What you have to do is match the <code>SignalR</code> server calls with <code>JavaScript</code> functions that will show the results to the connected clients:</p> <pre><code>&lt;script type="text/javascript"&gt; // the proxy to your hub var hub = $.connection.ProgressHub; // the function that will be call...
How to set light status bar for Android N <p>I use this way to set light status bar for <code>Android M</code>, and it works well:</p> <pre><code>if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) { activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSC...
<p>Well, I found the question.It did works to set light status bar mode.But after that, i changed the status bar's color, called setSystemUiVisibility() again and set other value.So the light status bar is not valid.</p>
How do I use a pager for long git add --patch hunks? <p>When I interactively add <code>diff</code> hunks with <code>git add --patch</code>, I sometimes get hunks which are longer than the screen.</p> <p>This is strange to me as I have already set:</p> <pre><code>[core] pager = less -FRX --tabs=4 [pager] # By...
<p>Add to your <code>gitconfig</code>:</p> <pre><code>[pager] add = less -FRX --tabs=4 </code></pre> <p>or:</p> <pre><code>[core] ...
proguard.ParseException: Unknown option '-encryptstrings' in proguard.cfg <p>When I run mvn install goal with progurad option then am getting the following error. Previously, I don't have this error. I could not find what has made the difference in getting the following error:</p> <pre><code> proguard.ParseException: ...
<p>The option <code>-encryptstrings '???*'</code> is only supported by DexGuard. So when you use ProGuard to build your application, you will receive such an error.</p> <p>Thus it is advised to separate the dexguard related configuration into a separate config file <code>dexguard-project.txt</code> that is only includ...
How do I run the same Gradle daemon for terminal and Android Studio? <p>I noticed that the Gradle uses a separate daemon than the terminal does, and it uses the gradlew (wrapper) to run its own instance of Gradle daemon.</p> <p>I noticed this when i tried to stop Gradle task in Android Studio by the command <code>grad...
<p>I found the answer myself by testing many ways.</p> <p>the point is when u use Gradle wrapper it will start a new daemon for every project even if they are with the same version you can stop using Gradle wrapper by one change in Android Studio so it uses system Gradle daemon (not using wrapper and running a new dae...
Drawing a multiple line ggplot figure <p>I am working on a figure which should contain 3 different lines on the same graph. The data frame I am working on is the follow:<br> <a href="http://i.stack.imgur.com/EtYKj.png" rel="nofollow"><img src="http://i.stack.imgur.com/EtYKj.png" alt="enter image description here"></a><...
<p>The key is to spread columns in question into a new variable. This happens in the <code>gather()</code> step in the below code. The rest is pretty much boiler plate ggplot2.</p> <pre><code>library(ggplot2) library(tidyr) xy &lt;- data.frame(a = rnorm(10), b = rnorm(10), c = rnorm(10), ind = 1:10) ...
Setting source to a azure media player <p>I have a azure media player embedded in my SharePoint page. The source to the file to be played is set dynamically through a script file.Th source files can be of wmv/mp4/mpg formats and retrived from a sharepoint video portal.</p> <p>However the source is not being set or it ...
<p>The mime type you're using in your given code implies that you're trying to set a smoothstreaming source (application/vnd.ms-sstr+xml) if you are setting the source as an MP4 you should use the mime type video/mp4</p> <pre><code>myPlayer.src([{ src: "YOUR_SOURCE.mp4", type: "video/mp4" }]); </code></pre> <p>you c...
[AngularJS][JavaEE] How to send multiple data with $http.post() <p>I work on a webapp, i have a probleme to send data and i didn't find some example. I use AngularJS and JavaEE. </p> <p>Now :</p> <p>AngularJs :</p> <p>quiz is an object.</p> <pre><code> roomFactory.create = function(quiz){ //item.idLesson = $sta...
<p>You can pass multiple Data as follow</p> <pre><code>var Indata = {'pram1': 'value1', 'pram2': 'value2' }; $http.post("/api/private/room/create", Indata) .then(function (response){ roomFactory.room = response.data; return roomFactory.room; },function (response){ $q.reject(response); }...
Java SPNEGO Authentication & Kerberos Constrained Delegation (KCD) to backend service <p>I have a Java web application which do SPNEGO authentication of clients in a Windows Active Directory environment. To authenticate the user we use code from the good old SPNEGO SourceForge project.</p> <pre><code>String encodedAut...
<p>I've actually been doing something like this recently but am using spring security kerberos. I put an example on github <a href="https://github.com/tellisnz/collared-kerberos" rel="nofollow">here</a>. The key thing that I found that I needed set up to use constrained delegation like you want it and S4U2Proxy was to ...
Find shapes on white background. Thinning the lines <p>I have the following image as a test image:</p> <p><a href="http://i.stack.imgur.com/NFXjb.gif" rel="nofollow"><img src="http://i.stack.imgur.com/NFXjb.gif" alt="enter image description here"></a></p> <p>I attempt to find the shapes on the image (and other images...
<p>I ended up using a mix of overlapping test and convexity scan. The convexity scans for the error between the convex hull and the actual contour. If this error exceeds a certain amount, the hull is ignored. The overlapping simply use bitwise and to detech if two convex hull's overlap. If they overlap more than 95% pe...
How to add one value of JSON to each div? <p>how i can to add one element from JSON to each div? (in each div should be other image)</p> <p><strong>html</strong></p> <pre><code>&lt;div class="card"&gt;&lt;/div&gt; &lt;div class="card"&gt;&lt;/div&gt; &lt;div class="card"&gt;&lt;/div&gt; </code></pre> <p><strong>scr...
<p>From your question, I assumed that you want to add images, div by div. That can be done by <code>eq()</code> as shown below.</p> <pre><code>$.each(json.images, function (key, value) { $(".card").eq(key).append('&lt;img src= "' + value.url + '"&gt;'); }); </code></pre> <p><div class="snippet" data-lang="js" ...
Most common character in a file in C <p>I'm doing my C programming course homework and I need to find a most common character in given file. </p> <p>My testing with a testfile, emptyfile and other small amount text files works great (or at least I think so), but in the last long testfile something goes wrong and the e...
<p>You should use &lt; operator in the second for loop. Because of that when you are checking frequency[i] > maxCount, at frequency[26] it behaves undefined behaviour, meaning the value at that index may be less or higher than the compared value.</p>
Is there such a thing as couchbase basket? <p>I have heard only of <code>couchbase bucket</code> is there also a <code>basket</code>? I would like to have multiple apps use multiple <code>buckets</code> but for couchbase performance is there a lighter thing than a <code>bucket</code> called <code>basket</code>?</p>
<p>Never heard of a basket in Couchbase. Now that being said we strongly encourage people to add a type field to every document stored in buckets. Before having queries we would tell you to do multiple applications by prefixing all your document keys by the app prefix. Now that we have n1ql and that you can do queries ...
How can control the items in view class queryset? <pre><code>class ModelListCreateView(GetQuerysetMixin, generics.ListCreateAPIView): queryset = get_objects_for_user(self.context['request'].user, 'model.view_model') serializer_class = ModelSerializer permission_classes = (permissions.IsAuthenticated,) </cod...
<p>If you want to access the request object, then override <code>get_queryset</code> instead of setting <code>queryset</code>.</p> <pre><code>class ModelListCreateView(GetQuerysetMixin, generics.ListCreateAPIView): def get_queryset(self): return get_objects_for_user(self.request.user, 'model.view_model') <...
VLCJ Get Video Time <p>I have the following code and i want to get the time of my Video but it returns -1. Anyone know why?</p> <pre><code>long video= ourMediaPlayer.getMediaPlayer().getLength(); </code></pre> <p>I have tried with getTime() instead of getLength but it returns -1.</p> <p>Thanks for your help.</p>
<p>The <code>getLength()</code> method returns -1 if the length is unknown. It depends on the type of media, but sometimes the length is not known until some time after the media starts playing.</p> <p>Similarly, <code>getTime()</code> returns -1 for the time (number of milliseconds from the start of the media) if the...
Linux 64bit calling convention uses register to pass 'this' pointer, but code is less efficient? <blockquote> <p>My question</p> </blockquote> <p>From wikipedia 64 bit API calling convention uses registers to pass first parameters in rdi, rsi, etc.</p> <p>But I found: 64 bit, when calling class's member function(e....
<p>in fact, the optimizer erases all of your code</p> <p>even changing main to return obj1.i the code of Test::Test() is optimized to null:</p> <pre><code>0000000000400470 &lt;main&gt;: 400470: b8 17 00 00 00 mov $0x17,%eax 400475: c3 retq </code></pre>
Change date format to a database value <p>I am displaying a 'date' Database value on a web page. I use Dreamweaver to build web pages which as I'm sure most are aware produces the PHP when binding the database value to the page. SO I have...</p> <pre><code>&lt;span class="date"&gt;&lt;?php echo $row_rsLatest['date'];...
<p>You can use <a href="http://php.net/strtotime" rel="nofollow">strtotime()</a> and <a href="http://php.net/manual/de/function.date.php" rel="nofollow">date()</a>:</p> <pre><code>$date = date("d-F-Y", strtotime($row_rsLatest['date'])); </code></pre>
How to fetch a particular value from a text file in powershell using regex? <pre> Linux 4.4.0-38-generic (ajaylinux) 09/27/2016 _x86_64_ (2 CPU) 07:22:03 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 07:22:03 PM all 0.16 0.04 0.09 0.16 0.00 0.01 0.00...
<p>Don't use regex. The file looks like it contains structured data. Read it <a href="https://technet.microsoft.com/en-us/library/hh849891.aspx" rel="nofollow">as CSV</a> and specify tab char as field separator. Selecting the desired column contents from CSV data is trivial.</p>
Cookie that dies when you leave the page <p>Is it somehow possible (using Laravel5.2/PHP or/and JS/jQuery) to set cookie that expires when user leaves a certain page or certain domain?</p>
<p>You can set the cookies to expire when the session end (a.k.a when the user closes the browser), also you have the option to programatically delete the cookies inside Laravel, which if u want can also be triggered by making your own ajax call to your own controller.</p> <p>You can find the expire on close option in...
Convert multiple column headers to Values in R <p>So my data is imported from excel in this format </p> <pre><code> alpha beta gamma var1 var2 var3 var1 var2 var3 1 21 50 5 22 48 6 2 27 50 5 24 48 6 3 26 50 5 28 48 ...
<p>When you have your header fixed in Excel, you can do as follows, to reshape your data. (example with random data).</p> <pre><code>library(reshape2) dt &lt;- data.frame(id = 1:100 ,beta_var1 = rnorm(100,mean = 4, sd = 2) , beta_var2 = rnorm(100,mean = 7, sd = 3) , ...
Firebase equalTo() not fetching desired results <p>I'm using Firebase. Where I need to fetch the record for a particular attribute. But when I have used the Firebase query method, I'm unable to get the actual result. Following is my code:</p> <pre><code>Firebase ref = ZopOrderingAplication.getFirebaseInstance(); Fireb...
<p>I think you need to try <strong>this</strong>:</p> <pre><code>Query queryRef = retailerMastRef.orderByChild("user_name").equalTo("8105409301"); </code></pre> <p>Remove <strong>user_name</strong> from equalTo() as you have it in orderByChild. </p> <p>Hope this helps. Do let me know if it changes anything for you.<...
How to disable log zip in apache2 <p>How to disable log access/error zip in <strong>apache2</strong> ?</p>
<pre><code>/var/log/apache2/*.log { daily missingok rotate 14 compress delaycompress notifempty create 640 root adm sharedscripts postrotate if /etc/init.d/apache2 status &gt; /dev/null ; then \ /etc/init.d/apache2 reload &gt; /dev/null; \ fi; endscript prerotate if [ -d /etc...
C: unsigned char * bytes array copying elements to other unsigned char * array <p>I think that copying elements of array like this: </p> <pre><code>unsigned char *new_bytes_array = malloc(sizeof(unsigned char)*length/2); for(int i=0, j=0; i&lt;length; i++) { if(i % 2 == 0) continue; new_bytes_array[j] = old_byte...
<p><code>new_bytes_array[j]</code> evaluates to an <code>unsigned char</code>. </p> <p>Assuming <code>old_bytes_array[i]</code> does as well, then this</p> <pre><code>new_bytes_array[j] = old_bytes_array[i]; </code></pre> <p>copies an <code>unsigned char</code> and not a pointer, not an <code>unsigned char*</code>.<...
Using JQGrid in a search screen <p>Hi (sorry for my pityful english) i have been reading on JQGrid for about 4 days. Small examples work great. But each time, the example show a grid alone filled at the loading of the page. i would like to have a search screen (one textbox like google) and show the answer in the jqGrid...
<p>If you are preloading all of the data needed for your <code>jqGrid</code>, then you can add a client-side search textbox using the code I've documented here:</p> <p><a href="http://stackoverflow.com/questions/8832085/jqgrid-change-filter-search-pop-up-form-to-be-flat-on-page-not-a-dialog/24528183#24528183">jqGrid c...
python-pptx: insert picture into content placeholder <p>I'm using python-pptx 0.6.0 and I created a slide with content with caption. I want to insert picture into the content placeholder but there is no attribute such as add_picture or insert_picuture to use. How can I add picture into this content placeholder? Thanks ...
<p>See the documentation on <a href="http://python-pptx.readthedocs.io/en/latest/user/placeholders-understanding.html" rel="nofollow">Understanding placeholders</a> and <a href="http://python-pptx.readthedocs.io/en/latest/user/placeholders-using.html" rel="nofollow">Working with placeholders</a>.</p> <p>In brief, usin...
How to refer to a cell in data grid view using its index in C# <p>I have a purchase bill form in which the sold items must appear with their elements one of that element is the <strong>unit</strong> each time I will save the bill in the database each rows of the data grid view must check the <strong>unit text</strong> ...
<p>Very simple</p> <pre><code>if ( pBilldgv.Rows[index of your row].Cells[index of your cell or 2].Value.ToString() ) // Do what ever you want to do. </code></pre> <p>The index cell is the column index or in another way the intersection of a row and a column will give you a cell.</p>
Cannot read property of undefined bootstrap eonasdan datetimepicker <p>I am using <a href="https://eonasdan.github.io/bootstrap-datetimepicker/" rel="nofollow">eonasdan datetimepicker</a> and I can not manage to access the data functions from Angular controller. </p> <p>The following code generates "TypeError: Cannot ...
<p>The problem was that I called the <code>$("#datetimepicker").data("DateTimePicker")</code> outside DOM.</p> <p>Solved by implementing a directive with isolated scope for binding the Ng-Model to datetimepicker.</p> <pre><code> .directive('timepicker', [ function () { var link; link = function (scop...
How to sort array as per key value using Angular.js/Javascript <p>I need one help. I need to sort an array as per key value with one specific format using Angular.js/Javascript.I am explaining my array below.</p> <pre><code>var stepsModel=[ {'day_id':2,'day_name':'Tuesday','image':"1.png"}, {'day_id':2,'da...
<p>You could use a hash table for the right assignment of the images to the days.</p> <p>Optional, you could use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce" rel="nofollow"><code>Array#reduce</code></a> instead of <a href="https://developer.mozilla.org/en-US/d...
PHP sum is wrong when it reaches 1000 <p>I have some problems with my shopping cart, it does not sum all the items when I add them, and the value reaches around 1000/1400, the sum is wrong and it just stops summing the items. Check this picture: <a href="http://prntscr.com/cn6uvg" rel="nofollow">http://prntscr.com/cn6u...
<p>By default, <code>number_format($pricetotal+$cartTotal,2)</code> will not only truncate two decimals, <strong>but also add a thousands separator</strong>.</p> <p>So 999 + 1 will not give "1000.0" but "1,000.0" which will then fail the sum (since it is a <em>string</em>, not a "<em>numbery</em>" value. If it is trea...
ipa uploaded succesfully but not showing after upload completes xcode 8 <p>While my build is uploading, it shows in iTunes Connect, but when uploading gets completed successfully the build no longer shows on iTunes Connect, it get vanished from there. </p> <p>I tried with both XCode 8 and application loader. I added a...
<p>First of all, check the message from Apple. Recently I also faced same issue. The reason was pretty simple, I missed description keys in info.plist. <strong>These keys are mandatory</strong> in <strong>Xcode 8 + iOS 10 SDK</strong></p> <blockquote> <p>This app attempts to access privacy-sensitive data without a u...
Multiple jQuery carousels on a page <p>I've been following <a href="https://www.barrelny.com/blog/building-a-jquery-slideshow-plugin-from-scratch/" rel="nofollow">this tutorial</a> to create a carousel and so far it's working well enough, but I'm a beginner and I need to have multiple instances of this carousel running...
<p>Seperate your carousels with individual class. change a bit code at event function like this</p> <pre><code>Zippy.prototype.events = function(){ this.$el .on('click',this.settings.arrowRight,{direction:'right'},this.changeSlide) .on('click',this.settings.arrowLeft,{direction:'left'},this.changeS...
Java- How can you close `FileInputStream` in finally block if the same method returns that `FileInputStream` <p><code>Sonar</code> is showing a bug for the below code which is of blocker type. It's complaining that I have not closed <code>FileInputStream</code> but how can I do that? <code>FileInputStream</code> is the...
<p>It is not necessary to close the input in the same function. The problem may be that you should not declare <code>InputStream is</code> in <code>try{}</code> block as well as putting the <code>return</code> statement.</p>
How to evaluate mathematical formula consist of string? <p>In mm project i want to evaluate mathematical formula which is a string. Example: <code>"((1*10)/100) + 100"</code>.</p> <p>How can evaluate such formula? I used <code>eval()</code> but it is throwing <code>Parse error: syntax error, unexpected end of file</co...
<p>php's <a href="http://php.net/manual/en/function.exec.php" rel="nofollow"><code>exec()</code></a> function allows to execute <em>commands</em>, not to compute the result of a mathematical equation or formula. That is something completely different. That string does not contain any commands, so it is not valid syntax...
Touch event on blended layer image Android <p>I have a precut image i.e One base image and multiple transparent layer of the the base image. I am trying to add the layer image on top of base image to select the layer and apply different color on it.</p> <p>I have tried the following way to achieve it but not able to f...
<p>Extend the View class, make the onDraw() function draw what you want to draw. The onTouchEvent() function implement the touch events. What you're trying to do isn't subsumed in any view already made but it's pretty easy to make a view. Just draw the bitmaps on the canvas in the correct order with the correct paints ...
How to animate CAShapleLayer's path changes? <p>I have a CAShapeLayer which contains a "hole" in it and a transparent surrounding(<a href="http://i.stack.imgur.com/oHqgx.png" rel="nofollow">see screenshot</a>). I want to animate that circle's radius changing(i want to make it bigger or smaller). Any ideas ? </p> <p>th...
<p>Try using 'CABasicAnimation' with the <code>@"path"</code> key. Below is the example configuring your animation:</p> <pre><code> CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"]; animation.duration = [CATransaction animationDuration]; animation.timingFunction = [CATransaction...
Javascript to validate a dropdown menu dependent by date <p>I kindly ask if there is someone who could be so kind to write a validation code for my form.</p> <p>I have a field with a calendar called "arrivaldate" and than a dropdown with the following items that could be for example some offers:</p> <ul> <li>none</li...
<p>Please Try this,</p> <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1....
Java LibGDX export jar with changed working directory exlipse <p>I have following problem: I developed an app in libgdx in eclipse. There was a problem with <code>Gdx.files.internal()</code> function, it threw file not found, but I searched it up and fixed by going into <code>Run Configurations</code> in eclipse, <code...
<p>You can find some useful information <a href="https://github.com/libgdx/libgdx/wiki/Deploying-your-application" rel="nofollow">here</a></p> <p>As I understand, you should set your working directory on run configuration. If you have many modules, it's good to have one folder for all.</p> <p>From you errors I can se...
CABasicAnimation swift not working <p>I'm newly moving from obj C to swift, i'm not sure why it's not working because in obj c it's working fine, please take a look to my code</p> <p>Here is my code </p> <pre><code>func addAnimationOnLayer( layer: CALayer, position: CGPoint, duration: TimeInterval, delay: TimeInterva...
<p>Before calling <code>CATransaction.begin()</code> try calling <code>CATransaction.flush()</code>.</p> <p>Your code would then look like:</p> <pre><code>func addAnimationOnLayer( layer: CALayer, position: CGPoint, duration: TimeInterval, delay: TimeInterval, fromPosition: CGPoint, toPostion: CGPoint, key: String) {...
Video-Audio confernce with app-bowser app-app and browser-browser <pre><code>Client want one application where he can video call to other guy with web to web or app to web or app to app and also he want chatting functionality with file sharing like whatsapp. Now my question is that in which technology i will gain this...
<p>I'm currently working on that app. You should use Kurento media server on a server side. RTC need communication channel, for that you should use WebSocket. There is should be some api for managing calls. For Android you should use ibjingle library (google for 'pristine'). On the other hand, you can use some ready so...
Activity controller for sharing screenshots displays empty <p>I want my code to share a screenshot when a button named share is clicked. </p> <p>The button function looks like this:</p> <p><strong>Swift 3</strong></p> <pre><code> func shareBtnAction(_ sender: AnyObject) { // first I take a screenshot of the draw...
<p>I figured out, <strong>swift 3</strong> wants you to initialize UIGraphicsGetImageFromCurrentImageContext more concretely as an UIImage type:</p> <pre><code>let image: UIImage = UIGraphicsGetImageFromCurrentImageContext()! </code></pre>
Symfony 3, doctrine Fatal error, Scalar type declaration 'integer' must be unqualified <p>I have this code :</p> <pre><code>class Entity { /** * @ORM\Column(type="Integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; ... } </code></pre> <p>when I try to run doctrine:sc...
<p>The problem was that instead of Column(type="Integer"), I should have type Column(type="integer"). It was just a matter of case.</p>
Css submenu not remain visible after menu unhover no javascript <p>I want to use only css, no javascript. When I mouse hover the top-level menu I can display the submenu, but as soon as I unhover the top-level menu the submenu disapper. How could I solve this without using javascript? Have I missed something?</p> <p>I...
<p>Add the class <code>has-children</code> to the li and use the li's hover event to display the submenu.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>.header ul { l...
different result Consecutive records in a table using SQL <p>I have the following Table definition with sample data. In the following table. "TP" consecutive 3 records 2 times,then "SL" consecutive 1 records 2 times…… </p> <pre><code>id | Result 1 | TP 2 | TP 3 | TP 4 | SL 5 | TP 6 | NONE 7 | NONE 8 | SL 9...
<pre><code>Declare @tblTest AS TABLE( ID INT, Result VARCHAR(50) ) INSERT INTO @tblTest VALUES(1,'TP') ,(2,'TP') ,(3,'TP') ,(4,'SL') ,(5,'TP') ,(6,'NONE') ,(7,'NONE') ,(8,'SL') ,(9,'TP') ,(10,'TP') ,(11,'TP') ,(12,'SL') ,(13,'SL') ,(14,'SL') ;WITH X AS ( SELECT T.*, ROW_NUMBER() OVER (ORD...
Broadcast event and on are not working in angular js <p>I am trying to generate broadcast an event from one controller and listen to it another one. But the result is not being displayed on the DOM , though there is no error . And also when I displaying normal $scope variables from both the controllers it is working . ...
<p>In this case, controller1 initiated first and then controller2. When controller1 initiated broadcast event has occurred and controller2 not yet initiated i.e. $on not yet registered. You can use $timeout. </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div cla...
java.lang.reflect.Type from canonical name <p>Is it possible to instantiate a java.lang.reflect.Type from its canonical name?</p> <p>For example, create a Type from "java.util.List".</p> <p>Thanks</p>
<p>A class <em>is</em> a type and so does <code>java.lang.Class</code> implement <code>java.lang.reflect.Type</code>.</p> <p>In other words, you can simply write</p> <pre><code>java.lang.reflect.Type listType=java.util.List.class; </code></pre> <p>or</p> <pre><code>java.lang.reflect.Type listType=Class.forName("jav...
Show all Available Bookable Product in "WooCommerce Bookings" extension <p><a href="http://i.stack.imgur.com/ZDwk2.png" rel="nofollow">User select date, time and then search</a></p> <p><a href="http://i.stack.imgur.com/ZDwk2.png" rel="nofollow"><img src="http://i.stack.imgur.com/ZDwk2.png" alt="enter image description...
<p>I have customized both WooCommerce &amp; Booking Extension:</p> <h1>To save bookable product :</h1> <pre><code>woocommerce-bookings/includes/class-wc-bookings-admin.php </code></pre> <h1>Method executes saving :</h1> <pre><code>save_product_data( $post_id ) at line 434 </code></pre> <h1>File for searching list...
Filter out null fields in snakeyaml <p>I am using snakeyaml to print my object in a YAML file. There are some fields which could be null. How can I prevent these field, when they are null from being printed in the file?</p>
<p>After some research I have finally found the solution. One needs to change how null fields have to be represented in Representer Here is the code</p> <pre><code>Representer representer = new Representer() { @Override protected NodeTuple representJavaBeanProperty(Object javaBean, Property property, Object pr...
Segregating dataset and name each new dataset as per unique column names <p>I have a dataset(nm) as shown below:</p> <pre><code>nm 2_V2O 10_Kutti 14_DD 15_TT 16_DD 19_V2O 20_Kutti 0 1 1 0 0 1 0 1 1 1 1 1 0 0 0 1...
<p>We can <code>split</code> by the substring of the column names of 'nm'. Remove the prefix of the columnames until the <code>_</code> with <code>sub</code> and use that to <code>split</code> the 'nm'.</p> <pre><code>lst &lt;- split.default(nm, sub(".*_", "", names(nm))) lst #$DD # 14_DD 16_DD #1 1 0 #2 ...
Encryption of Connection String <p>I used aspnet_regiis to encrypt connection string in app.config of a C# application. But I wonder that if any one knows this method, so he can decrypt the file that exists on the client machine, is this correct? if yes, so what I benefit from encrypting the connection string! and what...
<p>Yes this is correct. I recommend to use a Webservice and not a Database-Connection. </p>
Sharepoint export to Excel in mac <p>Currently I'm working on a Sharepoint 2013 project. What I want is to use export to excel out of the box but If i'm using mac then it does't allow me to export it. Is there any alternative way to make it work?</p>
<p>No: from <a href="https://blogs.msdn.microsoft.com/opal/2010/11/13/sharepoint-2010-on-a-mac-with-office-for-mac-2011/" rel="nofollow">this page</a></p> <blockquote> <p><em>Since I have already installed Office for Mac 2011, can I use the features on the Ribbon such as Connect to Outlook, Excel, SharePoint Workspa...
Java App Profiling to find out the Culprit Classes <p>We have a java web app running in a server. It is hosted with tomcat. I have enabled Flight recorder and i am able to connect to connect with JMC and recording Flight...</p> <p>Now, i am not sure how i can find the classes which is making my app slow.Let me be clea...
<p>You could open the JMX Console in JMC and create a trigger to dump a recording if the CPU load exceeds 90% or so. Check "when recovering from condition".</p> <p>When you get a recording, you can in the range navigator on the overview tab select the interval where the CPU spike happened, should be at the end of the ...
onclick check if that element not hasClass() <p>I want to check on click that div or li any element not <code>hasClass()</code> then do something.</p> <p>I am trying to do it like this:</p> <pre><code>$(document).on('click',function() { if(!(this).hasClass("help-icons") &amp;&amp; !(this).hasClass("help") &amp;&a...
<p>You forgot the <code>$</code></p> <pre><code>$(document).on('click', function() { if(!$(this).hasClass("help-icons") &amp;&amp; !$(this).hasClass("help") &amp;&amp; $(this).hasClass("close")) { $(".help-icons").hide(); } else if ( $(this).hasClass("help")) { $(".help-icons").show(); } else { $(".h...
Return SOLR result which has "x" field with value "v" <p>I am using SOLR 4.9 Version.Following are my indexed document.</p> <pre> <code> { "id": "1", "index_id": "index", "tm_title":"Avenger" "category":"1" "type":"movie" "article_type":"Hollywood" }, { "id...
<p>Use AND operator</p> <pre><code> localhost:8983/solr/collection1/select?q=article_type:Hollywood AND category:2 AND type:celebrity </code></pre> <p>second query</p> <pre><code>localhost:8983/solr/collection1/select?q=article_type:Hollywood AND category:1 AND type:celebrity </code></pre>
How to Center an oracle form in oracle form builder? <p>can anyone tell me how to position an oracle form in the middle of the screen when maximize the window ? Actually i have a form when i run it, it displayed at the upper left corner of the screen but i want it to be displayed in the center of the screen even while ...
<p>You can use CSS style for make this form middle of the page. Is that form have fixed width? Then use this style</p> <pre><code>.formSelector{margin: 0 auto;} </code></pre> <p>I think it will be working.</p>
Generate specific, non-zero return code? <p>I am working on some piece of python code that calls various linux tools (like ssh) for automation purposes. Right now I am looking into "return code" handling. </p> <p>Thus: I am looking for a simple way to run <em>some</em> command that gives me a specific non-zero return ...
<p>Run <code>exit</code> in a subshell.</p> <pre><code>$ (exit 5) ; echo $? 5 </code></pre>
deploy a java EE application on a live server <p>I've just finished developing a java ee application with tomcat and spring boot and angularjs and mysql on localhost, please can any body help how to deploy this app to run on live server and what are the changes must be done before generate the war ( i meant the porte ...
<p>If you're using Spring Boot, don't use the war option. Build a fat jar instead. That's the more common way of deploying Sprint Boot and it will save you an incredible amount of pain like this. For example, your complaint about ports is (going on memory) solved liked this:</p> <p><code>java -Dserver.port=80 -jar som...
Some websites rejecting HttpClient requests even with headers set <p>I have written some code to check to see if all websites in my database are still hosted and online.</p> <p>The problem is some of these sites seem to have bot protection and whenever I try to request then via HttpClient they raise an error instead o...
<p>Set the headers before sending the request. You are doing them after already getting a response</p> <pre><code>public static async Task CheckSite(string url, int id) { try { using (var db = new PlaceDBContext()) using (var client = new HttpClient(new HttpClientHandler() { AutomaticDe...
AVAssetExportSession in ios 10 not working for iPhone 7 <p>When I am blending two videos with AVAssetExportSession in ios 9 its working perfectly. but when i blend with AVAssetExportSession in iOS 10, it in not working. Please help me if any know the reason, Thank you.</p> <p>actualy code is working for iphone 6s and ...
<pre><code>It's a bug. It's fixed in Xcode 8.1 beta. </code></pre> <p>Xcode 8.1 beta [AVAssetExportSession allExportPresets] iPhone 7 Simulator now returns</p> <pre><code>AVAssetExportPreset1920x1080, AVAssetExportPresetLowQuality, AVAssetExportPresetAppleM4A, AVAssetExportPreset640x480, AVAssetExportPreset3840x2160...
Cannot launch twitter oauth function in Ionic app <p>First question on stack overflow, will try to get it right. I am having trouble with a Twitter oauth in an Ionic app, using libraries cordova, and ng-cordova-oath amongst others.</p> <p>I have succesfully managed a linkedin, facebook and google auth, retrieving data...
<pre><code> &lt;html ng-app="app"&gt; &lt;head&gt; // Did you load angularjs in scripts? &lt;script src="lib/ionic/js/ionic.bundle.js"&gt;&lt;/script&gt; &lt;script src="js/ng-cordova.min.js"&gt;&lt;/script&gt; &lt;script src="js/ng-cordova-oauth.min.js"&gt;&lt;/script&gt; &lt;script src="js/...
DLL project : migrating from Qt + MinGW to Visual Studio <p>I'm making a DLL, written in C++ with Qt Creator (but no Qt stuff inside, pure homemade C++), and using a standard qmake + MinGW/g++ build process. My friend is doing the framework/main soft, and he's using Visual Studio Express 2015, and he's supposed to use ...
<p>So I used qmake -tpvc to generate a VCproj file which compiled almost immediately in Visual Studio Express 2015 which my friend uses. I guess that's a valid solution to my problem then !</p>
Connection Error in Ignite web agent <p>For analysis of node in Apache ignite, I am using monitoring tool at [1] : <a href="https://console.gridgain.com/" rel="nofollow">https://console.gridgain.com/</a>. I tried running <strong>ignite-web-agent.sh</strong> for making connection with web server at link above, but I am ...
<p>Web agent can't resolve console.gridgain.com try to change 'URI to Ignite Console server' in <strong>/home/rishikesh/ignite-web-agent-1.7.2/default.properties</strong> please replace:</p> <pre><code>server-uri=https://console.gridgain.com:3002 </code></pre> <p>to:</p> <pre><code>server-uri=https://104.197.2.239:3...
How to highlight the closing div in editplus when I click or select an opening div <p>Is there any feature on editplus to highlight the closing div when I select the opening div. I know it happens with the opening and closing braces in edit plus, but It would be better if the same could be done with div. </p>
<p>You can find the closing or opening div by click <code>ctrl + {</code> when your cursor on the opening or closing div. <code>ctrl + }</code> for curly braces such javascript or PHP coding.</p>
IP address set to static, cannot get connection to server <p>I set my server with static IP address from the Network and Sharing Center. My server is an Azure VM. After setting it with static IP, i lost connection to my Machine. I check from the portal.azure.com, the server status is running but i realize that the netw...
<p><a href="https://azure.microsoft.com/en-gb/documentation/articles/virtual-networks-reserved-private-ip/" rel="nofollow">This link</a> describes the correct way to set internal private static IP addresses to azure VMs (using Powershell). You can try the step "How to remove a static internal IP from a VM" but I'm not...
Sorting a d.frame by a column of another d.frame R <p>I'm aware this question was made before, but my problem is a little bit different from what I have seen. And I can't solve it with previous questions and answers. </p> <p>I want to sort a data frame using the column of another data frame. But with a peculiarity. Th...
<p>Here's a possibility:</p> <pre><code>&gt; M1.s&lt;-M1[order(M2$y3[match(M1$x,M2$x)]),] &gt; M1.s x y y2 6 sc784 5.193 19.458 7 sc784 6.307 14.398 8 sc784 1.042 11.436 9 sc784 5.392 15.096 10 sc784 9.124 13.521 16 sc120 6.496 19.087 17 sc120 3.128 12.793 18 sc120 8.870 10.844 19 sc120 1.245 18.832...
jQuery: find descendants by selector and set value by index <p>Say I have the following structure representing inputs for soccer matches:</p> <pre><code>&lt;form&gt; &lt;div class="match"&gt; &lt;div class="scores"&gt; &lt;input type="text"&gt; &lt;input type="text"&gt; &lt;...
<p>Wrap your input in a jquery selector like <code>$(inputs[0])</code> or you can use <code>input[0].value</code> since input[0] is a dom element.</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 pretty...
mysql2: error on reading inital communication packets <p>following setup: ruby script on raspbian, external database (connection with ssh and msyql2). Problem: Gateway and port generation is OK, but trying to establish a mysql connection fails everytime with "Lost connection to MySQL server at 'reading initial communic...
<p>Ok, I finally have the solution. Coding was OK, another provider worked fine. So not always it is wrong code. Finally, somebody else was to blame! Have a nice day, Devyn</p>
How to secure swagger page in rails? <p>In my project there is a documentation of API's by using swagger which URL is like <strong>http//www.example.com/api</strong>. Issue is that these are public and anyone can see that. I want to secure this link so that anyone can't see these API's.</p> <p>I see <code>http_authent...
<p>The HTTP autentication can be done on Nginx (or Apache) level.</p>
MongoDB aggregation pipeline - matching $regex pattern of _id and setting as value of another field <p>Prior to the projection stage of my pipeline, my document ids are of the type:</p> <pre><code>"manchester_10:2016-09-28 09" "burnley_10:2016-09-28 09" </code></pre> <p>In the projection stage, I'm trying to project ...
<p>Try This: Assuming it is for single line string</p> <pre><code>/([^:]*):(\d{4}-\d{2}-\d{2} \d{2})/g </code></pre> <p>Here group 1 is location and group 2 is date</p>
Change lock screen wallpaper While playing music in foreground <p>I am developing a android music application above API-16, one of my requirement is to change the lock screen wallpaper when my music application is running in foreground. This feature can be seen in google play music application like when music notificat...
<p>This isn't possible from the standard <a href="http://stackoverflow.com/questions/2653954/how-to-set-android-lock-screen-image">API</a>. See this previous answer to this question.</p>
How to share a job from static html page to facebook or twitter or linkedin <p>Hi I am posting some jobs in my career page implemented a static web page using html, css there is no back end functionality part for that. I need to share those jobs to Facebook or twitter or linked in by clicking on those button can any o...
<p>I think you are creating mailer and want simple link to share you URLs.</p> <p>Here are sample share links</p> <pre><code>/*Facebook Share*/ &lt;a href="https://www.facebook.com/sharer/sharer.php?u=http%3A//yourpage.com"&gt;Share on Facebook&lt;/a&gt; /*Twitter Share*/ &lt;a href="https://twitter.com/home?status=...
Spring @RequestBody Bad Request <p>I am using POSTMAN to send request's.</p> <p>Configured all right there:</p> <ul> <li>Content-Type application/json</li> <li>Request Type POST and in Body I have the following:</li> </ul> <pre class="lang-none prettyprint-override"><code>{ "token":"EAACEdEose0cBAFLc4blCYmmetEMB...
<p>Your RegisterBody class is private. So nothing outside of the code in your class can create new instances of it. Try:</p> <pre><code>public static class RegisterBody { </code></pre> <p>Or, better still, move RegisterBody into its own java file.</p>
Adding a new user with specific permissions to an Azure Sql Database using Active Directory Integrated Authentication <p>I have an Azure SQL Server with two databases for which I'm trying to use Azure Active Directory Integrated Authentication. One of these databases is critical and most of the users need to be granted...
<p>Sorry for the delay, M. </p> <p>Yeah, you've confused two different levels of access control; the IAM controls that you described (Reader role assignment) allows a user to view (read) the settings in the Azure Portal. Instead, I suspect you want a user (AAD authenticated) to be able to <strong>only read</strong> th...
Getting for line in plaintext.split('\n'): UnicodeDecodeError: 'ascii' codec can't decode byte 0x96 in position 2: ordinal not in range(128) <p>I'm going to design sentimental analysis on twitter data using nltk tutorials but not able to run following code</p> <pre><code>import pickle import random import nltk from n...
<p>Open the files in text mode with the right encoding, e.g.:</p> <pre><code>with io.open("positive.txt", "r", encoding="UTF8") as fd: short_pos = fd.read() </code></pre>
How to generate xml from SQL with Column Name as prop and Column Value as value MSSQL Server <p>I have a SQL Table which has the following columns</p> <ol> <li><strong>Name</strong></li> <li><strong>FatherName</strong></li> <li><strong>MotherName</strong></li> <li><strong>Nationality</strong></li> </ol> <p>I want to ...
<p>Try it like this:</p> <pre><code>DECLARE @tbl TABLE(Name VARCHAR(100),FatherName VARCHAR(100),MotherName VARCHAR(100),Nationality VARCHAR(100)); INSERT INTO @tbl VALUES ('Name1','FatherName1','MotherName1','Nationality1') ,('Name2','FatherName2','MotherName2','Nationality2'); SELECT 'Name' AS [Prop/@ID] ,...
Windows Batch Script using FOR <p>I need to create an ftp script to from a file list. To create the script to from this list, I need to use the FOR command, but I do not know to use.</p> <p>List of files is called "verifica.txt" and within it have the lines:</p> <pre><code>C:\xml\UPLOAD\351506509569110001655505500001...
<p>Try this:</p> <pre><code>(echo in10xml echo xml_in10 for /f %i in (verifica.txt) echo put %i /content/UPLOAD/%~nxi echo bye)&gt; upload_files_xml.ftp </code></pre>
Hitting the Rate Limit <p>I'm currently working on an integration between Podio and another API, and i've stumbled on the following situation: </p> <p>I currently have to find information from a reference in one workspace in an app containing information about invoices and then locate the specific customer in the othe...
<p>Why not use Username/password authentication?</p> <p>That way you only have to authenticate once, and you have access to all spaces/apps you're admin in. This is more suitable for these types of dynamic workflows across apps.</p> <pre><code>//Authenticate podio with $username and $password. Podio::authenticate_wit...
Update trigger AWS Lambda [NodeJS SDK] <p>Is it possible to update programmatically (from a lambda function) the trigger of a (another) lambda function ?</p> <p><strong>UPDATE</strong> : more precisely the trigger is a Schedule Event (cron)</p> <p>I found some <a href="http://docs.aws.amazon.com/cli/latest/reference/...
<p>Scheduled events fall under the CloudWatch service. That's why you aren't seeing them under the Lambda SDK. You have to create or update the CloudWatch Event that points to a Lambda target. </p> <p>You didn't specify what language/SDK you are using, but <a href="http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AW...
ionic 2 error when start new project <p>E:\SocialLoginDemo>ionic start HelloWorld12 blank --v2 Creating Ionic app in folder E:\SocialLoginDemo\HelloWorld12 based on blank project</p> <p>Installing npm packages...</p> <pre><code>Error with start undefined Error Initializing app: There was an error with the spawned com...
<p>There was some problem in spawned command "npminstall" but now they have fixed this issue. Mostly it should work now and if not kindly share screenshot of errors being thrown.</p>
how to create regex expression <p>I have 2 kinds of string one with "Message:" and "Priority:" and other's without it.</p> <pre><code>string str1 = [AE][1W] Message:test mesage Priority:Info string str2 = test message </code></pre> <p>I would like to prepare Regex expression to check the existence of "Message:" and "...
<p>You can change your regex to:</p> <pre><code>(Message:[A-Za-z]+ \w+ Priority:[A-Za-z])\w+ </code></pre> <p>to make it work. However I'd write it like:</p> <pre><code>Message:(\w+[ ]?)+Priority:(\w+[ ]?)+ </code></pre> <p>So that there could be more than 1 word after <code>Message</code> or <code>Priority</code>....
Dynamic for loops <p>I am trying to build a program which uses two for loops and when called should print out:</p> <blockquote> <pre><code> 1 2 3 4 5 6 7 8 9 10 2 4 6 8 10 12 14 16 18 20 3 6 9 12 15 18 21 24 27 30 etc. </code></pre> </blockquote> <pre><code>let mutable s:string = "" let loopMulTable n = for...
<p>Just for fun here's a more idiomatic version:</p> <pre><code>[for i in 1..10 -&gt; List.init 10 (fun j -&gt; (j+1)*i)] </code></pre>
How to get job status of crawl tasks in nutch <p>In a crawl cycle, we have many tasks/phases like <em>inject,generate,fetch,parse,updatedb,invertlinks,dedup</em> and an <em>index</em> job. Now I would like to know is there any methodologies to get <strong><em>status</em></strong> of a crawl task(whether it is running o...
<p>You should always run Nutch with Hadoop in pseudo or fully distributed mode, this way you'll be able to use the Hadoop UI to track the progress of your crawls, see the logs for each step, access the counters (extremely useful!). </p>
Composer can't find composer.json <p>When I download any Laravel project and run <code>composer install</code> it says to me: </p> <blockquote> <p>Composer could not find a composer.json file in C:\Users\gbl\My Documents\vertrigoserv\www\</p> <p>To initialize a project, please create a composer.json file as d...
<p>you might want to try installing composer with-in your project directory. that will create composer.json in your project folder which will enable you to add whichever packages that you wish to add to this composer.json and update it.</p> <p>also make sure you have added php and composer in your PATH variable</p> <...
Draw Component in Canvas Without draw already drawed component again <p>I try to draw bitmap in touch points when touch move i need to draw the bitmap in newly added position not redraw the whole points again how to achieve that.</p> <p>i try the following</p> <pre><code>@Override public boolean onTouch(View v, Motio...
<p>onDraw needs to draw the entire view. So there is no way to draw only the new touches in onDraw.</p> <p>What you can do is create a memory bitmap, and draw new touches to the bitmap in onTouch. Then draw the bitmap to the screen in onDraw. Since the bitmap will never be cleared, you only have to add touches to i...
Dynamic Programming to find all palindromic substrings <p>I was trying to solve a question via dynamic programming. I have a string and I need to find all the possible palindromic substrings. Say, I have a string of length <code>n</code>. I have created a matrix <code>n*n</code> for the lookup. A cell <code>(i,j)</code...
<p>The palindromic substrings can be checked from whose length is one to N. </p> <pre><code> For i from 1 to n Mark all substring of length i is palindromic or not. </code></pre> <p>pseudocode: (string array 1-based)</p> <pre><code>for len=1 to n: // check string from length 1 to n for i=1 to (n-len +...
gmailr authentication on headless system <p>I'm successfully using <a href="https://cran.r-project.org/web/packages/gmailr/index.html" rel="nofollow">gmailr</a> on Linux Mint. But now I want to move the script that I've developed to a headless Debian server (no X window system). I've registered an "OAuth Client ID" in ...
<p>Finally found an answer at the gmailr <a href="https://github.com/jimhester/gmailr/issues/68" rel="nofollow">GitHub</a> page. You need the <code>.httr-oauth</code> file in the R working directory... It can becopied from the GUI machine to the headless one. </p>
Bootstrap datepicker hidden by the container div <p>I have a birthday input text where I use Bootstrap datepicker v4.</p> <p>The form is inside <code>&lt;div class="media"&gt;</code> container. As shown in the pic, the datepicker calendar is hidden by the border of the "media" div, I can't solve this with z-index, it ...
<p>Look for <code>overflow: hidden;</code> on the parent containers such as <code>.media</code>, and see if you can override that or remove it if it's set (<code>overflow: visible;</code> would be the override).</p> <p>I'm just guessing as I don't know what your complete CSS looks like, but another possibility might b...
Static x-axis with datetime type column <p>I set my chart's column type to datetime and it has added un-necessary dates with large space in between in the x-axis, and reduced the size of the columns to almost invisible.</p> <p>[screen shot 1]:</p> <p><a href="http://i.stack.imgur.com/oXpUT.png" rel="nofollow"><img sr...
<p>dates simply don't work well with <code>ColumnChart</code> </p> <p>you can try adjusting <code>bar.groupWidth</code> and other options but never seems to work </p> <p>in the <a href="https://developers.google.com/chart/interactive/docs/release_notes" rel="nofollow">release notes</a>, they mention they've...</p> ...
Create custom Observable <p>it is possible (and correct) to create a custom observable ? For example, if i have data in my cache, i would like create custom observable before make a http request:</p> <p>my request:</p> <pre><code>private device: Device; getDeviceById(deviceId): Observable&lt;Device&gt; { if(this....
<p>Yes, you can create one subject to work as observable as explained on answer <a href="http://stackoverflow.com/questions/39738974/can-i-emmit-the-event-from-parent-to-child-in-angular2/39739184#39739184">can i emmit the event from parent to child</a> and use it when you have data in your cache.</p>
Multiple forms in one controller in Symfony3 <p>I'm trying to use two forms in one controller. Each of them uses diffrent entity. Everytime i try to use second form, the first one executes. How to make it right?</p> <pre><code> $document = new Document(); $form2 = $this-&gt;createFormBuilder($document) ...
<blockquote> <p>@Cerad but how to do this in symfony?</p> </blockquote> <p>Start by defining three routes, one uses GET to display both forms. The other two uses POST to process an individual form. </p> <p><a href="http://symfony.com/doc/current/routing/requirements.html#adding-http-method-requirements" rel="nofo...
switchToViewController sometimes works sometimes not <p>I have one <code>viewController</code> with AVPlayer and other <code>viewController</code> for About box. This is function for switch :</p> <pre><code>func switchToViewController(identifier: String ) { let viewController1:UIViewController = UIStoryboard(nam...
<p>Try This</p> <p><a href="http://i.stack.imgur.com/l7GPr.png" rel="nofollow"><img src="http://i.stack.imgur.com/l7GPr.png" alt="enter image description here"></a></p> <pre><code>let nextView = self.storyboard?.instantiateViewControllerWithIdentifier("mapview") as! HomeWorkViewController self.navigationContr...
How to make elements fit AutoLayout in Xcode IB? <p>I set some constrains to several elements in Interface Builder. Is there any automatic way to force them fit those constrains?</p> <p><a href="http://i.stack.imgur.com/6xSUa.png" rel="nofollow"><img src="http://i.stack.imgur.com/6xSUa.png" alt="Example"></a></p>
<p>You can select the object which you need to be fixed and use "Update Frames" or "Update Constraints" as per your need.Check attached screenshot.</p> <p><a href="http://i.stack.imgur.com/z6MOF.png" rel="nofollow"><img src="http://i.stack.imgur.com/z6MOF.png" alt="enter image description here"></a></p>
Laravel parsing Input from a multiple select box not working <p>This is my pubf in my Controller which handles the request:</p> <pre><code>public function addPermissionsToRoleHandler($rid, Request $request) { $role = Role::find($rid); dd($request-&gt;permissions); foreach($request-&gt;permissio...
<p>I don't have the rep to comment so am posting as an answer. I am not sure, but I think it may be because the Request needs to be the first argument ?</p>
What does "seq_in_index" in MySQL database indexing means? <p><img src="https://s21.postimg.org/eam1u6u07/Issues.jpg" alt="Index Results"> When an index is created, there is one column I have doubts about, in concern with the physical linking of the data nodes. When 2 "seq_in_index" are same, how are they placed in th...
<p>It is the position of the column in the index.</p> <p>Example:</p> <pre><code>INDEX some_idx(column_a, column_b) </code></pre> <p><code>seq_in_index</code> for <code>column_a</code> is <code>1</code> and for <code>column_b</code> is <code>2</code></p> <p>In your case the compound index is</p> <pre><code>INDEX e...
Is this the "React.js" way of doing this? <p>I'm starting with React and I tried to create a simple form that says Hello <em>name</em>!</p> <p>However I feel having 2 state elements isn't the right way to do this.</p> <p>Does anyone knows or believes there's a better way to do this?</p> <p>By the way, I know I can j...
<p>one state is enough. </p> <pre><code>var Name = React.createClass({ getInitialState: function () { return { inputname: '' }; }, showName: function (event) { event.preventDefault(); this.setState({ inputname: this.refs.inputname.value }); }, render: fu...
Close jQuery UI dialog on overlay click <p>I want to close my modal when people click the overlay, normally u would use </p> <pre><code>jQuery('.ui-widget-overlay').bind('click', function() { jQuery('#dialog').dialog('close'); }) </code></pre> <p>but i am loading my modal after i create it, so it ...
<p>You can bind the event inside the <code>open</code> method</p> <pre><code>var dialog = $(".dialog").dialog({ autoOpen: false, closeText: "", width: 'auto', modal: true, open: function(event, ui) { //added here jQuery('.ui-widget-overlay').on('click', function() { jQuery('#dialog').dialog('clos...