input
stringlengths
51
42.3k
output
stringlengths
18
55k
Redis SET with option, without expiry <p>I'm writing a library that stores keys in Redis or Memcached. To keep it generic, I'd like to use <code>SET</code> for all my set operations, but I'm struggling to find an expiry value that equates to "don't expire". Is there a sentinel value I can send?</p> <p>For example, If ...
<p>Just send the set command <em>without</em> an EX option. </p> <pre><code>Set key value NX </code></pre>
Horizontal ViewPager inside vertical ScrollView <p>In my app I have a fragment with horizontal ViewPager and horizontal RecycleViews that sits under vertical ScrollView. My problem is that the ViewPager is blocking the parent vertical scroll. I tried to disable ViewPager vertical touch event, but it didn't help. Here i...
<p>You are using LinearLayout then you can set </p> <blockquote> <p>android:weightSum</p> </blockquote> <p>property for resolving this issue.</p>
how loop video with javasript? <p>i have some videos source. I want to play it again when the last video is over. I tried this code below,but after the last ended it wont start from the beginning.</p> <p>Here's my code below</p> <p><strong>HTML</strong></p> <pre><code>&lt;video id="myVideo" width="800" height="600" ...
<p>Can't you use the "loop" attribute of the "video" element ? </p> <p><a href="http://www.w3schools.com/tags/att_video_loop.asp" rel="nofollow">W3School loop</a></p>
Failure in login, but only in Samsung <p>In my app, I have a login process, once you are logged in, the app makes a call to the server to get a specific data:</p> <pre><code>Call&lt;JsonObject&gt; peticion= RetrofitClient.getRetrofitClient(InicioSesionGibActivity.this).login(imei, idCliente, user, encriptedPass); peti...
<p>Might be because it's a fast phone. When you save data to shared preferences are you reading it back immediately? You are using apply() which will store it in an asynchronous background thread and may not be there immediately if you try to read it back right away. </p> <p>You may want to use commit() instead, wh...
Conditional Validation for Serialized Array <p>How can I create a validation where <code>committed</code> presence needs to be true only if the challenge's category is <code>habit</code>?</p> <pre><code>class Challenge &lt; ActiveRecord::Base CATEGORY = ['goal', 'habit'] serialize :committed, Array validates :co...
<pre><code>validates :committed, presence: true, :if =&gt; lambda { |c| c.category == 'Habit' } </code></pre>
Extracting data from an android phone <p>I'm currently trying to create a program or app which extracts information from a phone, such as SMS &amp; Contacts. </p> <p>I've tried to find information on the net but i am unable to find any relevant help. </p> <p>I am not looking to be spoonfed, just to be pointed in the ...
<p>Start from official android docs. You can access that data with <a href="https://developer.android.com/guide/topics/providers/content-providers.html" rel="nofollow">Content Providers</a>.</p>
How to format/indent multiple line text constants <p>How do I use one print function to print all the text with correct code indentation on the second and subsequent lines?</p> <pre><code> printf("Program information\nThe program reads in the number of judges and \ the score from each judge.\nThen it calculates the...
<p>You want to avoid using <code>\[newline]</code> inside string constants.</p> <p>The c compiler will concatenate string constants for you, so you can format it like this:</p> <pre><code>printf("Program information\n" "The program reads in the number of judges and the score from each judge.\n" "Then it...
saving array of UIImage to parse as one file <p>In my swift app I have an array of UIImage and I need to save it to parse in one row and one column(as one file). I can do it when it's one image by using PFFile with no problem but for UIImage Array it doesn't work. How can I do It ? Is it Possible ? if it's possible how...
<p>You can save an array of NSData()</p> <blockquote> <p>images: [NSData()] UIImageView.image = UIImage(data: images[0])</p> </blockquote>
database to be used for log storing <p>I am starting up with a log monitoring tool which captures audit logs,firewall logs and many other logs.I Have an issue in choosing the right kind of database for this project as number of logs generated per second is at least 500 which has to be stored.</p> <p>Let's assume that ...
<p>A common stack used for log storing is the ELK stack composed of Elastic search, Logstash, and Kibana. </p> <ul> <li><strong>E</strong>lastic search is used to store the documents and can execute queries. </li> <li><strong>L</strong>ogstash monitors and parses the logs. </li> <li><strong>K</strong>ibana is used to ...
Get Pixel count using RGB values in Python <p>I have to find count of pixels of RGB which is using by RGB values. So i need logic for that one.</p> <p>Example.</p> <p>i have image called image.jpg. That image contains width = 100 and height = 100 and Red value is 128. Green is 0 and blue is 128. so that i need to fin...
<p>As already mentioned in <a href="http://stackoverflow.com/questions/138250/how-can-i-read-the-rgb-value-of-a-given-pixel-in-python">this</a> question, by using <code>Pillow</code> you can do the following:</p> <pre><code>from PIL import Image im = Image.open('image.jpg', 'r') </code></pre> <p>If successful, this f...
A href go on next page when i click on star rating input <p>On my page I have a table. In the table there is one <code>td</code>, in which I am showing average rating input. I want when I click on average rating page, the <code>href</code> goes to next page. </p> <p>Can anyone tell me how it can be possible?</p> <p...
<p>Use this code snippet for that : <br></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table&gt; &lt;tr&gt; &lt;td&gt;&lt;a href='supp_view_screen.php?id=$...
Unable to maintain one to many relationship in Eloquent using laravel 5.3 <p>I am using laravel eloquent model so there are three tables tempsocials, tempusers and tempdevices. so one user can have multiple devices and multiple social acounts. I created a models for three of above table and trying to maintain relations...
<p>You're making a new <code>Tempuser()</code>, it has no id, so your relation returns nothing as expected, you will need to pass an id to the method and with that id you could do something like:</p> <pre><code>Tempuser::find($id); </code></pre> <p>This will then return an actual model instead of creating a new one.<...
Group by time interval including start of next? <p>I'm trying to build a query that groups my data by a timed interval (i.e. 30 minutes) and then calculate the difference between the first and last row in each group.</p> <p><code>select (max(v) - min(v)) as x, from_unixtime(FLOOR(UNIX_TIMESTAMP(d)/(30*60))*(30*60)) as...
<p>A potential solution that I managed to come up with this morning:</p> <p><code>select *, IF(@lastV, @lastV - minV, 0) as `usage`, @lastV := minV from ( select min(v) as minV, max(v) as maxV, from_unixtime(FLOOR(UNIX_TIMESTAMP(d)/(30*60))*(30*60)) as timeKey from `test` group by timeKey order by timeKey desc ) i...
Javascript - why its treating windows 10 pro, IE11 as mobile or tablet? <p>I do not have mobile / tablet compatible layout, so when any user comes from mobile/tablet/linux terminal, i show a page "get out". But if the user is coming from a PC browsers IE old, IE edge, Safari, Google Chrome, Firefox, Opera, Midori etc e...
<p>Working.</p> <pre><code>window.onload = userAgentDetect; var is_pc = true; function userAgentDetect() { if(window.navigator.userAgent.match(/Mobile/i) || window.navigator.userAgent.match(/iPhone/i) || window.navigator.userAgent.match(/iPod/i) || window.navigator.userAgent.match(/IEMobile/i) || window.navi...
ng-option preselect value for (key,value) pair when value is an array of object <p>I can't do a pre-selection in <strong>ng-options</strong> from (key,value) pair when value is a array of objects, although if I use value.property then I can do the pre-selection.</p> <p>I wrote an example in jsfiddle and I'm able to pr...
<p>When using <code>ngOptions</code> you can use <code>track by</code> to determine an unique identifier to bind value properly. Also, the value mustn't be a string, it have to be an object like so:</p> <pre><code>$scope.data3 = { templateId :"001" , color : "yellow"}; </code></pre> <p>And your template:</p> <pre><c...
SSL: Intermediate certificate compromised -- Can they unrevoke a certificate? <p>I am using certs from an issuer called AlphaSSL. I just recently realised that my pages shows invalid certificate error on pageload. Further investigation shows that the intermediate certificate that binds my cert to GlobalSign's root cert...
<p>GlobalSign is currently experiencing issues which results in certificates being marked as revoked:</p> <p><a href="https://twitter.com/globalsign/status/786505261842247680">https://twitter.com/globalsign/status/786505261842247680</a></p>
With notepad++, if "Find All" strings match multiple times in 1 line, output shows duplicated lines <p>I would like to know how to prevent notepad++ to output duplicated lines when I execute Find All.</p> <p>Here is sample text file.</p> <pre><code>aaa aaa bbb bbb ccc ccc </code></pre> <p>I put "aaa" as search strin...
<p>I have never heard of a way to make the "Find result" window remove "duplicate lines". They originate from the multiple hits on the same line. </p> <p>To stop the dupes from appearing is to make sure you only find the last occurrence of the string on a line.</p> <p>To do this, you need to use a regex in the follow...
symfony 3 time when log in and log out <p>I'm pretty much new in symfony 3, so how I could get time when user log in and log out.. I know i should create entity for time.. that entity would have id,userID startTime, endTime.. and user should have a connection(many to many, that lot of user could have lot of log in.. ) ...
<p>For this answer I assume you store the users in the database. If not, please show how you do it.</p> <p>First of all please have a look at the doctrine documentation on how to connect entities to each other. In your case this should help: <a href="http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/ref...
Gradle: classpath dependency not resolved from nested project <p>I have a multi-project build set-up with gradle that will contain multiple android apps and libraries. </p> <p>Sample of the project structure:</p> <pre><code>root (Project Root) | android | module1 (Android Application) | module2 (Android Library) ...
<p>I have seen such folder arrangements especially with google sample projects that include and android folder and also a web folder. What you can try is to import the project using the android folder as the project folder since you may not be using gradle to build Ios and web if you have the two more folders for you p...
How to inflate the dropdown from the multidimentional array in php <p>I am trying to loop through an array for inflate the dropdown. But I am not able to do so. I have tried many methods for this. But Nothing works for me. One of the method I try below</p> <p>Here is the array which I am trying to inflate in dropdown....
<p>that's not so difficult, array isn't too nested, it is just a list of products, the only issue is that instead of using assoc and more meaningful keys, you have numbers.</p> <pre><code>echo '&lt;select name="productddl"&gt;'; foreach ($data as $row) { echo '&lt;option value="', $row[1], '"&gt;', $row[0] , '&lt;...
show checked text is not working when i click on new tab <p>I am trying to acheive show checked value text in one div.</p> <p><a href="https://i.stack.imgur.com/rXfai.png" rel="nofollow"><img src="https://i.stack.imgur.com/rXfai.png" alt="enter image description here"></a></p> <p>By default Tiffen is active so when i...
<p>I got the solution all the code is write but fault is in class name issue i gave small FoodMenu istead Foodmenu</p>
Pandas groupby countif with dynamic columns <p>I have a dataframe with this structure:</p> <pre><code>time,10.0.0.103,10.0.0.24 2016-10-12 13:40:00,157,172 2016-10-12 14:00:00,0,203 2016-10-12 14:20:00,0,0 2016-10-12 14:40:00,0,200 2016-10-12 15:00:00,185,208 </code></pre> <p>It details the number of events per IP ad...
<p>You can use <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.sum.html" rel="nofollow"><code>sum</code></a> and <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.mean.html" rel="nofollow"><code>mean</code></a> of boolean mask by condition <code>df == 0</cod...
how to handle cordinator layout in android studio? <p>please help me.</p> <blockquote> <p>java.lang.NoSuchFieldError: CoordinatorLayout_LayoutParams at android.support.design.widget.CoordinatorLayout$LayoutParams.(CoordinatorLayout.java:2274) at android.support.design.widget.CoordinatorLayout.generateLayo...
<p>Replace this code with your code. </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_...
Remove rows based on chronological order <p>The data that I am trying to work with is in a <code>data.frame</code> that has the following format:</p> <pre><code>Title Year Something 2006 something2 2007 Something 2008 Something 2009 </code></pre> <p>I'm specifically interested in being able to subset the data so that...
<p>If by fewer mean older (lower number) than you are looking for <code>df&lt;-df[df$Year&gt;2008]</code> or as you do <code>df&lt;-df[!df$Year&lt;=2008]</code></p> <p>You will need to overwrite the original <code>data.frame</code>, or it will just display the subset, but not save it. You can also use <code>subset(df,...
Laravel form does not assign corresponding values to the fields of a form <p>im in deep trouble. im using ajax to submit a form in laravel. when i submit a form it does not submit correctly because each field of laravel does not have its assigned value. first field of laravel form is method field, when i inspect my s...
<pre><code>&lt;form id="add_car_2" class="s-submit clearfix" method="POST"&gt; {{csrf_field()}} &lt;input type="hidden" name="_method" value="patch"&gt; &lt;div class="row"&gt; &lt;div class="col-md-6 col...
How to enable .zip file download in a directory inside wordpress website <p>I have created a wordpress website. I have created a directory named 'my-resources' in the root directory &amp; uploaded few zip files via FTP. Now I am trying to download the zip files by directly entering the zip file Url in a browser but it ...
<p>Use Chmod command and give permission 755 to that downloadable directory. You can use help of command from this link <a href="http://linuxcommand.org/lts0070.php" rel="nofollow">http://linuxcommand.org/lts0070.php</a></p>
Checking if string is complety shown in popup window <p>Is there a standard way to do this? My popup window has maxsize and I would like to cut the string if it is too long. Currently I'm doing </p> <pre><code> if(txt.length()&gt;320) { txt = txt.substring(0,320)+"..."; } </code></pre> <...
<p>You can define below property to textview. </p> <blockquote> <p>android:ellipsize="end"</p> </blockquote>
UWP Community Toolkit <p>I added the UWP Community Toolkit to a project and am getting the following error while executing.</p> <p><a href="https://i.stack.imgur.com/44ORB.png" rel="nofollow"><img src="https://i.stack.imgur.com/44ORB.png" alt="enter image description here"></a></p> <p>Has anyone ever experienced this...
<p>The <a href="https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.composition.dropshadow" rel="nofollow">MSDN page of DropShadow</a> shows that the calls was added in Build 14393 (V1607):</p> <p><strong>Device family</strong> Universal, introduced <strong>version 10.0.14393.0</strong></p> <p>So make su...
Python Sklearn validation.py:386 error while using predict SVC model <p>While using:</p> <pre><code>grid_search.GridSearchCV(svm.SVC(), parameters).fit(x_train, y_train).predict(x) </code></pre> <p>I get the following error:</p> <blockquote> <p>C:\Anaconda3\lib\site-packages\sklearn\utils\validation.py:386: Deprec...
<p>What does your dataframe look like? It is probably due to the shape of x_train/x_test. </p>
Magento SOAP-ERROR: Parsing WSDL - by cron <p>I have an ERP using the magento SOAP API v2 (<a href="http://www.example.com/api/v2_soap/?wsdl" rel="nofollow">http://www.example.com/api/v2_soap/?wsdl</a>). Through my local server, crons access every minute the API and synchronize data.</p> <p>Everything always worked ve...
<p>Ive faced this before and had to put the host name of the soap server (your Magento machine) in the /etc/hosts file because when making a soap call the server has to be able to resolve itself.</p>
R Shiny selectedInput inside renderDataTable cells <p>I search for solution to put selectedInputs in renderDataTable cells. I found js solutions: <a href="https://datatables.net/examples/api/form.html" rel="nofollow">https://datatables.net/examples/api/form.html</a> , however I do not know how to implement this solutio...
<p>Very similar to this: <a href="http://stackoverflow.com/questions/37356625/adding-a-column-with-true-false-and-showing-that-as-a-checkbox/37356792#37356792">adding a column with TRUE/FALSE and showing that as a checkbox</a></p> <pre><code>library(shiny) library(DT) runApp(list( ui = basicPage( h2('The mtcars...
Using sqlsrv_connect() in live environment <p>I've developed a web application in php that connects to an azure sql database using <code>sqlsrv_connect()</code>. This is a function from the <strong>SQLSRV</strong> driver by Microsoft. The application runs great locally (Using the azure database). I can select, insert a...
<p>You have to install php_sqlsrv_xx_ts.dll ext in your server.</p> <p>Please follow this link for correct dll file <a href="https://msdn.microsoft.com/en-us/library/cc296170(v=sql.105).aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/cc296170(v=sql.105).aspx</a></p>
merge two array value in laravel <p>I want to merge two array in laravel 5.3.I have variable '$type' which return </p> <pre><code>`Illuminate\Support\Collection Object ( [items:protected] =&gt; Array ( [1] =&gt; rinu )` </code></pre> <p>which is get from the query</p> <pre><code>$type0=DB::table('users')-&gt;where('...
<p>You seem to have a Collection for each value. So you are probably fetching each value independently instead of in one go.</p> <p>Your problem is probably solved by using <a href="https://laravel.com/docs/5.3/queries#where-clauses" rel="nofollow">whereIn</a> instead of a number of <code>where</code>s.</p> <pre><cod...
Preventing the process from exiting when running a gulp task (so a server remains up) <p>I have a gulp task that starts a server:</p> <pre><code>gulp.task('my-task', ['start-server'], function() {}); </code></pre> <p>The gulp task <code>start-server</code> registers a listener:</p> <pre><code>process.on('exit', func...
<p>That's what <code>gulp-nodemon</code> was meant to do: <a href="https://www.npmjs.com/package/gulp-nodemon" rel="nofollow">https://www.npmjs.com/package/gulp-nodemon</a></p> <p>Example implementation:</p> <pre><code>gulp.task('develop', function () { nodemon({ script: 'server.js' , ext: 'html js' ...
Restore webview scroll position? <p>I want to <strong>save the state</strong> of my <code>webView</code> with its <strong>page scroll position</strong> when user leaves the app and restore them when user opens the app again. So that, user can continue reading the restored webview content scrolled down to the restored p...
<p>You could save the position in the <a href="https://developer.android.com/reference/android/content/SharedPreferences.html" rel="nofollow">SharedPreferences</a> in the OnDestroy method and retreive it in the OnCreate method.</p> <p><strong>EDIT</strong>: As stated <a href="https://developer.android.com/reference/an...
PortAudio Streaming and processing in real time <p>I am new to PortAudio. My intention is to continuously capture data from the line-in input on my pc and process the data in real time.</p> <p>I am using the sample rate of 44100 and buffer size (frameCount) of 11025. I am successfully able to do this, but I am doing a...
<blockquote> <p>Is it bad to do all of my processing of the audio data inside this callback?</p> <p>I am also loosing data because of the time taken to execute my callback function.</p> </blockquote> <p>I think you answered your own question just there. Try pushing it to a buffer, and then have another thread d...
Delphi pointer memory and freeing <p>I'm using custom windows messages to exchange information from the worker thread to the forms in the main VCL thread. Whenever I need to send some data with the message I do this:</p> <pre><code>type PntStr = ^string; </code></pre> <p>then <strong>PostMessage()</strong></p> <pr...
<p>Yes, your approach is correct in terms of memory management. <code>New</code> and <code>Dispose</code> correctly deal with the managed type. That's really what they exist to do. </p> <p>Some nuances:</p> <ul> <li>Check the return value of <code>PostMessage</code>. If it fails then the message was not posted and th...
counting occurrence of elements in each sequence of the list in python <p>I have a (very big) list like the small example. I want to count the number of D in each sequence in the list and divide by the length of that sequence. (occurrence of D in each sequence).</p> <p>small example:</p> <pre><code>l = ['MLSLLLLDLLGL...
<p>You can simply use a <em>list comprehension</em>, get the count of <code>D</code> in each sequence and divide by the length of the sequence:</p> <pre><code>l = ['MLSLLLLDLLGLG', 'MEPPQETNRPFSTLDD', 'MVDLSVSPDVPKPAVI', 'XNLMNAIMGSDDDG', 'MDRAPTEQNDDVKLSAE'] result = [x.count('D')/len(x) for x in l] print(result) # ...
.htaccess - .html redirect to / <p>I am really new to this forum, it's my first post but I already read a lot. But I didn't find any solution for my problem.</p> <p>I will do the following via my <code>htaccess</code>:</p> <p>301 redirect from every url of my site with the ending .html to /.</p> <p>An example:</p> ...
<p>This should work for WordPress:</p> <pre><code># BEGIN WordPress RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} \.html$ RewriteRule ^(.*)\.html$ $1 [R=301,L] RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPres...
How does this for loop work and end? <p>There are two initialisation and no "<code>x&lt;y</code>" to limit the iterations. So how does this loop work?</p> <pre class="lang-js prettyprint-override"><code>var features = [{ position: new google.maps.LatLng(-33.91721, 151.22630), type: 'info' }, { position: new goog...
<p>Access to an out-of-bound index in Javascript will yield <code>undefined</code>, which is a falsey value. Once the index has got outside of the bound, the <code>feature = features[i]</code> assignment, which evaluates to the value it assigns, will be considered <code>false</code> and the loop will exit.</p>
SQL Challenge/Puzzle: How to merge nested ranges? <ul> <li>This challenge is based on a real life use-case involving IP ranges.</li> <li>The solution I came with is based on the <a href="http://stackoverflow.com/questions/39936479/sql-challenge-puzzle-given-a-stack-trace-how-to-find-the-top-element-at-each/39941615#399...
<p>Oracle solution:</p> <pre><code>with l as ( select level lvl from dual connect by level &lt; 66 ), r as ( select range_start r1, range_end r2, range_val v, range_end - range_start + 1 cnt from ranges ), t1 as (select distinct lvl, nvl(max(v) keep (de...
Dojo widget id is already registered <p>I read about 10 errors like this but nowhere I found a solution. </p> <p>I run this code in dojo:</p> <pre><code>this.myHeader = registry.byId("banner"); // returns 'undefined' if(!this.myHeader) { this.myHeader = new Header({ primaryBannerType: 'thin' }, "ba...
<p>Make sure you have no other DOM elements with the same ID on your page.</p> <p>I usually use the following utility script, which can spot this kind of problem very quickly and saving some time when debugging.</p> <p>You can just copy and paste in your developer console (it is a self invoking function).</p> <p><di...
How to set Docker-compose arguments in console? <p>My Docker containers will be set up through a bash script.</p> <p>In my docker-compose.yml file (which is called through <code>docker-compose up</code> inside the bash file) I have a few arguments:</p> <pre><code>version: "2" services: nginx: build: ./Doc...
<p>You can use environment variables in your <code>docker-compose.yaml</code> file, e.g.:</p> <pre><code>args: - site_title: $SITE_TITLE </code></pre> <p>In your Bash script, you can then set the title environment variable like this:</p> <pre><code>#!/bin/bash SITE_TITLE="My new title" docker-compose up -d </cod...
@Html.DropDownList - set particular text at top to display <p>@Html.DropDownList - set particular text at top to display</p> <h2>code:</h2> <pre><code>@Html.DropDownList("Plant",ViewData["PlantList"] as SelectList, new {style="height: 29px;"}) </code></pre> <p>The dropdownlist has five items from viewdata. They are ...
<p>Create a model;</p> <pre><code>public class MyModel { public int Number { get; set; } } </code></pre> <p>Return model to view.</p> <pre><code>public ActionResult Index { var model = new MyModel(); model.Number = "three"; return View(model); } </code></pre> <p>and in you view;</p> <pre><code> @Ht...
geopandas: how do I merge information only if point is inside a polygon? <p>I have a <code>geopandas</code> dataframe <code>A</code> with the geometry field set to a single <code>Point</code> (x,y). Then I have a second dataframe <code>B</code> with the geometry field set to some polygon and some other information. For...
<p>Just in case someone else needs it, and assuming your geometry is well-formed, then you can do:</p> <p><code>new_df = gpd.sjoin(A,B,how="inner", op='intersects')</code></p> <p>this was enough.</p>
Is there any way to make Linearlayout having children not clickable android? <p>I have a linearyLayout having several linearlayout and some views.</p> <p>I want to make the whole layout not clickable.</p> <p>this is the the first part of the linearlayout</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas....
<pre><code>public void setClickable(View view) { if (view != null) { view.setClickable(false); if (view instanceof ViewGroup) { ViewGroup vg = ((ViewGroup) view); for (int i = 0; i &lt; vg.getChildCount(); i++) { setClickable(vg.getChildAt(i)); } ...
python append() and remove html tags <p>I need some help. My output seems wrong. How can I correctly append the values of dept, job_title, job_location. And there are html tags with the values of dept. how can I remove those tags. </p> <p>my code</p> <pre><code>response = requests.get("http://hortonworks.com/careers/...
<p>The structure of your html is sequential, not hierarchical, so you have to iterate through your job list and update department title as you go:</p> <pre><code>import requests from bs4 import BeautifulSoup, Tag from pprint import pprint headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko...
Zip file not deleted in mule <p>I am reading a zip file using file inbound connector in mule. The file should be auto deleted, since auto delete is true. But it's not. The flow I have is</p> <p><code>&lt;file:connector name="File" writeToDirectory="D:\FileProcessed\ringmoved\" readFromDirectory="D:\FileProcessed...
<p>It's because you are not consuming the file. Try adding a transformer such as </p> <pre><code>&lt;object-to-string-transformer /&gt; </code></pre> <p>after the file endpoint.</p>
What is the 'right' way to form a row of elements? ul/divs? <p>I want to create a horizontal row of elements that form a panel of steps the user needs to take. These are all made out of blue rectangles that contain a title, text and an icon. See image for example.</p> <p><a href="https://i.stack.imgur.com/ZGEZn.png" r...
<p>Given the fact that you have a step-by-step template, you can easily use an ordered list as a container. <code>ol &gt; li(1/6%) &gt; h3 + img + p</code> </p>
Creating Hangman in Java using Arrays and Loops <p>Below is my code, it gets compiled in dr.java and works. I just need help to get the loop to end if they guess the word before their attempts run out and to show the letters that are typed in by the user while they are guessing the word. All help is appreciated. </p> ...
<p>You could do something like this. In the loop where you check if the letter equals one in the word add the last line below:</p> <pre><code>charVal = 'y'; wordRay[n] = trial; guessRay[n] = wordRay[n]; //Change the _ value to the letter in the array. </code></pre> <p>Then at the end of the <code>if (charVal == 'y')<...
swift check if textview is empty <p>I wonder how I proper check if a uitextview is empty.</p> <p>Right now I have a validation fucntion which does the check:</p> <pre><code>if let descText = myTextView.text { if descText.isEmpty { descErrorLabel.isHidden = false } else { descErrorLabel.isHidde...
<p>You could roll it all up into something like this...</p> <pre><code>func validate(textView textView: UITextView) -&gt; Bool { guard let text = textView.text, !text.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).isEmpty else { // this will be reached if the text is nil (unlikely) ...
How to modify the XML file using Python? <p>Actually I have got the XML string and parse the string to get the attributes from it. Now I want my XML file to change, viewing the attributes. Like I want to change the color of the stroke. Is there any way? How I will change and then again save the file.</p> <pre><code>im...
<p>You should probably read through the <a href="http://docs.geoserver.org/latest/en/user/styling/sld/cookbook/index.html" rel="nofollow">SLD Cook book</a> to get hints on how to change things like the colour of the lines in your SLD. Once you've changed it you need to make a <a href="http://docs.geoserver.org/latest/e...
mongoose old result based on time <p>I have the following code:</p> <pre><code> var dates = getDates(); var a = dates.now; var tomorrow = dates.tomorrow; console.log("{userid: " + userid + ", time: {$gte: " + a + "}, time: {$lte: " + tomorrow +"}"); tickets.find({userid: userid, time: ...
<p>You have numeric value as string and when you compare numeric values in string then it works different for ex. </p> <pre><code>console.log('2'&gt;'11') </code></pre> <p>it will print true. so change your schema to Number.</p>
How do you inject non-presentation dependencies like a repository in a WPF application without involving the presentation layer (i.e. view model)? <p>I'm trying to apply DI to my WPF application (with MVVM). I would like to adhere to an <a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-1/" rel="nofol...
<p>One way would be to define your repository using an interface and then using unity you can interject the correct implementation of the repository interface. </p> <p>The link here should get you started on using unity:</p> <p><a href="https://msdn.microsoft.com/en-us/library/dn223671(v=pandp.30).aspx" rel="nofollow...
Find max and min values in List[List[String]] comparing by the 1st element in each sub-list <p>I have a data structure like <code>List[(String, List[List[String]])]</code>. I need to find maximum and minimum value in the <code>List[List[String]]</code> comparing the 1st element in each sub-list:</p> <p>This is how I d...
<p>Like Alberto mentioned, it is always good to provide a full example to avoid confusion; see <a href="http://stackoverflow.com/help/mcve">http://stackoverflow.com/help/mcve</a>. Here is a solution to what it looks like you want:</p> <pre><code>// initialise structure val data = List(("foo", List(List("2", "b", "b"),...
IBM Process Designer - find all Java class references <p>My team inherited a system to support and develop and it's mostly created in IBM Process Designer with some functionality coming from external Java classes.</p> <p>Documentation is missing or incomplete (what a surprise!) so I need to make some kind of "architec...
<p>Found the solution:</p> <p>If you go to Snapshots in Process Center you can export Installation Package to local machine. Unzip it, then unzip export.twx and in Objectss folder you'll find XML representation of all objects. Search for 'javaClassName' string and you'll get the list.</p> <p>Unfortunately I had to us...
Remember user timezone selection, and apply timezone changes to datetime field on all pages <p>In my database I have a dateandtime field in one of the tables, which correctly displays the date and time from the database for the row I want. As I will possibly get users from many different countries I will need to allow ...
<p>I think that the most correct approach on this issue is the following: - save the timezone on each user in database or in cookie (if you dont have authenticated users) - create a global variable in php and javascript which you'll use all over your website called user_date - at the start of the page make that user_da...
Can CIDetector returns more than one CIFeature of type CIDetectorTypeRectangle? <p>I also found this question <a href="https://forums.developer.apple.com/thread/56394" rel="nofollow">on Apple Dev Forum</a>.</p> <p>Is it possible for a <code>CIDetector</code> set with <code>CIDetectorTypeRectangle</code> to return more...
<p>According to this talk in WWDC (<a href="http://asciiwwdc.com/2014/sessions/514" rel="nofollow">http://asciiwwdc.com/2014/sessions/514</a>), it is limited to only one rectangle.</p> <p>Here is a quote for that:</p> <blockquote> <p>So we've created a generic rectangle detector object and it takes one option par...
How to automate compile less css without less js <p>I am a newbie in lesscss. </p> <pre><code>using JavaScript is discouraged at the production stage as it will badly affect the website performance </code></pre> <blockquote> <p>In future, I will deploy PHP code on <code>apache server</code>.</p> <p>How to comp...
<p>The simplest setup for compiling LESS beforehand is covered in the official <a href="http://lesscss.org/#using-less" rel="nofollow">"Using Less" documentation</a> ("Installation" and "Command Line Usage" sections). Basically you'll do</p> <pre><code>$ npm install -g less $ lessc inputfilename.less outputfilename.cs...
NullPointerException when launching Camera view activity, which kills it instantly <p>I get fatal exception every time launching the tutorial app, clearly installed on phone JIAYU J3, from the activity listed below. All needed permissions and api key are added. Gradle builds finish without visionable failures. The issu...
<p>Problem solved: seems from the jump it was caused by taking unsuitable target SDK, appcompat and play-services versions.</p>
Can I use Websphere application server V8.0.0.10 (network deployment) for mobilefirst 7.1 clustering? <p>I have done Websphere application server V8.5 (network deployment) clustering for mobilefirst 7.1 using this link. </p> <p><a href="http://www.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.installc...
<p>Support is available from WAS ND 8.0.0.<strong>10</strong> onwards.<br> You cannot use WAS ND 8.0.0.3.</p> <p>See here: <a href="http://www-969.ibm.com/software/reports/compatibility/clarity-reports/report/html/softwareReqsForProduct?deliverableId=46183B706BEA11E48038141DE954FC88&amp;osPlatforms=AIX%7CLinux%7CMac%2...
Imitate click of different div <p>Currently using contactable and triggering the following:</p> <pre class="lang-js prettyprint-override"><code>$('#my-contact-div').contactable({ subject: 'feedback URL:'+location.href, header: '', url: 'mail.php', name: 'Name', email: 'Email', message : 'Message', submit...
<p>Sorted it by changing the js file with the following:</p> <pre><code>jQuery('#contactable-inner').toggleClick(function() { jQuery('#contactable-overlay').css({display: 'block'}); jQuery(this).animate({"marginRight": "-=5px"}, "2000"); jQuery('#contactable-contactForm').animate({"marginRight": "-=0px"}, ...
Delete the row with the highest id in mysql, using php <p>I'm working on a really simple minichat program (<code>php/mysql</code>) which displays the last 10 messages. </p> <p>I wanted to add a button to delete the last message (using a form, leading to a <code>php</code> file like the one under). </p> <p>I'm really ...
<p>According to the manual on <a href="http://dev.mysql.com/doc/refman/5.7/en/delete.html" rel="nofollow">DELETE Syntax</a>:</p> <blockquote> <p>Subqueries</p> <p>You cannot delete from a table and select from the same table in a subquery.</p> </blockquote> <p>So instead you should do something like:</p> <p...
View XML-Data as Table <p>I hope anyone can help me with my problem...</p> <p>I have a Table (DAT_Detail) in SQL Server 2008R2 with a XML-Column. In the XML-Column are my detailinformations for some tests... (I cannot change the table to another design, it hast to stay as xml). My table has 2 columns: DAT_Detail_ID (u...
<p>You can use this kind of solution:</p> <pre><code>SELECT TestValue1, TestValue2, TestValue3, TestValue4, TestValue5, TestValue6, TestValue7 FROM ( SELECT dd.DAT_Detail_ID, CAST(t.c.query('local-name(.)') as nvarchar(max)) as [Columns], t....
Wordpress Permalink Redirect <p>On the google search console i have thousands of 404 error with permalink structured like this </p> <p><a href="http://www.example.com/2016/01/11/victory-for-wenger-as-arsenal-top-premier-league-money-table/meky2xs@gmail.com" rel="nofollow">http://www.example.com/2016/01/11/victory-for-...
<p>you can try this </p> <pre><code>Redirect 301 /http://www.example.com/2016/01/11/victory-for-wenger-as-arsenal-top-premier-league-money-table/meky2xs@gmail.com http://www.example.com/2016/01/victory-for-wenger-as-arsenal-top-premier-league-money-table </code></pre>
Certain Unix commands fail with "... not found", when executed through Java using JSch <p>I have a piece of code which connects to a Unix server and executes commands.</p> <p>I have been trying with simple commands and they work fine.</p> <p>I am able to login and get the output of the commands.</p> <p>I need to run...
<p>The "exec" channel in the JSch (rightfully) does not allocate a pseudo terminal (PTY) for the session. As a consequence a different set of startup scripts is (might be) sourced. And/or different branches in the scripts are taken, based on absence/presence of the <code>TERM</code> environment variable. So the environ...
A more efficient / less-amateur way to do something based on selected option instead of a massive if-tree? <p>This has been bugging me for a while but I'm not sure if there's anyway to improve this... Basically in this project I have a list compiled of cards that I want to add to a final text output. I iterate through ...
<p>You could create a dictionary which maps your strings to the resource field names and lookup the card via the resource manager:</p> <pre><code>var mappings = new Dictionarx&lt;string, string&gt; { { "1734-IB8S", "m1734IB8S" }, { "1734-OB8S", "m1734OB8S" } /* ... */ } var resourceManager = new ResourceManager("yourr...
How to make a loading screen for a website hold for a certain number of seconds <p>I'm creating a website using the Salient theme in wordpress and I have a fairly large video file on the home page. So i set up a small gif to play as a loading image but sometimes the website loads too fast to even really see the gif.</p...
<p>Well, what you want is a <code>setTimeout</code>, but what you should do is preload the video.</p> <pre><code>setTimeout(function(){ // Hide loading }, 3000); // Time is in milliseconds </code></pre> <p><strong>Example</strong></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" d...
Pivot/Transpose in SQL Query in Oracle <p>I didn't know if my problem is related to Pivoting or Transposing so that's why I wrote both in the title.</p> <p>Below is my query (using it in an Oracle APEX Report)</p> <pre><code>SELECT QUESTION_ID, RESPONDENT, ANSWER FROM SURVEY </code></pre> <p>Here is ...
<pre><code>select * from table_name pivot ( min(answer) for question_id in (1 as q1, 2 as q2, 3 as q3)); </code></pre>
Find element by tag name within element by tag name (Selenium) <p>I want to print all the href(links) from a website. All these hrefs are stored in an 'a' tag, and these a tags are stored in a 'li' tag. Now, I know how to select all the li's. I need a way to select all the a's within the li's to get the 'href' attribut...
<p>I recommend css_selector instead of tag_name</p> <pre><code>aTagsInLi = driver.find_elements_by_css_selector('li a') for a in aTagsInLi: (print a.get_attribute('href')) </code></pre>
How can I print only the division that i want on html? <p>Hi guys I want that on the print section only the this division will be shown, what would be the script to this? And by the way this is a modal of every tenant on a table. This print will serve as a receipt of every tenant.</p> <pre><code> &lt;div cl...
<p>If I am not wrong, then the code below will do what you want. For more information, refer to the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media" rel="nofollow">MDN documentation about @media</a>.</p> <pre><code>@media print { body * { visibility: hidden; } .modal-body* { ...
Getting error: Type argument cannot be infered from usage when using LINQ to count nested foreach loop <p>I am trying to create a LINQ query for a nested foreach loop.</p> <p>The loop is as below:</p> <pre><code>var c = 0; foreach(var e in elements) { foreach(var a in e.Attributes) { if(...
<p>The type of <code>Attributes</code> is probably <code>dynamic</code> (or boxed as <code>object</code>) and thus the compiler does not know that it is a collection. Explicitly specify that it is an <code>IEnumerable&lt;T&gt;</code>:</p> <pre><code>int d = elements.SelectMany(e =&gt; (IEnumerable&lt;dynamic&gt;)e.Att...
Date parsing not failing with invalid format <p>The below piece of code should throw a parsing exception as per my understanding but it does not. Looked at the documentation but couldn't figure it out. </p> <pre><code>DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd", Locale.US); dateFormat.setLenient(false); da...
<p>This is what the <a href="http://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html#parse(java.lang.String)" rel="nofollow">javadoc</a> says:</p> <blockquote> <p>Parses text from the beginning of the given string to produce a date. The method may not use the entire text of the given string.</p> </blockqu...
Reading JSON Data with inconsistent data index extJS <p>I am currently trying to read data from an endpoint on my Chef Server using the JSON proxy reader in extJS in order to display it on a grid. Usually, the JSON response looks something like this:</p> <pre><code>{ "userId": 1, "id": 1, "title": "sunt au...
<p>I know nothing of extJS so this isn't really a direct answer, but then again this isn't really a Chef question either. Basically the Chef REST API is not built for direct consumption by simple clients. Notably the list endpoint you showed there only gives the name (and URL but that's pretty useless) for each cookboo...
Use hdf5 as caffe input, error: HDF5Data does not transform data <p>I used hdf5 file as caffe input data, and the error occured:</p> <blockquote> <pre><code>hdf5_data_layer.cpp:75] Check failed: !this-&gt;layer_param_.has_transform_param() HDF5Data does not transform data. </code></pre> </blockquote> <p>This is my de...
<ol> <li><p>As you already spotted yourself, you cannot have <code>transformation_param</code> in a <code>"HDF5Data"</code> layer - caffe does not support this.</p></li> <li><p>As for the transformation parameters themselves, look at <a href="https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto#L408-L4...
Inserting an Event in Google Calendar with VB.Net <p>I am trying to add a Google Calendar event using the code below:</p> <pre><code> Sub UpdateCalendar() Dim CalendarEvent As New Data.Event Dim StartDateTime As New Data.EventDateTime Dim A As Date A = "15-OCT-2016 12:00" StartDateTime.DateTime = ...
<p>Apparently commenting the following line solved the problem:</p> <pre><code>CalendarEvent.Id = System.Guid.NewGuid.ToString </code></pre>
Attempted relative import beyond toplevel package <p>Here is my folder structure:</p> <pre><code>Mopy/ # no init.py ! bash/ __init__.py bash.py # &lt;--- Edit: yep there is such a module too bass.py bosh/ __init__.py # contains from .. import bass bsa_files.py ... test_bash...
<p>TLDR: Do</p> <pre><code>import bash.bosh </code></pre> <p>or</p> <pre><code>from bash import bosh </code></pre> <p>If you also just happen to have a construct like <code>bash.bash</code>, you have to make sure your package takes precedence over its contents. Instead of appending, add it to the front of the searc...
Hide tabs within a tabbed control in Access <p>I have two tabs in my tabbed control and want to hide the tabs / tab names at the top of it as I want users to access the each tab using dedicated sidebar buttons (which I have created and which work).</p> <p>Is it possible to hide the tabs at the top of the form?</p>
<p>The default Format > Style = "Tabs". If you set this to "None" the tabs row will not appear.</p> <p><a href="https://i.stack.imgur.com/CQFtC.png" rel="nofollow"><img src="https://i.stack.imgur.com/CQFtC.png" alt="enter image description here"></a></p> <p>Alternatively, have oyu considered using a Navigation form?<...
Purpose of dbo.Policies table in SSRS <p>What is the purpose of the <code>[dbo].][Policies]</code> table in SSRS <strong>ReportServerDB</strong> database?</p> <p>I see two columns, <code>PolicyID</code> and <code>PolicyFlag</code> and I don't get any clue about purpose of this table. Is it possible to add anew row int...
<p>Each row of <code>Policies</code> table declares via <code>PolicyFlag</code> column if that policy is defined for system roles.</p> <p>A policy can be related only with created user defined objects, <code>UserType = 1</code> in <code>User</code> table. System defined objects like <code>NT AUTHORITY\SYSTEM</code> an...
Can't populate RecylcerView Android <p>I tried to follow how to build a recyclerview for my class project, but for some reason, I can't do it. I'm not sure of what I am missing. Ideas?</p> <p>EDIT: I went ahead and added more code upon reuqest</p> <p>The code that is relevant:</p> <pre><code>String selectedVenue; St...
<p>add the onPostExecute function to AsyncTask and notify the adapter</p> <pre><code>protected void onPostExecute(String result) { commentDetailAdapter.notifyDataSetChanged(); } </code></pre> <p>onPostExecute calls after the background process completed (coz array might be empty before that), and onPostExecute ...
Android Status Bar Color <p>I am having problem with status bar color when I use <code>android:fitsSystemWindows="false"</code></p> <p>It becomes transparent. I dont want that to happen. I want to it have <code>colorPrimaryDark</code> as its color.</p> <p>I have to set this as <code>false</code> because I am using a ...
<p>In your Activity below the setcontentview(...) </p> <pre><code>Window window = getWindow(); window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); // finally change the color if (Build.VERSION.SDK_INT &gt;= Build.VERSI...
.readlines() shouldn't return an array? <p>I have a problem with <code>.readlines()</code>. it used to only return the line specified, i.e. if I ran</p> <pre><code>f1 = open('C:\file.txt','r') filedata = f1.readlines(2) f1.close() print filedata </code></pre> <p>it should print the second line of <strong>file.txt.</s...
<p>Don't use <code>readlines</code>; it reads the entire file into memory, <em>then</em> selects the desired line. Instead, just read the first <code>n</code> lines, then break.</p> <pre><code>n = 2 with open('C:\file.txt','r') as f1: for i, filedata in enumerate(f1, 1): if i == n: break print ...
First non empty value in Column of data frame in R <p>I have one data frame which has column header but position of coulmn header is not fixed so can i read non empty value in 1st column to get the index of header to process the file.</p> <p>mydata.txt</p> <pre><code> test 34 45 ...
<p>Ok, for example </p> <pre><code>writeLines(tf &lt;- tempfile(fileext = ".txt"), text = " test 34 45 rt 45 56 tet3 67 56 Col1 Col2 Col3 Col4 Col5 45 45 23 56 12 34 45 67 65 32 45 67 78 90 54 56 43 ...
Button is not clicked unless I click on it twice in Firefox, using selenium webdriver and C# <p>I have a button in a web application which I want to click. I am using Selenium WebDriver, C# and Firefox version 47.0.1.</p> <p>I tried using explicit wait and also tried using Actions class. But nothing works. </p> <p>It...
<p>Sometimes their is some problems with IE11 and chrome in selenium is not able to work as expected. so I use double click instead of click in certain scenarios.</p> <p>Actions action = new Actions(driver); action.moveToElement(driver.findElement(By...path..."))).doubleClick().perform();</p>
Duplicate Boolean fields in JSON <p>I have boolean field as</p> <pre><code>private boolean isCustom; </code></pre> <p>having getter and setters as </p> <pre><code>public boolean isCustom() { return isCustom; } public void setCustom(boolean isCustom) { this.isCustom = isCustom; } </code></pre>...
<p>The annotation accepts a parameter. And it should be placed on the field, getter, <strong>and</strong> setter to prevent the duplicate </p> <pre><code>@JsonProperty("isCustom") </code></pre>
android gms big method count. How to avoid it? <p>I do - as many developers, have issues with the infamous android 65000 methods limit. I'm already multi-dexing my app but I'd really like to make it lighter somehow.</p> <p>This is the graph of my app's methods (taken with dexcount plugin: <a href="https://github.com/K...
<p>To understand where certain dependencies come from, run the <code>dependencies</code> Gradle task on your app's module. Suppose your app's module is called <code>app</code>, then the command will look like:</p> <pre><code>./gradlew -q :app:dependencies </code></pre> <p>The output should contain all transitive depe...
T-SQL sort integer values <p>id like to create a procedure wich later will have 5 integer parameters as an input. Within these procedure i want to sort those integer values in ascending order and later update a table. I did it with case whens so that i dont loose the information of each parameter (Background: Additiona...
<p>I don't know exactly how you want to use the sorted integers, but why not let SQL do the sorting for you? the below, creates a temp table (<code>@s</code>), with the five integers (passed in as parameters?) in it and sorts them. </p> <pre><code>declare @ip1 int = 2 declare @ip2 int = 1 declare @ip3 int = 3 decl...
What is the path for a font symfony <p>I am trying to do some text and convert it into an image. </p> <p>I got some code from the php manual.</p> <p>Im working on it in symfony 3.1</p> <p>The only problem that I have is how do you set the path for the font.</p> <p>The roboto-regular.ttf is in my <strong>/web</stron...
<p>There's actually no direct way to get path to webdir in Symfony2 as the framework is completely independent of the webdir. But you can use <code>getRootDir()</code>:</p> <pre><code>$path = $this-&gt;get('kernel')-&gt;getRootDir() . '/../web'; </code></pre>
Git Commit message structure <p>I am starting a new repository from scratch and I want to ensure I start off correctly. I am talking over from a previous developer who used github terribly and I want to fix it before I continue developing on to of their code. </p> <p>I have done a lot of reading on github and I will b...
<p>Writing a good commit message is important, and it's fantastic you're putting so much thought into it. In general, the rule of thumb is to write in present tense and to write short, descriptive messages.</p> <p>Maybe more importantly, commits should hold small and logical units of work. It appears in your example t...
Using a variable and an id inside a querySelector <p>I want to get value from the input column using querySelector. I need to use two id to get the correct column. The second id is stored in a variable and its an integer value. I have tried different things but I am not getting anything. Currently it gives me null. ...
<blockquote> <p>The outer id is methodProperties and the inner is input id="0eca409e-e2f7-467d-bd5e-dff9b63e3715" and I want to get its value ="Customers"</p> </blockquote> <p>Try this</p> <pre><code>descriptionFieldValue = document.querySelector( '#' + descriptionFieldId ).value; </code></pre> <p>or since th...
Deploy meteor server using development mongodb <p>I'm currently trying to deploy a Meteor server from scratch using the command <code>meteor build</code>, there is no big issue but a question that may be very dumb.</p> <p>In development environment, a mongodb instance is automatically started when I start my Meteor se...
<p>You need to set the environment variable like:</p> <pre><code>export PORT=3000; export MONGO_URL=mongodb://localhost:27017/my-app </code></pre> <p>Then you can run the main.js file using node.</p> <pre><code>node main.js </code></pre> <blockquote> <p>Note: When you build a meteor app. It converts the meteor ap...
ASP.net AjaxToolKit LineChart Drawing Series <p>I have the following SqlServer Data Table :<br/><br/> Years | Sales(A) | Sales(B)<br/> ------------------------------<br/> 2000 | 38000 | 55000<br/> 2001 | 18000 | 47000<br/> 2002 | 70000 | 16000<br/> 2003 | 21000 | 55000<br/> 2004 | 77000 | 5000...
<p>My theory, is the array is just getting appended. *Note, we may need separate arrays as it's getting rendered after the code.</p> <p>Try this,</p> <pre><code> dt = GetData("SELECT Years,A, B FROM LineChart") y = New Decimal(dt.Rows.Count - 1) {} y2 = New Decimal(dt.Rows.Count - 1) {} ...
Ionic Sign-up and Login with Firebase <p>I have just started learning ionic. I was wondering if anyone could guide me how to implement Login and Sign-up functionality using Firebase in Ionic? Any help would be appreciated.</p>
<p>I created a guide detailing that exact process <a href="https://javebratt.com/firebase-3-email-auth/" rel="nofollow">here</a>.</p> <p>But if you're just learning Ionic I do suggest you go through Ionic's documentation or invest in <a href="https://www.joshmorony.com/building-mobile-apps-with-ionic-2/" rel="nofollow...
Linq Left Join where right is null <p>relatively new to linq, coming from SQL. So, I'm trying to figure out left joins for the following:</p> <pre><code>SELECT * from MASTER m LEFT JOIN CHILD C ON m.ID=C.MASTER_ID WHERE C.MASTER_ID is null </code></pre> <p>So, normally this would return all of the records from M...
<p>If you are using EF, then you can get the masters which don't have children using the navigation property that represent the children:</p> <pre><code>var result= from m in MASTER where m.Children.Count()==0// or m.Any() select m; </code></pre> <p>If you want to do it using an explicit join ...
Getting lookup field value without specifying the name for onChange field event <p>I have a form, that could have <code>Contact</code> lookup field, or <code>User</code> lookup field, depending on the type of the person User wants to add. Only one of the fields is visible.</p> <p>There is also <code>Name</code> text f...
<p>When registering the onChange event handler pass <a href="https://msdn.microsoft.com/en-us/library/gg328130.aspx" rel="nofollow">ExecutionContext</a> as the first parameter. You can then get the input value like so:</p> <p>Event handler registration:</p> <p><a href="https://i.stack.imgur.com/2Ka0s.png" rel="nofoll...
wordpress visual editor not generating html p tags for the paragraphs <p>wordpress visual editor not generating html <code>&lt;p&gt;</code> tags for the paragraphs and thus non formatted content gets saved in the database. It results in showing all paragraphs together on frontend.</p>
<p>You can use this plug-in: <a href="https://wordpress.org/plugins/tinymce-advanced/" rel="nofollow">https://wordpress.org/plugins/tinymce-advanced/</a></p> <p>After activation goto <strong>Settings</strong> > <strong>TinyMCE Advanced</strong></p> <p>Under <strong>Advanced Options</strong> check '<strong>Keep paragr...
How to get current date and time with respect to Time Zone in Codeigniter <p>When I run the following code in codeigniter, it returns incorrect time and date for the India location. Please let me the solution. </p> <pre><code>'date_default_timezone_set('Asia/Kolkata'); $date = date('Y-m-d H:i:s', time()); echo $date;'...
<p>try this</p> <pre><code>$now = new DateTime(); $now-&gt;setTimezone(new DateTimezone('Asia/Kolkata')); echo $now-&gt;format('Y-m-d H:i:s'); </code></pre>
How To Qt Creator Embedded use PSQL <p>I'm trying to use connection to postgres with Qt Creator for embedded device with the Raspberry Pi 3, however the driver is not loaded. The same application on the desktop is ok.</p> <p>My example is quite simple.</p> <p>I have a console project with a main class and in it a log...
<p>QSqlDatabase::drivers() lists only the drivers that can be loaded on that particular platform, in many cases to have a working driver you need the Qt driver and a specific client library.</p> <p>Probably there is a postgresql client library for raspberry with your specific linux version somewhere but Boot2Qt does n...
ComboBox writing Words in a TXT <p>Let me show you what I have in my code : </p> <pre><code>public List&lt;String&gt; listQuality = new List&lt;string&gt;(); public int qualityChoose; InitializeComponent(); listQuality.Add("Fastest"); listQuality.Add("Fast"); listQuality.Add("Simple"); listQuality.Add("Good"); listQ...
<p>your question isn't very understandable, by the way you can do something like this example</p> <p>xaml:</p> <pre><code>&lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;/Grid.RowDefinitions&gt; &lt;ComboBox Grid.Row="0" Items...
$q doesn't work asynchronously <p>I am using <code>promise</code> and <code>$q</code> to make an asynchronous call. But it doesn't work.</p> <p>eventData.js</p> <pre><code>angular.module('eventsApp').factory('eventData' , function($http ,$q, $log) { return { getEvent : function() { var defe...
<p>This is how you get the data since you are returning a promise not the results:</p> <pre><code>eventData.getEvets().then(function(result){ $scope.event = result; }) </code></pre>