input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
How to get the specific option value of a dropdown by passing the option text in jquery <p>I am using the below line to get the value of a specific option of a dropdown, it is working in IE, but not working in Chrome.</p>
<p><code>$("#idDescription option[text='Business']").val();</code></p>
| <p>Use :contains pseudoselector.</p>
<pre><code>$('#idDescription option:contains("Business")').val()
</code></pre>
|
"Unable to locate the SpatiaLite library." Django <p>I'm trying to make Django's SQLite3 accept spatial queries. <a href="https://docs.djangoproject.com/en/1.10/ref/contrib/gis/install/spatialite/" rel="nofollow">This tutorial</a> suggests that I add this to settings:</p>
<pre><code>SPATIALITE_LIBRARY_PATH = 'mod_spat... | <p>Amusingly enough 5 days later I'm having the same issue. After a little bit of poking around I got it working:</p>
<p>Set</p>
<pre><code>SPATIALITE_LIBRARY_PATH = 'mod_spatialite'
</code></pre>
<p>and extract ALL the DLL files from the mod_spatialite-x.x.x-win-x86.7z to your Python installation directory. The dll... |
Octave: How to cirumvent the "imresize: IM must be a grayscale or RGB image" error? <p>This is an <a href="https://lists.gnu.org/archive/html/octave-bug-tracker/2014-12/msg00185.html" rel="nofollow">active bug</a> in Octave:</p>
<pre><code>error: imresize: IM must be a grayscale or RGB image.
</code></pre>
<p>I can't... | <p>The pixels of grayimage in octave must be in [0..1] range. You can scale amplitude of your matrix to satisfy this criterion:</p>
<pre><code>In = ones(6,6);
In(3,3) = -1;
minIn=min(In(:));
maxIn=max(In(:));
In1=(In-minIn)/(maxIn - minIn);
Out = imresize (In1, 2);
Out1=Out*(maxIn-minIn) + minIn;
</code></pre>
|
using vue js vs angular js with laravel <p>We will code large web application with laravel. Laravel and vue integration is amazing. And vue js is so easy to learn and simple framework. But I cannot sure should I use vue js in large project. Alternative framework which we think is angular 1. </p>
<p>What is the best fr... | <p>Well, depends on how your use case is. If its more like SPAs then Angular can do better job. Refer laracast for tutorials, there are reactJS flavour too. </p>
<p>One thing i would like to mention is vueJS having laravel like structure and coding style so that helps a lot. VueJS can serve almost everything you need.... |
Using Br tag in Xamarin Forms <p>I'm using Xamarin Forms. I use a BoxView for making spaces between lines but I don't know if I'm doing right. What is the proper way to using a br tag in Xamarin ? Is there an alternative way for it? I'm using this:</p>
<pre><code><StackLayout>
<Label Text="Line 1"></L... | <p>If you are already using a StackLayout, you can set 'spacing' between each element in the Stackayout, example :</p>
<pre><code><StackLayout Spacing="10">
</code></pre>
<p>Some other options can be found in the Xamarin Forum though... <a href="https://forums.xamarin.com/discussion/29700/label-and-n" rel="nofo... |
Circular cut out in rectangle using Android drawables <p>I would like to create the same shape as depicted in <a href="http://stackoverflow.com/questions/8503636/transparent-half-circle-cut-out-of-a-div">Transparent half circle cut out of a div</a> using Android drawables and fill the created circle with a round button... | <p>1) Create drawable oval with white color in xml.</p>
<p>2) Create a Relative layout with black background.</p>
<p>3) Draw the image with background of oval drawable over relative Layout.</p>
|
Output exact depth map in Blender <p>How can I output the depth information of each frame in blender to a <code>.txt</code> file?</p>
<p>I can generate a depth-map as gray-scale image with values in <strong>[0,1]</strong> but I want the values in units I use in Blender (<em>meter</em> in my case).</p>
| <p>The solution turned out to be very easy. Just link the <code>Z buffer</code> in the <code>Node Editor</code> with the output. Also make sure to turn he <code>Z buffer</code> on.</p>
|
Python: edit matrix row in parallel <p>here is my problem:<br>
I would like to define an array of persons and change the entries of this array in a for loop. Since I also would like to see the asymptotics of the resulting distribution, I want to repeat this simulation quiet a lot, thus I'm using a matrix to store the s... | <p>OK, so this might not be much use, I haven't profiled it to see if there's a speed-up, but list comprehensions will be a little faster than normal loops anyway.</p>
<pre><code>...
y_ix = np.arange(rep) # create once as same for each loop
for i in range(steps):
# presumably the two locations in the population to... |
Multiple Choice Quiz With Randomising Answer Positions PYTHON 3.5.2 <p>I am creating a Que Card quiz in which a keyword from a text file is chosen at random, the program should then show the correct definition along with 2 other incorrect definitions that are in the text file as well. So far I have the keyword, the cor... | <p>Here's one possible approach based on <code>random.shuffle()</code>. I've use objects to separate the question from the answers, and followed your convention that the first answer provided in constructing the question is the correct one. I've chosen to shuffle the indices rather than the answers themselves, just t... |
Nested Loop in r <p>I am having trouble writing an algo in r, in python this wouldnt be a big deal but r's syntax has thrown me off.
I would like to set the first index of z and nums equal to eachother and put it into a list.
Once in a list I would like to print the letter of a negative number.
Then i would like to p... | <p>What you could do is (using your data): </p>
<pre><code>df <- data.frame(z,nums, stringsAsFactors = FALSE)
</code></pre>
<p>There all the letters and nums in </p>
<pre><code> > df
z nums
1 a 1
2 b 3
3 c -2
4 d 8
5 e -4
6 f 4
7 g 2
8 h -3
9 i 9
10 j 1
11 k 4
12 l ... |
What is the best way to check if a column contains any of the keywords <p>I have table of keywords</p>
<p>Keywords:</p>
<pre><code>KeyID | Keyword
1 Small
2 Medium
3 Large
4 XXLarge
</code></pre>
<p>Then I have another table "Logs" that has over 100 000 records.</p>
<p>Logs: </p>
<pre><code... | <p>I tried in following way. Please Check:</p>
<pre><code>create table one(
keyid int,
keyword varchar(10)
)
insert into one values (1,'Small')
insert into one values (2,'Medium')
insert into one values (3,'Large')
insert into one values (4,'XXLarge')
create table two(
logid int,
description varchar(100))
insert i... |
Finding the minimum value in one column for all rows for with the same value in another column <p>So, basically I want to find the minimum value in one column for all data points with a specific value in another column. Here are some images for example:</p>
<p><a href="http://i.stack.imgur.com/1ju7a.png" rel="nofollow... | <p>Although I'm not 100% sure of desired outcome this array formula might help:</p>
<pre><code>=MIN(IF(Sheet1!$A$2:$A$308000=Sheet2!$A2,Sheet1!A$2:A$308000))
</code></pre>
<p>To apply this formula you must use <strong>Ctrl</strong> + <strong>Shift</strong> + <strong>Enter</strong>.
This one goes to cell <code>C2</cod... |
In an android MVP-structured app, what would be the "correct" way to pass a string resource as {path} to a Retrofit call? <p>In the Model layer, I've got a <code>DataManager</code> class that handles all Retrofit calls. </p>
<p>The retrofit methods need <code>{path}</code> parameters, because I store all REST endpoint... | <p>the best way is to use dependency injection either using libraries like "Dagger 2" or by the help of dependency inversion. </p>
<p>to do the first way you can refer to this link: (this way needs more code and time but the best practice - the most recommended to use in mvp architecture - learning is a bit complicate... |
List index while loop python <p>I have an issue with the following code. When i typed the exact secret words character, the following code wont match the secret codes. </p>
<pre><code>#initiate words for guessing secretWords =['cat','mouse','donkey','ant','lion']
#Generate a random word to be guessed generateWord = (... | <p>Why are you comparing one letter in generateWord to the entire userInput?</p>
<pre><code>if(generateWord[LetterNumber] == userInput):
</code></pre>
<p>That line compares the character at "LetterNumber" index to the userInput, so if a user enters a word it will never return true. </p>
<p>If you're attempting to co... |
scale intensitiey levels of ffmpeg filter output <p>how does ffmpeg scale filter output intensities?
I have a blend/divide filter that divides 8 bit frames by an 8 bit image and saves the output into an xvid avi. </p>
<p><code>blend=all_mode='divide':repeatlast=1</code></p>
<p>I would like to understand how exactly f... | <p>the <a href="https://github.com/hhool/FFmpeg/blob/master/libavfilter/vf_blend.c" rel="nofollow">source code</a> looks like this:</p>
<p><code>DEFINE_BLEND8(divide, av_clip_uint8(B == 0 ? 255 : 255 * A / B))</code></p>
<p>So I guess the answer is that the result gets multiplied by 255 and then clipped to 255</p>
|
Eloquent: How to join a directly related table and a indirectly related table? <p>To demonstrate my problem, I have created a fictitious database with these 4 tables (defined as Eloquent models): <em>User</em>, <em>Product</em>, ShoppingItem (short: <em>Item</em>), <em>Order</em>; with all their relevant relations. (<e... | <p>Well <code>whereHas</code> statment is only for limiting query results for the relation tables.</p>
<p>You need to use <code>join</code> statment to be able to <code>orderBy</code> the related table field, like this:</p>
<pre><code>$orders = Order::join('items', 'product_id', '=', 'products.id')
->select(... |
sequelize : Create new entry with existing foreign key <p>I create 2 models : </p>
<pre><code>userPreferenceCategories = sequelize.define("userPreferenceCategories", {
id : {
type : Sequelize.INTEGER,
autoIncrement : true,
primaryKey : true,
allowNull : false
},
... | <p>It seems it's the only solution</p>
<blockquote>
<p>No, because when you do a create with include, it will create the
associated instance, not associate it.</p>
</blockquote>
|
template won't render from model object after sorting <p>I am sorting an array of objects queried from Ember-Data by 'type'-key before returning them in the <a href="http://emberjs.com/api/classes/Ember.Route.html#method_model" rel="nofollow" title="model method"><code>model()</code></a>-method of an <code>Ember.Route<... | <p>The answer of @Pavol gets to the basic problem, however <code>return this.store...then(...)</code> <strong>will work</strong> because this is how promises work. Read <a href="https://promisesaplus.com" rel="nofollow">the documentation</a>.</p>
<p>So this will work:</p>
<pre><code>model() {
let obj = Ember.Object... |
Speed optimisation in Flask <p>My project (Python 2.7) consists of a screen scraper that collects data once a day, extracts what is useful and stores that in a couple of pickles. The pickles are rendered to an HTML-page using Flask/Ninja. All that works, but when running it on my localhost (Windows 10), it's rather slo... | <h2>Your Question on Rendering</h2>
<p>You can actually do a lot with Jinja. It is possible to run Jinja whenever you want and save it as a HTML file. This way every time you send a request for a file, it doesn't have to render it again. It just serves the static file.</p>
<p>Here is some code. I have a view that doe... |
Combing 2 IF statements <p>I need to state that if a score is above 21 and the month nam is'whatever' then $month = '3'</p>
<pre><code>if(strpos($data->form->name, 'april') !== false) && ($data->data->score * 1) >= 21 &&$x <= 41){
$amonth = "3";
}
elseif(($data->data->score *... | <p>Your first line is written the wrong way, you miss some <code>()</code></p>
<p>Use this : </p>
<pre><code>if((strpos($data->form->name, 'april') != false) && (($data->data->score * 1) >= 21 &&$x <= 41)){
</code></pre>
<p><strong>Update:</strong> Sorry, I've missed a <code>&&a... |
How to wait under UITests in Xcode until some view will be visible for tap? <p>Sometimes under UITests in Xcode the compiler try to tap the button before it is loaded and presented. Then arise a problem like <code>no matched found for...</code>.</p>
<p>But the simple solution for this is:</p>
<pre><code>sleep(1) //wa... | <p>You should create an <a href="https://developer.apple.com/reference/xctest/xctestexpectation" rel="nofollow">XCTestExpectation</a> and wait for it to be fulfilled</p>
<pre><code>expectationForPredicate(NSPredicate(format: "hittable == true"), evaluatedWithObject: mybutton, handler: nil)
waitForExpectationsWithTimeo... |
API REST for sending emails with attachment <p>I'm implementing a service to send emails thought a REST API and I don't know how to deal with the attachments in a restfull way. </p>
<p>Any ideas about how the interface should be? maybe 2 calls, one with the mail info (subject, content, etc) and other one with the file... | <p>You can send the whole e-mail with attachments as multipart/form - including both sender, receivers, body and attachments as various form fields in one single request.</p>
|
Android studio source codes red errors <p><a href="http://i.stack.imgur.com/2BYyN.jpg" rel="nofollow">this image is aboout activity.java</a></p>
<p>Now you can see the res point.it really confused me!
How to solve this problem, I really want to see that class.
If you know how to solve it ,just do it.</p>
| <p>Those unresolved imports refer to internal classes/interfaces that are not included in the SDK because they are not intended for public use.</p>
<p>If you want to view source code for those internal classes, you can just check them here <a href="https://android.googlesource.com/platform/frameworks/base/+/master/cor... |
Angular 2.0 / NodeJS project size <p>I have been using angular 1.x for a while now and I am currently checking if it's possible for me to <strong>upgrade to 2.0.</strong> I am having <strong>two concerns</strong>.</p>
<ol>
<li><p>The web development I am doing is with a specific application server which does not have ... | <p>Most of the NPM modules run on your system, they wont be part of your web application build</p>
<p>There are many techniques like <code>Ahead-Of-Time compilation, Tree shaking</code> to ensure Only code that we need for our application to be part of final build.</p>
<p>Currently "Hello world" app for Angular2 is 4... |
How to store data in Netezza which is encoded in various formats? <p>While storing data in Netezza tables there is a little discrepancy in data.
For example,'ïžAïžAIAI' which is in CP1166 encoding and is being modified when loaded into the table.</p>
<p>How do I avoid this modification of data on load or is... | <p>If you want to store unicode /Multibyte characters then you have to use NVARCHAR/NCHAR type data type which can store multibyte characters . You can also look at NZCONVERT /Iconv to have the desired output . </p>
|
Use xsl:analyze-string and preserve markup (like in an identity transform) <p>I would like to process an XML file so that whatever stands before or after two newlines in a row gets turned into a paragraph (like in LaTeX).</p>
<p>This is the source file:</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<... | <p>I think you need two passes, one that inserts a certain element (I have choosen <code>br</code> but of course you can choose anything that does not interfere with your existing vocabulary), and a second that uses <code>for-each-group</code> <code>group-starting-with="br"</code>:</p>
<pre><code><xsl:transform xml... |
Python tkinter: Canvas scrollbar appears but doesn't work <p>I've been trying to add a scrollbar to a canvas that contains a single frame, this frame is what holds the widgets. I have added the scroll bar which shows up correctly but it has no effect on the canvas.</p>
<pre><code>area2=Frame(border2,bg="#FAFAFA")
area... | <p>You are trying to embed a frame which contains various other widgets into a canvas so that you can scroll around. However, after you create the <code>scrollcanvasframe</code> you pack it, with is incorrect. The canvas is a geometry manager in its own right and the correct way to make the canvas manage another widget... |
Impossible to store data in base from a form <p>Im trying to store data in rails, but I simply can't, everytime I push with submit button, the values on base are null and the method save try to store data before I push button submit, here is my code :</p>
<p>images_controller.rb:</p>
<pre><code>class ImagesController... | <p>Add a <code>require</code> method in <code>image_params method</code> and the <code>require</code> method ensures that a specific parameter is present, and if it's not provided, the require method throws an error. It returns an instance of <code>ActionController::Parameters</code> for the key passed into <code>requi... |
How to sync across different users on the Realm Mobile Platform? <p>If say, I have a mobile app that comprises of some private data, and some shared data for a user. How do I set up the realm sync URL so that the shared data is sync across other users while the private data is only synced across devices for that partic... | <p>The Realm Object Server supports access control on Realms, such that users can be given the following permissions for a given Realm:</p>
<ul>
<li>Read</li>
<li>Write</li>
<li>Manage (meaning the user can grant or revoke permissions on the Realm)</li>
</ul>
<p>By default users can create new Realms within their uni... |
How to Embed a PowerBI Tile in a Rails app? (and apply filter to it) <p>I'm struggling with this since a week... I have tried so many things, read so many documentations (walkthrougsh), I can't find any solutions and I have lost the clarity. I really need your help.</p>
<ul>
<li><p>I have created a simple Rails app.</... | <blockquote>
<p>New tile API allows to integrate content from a userâs Power BI
account into application UI for tiles that are on a userâs
dashboards. You can leverage this to add personalized BI content from
your userâs Power BI account into your application.</p>
</blockquote>
<p>See <a href="https://p... |
How is a double entry in Yaml parsed by ElasticSearch? <p>I have been asked to investigate performance problems in an ElasticSearch cluster, and have come across the following configuration:</p>
<pre><code>indices:
breaker:
fielddata:
limit: 50%
fielddata:
cache:
expire: 15m
size:... | <p><a href="http://www.yaml.org/spec/1.2/spec.html#key//" rel="nofollow">Relevant section</a> in YAML spec:</p>
<blockquote>
<p>The content of a mapping node is an unordered set of key: value node pairs, with the restriction that each of the keys is unique.</p>
</blockquote>
<p>Therefore, the YAML you posted is sim... |
Why is that the following indexOf isn't matching the given substring? <p>I'm looping through an array of URLS. If the url has the substring <code>/w/400/h/400/g</code> I want it to run some code. However, it never runs:</p>
<pre><code> for (let i = 0; i < this.leancloudFiles.length; i++) {
console.log('LEAN:',... | <p>It doesn't match because it the substring just doesn't appear in the strings.</p>
<p><code>indexOf('/w/400/h/400/g')</code> ends the pattern with a lowercase G, but the URLs have lowercase Qs there.</p>
|
Can I change the default escaping in Handlebars.java? <p>I have a template with default Handlebars expansion <code>{{thing}}</code>.</p>
<p>For various nasty reasons I'd like to use it to render JSON, and so not to do the default HTML escaping that comes with <code>{{</code>.</p>
<p>I'd also like to use the template ... | <p>You can configure Handlebars with various <code>EscapingStrategy</code>s - in this case <code>EscapingStrategy.JS</code> does the trick.</p>
|
How can I draw a bezier curve polyline on a bing map wpf c#? <p>Bing maps library for wpf seems not to include any helper to draw a bezier curve.
It has MapPolyLine which can be used to draw straight lines between n points.
Any solution?</p>
<p>Thanks</p>
| <p>Bing Maps does not support curved geometries directly, so instead can approximate the shape of a curved line by creating a polyline containing several small segments.</p>
<p>Hope this article will help
<a href="https://alastaira.wordpress.com/2011/06/27/geodesics-on-bing-maps-v7/" rel="nofollow">https://alastaira.w... |
How could I append time stamp range within my elasticsearch query? <p>I'm trying perform an elasticsearch query as a <code>POST</code> request in order pull data from the index which I created. The data which is in the index is, a table from MySQL DB, configured though <code>logstash</code>.</p>
<p>Here is my request ... | <p>You just need to remove the <code>+</code>as they are only necessary when sending a query via the URL query string (i.e. to URL-encode the spaces), but if you use the <code>query_string</code> query, you don't need to do that</p>
<pre><code>AND timestamp:[2015-05-27T00:00:00.128Z TO 2015-05-27T23:59:59.128Z]"
... |
Could not parse the remainder: '/{{menu.Info.page}}' from ''item'/{{menu.Info.Page}}' <pre><code> <a href="{% url 'page' %}"><img id="page" class="abc" src="{{STATIC_URL}}page/code_251.png" style=""/></a>
</code></pre>
<p>Hitting this url like localhost:8000/app/page works fine.</p>
<p>If I want som... | <p>You're confused about at least two things here.</p>
<p>Firstly, you would never use <code>{{ }}</code> <em>inside</em> a tag. You're already in the template language context there: you have access to variables directly.</p>
<p>Secondly, the <code>{% url %}</code> tag works on urlpattern names and parameters, not l... |
Reg Exp Capture everything before a certain word in VBA <p>Hi I want to capture everything before the word contact
Eg:</p>
<pre><code>15 Lecky Road
Ballinderyy
Upper Lisburn
BT28 2QA
Contact: Anna Murphy
Telephone: 02892 610634
Fax: 02892 610635
</code></pre>
<p>This is my regexp:</p>
<pre><code>(.|\n)*Contact$
</co... | <p>I'd use:</p>
<pre><code>answer=split(s,"Contact:")(0)
</code></pre>
<p>Far faster than regexp</p>
|
optional std::nullopt_t implementation in libcxx <p>Clang implements <code>std::nullopt_t</code> this way:</p>
<pre><code>struct nullopt_t
{
explicit constexpr nullopt_t(int) noexcept {}
};
constexpr nullopt_t nullopt{0};
</code></pre>
<p>Why not simply:</p>
<pre><code>struct nullopt_t{};
constexpr nullopt_t ... | <p>According to <a href="http://en.cppreference.com/w/cpp/utility/optional/nullopt_t" rel="nofollow">cppreference</a>:</p>
<blockquote>
<p><code>std::nullopt_t</code> must be a LiteralType and cannot have a
default constructor. It must have a constexpr constructor that takes
some implementation-defined literal t... |
Enable and disable gprof at runtime? <p>I wonder if there's any API within <code>gprof</code> to enable and disable profiling at runtime by the monitored application. I'm interested on disabling the profiling of certain parts of the code and enabling it to focus on those that are interesting to me. I mean, is there a w... | <p>There's an undocumented and hidden way of doing this that works on some systems (at least some, if not all, versions of glibc and some BSDs).</p>
<pre><code>$ cat foo.c
extern void moncontrol(int);
static void
foo(void)
{
}
static void
bar(void)
{
}
int
main(int argc, char **argv)
{
moncontrol(0);
foo();... |
WildFly 10 Jgroups allways binding to localhost interface <p>Hi I'm trying to develop a clustered application that uses Infinispan for caching. First I tried to run in replicated mode by starting two instance of wildfly using the localhost as binding interface (with port offsets). This worked fine. But once I start the... | <p>I posted the same question in <a href="https://developer.jboss.org/thread/272517" rel="nofollow">Jboss developer</a> since I didn't get any answer here.
And this is the answer I got from there.</p>
<p>By default Jgroups bind to private interface. When starting the server this IP can be provided as well.</p>
<pre>... |
Keep same URL after login Spring security <p>i want to stay in the same page after login but spring oblige u to redirect to <code>defaultSuccessUrl</code>
my code is like this</p>
<pre><code>@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf().disable()
... | <p>Set </p>
<p><strong>always-use-default-target="true"</strong> </p>
<p>which will force spring-security to go to /index.html</p>
|
Is there a pattern in JavaScript for loosely coupled objects. <p>I'm relatively new to JavaScript so apologies if this type of question is an obvious one. </p>
<p>We have an app which uses etcd as its way to store data. What I'm trying to do is implement a way of swapping or alternating between different backend data ... | <p>I come from Delphi / C# etc. And interface are just a pain in the but.
Javascript is so much nicer..</p>
<p>With javascript interfaces are not needed, just add the method.</p>
<p>eg.</p>
<pre><code>function MyBackend1() {
this.ver = 'myBackEnd1';
}
function MyBackend2() {
this.ver = 'myBackEnd2';
this.... |
Editing the content of one list based on the content of a second list with limited columns <p>I am trying to delete all lines in List A that don't match lines in List B.</p>
<p>My issue is that the format of both lists is only identical for the first 16 columns. </p>
<p>I only want to compare the lists by these initi... | <p>This assumes lines in List A are unique with respect to the first 16 characters (or if not, that you only want to print the latest one). Also, if lines in List B are repeated, the output will repeat the line from List A, as well.</p>
<pre><code>$ awk -F: 'NR==FNR{a[$1 $2]=$0; next} ($1 $2) in a {print a[$1 $2]}' a.... |
jquery calling in order <p>I'm new in Jquery and want to add date time picker with a bootstrap template.
I've some JQuery but it give me error ,may be because of it's order,can any one help me to rearrange it .</p>
<pre><code><script src="/bower_components/jquery/dist/jquery.min.js"></script>
<scrip... | <p><em>Please Try This</em></p>
<pre><code> <script type="text/javascript" src="/timepicker/script.js"></script>
<link rel="stylesheet" media="all" type="text/css" href="/timepicker/jquery-ui-timepicker-addon.css" />
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
&... |
Firebase sorting and filtering <p>I'm trying to filter blog entries through url params containing the url property of its categories array.</p>
<pre><code>http://example.com/blog.html?filter="foo-bar"
</code></pre>
<p>I want to list every entry that has the filter param in its categories array url value.</p>
<p>This... | <p>With Firebase and other NoSQL database structures, there is a practice called <strong>denormalization</strong> that helps with sorting and filtering. The basic idea is to have the same data in multiple formats, designed for a specific task. So in your case, you might have something like this:</p>
<pre><code>blogEnt... |
Arrow operation in javascript <p>I understand the array operation in javascript is a shorter syntax of function expression. However, I don't understand the following code when several <code>=></code>s put together, what does it mean?</p>
<pre><code>const logger = store => next => action => {
let result =... | <p>This is a curried function.</p>
<p>There is an in-depth description here: <a href="http://stackoverflow.com/questions/32782922/what-do-multiple-arrow-functions-mean-in-javascript">What do multiple arrow functions mean in javascript?</a></p>
|
web.xml error-page 404 error path <p>I've the following web.xml:</p>
<pre class="lang-xml prettyprint-override"><code><servlet>
<servlet-name>dispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
... | <p>If you have deployed your application on Tomcat and you are just typing localhost or localhost:port it won't redirect to your application.</p>
<p>You can access by typing localhost:port/YourProjectName. It is root of your project and if you want to access any other resource you can access it by localhost:port/YourP... |
How can I get xlim, ylim values of figure in python? <p>I am using figure module in a python project. In this project there are more than one figure plots. I want to get zoom ratio and zoom position of user and implement them in to other figures. In other words I want all figures have same zoom conditions. </p>
<p>Edi... | <p>xlim and ylim are properties of <code>Axes</code> not <code>Figure</code>. You can get it by:</p>
<pre><code>ax.get_xlim()
ax.get_ylim()
</code></pre>
<p>to monitor changes:</p>
<pre><code>ax.callbacks.connect("xlim_changed", func)
ax.callbacks.connect("ylim_changed", func)
</code></pre>
<p>where <code>func()</c... |
Image is not loaded using Glide <p>I have a vector image. If I want to set the image to ImageView, the picture is not loaded.</p>
<p>code:</p>
<pre><code>Glide.with(this).load(R.drawable.vector_image).into(imageView)
</code></pre>
<p>However, when I use: </p>
<pre><code>imageView.setImageDrawable(ContextCompat.getD... | <p>Glide doesn't support vector drawables yet. So implementing vector drawables you have to do yourself.
For reference you can check below links for this issue reported by developers on github:</p>
<p><a href="https://github.com/bumptech/glide/issues/1419" rel="nofollow">link 1</a><br>
<a href="https://github.com/bump... |
Remove comma separator <p>In my Crystal Reports Viewer control, the report groupes by a field (i.e. <code>project id = 100061</code>). However it displays in the group tree view with comma separator like <code>100,061</code>. How can I remove this?</p>
| <p>Right Click on the Field, choose <em>Format Field</em>.</p>
<p>In the <em>Number</em> Tab, click <em>Customize</em> button, then un-check the <strong>Thousand Separator</strong> checkbox in the <em>Number</em> Tab.</p>
|
Changing the default color of TabItems (MahAppsMetro) <p>I am using <code>MahAppsMetro</code> and have a <code>TabControl</code> - actually the inactive Tabs should have a Gray Foreground and become Black on MouseOver. Somehow they are Black the whole time..
This is how I use the TabControl:</p>
<pre><code><Control... | <p>Try to define a style for <code>TabItem</code> with custom trigger.
Add the following markup in your Grid:</p>
<pre><code><Grid.Resources>
<Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}">
<Style.Triggers>
<EventTrigger RoutedE... |
Writing a list into the file by using Python <p>I am trying to write a list into the file. I used:</p>
<pre><code>studentFile = open("students1.txt", "w")
for ele in studentList:
studentFile.write(str(ele) + "\n")
studentFile.close()
</code></pre>
<p>As a result, the output was:</p>
<pre><code>['11609036', 'MIT'... | <p>Use <code>.join</code> to convert each <em>sublist</em> into a string: </p>
<pre><code>studentFile.write(' '.join(ele) + "\n")
</code></pre>
<p>You may find the <a href="https://docs.python.org/3/whatsnew/2.6.html#pep-343-the-with-statement" rel="nofollow"><code>with</code></a> statement which creates a <em>cont... |
How can I make phpunit do code-coverage on an external repository? <h2>Question</h2>
<p>I want to have <code>PhpUnit</code> tests in one <code>git</code> repository and the code being tested in another one. <strong>Q: May I do code-coverage?</strong></p>
<p>In principle, this may sound weird to you. To prevent answer... | <p>Whitelist the directory you want coverage on.</p>
<pre><code>fizz/
âââ composer.json
âââ phpunit.xml.dist
âââ src
â  âââ Fizz.php
âââ test
âââ FizzTest.php
buzz/
âââ composer.json
âââ phpunit.xml.dist
âââ src
â  âââ Buzz.php
âââ test
... |
Reading stored data in offline mode <p>In the last 2 days,I had a small problem. Let me explain the situation first. I get some data from my server(as JSON objects of course),store them in the database and display them in a recycler view. </p>
<p>Now I want to try something interesting. The data should be displayed wh... | <ol>
<li>One issue is , titleForSQLite,imageForSQLite,articleForSQLite values are populated with only the last values in the data stream since they are inside a for loop. </li>
<li>Check whether your dba object is ready to read and write to database.</li>
</ol>
|
JavaScript - Weird usage of Date.getDate() for to get the days-count of a month. How does that work? <p>I've seen that code-technique, trick, hack (how you wanna call it) on CodeReview: <a href="http://codereview.stackexchange.com/questions/142706/take-a-specified-weekday-and-check-if-it-falls-on-the-remaining-days-of-... | <p>This is simply a property of the <code>Date</code> class, as documented on MDN:</p>
<blockquote>
<p>Where Date is called as a constructor with more than one argument, if values are greater than their logical range (e.g. 13 is provided as the month value or 70 for the minute value), the adjacent value will be adju... |
Pandas dataframe comparison hangs without error message <p>This is my first pandas attempt, so I was wondering what is the problem. I am trying to compare two dataframe of about 30.000 rows each. My first intuition led me to iterate both dataframes, so for every entry in the df1, we iterate all the rows in the df2 to s... | <p>You can use <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.merge.html" rel="nofollow"><code>merge</code></a> with parameter <code>indicator=True</code> and then filter by <a href="http://pandas.pydata.org/pandas-docs/stable/indexing.html#boolean-indexing" rel="nofollow"><code>boolean indexing<... |
call a link with an Android app <p>I want to call a link using a button for switching on and off a led </p>
<p>turns my led on:</p>
<p><a href="http://10.0.0.3/light4on" rel="nofollow">http://10.0.0.3/light4on</a></p>
<p>turns my led off:</p>
<p><a href="http://10.0.0.3/light4off" rel="nofollow">http://10.0.0.3/lig... | <p>You can call any api which you are calling as url in your android application using <a href="http://developer.android.com/reference/java/net/HttpURLConnection.html" rel="nofollow">HttpUrlConnection</a> or <a href="http://square.github.io/okhttp/" rel="nofollow">OkHttp</a> </p>
<p>First of all, request a permission ... |
How to obtain user browser details, IP address and location information? <p>I need assistance in getting the users browser information, IP address and GEO location. We are developing asp.net application which we need the above information to track the user information from where he/she is accessing the application with... | <p>Try below javascript function, This will return Browser Name and Browser Version.</p>
<pre><code>function get_browser()
{
var ua = navigator.userAgent, tem,
M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) ||[];
if (/trident/i.test(M[1]))
{
tem = /\brv[ :]+(\d+)/g.... |
STDERR.reopen() thows an error in Ruby <p>I'm trying to write to the standard error file for my test case:</p>
<pre><code>STDERR.reopen("err","w")
</code></pre>
<p>but it fails giving the following error:</p>
<blockquote>
<p>Errno::EACCES: Permission denied @ rb_io_reopen - err</p>
</blockquote>
<p>I can't seem t... | <p>This error occurs if you don't have write access to the current directory (or to the file "err" if it already exists).</p>
<p>Depending on your requirements, you might want to use a file in the temp directory instead:</p>
<pre><code>STDERR.reopen("/tmp/err","w")
</code></pre>
|
GIT based asp.net web app fails to deploy to Azure with typescript compile error <p>I have this asp.net (4.6.2) web application which compiles and runs fine on my local machine.</p>
<p>The project is in a Git repo in VSTS.</p>
<p>I want this site deployed to Azure web sites. So I make a Webapp and set the deployment ... | <p>So the problem is that the Azure build machine is not equipped with typescript 2.0 (yet) and knockout.d.ts uses a 2.0 syntax for something. See the comments below the question.</p>
<p><a href="http://github.com/projectkudu/kudu/issues/2163" rel="nofollow">GitHub issue here</a></p>
|
reload/reset route file in laravel <p>This is a rare question. Could be there is thousand better ways to solve the next problem but I didn't discover how to do it better.</p>
<p>I have a site in N languages (en, fr, es). In each request I set the locale. In the routing file I have something like</p>
<pre><code>Route:... | <p>This is a delicate question, and I may be wrong, but this Laracast may be able to help:</p>
<p><a href="https://laracasts.com/discuss/channels/requests/multi-language-routes-and-url" rel="nofollow">https://laracasts.com/discuss/channels/requests/multi-language-routes-and-url</a></p>
|
Pass dynamic arguments to an object-> on sql fetch using PHP <p>I want to make a dynamic list of arguments for my sql fetch, since the sql might vary a lot.</p>
<p>The list represent the database col names:</p>
<pre><code>$args = array(
'id',
'colname',
'colname2',
'colname3',
'colname4'
);
</... | <p>Why are you fetching an object when you want an array? </p>
<p>This seems needlessly complicated; if you fetch the right columns you have everything you need in one statement.</p>
<p>Something like:</p>
<pre><code>$fetch = $db->connect->query('select `' . implode('`, `', $args) . '` from tablename');
$resul... |
how to get the value of an input field by simple_html_dom <p>I want to get the value of a input field. For eg. i have this input field in my HTML. Now i have used this for getting the HTML DOM. </p>
<p>simple_html_dom.php</p>
<p>After that i tried like this. But cant get the value. </p>
<pre><code> include_once('si... | <p>Have you tried using <a href="http://php.net/manual/domelement.getattribute.php" rel="nofollow">DOMElement::getAttribute</a>?</p>
<pre><code>$token = $doc->getElementById("hash_9e879c117c")->getAttribute("value")
</code></pre>
|
Entity Framework query missing a filtered index on SQL Server 2012 <p>I have this EF query: (only kept the essential part)</p>
<pre><code>int maxRetryCount = 5;
var erroredArchiveFilesQuery =
transitionLogSessionContext.Set<ArchivedFile>().Where(f =>
f.RetryCount < maxRetryCount
).Take(maxBatchSize);
... | <p>You need to ensure that SQL Server recompiles the plan each time based upon the actual value of the parameter <code>maxRetryCount</code>. This is not easy in EF but can be done using a custom database interceptor to add <code>option (recompile)</code> hint to your query.</p>
<p>See details here <a href="https://www... |
Public network in vagrant <p>I Need to setup 2 vagrant machine with public network,so follow this link to <a href="https://www.vagrantup.com/docs/networking/public_network.html" rel="nofollow">https://www.vagrantup.com/docs/networking/public_network.html</a> edit the Vagrantfile.</p>
<p>But only one machine only have ... | <p>Your <code>Vagrantfile</code> seems good to me. It may be your <code>Machine2</code> IP <code>192.168.1.20</code> is assigned to other system. if assigned to other system then DHCP will not assign this IP to your machine.
if you are sure these IPs not assigned to other system then make it <code>static</code> otherw... |
Java Authentication and Authorization <p>Can anyone comment on this scenario belong to authentication or authorization</p>
<p>Authentication : User is logging with username & password - called authentication.</p>
<p>Authorization : User has some role - called authorization.</p>
<p>If I have only username and use... | <p>Authentication is the check if someone is the person he/she says he/she is (e.g. by asking for a <em>password</em>).
Authorization is the check if someone has the right to do something.</p>
<p>So in your case that database isn't able to check authentication. If the information about what the user is allowed to do c... |
How to play a sound when my index.html changes <p>I upload every 1 minute my index.html to an ftp. Sometimes the index stays the same, sometimes it is changes a little. I am looking for a way to play a sound when my index.html changes.
I refresh the page automatically every 20 seconds . I want to play a sound if it h... | <p>Without considering all possible edge cases, this is actually fairly straight forward. You just need to make use of <code>localStorage</code>.</p>
<p>The idea being, that on document load, you compute the current size of the document and then compare this to a value you've stashed in <code>localStorage</code>.</p>
... |
Conversion failed when converting the varchar value '29/09/2016' to data type int <p>I'm getting error when using Stored procedure.
Below is code of stored procedure:</p>
<pre><code> ALTER PROCEDURE [dbo].[usp_specificorderchangedhistory]
-- Add the parameters for the stored procedure here
@st... | <p>Add more quotes and use SELECT:</p>
<pre><code>ALTER PROCEDURE [dbo].[usp_specificorderchangedhistory]
@OrderDate datetime= null
AS
BEGIN
declare @cond varchar(max)
if @OrderDate is not null
set @cond = ' and convert(varchar,so.OrderDate,101) ='''+convert(varchar,@OrderDate,101)+''''
S... |
Should I use POST or PUT for API call that can create or update <p>I wonder if I should use POST or PUT for my API call.</p>
<p>The backend will either create or update an existing row in my DB. I know that I use POST for creating and PUT for updating, but what should I use when I dont know which one will get toggeled... | <p>I don't think that the create/update distinction is the best way to decide between PUT and POST. This is backed up by the <a href="http://restcookbook.com/HTTP%20Methods/put-vs-post/" rel="nofollow">rest cook book</a>:</p>
<blockquote>
<p>The HTTP methods POST and PUT aren't the HTTP equivalent of the CRUD's crea... |
Wordpress: get_terms() not returning anything even if terms have objects <p>Normal behaviour of get_terms is not to return terms if there are no posts assigned to. But this is not the case, I can see terms assigned in admin and also checked the database and all seems fine. Also check this code:</p>
<pre><code>$p = get... | <p>Found the problem: the count field of the term_taxonomy table was empty, and this is because I bulk-saved my posts using <code>wp_insert_post()</code> during a custom import.</p>
<p><code>wp_insert_post()</code> seems to have a bug: it correctly applies specified terms to the new post but doesn't update the term_ta... |
Scroll grid to reveal columns <p>I need to check in my test if grid contains all necessary columns, but protractor cannot find columns that aren't visible so I need to check a few columns, then scroll and check the rest of columns. Is there any way I can scroll grid? Is this even a good approach? </p>
| <p>If the columns are not visible at the moment, but are present in the DOM, you can <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView" rel="nofollow">scroll into view</a> of the last column to scroll the grid. Something along these lines:</p>
<pre><code>var columns = element.all(by.repe... |
How to unsubscribe from my nifty TimerObservable in rxjs <p>I keep getting the error that unsubscribe is not a function. I'm using rxjs@5.0.0-beta.12.</p>
<p>These are my import statements:</p>
<pre><code>import { TimerObservable } from 'rxjs/observable/TimerObservable';
import 'rxjs/add/operator/take';
</code></pre>... | <p>Callers of <code>subscribe</code> receive a <a href="http://reactivex.io/rxjs/manual/overview.html#subscription" rel="nofollow">subscription</a>:</p>
<pre><code>startCountdownTimer(): void {
this.subscription = this.countdown.subscribe(
i => this.timeRemaining = (5 - i).toString(),
null,
... |
Getting a tuple in a Dafaframe into multiple rows <p>I have a Dataframe, which has two columns (Customer, Transactions).
The Transactions column is a tuple of all the transaction id's of that customer.</p>
<pre><code>Customer Transactions
1 (a,b,c)
2 (d,e)
</code></pre>
<p>I want to convert this into a... | <p>You can use <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html" rel="nofollow"><code>DataFrame</code></a> constructor:</p>
<pre><code>df = pd.DataFrame({'Customer':[1,2],
'Transactions':[('a','b','c'),('d','e')]})
print (df)
Customer Transactions
0 1 ... |
Securing android app url's from invalid requests <p>I am trying to find ways to ensure anyone invoking the app's url's from anywhere else except the app is invalid and I am using okhttp3. In my header request I have a user-agent whose value is the app key-hash generated when needed and never logged using</p>
<pre><cod... | <p>Nothing you can implement would stop a power user from extracting the necessary values. It is just a matter of how long it takes (minutes, hours or days). </p>
<p>The presented solution is really simple. I assume using Xposed or an Man-in-the-middle proxy braking it is just a matter of minutes. </p>
<p>If you real... |
Check device Id and name in sqlite database <p>I have an activity to check if the device id and the device name exist in the local database (sqlite) and when the device is already registered then I will pass to another Activity called ConnectToCostCenter
<strong>The code of an activity is:</strong></p>
<pre><code>pub... | <p>i think you getting little confusion to matching the condition, do some another way like you will iterate the array list and make condition inside the loop whether you can get true or false and make redirect the activity where you want. </p>
|
Is it possible to use a proxy server in redis-cli? <p>From time to time I have to use a proxy server to get access to every web page. Is their a way to tell the redis client (<code>redis-cli</code>) to not use the normal connection but to use a proxy?
Or are there any other clients, which allow a proxy?</p>
| <p>You can create a SSH tunnel between your machine and the one hosting the Redis server:</p>
<p><code>
ssh -L 6379:localhost:6379 user@remotehostname
</code></p>
<p>(6379 is the default port for Redis)</p>
<p>You can also use <a href="https://redisdesktop.com/" rel="nofollow">Redis Desktop Manager</a> or <a href="h... |
Selenium Python how would verify a html table contains no data, the table is empty <p>I have a HTML table on a webpage and the table is empty. It contains no data as the data has been deleted by a previous test.
For this test I would like to check, verify the html table is empty, it contains no data.
What is the best ... | <p>Assuming that the only visible text in the <code><table></code> when it is empty is <em>"No data to display."</em>, then you can simplify the XPath as follow (formatted for readability) :</p>
<pre><code>//table[
@id="data_configuration_edit_data_object_tab_address_rules_tb_level_rules_locality"
a... |
How to capture varargs <p>I have static method, and i want to capture <strong>varargs</strong></p>
<pre><code>Executor ex = new Executor();
ex.execute(String nodeName, boolean status, Property ... properties);
ArgumentCaptor<Property> propertyCaptor = ArgumentCaptor.forClass(Property.class);
verify(ex).execute(... | <p>I'm not sure what exactly you are trying to test, but the following works: </p>
<pre><code>class SpecialExecutor implements Executor {
@Override
public void execute(Runnable command) {
}
public void execute(String nodeName, boolean status, Property... properties) {
}
... |
R - Disaggregate coverage area data based on a ranking preference <p>I have 4G mobile coverage at the Local Authority level in the UK, as a percentage of geographical area covered (for approximately 200 areas). I want to disaggregate this data so I can work with roughly 9000 lower-level postcode sector. </p>
<p>The mo... | <p>this is how I interpret this question. Correct me if this is not what you meant.
Suppose you have the following data.</p>
<pre><code>dat <- data.frame(
Name = "A", pcd.sector = 1:5,
area = c(2, 3, 1, 5, 3),
areaSum = 14, LA.4G = 8
)
dat
# Name pcd.sector area areaSum LA.4G
#1 A 1 2 ... |
Function that extracts words from text ( array of chars ) and put them in 2 dimensions array <p>I'm learning C and have some struggles.I have to make a program , which becomes a text (max 80 chars) and put the words from text in a char words[80][80] (every word must be only single time in this array! it is also define... | <pre><code> while( p != NULL ){
strcpy(token[i],p);
printf("%s\n",*(token+i));
i++;
p = strtok(NULL , " "); --> here you are just splitting the words
}
</code></pre>
<p>Now token will contain all the words in splitted manner, not as per your requirement of "each word only once". You can compare ... |
Using checkbox to decide which input boxes value to sum <p>I am trying to write some Javascript/jQuery to sum the value entered in multiple text boxes.</p>
<p>Each input box has a checkbox associated with it, and based on that checkbox the value will be added to the total. For example, if the user selects <code>Activi... | <pre><code><input type="checkbox" id="afees" class="sum-checkbox" />
<input type="number" id="optional" name="afees">
</code></pre>
<p>assign <code>input#number</code> <code>name</code> as id of corrsponding checkbox.
add one common class <code>(e.g. sum-checkbox)</code> for required checkbox.</p>
<pre><c... |
angular directive map object that has function inside <p>I try to create a directive that has an argument which is an object.
This object has a property <code>map</code> that can be a function.</p>
<p>Every time I run it I get this error </p>
<blockquote>
<p><a href="https://docs.angularjs.org/error/" rel="nofollow... | <blockquote>
<p>No Function Declarations: You cannot declare functions in an Angular expression, even inside ng-init directive.<br>
<a href="https://docs.angularjs.org/guide/expression" rel="nofollow">Angular Expressions</a></p>
</blockquote>
<p>It looks like that rule also applies to object properties</p>
<p><di... |
error in Tslint upgrading <p>Hi I am unable to get through this error please help me with this error and I have tried sudo apt-get install nodejs legacy and etc but was not able to find the solution</p>
<pre><code> TS build-rt
/home/gautam/sd.js-master/node_modules/tslint/lib/ruleLoader.js:29
... | <p>The no-trailing-comma rule was removed, it has been replaced by the trailing-comma rule (#687)</p>
<p>EDIT:
In your /tslint.json file remove the use of "no-trailing-comma". It can be replaced with the new "trailing-comma" rule which you can find more about here: <a href="https://palantir.github.io/tslint/rules/trai... |
Wrap div around a hidden div <p>I have a parent div "d1" and it contains a child div "d2". d2's visibility changes every time a particular button is clicked. What I need is to wrap d1 around its other contents when d2 is hidden and expand when d2 is visible.
Its something like this:</p>
<pre><code><div id="d1">
... | <p>Use <code>display:none</code> and <code>display: block</code> instead of using <code>visibility: hidden</code> and <code>visibility: visible</code></p>
<p>as <code>display:none</code> will hide the element completely and its space.</p>
|
How to make DataTable draw new results? <p>I have a problem with drawing new data into my table using <code>DataTable</code> plugin. I have table that show recepients of notification called <code>#recipientsTable</code> that is stored inside one modal. Now, whenever modal is opened it should show different recipients w... | <p>I am sure that you've tried many ways.</p>
<p>I can suggest a way, that I've done recently successfully.</p>
<pre><code>//Check table is ready
$('#recipientsTable').ready(function () {
//Check data-table is already exists
if(table)
{
//If already exists then
//1.clear the datatable by usi... |
How to get total error count from Klocwork automatically <p>I have a project running in Klocwork and after the build gets completed the Klocwork results will be generated. Every time I need to go to the Klocwork portal to get the results and look for the new issues or the total issues. Instead I need an API or script t... | <p>I answered a <a href="http://stackoverflow.com/a/28774031/1100827">similar question over here</a>. Below is an updated answer with links to the documentation for the most recent release, Klocwork 11.</p>
<p>Klocwork has a <a href="https://support.roguewave.com/documentation/klocwork/en/11-x/klocworkinsightwebapicoo... |
Need to replace ' with ' <p>Hi i am using below code to replace the single quote with the <code>&apos;</code> but it's not working could you please help me out on this?</p>
<pre><code>String name = "Hello's";
name.replaceAll("/'/g", "&apos;");
System.out.println(name);
</code></pre>
| <p>You have to assign your variable with your new value.</p>
<pre><code>String name = "Hello's";
name = name.replaceAll("'", "&apos;");
System.out.println(name);
</code></pre>
<p>Hope it helps.</p>
|
SQL loop over columns and excute REPLACE statement <p>I am trying to replace a CRLF character in a table in SQL Server. The statement for one column works and goes like this:</p>
<pre><code>select REPLACE(REPLACE(col_name,char(13),''), char(10), '') from table_name
</code></pre>
<p>Now I would like to repeat this for... | <p>Two things; <strike> as noted by the other answer </strike> there needs to be a comma after the initial <code>[c.name]</code>. Also, to get a single quote inside the string, you need two single quotes. Hence, to get two single quotes together, you need four single quotes.</p>
<pre><code>select @sql = @sql + 'select... |
View change from api19 to api23 <p><a href="http://i.stack.imgur.com/eFXRV.png" rel="nofollow">API 19 screen</a></p>
<p><a href="http://i.stack.imgur.com/SgpiV.png" rel="nofollow">API 23 screen</a></p>
<p>In API 19 buttons cover the whole screen while API 23 doesn't cover.How to make API 23 buttons cover whole screen... | <p>You will need to use <code>dimens</code> file for supporting multiple screens. You can view official documentation for supporting multiple dimens here <a href="https://developer.android.com/guide/practices/screens_support.html" rel="nofollow">https://developer.android.com/guide/practices/screens_support.html</a></p>... |
Error whilst attempting to generate Objects - Constructor classes <p>I am having issues with compiling my code.</p>
<p>The issues appears to be when I try to generate objects from the Customer class in my main Class. The line of code in the main class CareHire is:</p>
<pre><code>newCust[i]=new Customer();
</code></pr... | <p>This syntax is wrong <code>s[i]=String new custName ();</code> </p>
<p>it should be <code>s[i] = new Customer();</code></p>
<p>"s" is declared as an array of customers <code>private Customer s[]=new Customer[20]</code> </p>
<p>I assume Cusotmer has a Constructor or some methods to add the Name and Days of hire da... |
how to create basic email support system using java <p>we have developed one web application for our client and now he wants email support system for his application.by which there customer will send request mail and client support team will respond him on his mail.for now client don't want to buy any existing support ... | <p>Here is a demo class for sending email using a Gmail address-</p>
<pre><code>import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
imp... |
Combining multiple files in a single tar file <p>I have 2 flat text files and want to combine them into a single tar file.
I'm trying to do it using the below command but getting extra lines in the merged file. (Attaching screenshot also)</p>
<pre><code>tar -cvf merge.tar file1 file2
</code></pre>
<p><a href="http://... | <p>The best way to make a <em>tar</em> archive is using the <em>tar</em> tool program, as you did.</p>
<p>However, if you need just to <em>concatenate</em> two files, then just use <em>cat</em>:</p>
<pre><code>cat file1 file2 > file12
</code></pre>
|
OutofBoundException when sending an array to a method <p>public class I5Exc1a {</p>
<pre><code>public static int[] reverse(int[] array)
{
int[] local = array;
int i = local.length;
int j = 0;
int[] arrayR = new int[i];
for (;i>-1; i--)
{
arrayR[j] = array[i];
j++;
}
... | <p>You are starting from <code>i = local.length</code> and that's already out of bounds.</p>
<p>Look at this array:</p>
<p><code>[0, 1, 2]</code> - 3 items so <code>length = 3</code>, but if you do <code>array[3]</code> there is no such element, element <code>2</code> is at index number <code>2</code>, starting from ... |
Know if a class was added (was added with javascript) <p>I am programming a web and i need to know when a Class was added.
I am using a JavaScript plugin and the plugin add a CSS Class in then deletes it and add it in other div (gallery). I need to know in every moment in which 'div' is this class. </p>
<p>Here you h... | <p>Hi :) thanks four your Ideas. </p>
<p>As @T.J. Crowder writed Mutation Observer is a very good option for this question. </p>
<p>Hier a link with the Answer:
<a href="http://stackoverflow.com/questions/17172470/how-to-detect-class-changing-by-domattrmodified">How to detect class changing by DOMAttrModified</a></p>... |
Android Here SDK OnPositionChangedListener not called in latest version of SDK <p>I've been using HERE Android SDK for some time now.
Today, I updated to the latest version of the SDK(3.2.1) and the OnPositionChangedListener is no longer triggered.</p>
<p>Everything else seems to work( map loading, place search, route... | <p>You have to call start method after adding listener.</p>
<pre><code> posManager.addListener(new WeakReference<PositioningManager.OnPositionChangedListener>(positionListener));
posManager.start(PositioningManager.LocationMethod.GPS_NETWORK);
</code></pre>
|
Want to show Filter Data in DevExpress GridControl when I repoen the page <p>I have <code>DevExpress GridControl</code> in my MVC application along with simple search box to search and filter the values on all GridControl's string columns.</p>
<p>Here, I need to show the filtered text (search text) and filtered values... | <p>@subash </p>
<p>Please try this </p>
<p>you can enable the following <code>properties</code>, you can solve the problem</p>
<pre><code>gridName.SettingsCookies.Enabled = true;
gridName.SettingsCookies.CookiesID = "YourCoookiesName";
gridName.SettingsCookies.StoreColumnsVisiblePosition = true;
gridName.SettingsCoo... |
FoxPro My using .prg(coding) move fields <p>I would like toalter the table to move fields from one place to another.</p>
<pre><code>ABS1
ABS2
ABS4
ABS8
ABS3
</code></pre>
<p>So I would like to move ABS3 after ABS2, but not move the physicly.
Would like the code do it for me.</p>
| <p>Assuming that table is named "mytable.dbf" and you have exclusive access:</p>
<pre><code>select * from mytable into table tmp
use in ('myTable')
erase ('myTable.dbf')
* erase ('myTable.fpt')
* erase ('myTable.cdx')
select ABS1, ABS2, ABS3, ABS4, ABS8 from tmp into table myTable
</code></pre>
<p>and then recr... |
how to check if object is an array of objects <p>I have a object like below which is an array of objects.</p>
<p>In swift language, How can i check whether object is an array of objects ?</p>
<pre><code> DefinitionList = (
{
accountNum = {
isEditable =... | <p>You can use "is" operator in Swift language.</p>
<pre><code>if objects is [AnyObject] {
print("right, its array of objects!")
} else {
print("no, its not an array of objects!")
}
</code></pre>
<p>Hope this will help you</p>
|
XWiki: StackOverflowError while importing XAR <p>I updated my xwiki to Version 8.2.1. After that I get an StackOverflowError everytime I try to upload a XAR. Does anyone have any idea where this comes from?</p>
<pre><code> 14:39:05.955 [https://localhost/ xwiki /bin/get/XWiki/XWikiPreferences?xpage=packagedescripto... | <p>This error seems to suggest that you have a version of Jackson older than the one which is supposed to be provided in XWiki WAR. One that does not support @Transient which is used to skip serialization of EntityReference#getReversedReferenceChain().</p>
<p>Maybe your application server bring an older version of Jac... |
nav bar and search box inline <p>how can I create horizontal navbar and search box together in one line in the center of the page?
I use text-align center to put the nav bar at the center of the page, but when I use float to make the search box place beside nav , the whole nav float to left.</p>
<p><div class="snippet... | <p>This should work for you, note the use of inline-block for the display property of your list item and your form. Also placed the text-align center on your outer div. Will now render the nav items with search in the center of the screen.</p>
<p>Also removed the inherit padding on the left side of an unordered list (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.