_id stringlengths 2 6 | text stringlengths 4 46k | title stringclasses 1
value |
|---|---|---|
d11701 | Because remove is a method that changes the mutable list object it's called on, and returns None.
l= MyWords.upper().split()
l.remove(SpamWords[SpamCheckRange])
# l is ['YES']
Perhaps you want:
>>> [word for word in MyWords.split() if word.upper() not in SpamWords]
['yes']
A: remove is a method of list (str.split re... | |
d11702 | I found a good example which works well with twitter4j 3.0.3 on android. Others do not work.
http://hintdesk.com/how-to-tweet-in-twitter-within-android-client/
A: This is the working example from my code , i am using twitter4j and also you don't need to set any intent in manifest since i use webview instead of browser... | |
d11703 | The error you were seeing is because you had accidentally included an extra ? inside of your @() block, and it should have been a :
Overall, it was close you just need to make sure that you break out of the string concatenation and get back to the razor (server) scope for the rowId.
<img src='../../Images/Edit.png' al... | |
d11704 | bar = 5 is not an expression. The multiple assignment is a separate statement from the assignment statement; the expression is everything to the right of the right-most =.
A good way to think about it is that the right-most = is the major separator; everything to the right of it happens from left to right, and everyth... | |
d11705 | In a class definition, Python transforms __x into _classname__x. This is called name mangling. Its purpose is to support class local references so that subclasses don't unintentionally break the internal logic of the parent class.
A: Cause
This is due to Python's name mangling of class attribute names that start wit... | |
d11706 | Generally speaking you can't add something to an existing type. (you can however create a subtype at runtime and add things to that)
In your case though I suggest just using a regular variable that you capture when you create the shim, you can then return that variable as part of your shim and read it later at your des... | |
d11707 | Multiple formulas can be assigned at the same time, and the relative (without $) row/column references will be auto adjusted :
Sub CalcualteSFA()
Dim r As Range
Set r = [H87:S92]
r.Formula = "=Sumproduct([KNA_Amt]*--([KNA_Dt]=h$25)*--([KNA_Cat]=$b47)*--([KNA_Prgm]=$D$8))"
r.Value = r.Value ' optiona... | |
d11708 | I dont think you can get other user's follower list/following list anymore. You can only get the list for the logged in user.
Here is documentation: https://www.instagram.com/developer/endpoints/relationships/
https://api.instagram.com/v1/users/self/followed-by?access_token=ACCESS-TOKEN
you can only get list for self,... | |
d11709 | Here the basic route descriptions
you can know more from
https://laravel.com/docs/5.7/routing
┌────────┬─────────┬──────────────────────────────────┬────────────────────────┐
│ HTTP │ CRUD │ ENTIRE COLLECTION (e.g /USERS) │ SPECIFIC ITEM │
│ METHOD │ │ │ (e.g... | |
d11710 | The setTimeout method of javascript can be used to run code you specify after a set delay in miliseconds.
Try this:
var timeout;
$("#date_1").hover(
function () {
$(this).addClass("door");
timeout = setTimeout(function() { $(this).addClass("doorstatic"); }, 2000);
}, function () {
clearT... | |
d11711 | Try this :
df['Book'] = df['Exposure'].replace(0, 100) | |
d11712 | Updated to return current year plus previous 5 years. Should be very fast as this is a small recordset.
SELECT YEAR(GETDATE()) as YearNum
UNION
SELECT YEAR(GETDATE()) - 1 as YearNum
UNION
SELECT YEAR(GETDATE()) - 2 as YearNum
UNION
SELECT YEAR(GETDATE()) - 3 as YearNum
UNION
SELECT YEAR(GETDATE()) - 4 as YearNum
UNION
... | |
d11713 | /// <summary>
/// Static method to detemine the WPF end point of the arc.
/// </summary>
/// <param name="arc">The DXF ArcEntity object to evaluate</param>
/// <returns>Point with values of the arc end point.</returns>
public static Point calcEndPoint(Arc arc)
{
double x = (Math.Cos(... | |
d11714 | I was able to achieve that with IIS successfully! I know the post is old but hopefully, it will save time for solution seekers :)
First (just a reminder) ensure that you have .NET Core Hosting Bundle installed on IIS machine (link could be found here). Bear in mind that it will require at least WinSrvr2012R2 to run.
No... | |
d11715 | Try this.
RewriteEngine on
RewriteRule "/foo/bar$" "/some/folder/file.xml" [PT]
you can even specify mime-type.
RewriteRule "/foo/bar$" "/some/folder/file.xml" [PT,H=application/xml]
You need internal remapping. | |
d11716 | Compiling for another architecture is called cross compiling, but of course you would have read that on the Busybox FAQ. Not to mention the link provided there to cross-compilers for all architectures you could ask for.
You could try find a pre-built MIPS binary, the best would be to ask the Busybox list directly if in... | |
d11717 | According to the HashMultiMap Javadoc, you chose the right MultiMap for that purpose:
The multimap does not store duplicate key-value pairs. Adding a new key-value pair equal to an existing key-value pair has no effect.
Now, you only have to make sure that equals() (and hashCode()) is implemented correctly on your v... | |
d11718 | Using nltk.tag.stanford.POSTagger.tag_sents() for tagging multiple sentences.
The tag_sents has replaced the old batch_tag function, see https://github.com/nltk/nltk/blob/develop/nltk/tag/stanford.py#L61
DEPRECATED:
Tag the sentences using batch_tag instead of tag, see http://www.nltk.org/_modules/nltk/tag/stanford.ht... | |
d11719 | Swift 3:
// in case, that you have defined `attributedText` of label
var attributes = attributedText.attributes(at: 0, longestEffectiveRange: nil, in: NSMakeRange(0, attributedText.length))
...
A: Swift 4:
If you want to get the attributes for NSTextAttachment (just change the attribute value if you want font)
commen... | |
d11720 | Filebeat is trying to resolve "logstash", but you don't have a service with that name. You have "logstash-logstash". Try to change filebeat config (line 49 and 116 in filebeat values.yaml) or change the name of your logstash service accordingly. | |
d11721 | The left side of the bar is connected to the xAxis, which makes the left border less visible. There are some possible solutions to this issue.
*
*You can set the minimum value of the xAxis to -0.1 and set startOnTick property to false. Then the left border is visible (it's not directly connected to the axis).
Demo:
h... | |
d11722 | You're getting inexact results because you're rounding down to two decimal places after every calculation. Your calculator isn't doing that.
With no rounding.
>>> (Decimal(40) - Decimal(56.5)) / Decimal(56.5)
Decimal('-0.2920353982300884955752212389')
With rounding:
>>> (Decimal(40) - Decimal(56.5)) / Decimal(56.5)
D... | |
d11723 | Try the following code:
elements = soup.findAll('img', attrs={'class':'profile_photo_img'})
for element in elements:
print element['data-src']
print element['alt']
Also make sure that the soup is right parsed from the html by printing it before you are searching for elements | |
d11724 | Use plt.bar
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0, 5, 0.1);
y = np.sin(x)
plt.bar(x, y, width=0.08,edgecolor='None',color='k',align='center')
plt.show() | |
d11725 | Isn't Firebase stores all its data in MongoDB?
Update May 2016
Apparently a page where Firebase was mentioned in MongoDB's site was removed (http://www.mongodb.org/about/production-deployments/)
After some search on their site I've found another page in their blog
https://www.mongodb.com/post/45270275688/mongodbs-growi... | |
d11726 | You can try something like
import random
p = 0.5
arr = np.array([0, 0, 1, 1, 2, 2])
# number of similar elements required
num_sim_element = round(len(arr)*p)
# creating indeices of similar element
hp = {}
for i,e in enumerate(arr):
if(e in hp):
hp[e].append(i)
else:
hp[e] = [i]
#print(hp)
o... | |
d11727 | Check this codesanbox I made: https://codesandbox.io/s/stack-71649799-v-chip-data-table-item-slow-z7p2db?file=/src/components/Example.vue
You can use the item slot of the data table. Some vuetify components comes with special sections for easier customization called slots, in this case the item slot of the data table l... | |
d11728 | Assuming that #search is probably a text input field, you can add the following code right before your ajax request:
// get the value that the user has typed
var v = $(this).val();
// don\'t go on if less than 3 chars or
// some other key was pressed that did not change the data
if (v.length < 3 || v == $(this).data('... | |
d11729 | strlen(key) is invalid in later code as earlier code was injecting null characters in key[] whenever an 'a' or 'A' was used:
if(islower(key[i])) {
key[i] = key[i] - 'a';
Find the string length of key[] before changing its contents and use that
int n = strlen(key);
...
// k = j % strlen(key);
k = j % n; | |
d11730 | Looks like the only two things you need from URL are action and controller and if the action is "index" you don't need it. In this case I believe that you are doing it right. This is a slightly modified piece of code I was using in ASP.NET MVC project:
string actionName = this.ControllerContext.RouteData.Values["action... | |
d11731 | We can use separate
library(dplyr)
library(tidyr)
df1 %>%
separate(products, into = paste0('product', 1:3),
sep=",\\s+", extra = "merge")
# id product1 product2 product3
#1 1001 milk cheese sugar
#2 1002 milk <NA> <NA>
#3 1003 cheese eggs <NA>
Or cSplit which would automa... | |
d11732 | You can set up a temporary DataFrame with custom columns to sort and use its index to reorder the original:
idx = (df
.assign(Length=-df['Length'].sub(10).abs(),
Name=pd.Categorical(df['Name'], categories=['Joe', 'Bob'], ordered=True)
)
.sort_values(by=['Length', 'Score', 'Name'], ascending=Fals... | |
d11733 | by default, a string field will have a standard tokenizer, that will emit a single token "FRUIT12" for the "FRUIT12" input.
You need to use a word_delimiter token filter in your field analyzer to allow the behavior your are expecting :
GET _analyze
{
"text": "FRUIT12",
"tokenizer": "standard"
}
gives
{
"tokens... | |
d11734 | This should work:
echo "PREPENDED STRING" | cat - /tmp/file | sed 's/test/test2/g' > /tmp/result
A: Or just use only sed
sed -e 's/test/test2/g
s/^/PREPEND STRING/' /tmp/file > /tmp/result
A: Or also:
{ echo "PREPENDED STRING" ; cat /tmp/file | sed 's/test/test2/g' } > /tmp/result
A: Try:
(printf "%s" "PREPEND... | |
d11735 | Servlet2 must be without any mapping in annotations or in web.xml.
Then you cannot use HttpServletRequest#getRequestDispatcher(String), which is a container managed method that checks those mappings.
That condition is ridiculous and makes no sense. If you aren't going to use the Servlet container, don't make a Servlet... | |
d11736 | try this
import android.os.Bundle;
import android.os.SystemClock;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.Chronometer;
public class MainActivity extends AppCompatActivity ... | |
d11737 | You are incorrectly handling the files and everything else when inserting them into the database. All files that are already there are damaged and probably destroyed.
addslashes() is no escaping function for a database. Always use the escaping function that comes with the DB extension you are using. If you are using my... | |
d11738 | ID should always be unique to each element, so I am using a class instead. Use of parents() will give you the the container to find() the hidden inputs in to retrieve the values.
$('.btnitemaddtotray').on('click',function() {
var btn = $(this),
row = btn.parents('td').first();
itemId = row.find('... | |
d11739 | I think it's you're just missing the className="loading" in <Loading />:
import { Loading, MyComponent } from "./index";
import ReactDOM from "react-dom";
describe("MyComponent", () => {
it("spying on ReactDOM", () => {
const spy = jest.spyOn(ReactDOM, "render");
MyComponent.show();
expect(spy).toHaveBe... | |
d11740 | If you are using two GPU's let's say Intel GPU and NVIDIA GPU, then please choose graphic driver to NVIDIA GPU by opening NVIDIA control Panel.
In case if you are using only one driver then please update NVIDIA GPU graphic driver. | |
d11741 | Systematically build it up as you describe
*
*get hits and last hit per UserID and ProductID
*select rows from this aggregated data frame that match max hits and max last_hit
import io
import pandas as pd
df = pd.read_csv(io.StringIO(''' ProductID UserID Activity OS date time
392281 Pr102405 U100040 PAGELOAD Window... | |
d11742 | As I Know, It should be 10 gigabytes for one single database not for all, and about your last question, It shouldn't be like this. the limit is 10 gigs for each database and I don't think there is any limit for servers.
and also this site might help you find out more about this. | |
d11743 | If all first names had the same length, then you would be able to use sortrows, but in your case, that would require padding and modifying your array, anyway, so that you're better off converting it into "LAST FIRST MIDDLE" before applying sort. Fortunately, there's a simple regular expression for that:
names = {'John ... | |
d11744 | Probably the best route is do a custom lookup and change the extended data type of the key field to reflect that. In this way the change is reflected in all places. See form FiscalCalendarYearLookup and EDT FiscalYearName as an example of that.
If you only need to change a single place, the easy option is to override p... | |
d11745 | I had the same problem and I solved it this way:
*
*First add gammu user to sudoers, with no password:
type: $ sudo visudo
and add: gammu ALL=(ALL) NOPASSWD: ALL
*Then run gammu-smsd as root user:
in /etc/init.d/gammu-smsd
change USER=gammu to USER=root
save it and don't forget to restart daemon: service gammu-s... | |
d11746 | With help from an expert the following works:
def user_addgroup_handler(sender, instance, created, *args, **kwargs):
# g = Group.objects.get(id, limit_choices_to=(Q(forum_id__in = CustomUser.business_location_county)))
# group = Group.objects.get(name=instance.business_location_county.name)
# for g in Cust... | |
d11747 | First you need to add attribute enctype="multipart/form-data" to your form tag like this:
<form class="form-horizontal hide form-data" role="form" enctype="multipart/form-data">
And formData can't be inspected in console window you should use this way
for (var pair of formData.entries()) {
console.log(pair[0]+ ', ... | |
d11748 | Using the DateTime object it can be easy and accurate
$dates = ['25/11/2021','24/11/2021','23/11/2021'];
foreach ( $dates as $date){
$df = (DateTime::CreateFromFormat('d/m/Y', $date))->format('l d F Y');
echo "<li class='header'><h1>{$df}</h1></li>" ."\n";
}
RESULTS
<li class='header'><h1>Thursday 25 November... | |
d11749 | Drawing the 'hash mark' is going to be the real problem. TreeView has a DrawMode property but its DrawItem event doesn't let you draw between the nodes.
You need to handle this by changing the cursor to indicate what is going to happen. Use the GiveFeedback event, set e.UseCustomCursors to false and assign Cursor.Cur... | |
d11750 | *
*You haven't closed the tag correctly for the "#addrow" button.
*You can extract the values from the modal like so (after you give the <select> elements a proper id:
var dayPickerSelect1 = $("#daypicker-select1").val();
var dayPickerSelect2 = $("#daypicker-select2").val();
*You can then pass the extracted values ... | |
d11751 | 1) You can use HTML5 & javaScript to take screenshots. This will work for sure. check more details
here
(function (exports) {
function urlsToAbsolute(nodeList) {
if (!nodeList.length) {
return [];
}
var attrName = 'href';
if (nodeList[0].__proto__ === HTMLImageElement.pr... | |
d11752 | Python as a built-in module called json, that provides a json.JSONDecoder and a json.JSONEncoder class, a JSON (JavaScript Object Notation) parser (json.loads) and few other functions.
If you have your data.json file, you can convert it to Python...
import json
with open("data.json", 'r+') as file:
my_data = json.... | |
d11753 | You need to update the form control value:
if (this.formIdFromParent) {
this.service.getFiles(this.formIdFromParent).subscribe(result => {
this.fileData = result;
this.formIdFromParent.controls['Notes'].setValue(this.fileData. GlobalNotes);
})
} | |
d11754 | AVI files are practically limited in size.
when you force it to use OPENCV_MJPEG, it will only use OpenCV's own writing methods, which can only do AVI and MJPEG.
if you need a different container, you have to use a different backend, such as FFMPEG. you can still have MJPG for a codec (fourcc). | |
d11755 | With the introduction of (i|android|windows)phones, things have changed, and to get a correct and complete solution that works on any device is really time-consuming.
You can have a peek at https://realfavicongenerator.net/favicon_compatibility or http://caniuse.com/#search=favicon to get an idea on the best way to get... | |
d11756 | Another way:
data='''a b
0 (45.349586099999996, -75.81031967988278)
1 (-37.77922725, 175.2010323246593)
2 (-42.9945669, 170.7100413)
3 (-39.2711067, 174.154795)
4 (51.2800275, 1.0802533)
5 (-41.30222105, 172.89453190955697)
6 ... | |
d11757 | SymPy has a lambdify module for these purposes:
from sympy.utilities.lambdify import lambdify
func = lambdify((x1, x2), r.diff(x1))
func(1, 2) # evaluate the function efficiently at (1, 2) | |
d11758 | You get the final URL you want to use for tracking purposes back with a Auth_OpenID_SuccessResponse object, in the claimed_id attribute. (The getDisplayIdentifier() method outputs a version more intended for human consumption, which may or may not be different.) | |
d11759 | Despite the fact that using a VARCHAR(255) as a foreign key is probably highly inefficient and/or will require huge indices, I guess that generally an option that defines the foreign key of the other table would come in handy here, similar to targetForeignKey for belongsToMany associations. You may to want to suggest t... | |
d11760 | Another form to do it is
recode age_n (0/65=0 "0") (66/150=1 "over 65")
So you have a dummy with your requirement (from 0 to 65, values change to 0, appearing a "0" in the table; from 66 to 150, values change to 1, appearing this time "over 65" in the table). If you want to maintain values of age_n,
gen age_n2=age_n
... | |
d11761 | That's the most important bit to solve this problem:
x = r * Math.cos(t) + offsetX;
y = r * Math.sin(t) + offsetY;
which is parametric form of circle equation... "r" is radius and "t" is 'progress' from 0 to 2π, (wiki)
You can easily do that in JavaScript using either "canvas" or SVG (check Raphael.js library)
A: Her... | |
d11762 | This is indeed possible, as I have just done it. You need to trap the 'moveend' and 'move' events from the map being panned or zoomed (moveend is triggered at the end of a zoom, but you could trap 'zoomend' as well to be on the safe side). If you trap these using the parent map as the context then you can get the new m... | |
d11763 | Libraries like commons-beanutils can help you if you want to compare bean properties (values returned by getters) instead of comparing field values.
However, if you want to stick with plain reflection, you should:
*
*Use Class.getDeclaredFields() instead of Class.getFields(), as the latter only returns the public fi... | |
d11764 | There is no now.Image in this code.
if (now.Image) {
return <img src={preview} />
}
return <Message text={now.text} key={key} />
});
there may be now.Text which represents now.Image and preview in your code
because you set it in this part of code
setMessageList([...initMessageList, {
t... | |
d11765 | If you want links from not nested articles, try:
articles = browser.find_elements_by_tag_name('article'):
for article in articles:
print(article.find_elements_by_xpath('./*[not(descendant-or-self::article)]/descendant-or-self::a'))
A: Parse the article element with BeautifulSoup and get all the anchor tags in eas... | |
d11766 | Changed Version from
"socket.io-client": "^4.5.1",
To
"socket.io-client": "^1.7.4",
And Changed
import {io} from "socket.io-client
To
import io from "socket.io-client | |
d11767 | jQuery Tools Scrollable is iPad/touch friendly.
As an example, checkout the custom scrollable slider on trekk.com (works on iPad) that I built with jQuery Tools.
A: I recently used a plugin called Flexslider (http://flex.madebymufffin.com/) that supports swiping between images on iOS. | |
d11768 | I figured using this:
Go search here: /var/www/html/
A: I solved this by using the Duplicator plugin for wordpress, instead of the All-in-One WP migration.
The Duplicator plugin will produce two files; an archive file and an installer file. This link here will tell you how to upload these:
https://snapcreek.com/duplic... | |
d11769 | For this i always use widget_tweaks
*
*Install it : pip install django-widget-tweaks .
*Add 'widget_tweaks' to INSTALLED_APPS in settings.py after django apps and just before your apps.
*Add {% load widget_tweaks %} to the top of the template you will customise.
Now to add a class for a field "name" of form1 d... | |
d11770 | According to @Ryan, your problem is that you are running it in Python 2 instead of Python 3. Running it in Python 3 should fix it. | |
d11771 | A f:selectItem that has noSelectOption set to true represents a "no selection" option, something like this:
-- Select a Colour -- < noSelectOption was intended for this case
Red
Green
Blue
Tomato
This item is rendered in the menu, unless hideNoSelectionOption is set to true in your menu component. In that case, the op... | |
d11772 | It is not because you saved it as jsp or html page. You need to add charset="UTF-8" to your script declaration as d3.js uses UTF characters.
eg.
<script src="http://d3js.org/d3.v3.js" charset="UTF-8"></script> | |
d11773 | updating the googlePlayService should solve the problem.
If its your emulator than you can try this way | |
d11774 | Not really an answer to your question as you are using MD5. However as this thread pops up when searching for the error, I am attaching this to it.
Similar errors happen when bcrypt is used to generate passwords for auth_basic:
htpasswd -B <file> <user> <pass>
Since bcrypt is not supported within auth_basic ATM, myste... | |
d11775 | You cannot use template variable inside static tag like this:
{% static 'clinic/img/{{ image }}' %}
Instead use with and add filter
{% with "clinic/img/"|add:image as image_url %}{% static image_url %}{% endwith %}
A: You cannot use a variable inside a {% static %} tag. What you can do is to use get-static-prefix and... | |
d11776 | When we deal with response from web server then we can't sure about objects and types. So it is better to check and use objects as per our need. See for your reference related to your question.
if let dictionnary : NSDictionary = responseObject as? NSDictionary {
if let newArr : NSArray = dictionnary.objectForKey... | |
d11777 | Your code seems ok, but dont forget you may need to add the access token to the batch request
like:
$params['access_token']=[USER_ACCESS_TOKEN];
$ret_val = $facebookObj->api('/?batch='.json_encode($queries[$a]), 'POST', $params);
And for testing you may want to create a new page with a couple of friends added and tes... | |
d11778 | Use this:
import scala.reflect.io.File
File(".").toAbsolute
A: I use new java.io.File(".").getAbsolutePath, but all the other answers work too. You don't really gain anything by using Scala-specific API here over regular Java APIs
A: import scala.sys.process._
val cwd = "pwd".!! //*nix OS
A: Use this
System.getPr... | |
d11779 | in many ways. For instance, write a method that will do the conversion for you:
private String convertChoice(String abbr)
{
if (abbr.equals("T")) return "Stone";
else if (abbr.equals("S")) return "Scissors";
else return "Paper";
}
then use convertChoice(iChoice) instead of iChoice when updating the value in y... | |
d11780 | The one and only time you use htmlentities for anything is if and when you're outputting data into HTML, right then and there. E.g.:
<p><?php echo htmlentities($data); ?></p>
In any other context HTML entities are generally useless* and will only garble/change/destroy your data. Indeed, using it on a password, probabl... | |
d11781 | The API documentation seems pretty definite, no qualifications or weasel-wording:
The subprocess is not killed when there are no more references to the Process object, but rather the subprocess continues executing asynchronously.
So the parent has to kill it, it won't go away when the parent terminates.
A: Not a gr... | |
d11782 | If lambda has got these IAM permissions it will show the custom loggers as well as default AWS invocation/error logs
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents" | |
d11783 | I am assuming that you want to obtain something like this:
where you input a location in the A9 cell and a Weight in the B9 cell and it automatically puts the correct rate in the C9 cell. This can be achieved with the following formula (in the C9 cell):
=ARRAYFORMULA(VLOOKUP(A9,A1:G5,HLOOKUP(B9,{A1:G1;COLUMN(A1:G1)},2... | |
d11784 | Try adding "BEGIN", "END" and "DELIIMITER", like this:
DELIMITER $$
CREATE PROCEDURE `Search_contacts`(IN `in_owner_id` INT,
IN `in_first_name` VARCHAR(255))
BEGIN
IF in_first_name IS NOT NULL THEN
SELECT * FROM `contacts`
WHERE `owner_id` = in_owner_id AND `first_name` LIKE in_first_name;
E... | |
d11785 | I don't believe there's any way to get information for all URLs that match a certain pattern, I think you have to specify the individual URLs manually - this shouldn't be a bug problem if it's your own site, as you'll already have a database of all possible article URLs, but if you're checking someone else's site it co... | |
d11786 | In order for that data to be posted to the server, you have to store it in a form value.
HTML elements in their entirety aren't posted to the server. Only the key/value pairs of form elements are. (WebForms is trying to trick you into thinking that the whole page is posted to the server, but it's a lie.)
Add a hidden... | |
d11787 | For only "one select":
var options = [
{ text: 'item1', value: 'item1', selected: true},
{ text: 'item2', value: 'item2', selected: false},
];
function isValidSelection(v){
var l = options.filter(function(item){
return item.selected==true;
}).length;
var r = ( !v ) || (v && l==0);
... | |
d11788 | Here is an example of how to return a List<string> from an object mocked by NSubstitute:
using System.Collections.Generic;
using NSubstitute;
using Xunit;
public interface ISomeType {
List<string> MyFunction();
}
public class SampleFixture {
[Fact]
public void ReturnList() {
var _mockedObject = Su... | |
d11789 | Try this:
Fiddle demo
--Your table
create table t (id int identity(1,1), col1 varchar(10),
col2 varchar(10))
--Insert query
insert into t
select c1 + case when number = 1 then '' else convert(varchar(10),number-1) end col1,
c2 + case when number = 1 then '' else convert(varchar(... | |
d11790 | For android specific settings. (Setting up makefiles, the AndroidManifest.xml, etc.) refer to SDL2/docs/readme.android and general "command line android help" on the internet.
Setting up the VS2015 solution generally goes as follows:
*
*Create new folder project
*Put game source in project/src
*Create shared items... | |
d11791 | Add this to your css:
input[type=submit]{
height: 22px;
line-height: 18px;
cursor: pointer;
}
A: Instead of using height and width like you are currently doing you should use padding because then the text is vertically centred.
The reason that the is not being sent is because you are not currently using a... | |
d11792 | You should redirect internally as well so your code should looks like this :
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} /detail\.php\?i=([^\s&][A-Za-z0-9-]+) [NC]
RewriteRule ^ %1? [R=302,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /detail.php?i=$1... | |
d11793 | To clear all nodes in the tree, you can call
myTree.delete_node(myTree.get_node("#").children); | |
d11794 | Why do you think it is any different from this probable SO question you are referring to?
Its just that instead of inserting a line, you need to read your inputfile.txt into a variable as shown here
and insert that into the file, instead of the value as clearly shown in the question. (links provided above)
A: insert c... | |
d11795 | There's a Wordpress Search and Replace Tool that will do what you need.
If you download a PHP script from the link, place it in the root of your site and then navigate to it will find and replace any term in the site database and / or files.
Obviously make sure you remove after you're done and it's better to rename it ... | |
d11796 | *
*no Select, Activate, ActiveCell, etc
*no OnError
*no Resume
*iterate from bottom to top
Option Explicit
Sub dupAmps()
Dim WS As Worksheet, C As Range
Dim LR As Long
Dim I As Long
Set WS = Worksheets("sheet1")
With WS
LR = .Cells(.Rows.Count, 1).End(xlUp).Row
End With
For I = LR To 2 Step -1
... | |
d11797 | For security reasons browsers do not allow this, i.e. JavaScript in browser has no access to the File System, however using HTML5 File API, only Firefox provides a mozFullPath property, but if you try to get the value it returns an empty string:
$('input[type=file]').change(function () {
console.log(this.files[0].m... | |
d11798 | The companion object of a case class extends FunctionX[T1, T2, <CaseClass>] so that you can use it to construct instances of the case class.
So, for example, if you have a case class
case class Foo(i: Int, s: String)
the compiler will generate a companion object
object Foo extends (Int, String) ⇒ Foo with Product2[In... | |
d11799 | MsgBox( Format(currentDate, "#0"))
or other format you prefer
A: Dim currentDate
currentDate = Now * (8.64 * 10 ^ 11) + 109205
'MsgBox (DateAdd("d", -90, Now))
MsgBox (Format(currentDate(), "MM dd, yyy"))
MsgBox (Format(Now(), "MM dd, yyy"))
Now() displays a date
currentDate is an over flow.
How to format date in V... | |
d11800 | Set AutoPostBack=true on btnAnswer. It's not triggering the server to act on the button click.
A: If you want to get event btnAnswer_Click triggered , then you must render the same Content and assign the eventHandler in every pageload(ie; the page load after the client button click must render the button again and Ev... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.