input
stringlengths
51
42.3k
output
stringlengths
18
55k
Concatenating every third list <p>I have a big list of lists. And I want to <code>concat</code> every third list into each other. Like such</p> <pre><code>let xss = [[1,2,3],[1,2,3],[1,2,3], [4,5,6],[4,5,6],[4,5,6], [7,8,9],[7,8,9],[7,8,9]] someFunk xss = [[1,2,3,1,2,3,1,2,3], [4...
<p>Just for bikeshedding purposes, I think I would write something like this:</p> <pre><code>import Data.List.Split someFunk = map concat . chunksOf 3 </code></pre> <p>It's concise, and I think it also reads a lot like your English description. It uses the <a href="http://hackage.haskell.org/package/split">split</a> ...
Elasticsearch + Kibana, sorting on uri yields no results. (uri isn't analyzed) <p>I have a log of HTTP requests, one of the fields is a URI field. I want to get the average duration in ms for each URI. I set the y-axis in Kibana to <code>"Aggregation: Average , Field: durationInMs"</code>. </p> <p>For the x-axis I ha...
<p>When reindexing data, the <code>httplogentry</code> mapping doesn't get ported from <code>lsc-logs</code> to <code>lsc-logs2</code>, you need to create the destination index+mapping first and only then reindex.</p> <p>First delete the current destination index</p> <pre><code>curl -XDELETE localhost:9200/lsc-logs2 ...
How to display Status ERROR if sql columns has zero value? <p>I have this line of code, which checks the result of the query. I want to have a STATUS ERROR if one of the columns contains a value= '0'. </p> <p>If the condition founds a zero value it will echo: Status: ERROR,</p> <p><a href="http://i.stack.imgur.com/QF...
<pre><code> bool zeroExist = false; $finfo = $result-&gt;fetch_fields(); foreach ($finfo as $val) { while($row = $result-&gt;fetch_assoc()) { if ($row[$val-&gt;name] === 0) { zeroExist = true; break; } } if(zeroExist){ break; } } if (!zeroExist){...
Form Enabled in FormClosing Event Not Working <p>I'll show you my code first:</p> <pre><code>Private Sub AddProductToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AddProductToolStripMenuItem.Click Me.Enabled = False Dim frmAddProduct As New FormAddProduct frmAddProduct.Show() frmAddPr...
<p>This line is your problem:</p> <pre><code>Dim frmMainIndex As New FormMainIndex </code></pre> <p>You are instantiating a <em><strong>new</strong></em> <code>FormMainIndex</code>. Whenever you use the <a href="https://msdn.microsoft.com/en-us/library/77s47661.aspx" rel="nofollow"><strong><code>New</code> keyword</s...
Borders not showing in CSS <p>So I have a problem with bottom border not showing on my elements. When I inspect the element it's not overwritten by anything and there is also no error being shown. </p> <p>I wrote this poorly. So I need just the bottom border, others should not be seen.</p> <p><div class="snippet" dat...
<p>Add a container div and give the id 'top'. <a href="https://jsfiddle.net/jwk442hx/" rel="nofollow">jsfiddle</a></p> <pre><code>&lt;div id="top"&gt; &lt;input type="email"&gt; &lt;br&gt; &lt;p&gt;Something&lt;/p&gt; &lt;input type="text"&gt; &lt;br&gt; &lt;p&gt;Something2&lt;/p&gt; &lt;input type="tel"...
DateTimeFormatter exception <p>I am having issues with the DateTimeFormatter in Java.</p> <p>I have the following code:</p> <pre><code>DateTimeFormatter format = DateTimeFormatter.ofPattern("dd/MM/yyyy"); LocalDateTime startDate = LocalDateTime.now(); LocalDateTime endDate = LocalDateTime.parse(ceremonyDetails.getDat...
<p>You should use <a href="http://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html" rel="nofollow"><code>LocalDate</code></a> rather than <a href="http://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html" rel="nofollow"><code>LocalDateTime</code></a>. One is for a date-only value, the other for a...
DeserializeObject array to object gives no result <p>When I try to deserialize the json I receive from an external source my program won't map the childobjects when I use <code>value.first()</code>.</p> <pre><code>private Class1 class1List; public List&lt;Class1&gt; Class1List { get { return new List&...
<p>If you are that particular not add private member I have tried an another solution</p> <pre><code> var selctedList = JObject.Parse("YOUR JSON").SelectToken("Class1List").ToString(); var class1List = JsonConvert.DeserializeObject&lt;Class1[]&gt;(selctedList, new Class1Converter()); public class Class1 ...
Beacons integration without application on device <p>Can i know is it possible to communicate with Beacon without having any Mobile app on device?</p> <p>Thanks in advance</p>
<p>You should checkout Eddystones from Google. They can push you URLs even without app. </p> <p>If you want to interact with beacons and do custom stuff (notifications, http requests, etc) you will need an app. </p>
Bootstrap 4 - Pull left and right removed for .pull-{xs,sm,md,lg,xl}-{left,right,none} - Do I have to write each of them? <p>In the newest version the pull-left and pull-right have been replaced by .pull-{xs,sm,md,lg,xl}-{left,right,none}</p> <p>That means that instead of writing a simple class="pull-right" I will hav...
<pre><code>$('.pull-right').addClass('pull-xs-right').removeClass('pull-right') </code></pre>
How to get correct answer <p>I have this example, how i can make it to show the correct answer. If everyone is online, then the global status is online. If some one is away, global status is away. If everyone is offline -> offline.</p> <pre><code>var group, part1, part2, part3; group = 'Group Status'; part1 = 'online...
<p>Here is what I think you want to do: <a href="http://es6fiddle.net/itfgy2xt/" rel="nofollow">http://es6fiddle.net/itfgy2xt/</a></p> <p>It helps to use an array for your group parts, so you can use array methods, namely <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/e...
Dropdown list values not being populated <p>My aim is to show values in a dropdown list. </p> <p>My code gets the data from database but the dropdown list is not being populated</p> <pre><code>$scope.CountryID = xxx.CountryID; </code></pre>
<p>To show data in <code>DropDown</code> list you need use <code>ng-repeat</code></p> <p>eg:-</p> <pre><code>&lt;select&gt; &lt;option ng-repeat="cate in category" value="{{cate.id}}"&gt;{{cate.name}}&lt;option&gt; &lt;/select&gt; </code></pre> <p>In above code <code>category</code> is a <code>$scope</code> with...
How to handle UNNotificationAction when app is closed? <p>How to handle new iOS10 Notification Action when app is closed (not in background) ?</p> <p>when app is minimalized everything works fine with:</p> <pre><code>UNUserNotificationCenter.current().delegate = x </code></pre> <p>and handling it in</p> <pre><code>...
<p>Yes, it always launch the app, when user tap action in notification, button launches your app. Some lines from <a href="https://developer.apple.com/reference/uikit/uiusernotificationaction" rel="nofollow">apple doc</a>: </p> <p><strong>Tapping a button launches your app (either in the foreground or background) and ...
package require with static lib <p>I am working on app which uses tcl package implemented in C++ and linked as static library (app is developed long time ago). It does following:</p> <pre><code>// Library code extern "C" int testlib_SafeInit _ANSI_ARGS_((Tcl_Interp *interp)) { return Tcl_PkgProvide(interp, "testl...
<p>Well, the simplest technique for statically providing a package is to just install it directly. The package init code should be the one calling <code>Tcl_PkgProvide</code> — you don't do so from main() usually — and you probably don't need <code>Tcl_StaticPackage</code> at all unless you're wanting to install th...
Delete from tables is not clearing oracle space <p>I've created a tablespace and user and I've 10 tables under this user, having LOB objects which is eating up the space but it required as part of the application. I've created a delete script which deletes the data before 30 days from these tables .But even after delet...
<p>When an extent is allocated to a table (or index, etc) it belongs to that table until you</p> <ol> <li>drop the table</li> <li>truncate the table</li> </ol> <p>When you delete the data from the table -- the blocks will go onto the freelist for that table (assuming the amount of space on a block that was freed fell...
JavaFX how to cancel ComboBox selection change? <p>Here is the demo code:</p> <pre class="lang-java prettyprint-override"><code>public class ComboBoxTest extends Application { public static void main(String[] args) { Application.launch(ComboBoxTest.class); } @Override public void start(Stage ...
<p>There are 2 issues here.</p> <ol> <li><p>A change from value <code>a</code> to value <code>b</code> is not valid, but also a change from <code>b</code> to <code>a</code> is invalid. Therefore when the value is changed the listener undos the change which leads to another change event that the listener tries to undo,...
SQL query with one to many relation <p>I have following table</p> <p>Table1</p> <pre><code>id name col1 col2 col3 col4 ----------------------------------- 1 test 1.1 1.2 1.3 1.4 2 test2 2.1 2.2 2.3 2.4 </code></pre> <p>Table2</p> <pre><code>id fk_table1 amt type(fk_table3) ------...
<pre><code>SELECT t1.id, t1.name, t2.total_type1_amt, t2.total_type2_amt FROM table1 t1 INNER JOIN ( SELECT fk_table1, SUM(CASE WHEN type = 1 THEN amt END) AS total_type1_amt, SUM(CASE WHEN type = 2 THEN amt END) AS total_type2_amt GROUP BY fk_table1 ) t2 ON t1.id ...
Stuff spaces at end of lines in file <p>I am trying to read a fixed with file that has lines/records of different lengths. I need to stuff spaces at the end of the lines which are less than the standard length specified.</p> <p>Any help appreciated.</p> <p><a href="http://i.stack.imgur.com/N5Kbd.png" rel="nofollow">e...
<p>You can use <a href="https://docs.python.org/3.3/library/string.html" rel="nofollow">string.format</a> to pad a string to a specific length.</p> <p>The documentation says that <code>&lt;</code> pads to the right so to pad a string with spaces to the right to a specific length you can do something like this:</p> <p...
How can I use my Icon in Serenity Template instead of Glyphicons? <p>I am using Serenity template for my asp net MVC application. What I am trying to do is to add icons and use them instead of using serenity template glyphicons. I don't know how to do this in this template file.</p>
<p>The icons you use should be font based. </p> <p>If you need images, match them some class, e.g. my-custom-icon1, then style it with css .my-custom-icon1 { background-image: url(...); )</p>
Printing values from a pointer to an array returned from a function (C++) <p>I have a function that returns a pointer to an array, and I want to print each value in the array</p> <p>When I run it, it prints</p> <pre><code>int* merge_sort(int arr[], int size) { if (size &lt;= 1) { return &amp;arr[0]; }...
<p>Make sure that you returned correct pointer, for example (if pointer should point to <code>values</code>):</p> <pre><code>std::cerr &lt;&lt; "\n" &lt;&lt; sorted &lt;&lt; " "&lt;&lt; &amp;values &lt;&lt; "\n"; </code></pre> <p>should return same values:</p> <pre><code>003DFD64 003DFD64 </code></pre>
Is it possible to search for a person or company in LinkedIn's API? <p>I am trying to search for a company/person through LinkedIn's current API by using the directions provided on this post </p> <p><a href="http://stackoverflow.com/questions/3781581/linkedin-api-for-company-directory">LinkedIn API for Company Directo...
<p>LinkedIn has limited its API access some time ago. See the <a href="https://developer.linkedin.com/support/developer-program-transition" rel="nofollow">details</a>. Inorder to do a person search you should get vetted <a href="https://developer-programs.linkedin.com/documents/people-search-api" rel="nofollow">API acc...
Go through object when keys are know <p>I have object </p> <pre><code>var routes = { "home":{ hash: "/home", children: { "just-home": { hash: "/home/just-home", children: {...} }, "sub-homea": { hash: "/home/sub-homea", children: {...} ...
<p>Found simple solution - </p> <pre><code>pathArray.map(function (item) { if (obj[item].hash === item){ obj = obj[item].children; } }) </code></pre>
use css variable with scss darken and ligthen filter <p>I would like to use scss <code>lighten()</code> and <code>darken()</code> function with CSS4 <code>var</code>.</p> <p>Like this : </p> <pre><code>box-shadow: inset 0px -2px 50px 45px darken(var(--colorbtn),20%); </code></pre> <p>It seems not working, gulp write...
<p>This can't really work because SASS is a <em>preprocessor</em>, and CSS custom properties can be dynamically changed at <em>run-time</em>. For SASS to be able to preprocess this with darken, it would have to replace the custom property with a static value, in which case the usefulness of the custom property is lost...
how to build a 'page track' in SSRS <p>I have 6 pages built in SSRS in a break down sequence:</p> <p>A->B->C->D->E->F</p> <p>I wonder is there a way to build a 'page track' something like displaying 'A->B->C->D->E->F' on the top of each page</p> <p>for example:</p> <p>when on page B, it displays: A->B when on page ...
<p>You can identify pages by using <code>PageNumber</code> global variable. <code>PageNumber</code> is only accessible from <code>Page Header</code> and <code>Page Footer</code>, so you have to add a Page Header/Page Footer via <code>Report</code> in menu bar.</p> <p>Then place a textbox inside it with the following e...
Jasmine Open And Close Db Connections <p>I have multiple files with unit tests. I want to avoid to concat them. I need to close the mongoose connection in order for <code>gulp-jasmine</code> to <a href="https://github.com/sindresorhus/gulp-jasmine/issues/49" rel="nofollow">exit</a>. I also want to avoid to put the conn...
<p>This seems to work, still wondering why I can't use the <code>disconnected</code> event:</p> <pre><code>connections = 0 disConnectionRetries = 0 MAX_DISCONNECTION_RETRIES = 10 connectDB = (callback) -&gt; console.log "CONNECTING TO DB", mongoose.connection.connectionState configDB = require(applicationDir + 'b...
Rascal createM3FromEclipseProject with huge Java project <p>I'm completely new to <a href="/questions/tagged/rascal" class="post-tag" title="show questions tagged &#39;rascal&#39;" rel="tag">rascal</a>. I'm currently just trying some basic things on our project and a test project.<br> On a test project the following wo...
<p>Check your profiler (VisualVM), most likely you are primarily waiting for the Garbage Collector to free up memory, then consume it, and ask for more memory again.. increasing the max memory for the JVM can greatly help (<code>-Xmx8G</code> in the eclipse.ini).</p>
Android empty sms inbox on Tablet <p>For a project I have to make an sms application on a tablet with SIM. I am able to send a sms and to receive a sms, but when I use Content Resolver to acces "content://sms/inbox" my cursor has no data. Anyone has an idea of what could be the problem?</p> <p>Here is my code to read ...
<p>From information gleaned in the comments, and the tests you've run on the device, it seems there isn't really a problem. You just started out with a fresh, empty SMS Provider. Since you didn't have a default SMS app installed at the time, there was no app available to write any incoming messages to the inbox, which ...
Can git clone benefit from http2 <p>Can git clone benefit from http2?</p> <p>I do always prefer ssh over http(s) because of various network errors but also ssh seems to be a bit faster than http(s). So my question is: Could git, especially clone, benefit from http2 s multiplexing functionality for example?</p>
<p>The <a href="https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols#The-Smart-Protocol" rel="nofollow">smart protocol</a> over HTTP uses a few long-running requests; HTTP/2 would not benefit dramatically here.</p> <p>By contrast, the <a href="https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols#...
Search rows with duplicate value in datatable <p>I have this datatable (RadkyData):</p> <pre><code>Name EAN PRICE ITEM1 12345 10 ITEM2 5558 55 ITEM3 12345 44 </code></pre> <p>I need to search rows with duplicate value EAN.? (a list of all EAN that are duplicate) I have this code:</p> <pre><code>va...
<pre><code>var rowsWithDupEAN = RadkyData.AsEnumerable() .GroupBy(row =&gt; row.Field&lt;string&gt;("EAN")) .Where(g =&gt; g.Count() &gt; 1) .SelectMany(g =&gt; g); </code></pre> <p>If you don't want the rows but only this column values(as mentioned in a comment):</p> <pre><code>var dupEanList = RadkyData...
Persist entity : cannot be null <p>When I use this code, I have this error " <strong>Integrity constraint violation: 1048 Column 'ecriture_id' cannot be null</strong> " :</p> <pre><code> $produit = new Produit(); $ecriture = new Ecriture(); $produit-&gt;setEcriture($ecriture); // $this-&gt;em-&gt;persis...
<p>I have always had similair problems when I added new columns to my database, and got liek you the cannot be null error. </p> <p>What mostly fixed it for me was adding nullable is true, then in twig, controller or form add the required = true attribute. Therefor it always had to be filled.</p>
how to call non static method from static inner class within same activity <pre><code>public class ABC extends Activity{ public void foo(int val) { } ... public static class Receive extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { ...
<p>Move <code>public void foo(int val)</code> to Class <code>Receive</code></p>
How compiler overloades template function without argument list change? <p>As you can see in the code below method <code>get</code> is templated. </p> <pre><code>struct A { int i; char c; }; class SL { static void* m_a; public: template &lt;class T&gt; static T* get() { return stat...
<p>Template <em>instantions</em> are really <em>different</em> functions which are not overloaded. You may think of the template parameters <code>&lt;B&gt;</code> as a part of the function name. So <code>SL::get&lt;A&gt;</code> and <code>SL::get&lt;B&gt;</code> are really different functions (though stemming from the s...
How to divide a numerical columns in ranges and assign labels for each range in apache spark? <p>I have the following sparkdataframe:</p> <pre><code>id weekly_sale 1 40000 2 120000 3 135000 4 211000 5 215000 6 331000 7 337000 </code></pre> <p>I need to see in which of the following intervals item...
<p>Assuming ranges and labels are defined as follows:</p> <pre class="lang-py prettyprint-override"><code>splits = [float("-inf"), 100000.0, 200000.0, 300000.0, float("inf")] labels = [ "under 100000", "between 100000 and 200000", "between 200000 and 300000", "more than 300000"] df = sc.parallelize([ (1,...
TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead <p>Always getting this warning <strong>TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead.</strong> and not finishing Activity for First time. On Second time not getti...
<p>Try not using </p> <pre><code>&lt;android.support.v7.widget.AppCompatEditTextinstead </code></pre> <p>instead use </p> <pre><code>&lt;EditText </code></pre> <p>So you will get:</p> <pre><code>&lt;EditText android:id="@+id/et_email" android:layout_width="match_parent" andro...
Does a Jmeter thread really approximate a user? <p>I am trying to setup a JMeter load test, using the Recording Controller. </p> <p>This results in duplication of all the calls the web browser would make - including css files, js files and images.</p> <p>Given that a web browser would get these concurrently (performi...
<p>Strictly Speaking, JMeter can't simulate a browser. Jmeter has its own limitations, like not running javascript (as per 3.0 version), sending ajax requests from events etc.</p> <p>But, for your question, there is support in JMeter.</p> <p><a href="http://i.stack.imgur.com/9xfsa.png" rel="nofollow"><img src="http:/...
New NAND partition for UBIFS <p>I am working on custom board based on the NXP i.MX7D SoC. I want to create new partition to save configurations database on nand.</p> <p>For that i have made changes in u-boot in mtdparts args which is get passed to the kernel on command line. New nand partition is created successfully ...
<p>Here is my startup sequence for UBIFS:</p> <pre><code>mkdir /data ubiattach /dev/ubi_ctrl -m 8 -O 2048 | grep "available 0 LEBs" retval=$? if [ "$retval" = "1" ]; then # Flash memory doesn't contain UBI image ubimkvol /dev/ubi0 -N data_volume -m fi mount -t ubifs -o sync ubi0:data_volume /data retval=$? if ...
I cannot change the image in pictureBox1 from code in C# <p>First things first: Im pretty new to Programming, and I'm trying to learn the C# Language</p> <p>My Goal: Having a method that changes the picture in pictureBox1.</p> <p>Issue: I get the error that tells me that an object reference is required for non-static...
<p>Your method declaration should be something like this: </p> <pre><code>public void valueChecker(char value,PictureBox pictureBox1) </code></pre>
onchange event not accepting my javascript code <p>I have two text input for the user to type numbers, and I would like the page to output the total of these two numbers in another text input</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"...
<p>I suggest putting the code of your onchange in a function and just calling that function onclick. It makes things way more easy to debug.</p> <p>Example</p> <pre><code>function addValue(field) { parseInt(document.getElementById('attendance_output').value) += parseInt(field.value); } &lt;input id="attendance_1...
jQuery checking if input has value by function call <p>I defined this function which checks if a input field is empty or not</p> <pre><code>function hasValue() { if ( !!$.trim( $(this).val() ) ) return true; } </code></pre> <p>It just works fine for filtering a jQuery Collection</p> <pre><code>$('#form'...
<pre><code>$('.input').change( function () { var empty = hasValue.apply( $(this) ); //apply function should be used this way . // var empty = $(this).hasValue(); //doesn't work either $('#box').find('.required-tmp').toggleClass('required', empty ); }); </code></pre>
Yii2, ExportMenu: How to format a date, that Excel recognise it automatically as date? <p>I use in my grids the extension <a href="https://github.com/kartik-v/yii2-export" rel="nofollow">yii2-export</a> to export data to XLS and XLSX. Whatever I try, Excel does not automatically recognize the dates. I have tried e.g. t...
<p>You can try this:</p> <p>In grid configuration add:</p> <pre><code>'onRenderDataCell' =&gt; function ($cell, $content, $model, $key, $index, $grid) { if ($key == 'mydate') { $cell-&gt;setValue(\PHPExcel_Shared_Date::PHPToExcel(\Yii::$app-&gt;formatter-&gt;asTimestamp($model-&gt;$key))); } }, </code...
Python dropbox - Opening spreadsheets <p>I was testing with the dropbox provided API for python..my target was to read a Spreadsheet in my dropbox without downloading it to my local storage. </p> <pre><code>import dropbox dbx = dropbox.Dropbox('my-token') print dbx.users_get_current_account() fl = dbx.files_get_previe...
<p>No, the Dropbox API doesn't offer the ability to selectively query parts of a spreadsheet file like this without downloading the whole file, but we'll consider it a feature request.</p>
How to change color of selected text of textarea? <p>I have <code>textarea</code> and i want to change color of selected text. Example:</p> <pre><code>var text = "abcdefg"; </code></pre> <p>I want to change color of selected text <code>efg</code>.</p> <p>here is my code:</p> <pre><code>var input = document.getEleme...
<p>Use <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/::selection" rel="nofollow"><code>::selection</code></a> CSS selector that select part of text is seleced. You can add your CSS property to selected text of elements.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-b...
The size become small when move to other directory <p>There is a file named hive2016080223.txt located in /home/routedata whose size is 8G. Then I move the file to /home/hadoop/data/ </p> <pre><code>mv routedata/* hadoop/data/ </code></pre> <p>But this time the size of the file became 7.1G. Could anyone tell what's ...
<p>In scenario with Hadoop these cases are more probable:</p> <p>Compression: FS supporting compression and having it enabled will compress files on it automatically. Compression for txt files could produce amazing results.</p> <p>Data De-duplication: FS supporting DDD will not write some duplicated data into storage...
how to put image_tag with link_to_unless_current in rails? <p>I would like put "image_tag" instead of "en"</p> <blockquote> <p>&lt;%= link_to_unless_current "en", locale: "en"%></p> </blockquote> <p>i try this one but it's not working: </p> <blockquote> <p>&lt;%= link_to_unless_current "#{image_tag('flag.png')}"...
<p>I think this is what you're looking for:</p> <pre><code>&lt;%= link_to_unless_current image_tag('flag.png'), locale: "en" %&gt; </code></pre>
AVPlayerviewcontroller ios objective c <p>I have an application for both ipad iphones, ipad users always landscape mode is enabled and portrait for iphone users, now what I am trying to achieve is in the iphone application I play a video using AVPlayerViewController but since the application is locked in portrait insid...
<p>Add below code in your <code>AppDelegate.m</code> file.</p> <p><strong>Objective C</strong></p> <pre><code>#if __IPHONE_OS_VERSION_MAX_ALLOWED &lt; __IPHONE_9_0 #define supportedInterfaceOrientationsReturnType NSUInteger #else #define supportedInterfaceOrientationsReturnType UIInterfaceOrientationMask #endif - (s...
Laravel: variable + parameter in view <p>I want to ask if it is possible to do something like this in View in Laravel 5.2:</p> <p><code>&lt;p&gt; This is window: {{$element_ + 'window'}} &lt;/p&gt; &lt;p&gt; This is wall: {{$element_ + 'wall'}} &lt;/p&gt;</code></p> <p>The values for this variables are from $element...
<p>There are couple of options.</p> <p>First - is to use <code>@php</code> block in <code>.blade</code> file for dynamic output:</p> <pre><code>@php ${'window'} = ${$element_.'window'} @endphp </code></pre> <p>Second is to write custom blade extension to output anything you need.</p> <p>Third is to define custom me...
Sql to select count using dates <p>I am using SQL Sever database, I am writing a query to select count of each option's RecordDate is found in surveys start and end date. If same any option found more than one time between the start and date, even then should be considered once.</p> <pre><code>tblOptions -------------...
<p>You can achieve this by joining your data together and then grouping it together (The <code>distinct</code> option below) so you can count the unique combinations:</p> <pre><code>select [Option] -- You really should try to avoid using reserved ,count(1) as [Count] -- words for your column...
Angular 2 - Preload background image? <p>I have this angular project where I have a big background image that fills the page and a simple sidebar with links that when clicked, will change the url of the background with another image (from a cdn). Since these images are fairly big they take a second or two to load and i...
<p>One way to do it would be to use <code>Blob</code> to get the image and store it in an <code>img</code> component, this way you have your hands on the loading process and you can add your loading gif:</p> <pre class="lang-js prettyprint-override"><code>@Component({ selector:'loading-image', template:'&lt;img ...
spf, dkim and dmarc passes but email goes to spam <p>I configured postfix, dovecot and opendkim on digitalocean server.</p> <p>When I am sending mail to gmail or google apps users it marked as spam.</p> <p>I checked on original mail everything is passed.</p> <p>here is my mail.</p> <pre><code>Delivered-To: username...
<p>Nothing.</p> <p>There's nothing wrong with your configuration - all the SPF and DKIM checks pass. Whether messages get put into spam folders is generally not up to you, nor anything you do; <em>it's up to your recipients</em>. If your recipients open your messages, spend time reading them, click on your links, don'...
Why is getResult() only returning an array with only the last record? <p>I'm writing a console app in Symfony 3, but for some reason my query results are coming back with only 1 result in the array where I confirmed running it in MySQL and get several results back. Here is the relevant code:</p> <pre><code>$arr_id = a...
<p>Try:</p> <pre><code>$rt = $em-&gt;createQuery($dql2) -&gt;setParameters( array( 'in' =&gt; $arr_id, ) ) ; </code></pre>
How can I convert this command line code to run in PowerShell ISE 2.0? <p>So I'm using this console command to open a file using a specific application and then passing in a parameter (spacing used to make it more legible)</p> <pre><code>start C:\"Documents and Settings"\User\"My Documents"\Application_folder\Applicat...
<p>How about</p> <pre><code>&amp; 'C:\Documents and Settings\User\My Documents\Application_folder\Application.exe' "C:\Documents and Settings\user\My Documents\file_folder\file.type" "Parameter1" </code></pre>
Get data from mysql to input tag when value of select is ID <p>I have MySQL table "names":</p> <pre><code> id | name | country | age 1 | Mark | Germany | 20 2 | Jack | UK | 23 3 | Mary | US | 32 4 | Suzan | Italy | 15 </code>...
<p>There are 2 things you have to do:</p> <p>First you put the value you want to use as value in the value from the option.</p> <p>To simplify the example see HTML the value of the option is the value you need! So no reason to set there an ID and get the age.. even if that is possible there is not reason here to do t...
How to join tables, concatenate some data <p>I have two tables:<br> 1. indexes and quantity of indexes<br> 2. indexes and quantity of indexes with specified boxcodes. Boxcode is a number of box, which box contains indexes.<br></p> <pre><code>1. input table 1 item_id quantity 1 10 2 15 3 5 1 5 ...
<p>Weird, but it works:</p> <pre><code>;WITH rec1 AS ( SELECT rownum, item_id, 1 as q, 1 as [Level], quantity from #input1 UNION ALL SELECT r.rownum, r.item_id, 1, [Level] + 1, i.quantity FROM rec1 r ...
Using C in Swift - strlcpy - Cannot convert value of type 'UnsafeMutablePointer<_>' <p>I am trying to use strlcpy in Swift 3.0, but keep getting the error "Cannot convert value of type 'UnsafeMutablePointer&lt;_>' to expected argument type 'UnsafeMutablePointer!'"</p> <p>Here is my code</p> <pre><code>func login(port...
<p>C arrays are imported to Swift as tuples. But the memory layout of C structures is preserved in Swift, therefore you can use the address of the first tuple element <code>loginEvent.portalUri.0</code> (which has type <code>CChar</code> aka <code>Int8</code>) as the target address.</p> <p>Also you can pass a Swift <c...
PHP Array Sum By same key value pair needs to Calculated <pre><code>&lt;?php error_reporting(E_ALL); $test_array = Array(Array ( "pid" =&gt; 1, "encounter" =&gt; 20, "code" =&gt; abc, "fee" =&gt; 300.00 ), Array ( "pid" =&gt; 1, "encounter" =&gt; 20, "code" =&gt; abc, "fee" =&gt; 300.00...
<p>if i understood your problem, you need to sum the fee column everytime the 3 other columns have the same value. I customised your code a bit so you can have the total cost for each of your elements.</p> <pre><code>//Declaration... $pre_pid = ""; $pre_encounter = ""; $pre_code = ""; $pre_fee = ""; $sum_charges = 0; ...
{$WARN SYMBOL_PLATFORM OFF} does not turns off warnings <p>I have this piece of code:</p> <pre><code>INTERFACE {$WARN SYMBOL_PLATFORM OFF} USES Winapi.Windows, etc, {$IFDEF MSWINDOWS}Vcl.FileCtrl, {$ENDIF} System.IniFiles; {$WARN SYMBOL_PLATFORM ON} </code></pre> <p>The compiler shows:</p> <blockquote> <p>[dcc...
<p>You are using the wrong directive. <a href="http://docwiki.embarcadero.com/RADStudio/en/W1002_Symbol_%27%25s%27_is_specific_to_a_platform_(Delphi)"><code>SYMBOL_PLATFORM</code></a> controls warnings for <em>symbols</em> marked platform specific. Your warning relates to a <em>unit</em> marked platform specific. </p> ...
How can I change already created Expression? <p>I have kind of following class:</p> <pre><code>public class Entity { public int Id { get; set; } public string Name { get; set; } } </code></pre> <p>I am passing <code>IEnumerable&lt;Entity&gt;&gt;</code> as data source to kendo grid (I think it does not matter,...
<p>According to @JonSkeet's comment I have implemented the following </p> <pre><code>internal class KendoExpressionModifier : ExpressionVisitor { public Expression Modify(Expression expression) { return Visit(expression); } protected override Expression VisitConditional(ConditionalExpression n...
Show Details on Pie-Chart android <p>I need a pie-chart like shown below</p> <p><a href="http://i.stack.imgur.com/wc2YS.png" rel="nofollow"><img src="http://i.stack.imgur.com/wc2YS.png" alt="enter image description here"></a></p> <p>I have searched a lot but most similar case I can find was <a href="http://wptraffica...
<p>Use Can try this...</p> <p>Pi Chart</p> <p>You can follow <a href="https://github.com/HackPlan/AndroidCharts" rel="nofollow">This</a> link.... </p> <pre><code> &lt;view android:layout_width="300dp" android:layout_height="wrap_content" class="im.dacer.androidcharts.PieView" android:id="@+id/pie_view" /&gt; PieV...
Pivot table on R using `dplyr` or `tidyr` <p>I have data set like below: </p> <pre><code>&gt; head(worldcup) Team Position Time Shots Passes Tackles Saves Abdoun Algeria Midfielder 16 0 6 0 0 Abe Japan Midfielder 351 0 101 14 0 Abidal France ...
<p>One option will be to <code>gather</code> first, group by 'Var' and <code>summarise</code> to get the <code>mean</code> of 'Val'</p> <pre><code>library(dplyr) library(tidyr) worldcup %&gt;% gather(Var, Val, Time:Saves) %&gt;% filter(Var!= "Shots") %&gt;% group_by(Var) %&gt;% summarise...
Mobile app and server <p>Im writing an android app and need to get data from a server. How can I know if there changes in the data whithout downloading all data every time ?</p> <p>Do you think relying on date and time will work? I mean: if the server tells apps last time updated was at 11.00 and current time is 11.01...
<p>You can use a pending intent along with alarm manager and broadcast receiver to achieve this functionality.</p> <p>For instance you can you can send a simple request say "Request A" to get a response from the server. On the server side if data has changed the response will be "true" else "false".</p> <p>Now if you...
When is iOS app receipt not available? <p>I want to read the original application version from the app's receipt.</p> <p>In development the app contains no receipt since it's not installed from the store. I need to start a <code>SKReceiptRefreshRequest</code> in order to get a sandbox receipt. But that prompts the use...
<p><strong>Edit</strong></p> <p>When is iOS app receipt not available? Here's one scenario where the app receipt will be missing. If a user purchases your app from iTunes on a computer (a non-iOS device) and then later syncs that app to their device, there will not be an app receipt. </p> <p>See <a href="https://deve...
Create SQL database from dict with different features in python <p>I have the following dict:</p> <pre><code>base = {} base['id1'] = {'apple':2, 'banana':4,'coconut':1} base['id2'] = {'apple':4, 'pear':8} base['id3'] = {'banana':1, 'tomato':2} .... base['idN'] = {'pineapple':1} </code></pre> <p>I want to create a SQL...
<p>ids will get duplicated if you use the sql i would suggest use postgres as it has a jsonfield ypu can put your data there corresponding to each key. Assuming you are not constrained to use SQL.</p>
ListSelector for RecyclerView on touch free device (using onKey Listener) <p>I am trying to implement a list selector for my <code>RecyclerView</code> grid on a touch free device. My implementation works fine but it requires <code>notifyItemChanged()</code> method which is not efficient performance wise. I have a grid ...
<p>There are couple of optimisations you could add to your code:</p> <ol> <li><p>Don't call <code>notifyItemChanged()</code> when <a href="https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html" rel="nofollow"><code>RecyclerView</code></a> is scrolling. There are couple of handy methods fo...
Create sample database backup <p>We, like many businesses, have a live environment and a development environment. For reasons beyond my control, the dev environment does not have the capacity to store everything from the live environment. As such, when the dev env needs to be refreshed, the DBA has to manually copy a s...
<p>Snapshot replication could be an option. You could put filters on the different articles (tables) to replicate just the sample of data across. Script this on the first run, and then re-use again. </p> <p>Next step would be to schedule these scripts to run weekly/monthly (period that you want it refreshed).</p>
Angular2 HTTP GET parameter inside URL <p>I would like to call REST service GET method with with Angular2 HTTP and parameter "searchId" inside the URL like this:</p> <pre><code>http://localhost:8080/services/name/:searchId/documents/ </code></pre> <p>In AngularJS it was quite easy: </p> <pre><code> getDataReso...
<p>The only way to do it is unfortunately simple concatenation:</p> <pre><code>getData(searchId:number):Observable&lt;any&gt;{ return this.http.get(http://localhost:8080/services/name/"+searchId.toString()+"/documents/"; } </code></pre> <p>More informations on <a href="https://angular.io/docs/ts/latest/guide/serv...
Fetch initial records <p>I'm playing with CloudKit and am confused how and when I should fetch initial records for my local cache at first launch of app. Should I fetch all records before I do the initial subscription, or after?</p> <p>And it seems like we can skip using queries to fetch data. We could use (and I do u...
<p>I'm not fully there to understanding this yet, but it seems that we cannot use the defaultZone for this stuff. We have to create a custom zone and use subscriptions for that... I guess there is a good reason for this and a longer explanation but I'll go with this for now... I hope it works too :-P (to use a custom z...
Spring Security not working after migrating from version 3 to 4 <p>Recently I migrated from Spring Security 3 to version 4. Everything worked well before but now nothing works. </p> <p>Here is my <code>spring-security.xml</code>:</p> <pre><code>&lt;beans:beans xmlns="http://www.springframework.org/schema/security" ...
<p>You are missing many referrenced beans here.</p> <ol> <li><code>user-service-ref="Authentication"</code></li> <li><code>success-handler-ref="Logout"</code></li> <li><code>authentication-success-handler-ref="AuthenticationSuccess"</code> </li> <li><code>authentication-failure-handler-ref="AuthenticationFailure"</cod...
How to generate apk file for cordova mobile app developed in Mobile First 8.0? <p>I want to install my app in different android devices and so I want to generate apk file of my app.</p> <p>Note: There is no hooks folder when I create a Application.</p> <p><a href="http://i.stack.imgur.com/RPlFi.png" rel="nofollow"><i...
<p>In MobileFirst Foundation 8.0 you create Cordova apps <strong>using the Cordova CLI</strong>, and you <strong>add to it</strong> the MobileFirst Foundation Cordova plugin (the MobileFirst Foundation SDK).</p> <p>Since you create standard Cordova apps, you also create the .apk using the Cordova CLI.</p> <p>Learn ho...
Where should class objects be declared? <p>Should they be declared in the <code>.cpp</code> or <code>.h</code> files?</p> <p>Example 1:</p> <pre><code>A.h #include "B.h" #include "C.h" class A { void someFunction(); B b; C c; } </code></pre> <p>Example 2:</p> <pre><code>A.cpp #include "B.h" #includ...
<p>Declare them with the narrowest scope as possible. If a <code>class</code> is only used in a single translation unit, then declare and <em>define</em> it in the source file. Typically you'd only <em>declare</em> a <code>class</code> in a header file if it's declaration is required by more than one transation unit.</...
Want to delete all #N/A from the multiple sheet in one go <p>Need help here.</p> <p>I am using the below coding where i want to delete entire row contains #N/A, though i am bale to delete but it deletes one by one line which is time consuming. i want that it select all the #N/A and delete in one go with in the range.<...
<p>Do you really need VBA for this? Do you have any other errors in cells?</p> <p>If you only have those #N/A errors how about just selecting your column/range and using ctrl+G --> Special --> select formula errors, then you can just right click delete all.</p> <p>If you still want to use macro as you might to go thr...
How to display a number in triangle fashion using progress-4gl <p>How to display a number or numbers in triangular pattern using progress4gl frame ? Kindly help me .</p> <p>E.g.</p> <pre><code> 1 OR 1 1 1 1 1 2 3 1 1 1 1 1 1 2 3 4 5 ...
<p>Really courious about the use case .... but:</p> <pre><code>DEFINE VARIABLE i AS INTEGER NO-UNDO . DO i = 1 TO 5: DISPLAY FILL (" ", (6 - i) * 2) + FILL ("1 ", i * 2 - 1) FORMAT "x(40)" WITH DOWN STREAM-IO. DOWN 1. END. </code></pre> <p>gets close.</p>
AngularJS open PDF in new tab and change filename/url <p>In my AngularJS Website I want to load .pdf documents and show them in new browser tabs. The following code works, but some things bother me:</p> <p>The createdObjectURL is set as the title of the document and browser tab. That means my documents are always titl...
<p>Open a new tab with the url to the resource returning the byte-array! Something like:</p> <pre><code>$window.open('localhost:xxx/api/document', '_blank'); </code></pre>
Google Sheets Query Language, return 0 <p>I've been having troubling getting the query function to return 0 when the queried data isn't found.</p> <p>Given the following data...</p> <p><img src="https://i.imgur.com/b1I7r3P.png" alt="Example Data One"></p> <p>With each sheet being a different player, I need to count ...
<p>You may add dummy data into the formula:</p> <pre><code>=QUERY(data;{QUERY(UNIQUE(QUERY({Sheet1!A2:C;Sheet2!A2:C;Sheet3!A2:C},"select Col1, Col2 where Col2 &lt;&gt; '' and Col3 contains 'A'")),"select Col1, 1");QUERY(QUERY({Sheet1!A2:C;Sheet2!A2:C;Sheet3!A2:C},"select Col1, Col2 where Col2 = '' and Col1 &lt;&gt; ''...
Android simple way to read / write data <p>So I just started out with JAVA and I have been trying to save a simple combination of username and password into SharedPreferences. Though i'm not so sure I understand how this actually works. So here is the code I currently have;</p> <pre><code>public void init() { Edit...
<p>Hey create a generic class like below and wherever you want to store values in shared preferences you can use it respective function to store paricular datatype. </p> <pre><code> import android.content.Context; import android.content.SharedPreferences; public class SharedPrefManager { public sta...
How do I create an instance of a hadoop file system remotely using Java? <p>I want to access a Hadoop file system through Java remotely, but every time I run the following code it's just showing the Local file system. </p> <p>I have gone through many solutions on Stack Overflow but nothing seems to work.</p> <p><stro...
<p>This setting:</p> <pre><code>obj.set("fs.defaultFS", "hdfs://localhost:8020"); </code></pre> <p>is already present here: ( No sense to use it.)</p> <pre><code>obj.addResource(new Path("/etc/hadoop/conf/core-site.xml")); obj.addResource(new Path("/etc/hadoop/conf/hdfs-site.xml")); </code></pre> <p>These files, of...
Titanium stuck on splash when app taken in background <p>Here is <a href="https://youtu.be/INpb-3M66U4?t=1m55s" rel="nofollow">video</a> of the problem. </p> <p>When I run the app first time, works perfectly. Then I press back button. When I try to open the app once again, stuck on splash. </p>
<p>I'm also seeing this issue and saw that this issue is already reported: <a href="https://jira.appcelerator.org/browse/TIMOB-23901" rel="nofollow">https://jira.appcelerator.org/browse/TIMOB-23901</a> and there are pull request already to fix it.</p> <p>Have a look at this comment over here: <a href="https://jira.app...
Python: how to count the access of an instance variable <p>I have a python class as below.</p> <pre><code>class A(object): def __init__(self, logger): self.b = B() self.logger = logger def meth1(self): self.b.mymethod1() def meth2(self): self.meth1() self.b.mymethod2() .....
<p>make 'b' a property and and increase the counter corresponding to be in the setter.</p> <pre><code>@property def b(self): self.b_counter += 1 return self._b </code></pre> <p>and in your class replace b with _b</p>
Cascading precedence constraints SSIS <p>I have a question on how to set up precedence constraints in SSIS.</p> <p>I have the following flow in the package:</p> <p><a href="http://i.stack.imgur.com/FgnL0.png" rel="nofollow"><img src="http://i.stack.imgur.com/FgnL0.png" alt="enter image description here"></a></p> <ul...
<p><a href="http://i.stack.imgur.com/pmp9f.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/pmp9f.jpg" alt="enter image description here"></a></p> <p>I agree with @Iamdave for his direction that says modify your script in each script do the check there if it should or should not execute rather than using express...
Sort List based on multiple properties Collection.sort() Compile error <p>I need to sort a list using multiple properties, I tried this code but I am getting a compilation error</p> <pre><code>package com.demo; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Lis...
<p>you need to implement <code>Comparable</code> Interface for this. E.g:</p> <pre><code>class Kot implements Comparable&lt;Kot&gt; { private String productName; private Integer kotNo; public Kot() { } public Kot(String productName, Integer kotNo) { this.productName = productName; ...
Qt5 app icon does not show up on Windows 7 <p>I have a Qt5 app. Icon is resides in Qrc file which is embedded to exe as cpp (as you know). On my local pc (Windows 10) i can see icons on tray and also on forms title. But on Windows 7 same exe does not show my icon.</p> <p>Does anybody know why this might be happening? ...
<blockquote> <p><strong>Reference</strong>: <a href="http://stackoverflow.com/questions/25679623/icon-is-not-showing-up-in-qt-main-window">Icon is not showing up in Qt Main Window</a></p> </blockquote> <p>This solved my problem.</p>
How to calculate the values of a pandas DataFrame column depending on the results of a rolling function from another column <p><br>A very simple example just for understanding.</p> <p><strong>The goal is to calculate the values of a pandas DataFrame column depending on the results of a rolling function from another co...
<p>IIUC the explanation by @IanS (thanks again!), you can do</p> <pre><code>In [75]: np.array([df.DATA.rolling(4).max().shift(-i) == df.DATA for i in range(4)]).T.sum(axis=1) Out[75]: array([0, 0, 3, 0, 0, 0, 3, 0, 0]) </code></pre> <p>To update the column:</p> <pre><code>In [78]: df = pd.DataFrame({'DATA':s, 'POINT...
ajax form submission with jquery validations <p>I'm trying to submit my contact form using AJAX with jQuery validation. I think there are errors in passing form data. The validation works properly but something is wrong with the AJAX that I'm unable to figure it out. Please review my code below and help me to sort out ...
<p>Instead of using <code>submitHandler</code> event use <code>.valid()</code> function of jquery validate. which allow ajax call only when all the form fields meet validations.</p> <p>Please check below code.</p> <pre><code>$(document).ready(function(){ $('#test-form').validate({ rules: { name:{ ...
Remove Multiline Script using regular expression <p>I have following Script which can have multiple occurrences in a post</p> <pre><code>&lt;script type='text/javascript'&gt; if(typeof(jQuery)=="function"){(function($){$.fn.fitVids=function(){}})(jQuery)}; customfunction('customfunction_div').setup( {"play...
<p>You should parse HTML with the right tools like <code>DOMDocument</code> rather than relying on regular expressions. </p> <p>Here is a snippet showing how to grab the <code>script</code> tags containing the word <code>customfunction_div</code> inside and remove them:</p> <pre><code>$html = "&lt;html&gt;&lt;head&gt...
how to create the index from mongoose in elastic search in node,expressjs <p>I want to create the index in elastic search with mongoose, express but there is no documentation available. I try mongoosastic but that is not comfortable.</p> <p>So can anybody help me?</p>
<p>You can use this module</p> <p><a href="https://github.com/elastic/elasticsearch-js" rel="nofollow">https://github.com/elastic/elasticsearch-js</a></p> <p>It's pretty simple to use and have a lot of documentation.</p> <p>Just connect to DB-> get records that you need-> for each record run publish(client.bulk meth...
Python: [Errno 2] No such file or directory <p>I want to open and read all csv file in a specific folder. I'm on OS X El Capitan version 10.11.6, and I'm using Python 2.7.10. I have the following function in phyton file:</p> <pre><code>def open_csv_files(dir): for root,dirs,files in os.walk(dir): for file in files...
<p>You need to build absolute path to file based on values of <code>root</code> (base dir) and file name.</p> <pre><code>import os def open_csv_files(directory): for root, dirs, files in os.walk(directory): for file_name in files: if file_name.endswith(".csv"): full_file_path ...
How to submit app made by third party to iTunes Connect without giving away the distribution certificate? <p>I'm developing apps for other companies. My customers want their app in App Store to show as published by their own company, not mine. Also, they don't want to give me their private key for signing apps for App ...
<p>Try this one, you can sign IPA package by your certificate and send it to them, then ask them to re-sign it using their own certificate.</p> <p><a href="http://dev.mlsdigital.net/posts/how-to-resign-an-ios-app-from-external-developers/" rel="nofollow">How to Re-Sign an iOS App from an External Developer</a></p>
Cythonize dynamic pyx function <p>I've created a <code>pyx</code> file dynamically, but struggle to cythonize and use the function encoded in it.</p> <p>I tried </p> <pre><code>import pyximport pyximport.install() import imp module = imp.load_source('module.name', pyxfilename) </code></pre> <p>but this doesn't seem ...
<p>You could use the function <code>pyximport.load_module</code> instead of <code>imp.load_source</code> (<a href="https://github.com/cython/cython/blob/151d653d3c7ab07e9d961c9601b2ff45202e6ce2/pyximport/pyximport.py#L207" rel="nofollow">https://github.com/cython/cython/blob/151d653d3c7ab07e9d961c9601b2ff45202e6ce2/pyx...
Protractor Async call issue <p>I am new to protractor. Intially when building my code i used multiple its but then I moved everything in one it and now my code looks like this :</p> <pre><code>var UI = require('./../ui.js'); var co = require('co'); var ui = new UI(); describe("MapFeedback: address-no longer exists", ...
<p>You will see error when Jasmine timeout's before the complete execution is done</p> <p>Either increase the timeout setting in protractor conf.js</p> <pre><code> timeout: 50000, </code></pre> <p>Or if you want to do the timeout change only for this spec</p> <pre><code> this.timeout(50000); </code></pre> <p>And ...
Reorder columns by a number embedded in their names <p>I have dataset which has following column names:</p> <pre><code>df X100_TT_7.1 X50_TT_1.1 X60_TT_2.1 X80_TT_4.1 X70_TT_3.1 X85_FTT_5.1 X90_TT_6.1 0.08 0.06 0.84 0.95 0.89 0.91 0.86 </code></pre> <p>I want to re...
<p>We can use <code>mixedorder</code> from <code>gtools</code> to <code>order</code> the columns </p> <pre><code>library(gtools) df1 &lt;- df[mixedorder(names(df))] df1 # X50_TT_1.1 X60_TT_2.1 X70_TT_3.1 X80_TT_4.1 X85_FTT_5.1 X90_TT_6.1 X100_TT_7.1 #1 0.06 0.84 0.89 0.95 0.91 ...
Storage Access Framework deleteDocument <p>I just try to delete a file using Storage Access Framework however deleteDocument always returns false. I have a Asus zenfone 5 with Android 5.0 I just wonder if the contentprovider and uri is correct or not. The uri is a path from SDCard(/storage/MicroSD/test123123.apk)</p> ...
<p>The problem is that you used Uri.parse(t) while SAF has its own document addressing system. You cannot map filepath to SAF tree unless doing some custom mapping.</p> <p>Here is the code in Xamarin:</p> <pre><code> protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Inten...
Extracting a link with jmeter <p>So I need to delete an "onclick" dynamic link using jmeter.</p> <p>Here is the sample of one of the links:</p> <p>"<code>&lt;a href="/dag/daaction.do?param=1678245" onclick="return delReminder()"&gt;Delete&lt;/a&gt;</code>"</p> <p>What I need is to extract number and post it in order...
<p>If you need to do it with XPath you could try going for substring-after function like:</p> <pre><code>substring-after(//a[text()='Delete']/@href,'param=') </code></pre> <p>The above expression returns everything which is after <code>param=</code> text in <code>href</code> attribute of <code>a</code> HTML tag havin...
Tableau Customised FIlter <p>Below is the screenshot of the visualization that I have been working on.</p> <p><a href="http://i.stack.imgur.com/EiDjk.png" rel="nofollow"><img src="http://i.stack.imgur.com/EiDjk.png" alt="enter image description here"></a></p> <p>I need a small help/advice/guidance regarding one Custo...
<p>You probably only need one IF statement. </p> <pre><code>If [MeanCost.mean] &gt; {fixed : avg([MeanCost.mean]) } then 'show' else 'hide' END </code></pre> <p>Create a new calculation as well for a new reference line, this is calculation2 in the sample workbook. </p> <pre><code>{fixed : avg([MeanCost.mean]) } </co...
Drupal 8 get data from table? <p>this is my code.</p> <pre><code> $connection = Database::getConnection(); $sth = $connection-&gt;select('node_field_word_record', 'x') -&gt;fields('x', array('field_word_record_useruuid')); $data = $sth-&gt;execute(); $results = $data-&gt;fetchAll(\PDO::FETCH_OB...
<p>It was sheer stupidity on my part guys,the rong is <code>node_field_word_record</code>,there is missing a <code>_</code>,the right table name is <code>node__field_word_record</code>.</p>
DllImport __Internal not working despite correct function setup <p>Using embedded Mono, I'm trying to execute a very simple C function from within C#.</p> <p>This is the function in C++ code (in global scope):</p> <pre><code>extern "C" { static int __attribute__((noinline)) dllImportTest() { return 66...
<p>Turns out the dllImportTest function did not appear in the executable due to it being static. Admittedly, a static function in the global namespace makes little sense in most situations anyway.</p> <p>So replacing this:</p> <pre><code>extern "C" { static int __attribute__((noinline)) dllImportTest() { ...
Empty / blank out all fields in a form page <p>I have the below code, is there a way to put this in a simpler format. I am having to blank out 50 or more fields when a date in a certain key field is changed or made blank.</p> <pre><code>if (zEntry ==""){ document.getElementById("Q229I1226").value=""; document.getElem...
<p>You have to add common class to your inputs. </p> <pre><code>var array = document.getElementsByClassName('className'); for (var i = 0, lng = array.length; i &lt; lng; i++) { array[i].value = ''; } </code></pre>
dimple tickFormat ignores grouping comma <p>I have a dimple chart displaying some large numbers. I want the precise values to appear in the toolbox (not truncated to 14k) so I changed the <code>tickFormat</code>. However, dimple/d3 seems to ignore the grouping comma, which makes large numbers hard to process. </p> <pr...
<p>According to the API documentation the property <a href="https://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.axis#tickFormat" rel="nofollow"><code>dimple.axis.tickFormat</code></a> will accept the format specifier string (i.e. <code>",.0f"</code>). as it is passed to <code>d3.format()</code>. You don't have to c...
FTPClient in android convert image to bitmap <p>Help!! i have installed ApacheCommons.net FTPClient. As i need to download a PNG file via ftp. The stream downloads but iam having trouble converting it into a Bitmap so i can save to local storage. </p> <pre><code> mFTPClient.connect("path"); mFTPClien...
<p>This is how i got around it. Thanks greenapps for making me think down a different route</p> <pre><code> mFTPClient.connect("path"); mFTPClient.login("anonymous","nobody"); mFTPClient.enterLocalPassiveMode(); mFTPClient.changeWorkingDirectory("/fax"); mFTPClient.setControlEncodin...
How to convert std::result_of to decltype in a template argument <p>At CppCon 2015, S. Lavavej from Microsoft <a href="https://www.youtube.com/watch?v=zt7ThwVfap0#t=17m15s" rel="nofollow">said</a> to avoid using <code>result_of</code>. But I have a situation in which I can't seem to be able to find a proper alternative...
<p>Yes, your use of <code>result_of</code> here causes a bug. And yes, there is a way to write your code without <code>result_of</code> that clears the bug. And we can do this without constructing an equivalently buggy <code>decltype</code> replacement.</p> <p>First, note your <code>result_of</code> code has a bug.<...
'NoneType' object has no attribute 'append' <p>I have two lists that I'm merging into a dictionary</p> <pre><code>keys = ['p2p', 'groupchat'] tests_available = ['p2p_1', 'p2p_2', 'p2p_3', 'groupchat_1', 'groupchat_2'] </code></pre> <p>The expected output will be something like</p> <pre><code>{'p2p': ['p2p_1', 'p2p_2...
<p>Your values are set to <em>None</em> in <em>fromkeys</em> unless you explicitly set a value:</p> <p><strong>fromkeys(seq[, value])</strong></p> <p><em>Create a new dictionary with keys from seq and values set to value. fromkeys() is a class method that returns a new dictionary. value defaults to None.</em></p> <p...
Url redirect on azure <p>I have used web.config to redirect the url to a different website but after i remmove the line of code that redirects, the changes do not reflect and when i access the website i still get an redirect. I have tried to restart the AppService plan but that does not work. How can I change everythin...
<p>You had a Permanent redirect. That will result in a HTTP 301 code, which in most normal circumstances will be cached.</p> <p>It <em>may</em> help to clear your browser's cache. Or try a different browser.</p> <p>See <a href="https://stackoverflow.com/questions/9130422/how-long-do-browsers-cache-http-301s">How long...
How to extract a link from a String in Java or Groovy? <p>Let's say you have this variable,</p> <pre><code>String message = "This is a link http://www.example.com/" </code></pre> <p>or you have this,</p> <pre><code>String message2 = "This is a link http://www.example.com/ and another link http://www.myfico.com/Image...
<p>Something like this will work for the two examples you give:</p> <pre><code>def links = message2.findAll(/http:\/\/\S+/) </code></pre> <p>That is, find anything that starts with <code>http://</code> up until some sort of whitespace</p> <p>There are more complex regular expressions <a href="http://stackoverflow.co...