_id stringlengths 2 6 | text stringlengths 4 46k | title stringclasses 1
value |
|---|---|---|
d6001 | One way to do this is to use tapply() function:
df <- data.frame(City=c( "city1","city2","city3","city1","city2","city5"),
County = c("a", "b","a","b","a","b"))
df$City[which(tapply(df$County, df$City, length) > 1)]
This will create the following output:
> df$City[which(tapply(df$County, df$City, le... | |
d6002 | Solved. Problem was caused because we were using an old version of net-ldap (0.1.1). I updated this gem to the last version (0.3.1) and works like a charm. | |
d6003 | Solution:
*
*My machine was with 2 flutter sdk installed. I unnistalled one, and everything worked again. | |
d6004 | Is there another process binding to TCP/11211?
Perhaps you tried to start the memcached service as a non-privileged user and it failed with:
$ service memcached start
Starting memcached: [ OK ]
touch: cannot touch ‘/var/lock/subsys/memcached’: Permission denied
After that, serv... | |
d6005 | Yes you are correct. If you use any private Apple API in your app, it will be rejected.
Note that a third party code library is not the same thing as a private API (such as libraries you download from github, sourceForge, etc.) As long as the library(s) you use follow the rules, that is fine.
I'm not familiar with CTMe... | |
d6006 | Ok - for this question I got the "Tumbleweed Badget" - LOL
I admit it's a very special one and makes obvious, how much I am a beginner here. So I asked another question based on the same problem and spend some effort to make it easier to understand the code and to reproduce it. This paid off! Look here for the solution... | |
d6007 | Your first error probably comes from a typo somewhere.
firebase.auth(...).signInWithLoginAndPassword is not a function
Notice it says signInWithLoginAndPassword, the function is called signInWithEmailAndPassword. In the posted code it's used correctly, so it's probably somewhere else.
firebase.auth(...).GoogleAuthProvi... | |
d6008 | It is possible. You do not even need more than one step. Map-Reduce can be implemented in a single step. You can create a step with ItemReader and ItemWriter associated with it. Think of ItemReader -ItemWriter pair as of Map- Reduce. You can achieve the neccessary effect by using custom reader and writer with propper l... | |
d6009 | Assuming you're asking whether the memory managed by a valarray is guaranteed to be contiguous, then the answer is yes, at least if the object isn't const (C++03, §26.3.2.3/3 or C++11, §26.6.2.4/2):
The expression &a[i+j] == &a[i] + j evaluates as true for all size_t i and size_t j such
that i+j is less than the len... | |
d6010 | DLLs and code using DLLs which are linked against different versions of the runtime library (and possibly other libraries) are in danger of breaking, if one or more of the following happens:
*
*Interface to DLL uses classes/structures, where the size might differ depending on version of runtime library. (One unfortu... | |
d6011 | Some of the naming conventions used in your example are a little weird. If all you want to do is sort I would consider changing the "name" parameter to something more descriptive. Keeping with your example the following might help.
class V1::DataController < V1::ApplicationController
...
def index
#ASC
if ... | |
d6012 | As you tagged you question with "perl", you can use Perl. Try LWP - popular module, and much more convenient than curl. For more complex tasks, try WWW::Mechanize.
A: You might want to look at the HTTP Extension. It looks like a pretty complete abstraction implemented over curl.
A: If you want something more sophist... | |
d6013 | npm install react-native-safe-area-context
Try this and build.
If not,
Please check your computer's environment variables and set JAVA_HOME if it has not already been setup. | |
d6014 | Keep in mind, DynamoDB has a 400KB limit on each item.
I would recommend using S3 for images and PDF documents. It also allows you to set up a CDN much more easily, rather than using something like DynamoDB.
You can always link your S3 link to an item in DynamoDB if you need to store data related to the file.
A: AWS D... | |
d6015 | Triggering a click outside the element should do the trick.
$(document).click();
There is no official way to 'close' the bootstrap dropdown, however, the above one is a workaround to handle that. It basically triggers a fake click outside the dropdown, therefore, closing it.
If you want it to close every time user star... | |
d6016 | include("../includes/db.php");
$result = $link->query("SELECT * FROM users");
echo $result->num_rows;
My bad for the previous answer. It's been a while since I've used PHP | |
d6017 | Not directly, but you can do the following:
In your install4j project add a launcher (with arbitrary configuration) and open the project file in a text editor. Locate the launcher element and swap it out with the contents of your exe4j file. | |
d6018 | Is there any chance you had to set the field name to some file variable? So, I believe you expected [saveField]="file" to set field name to 'file' string but instead it searches for some this.filevariable which is undefined so you got field name set to the default 'files' value?
A: Followed @GProst suggestions and ana... | |
d6019 | Getting the gradient from a random image is going to be tough for any image processor. You would probably have better luck by getting the pixel data for the image, finding the top and bottom pixel, pulling the color data out of them, then using these values to create your gradient.
A: Get started with this tool
http:... | |
d6020 | I don't really understand what you want, but isn't diff -ur enough for you? It will work even on directories without any kind of version control.
A: git diff does exactly that. but it only works for git projects.
hg diff, svn diff pretty every version control system can diff directory trees
A: From git diff manpage:
... | |
d6021 | s <- c(1,2,3)
result = matrix(0, nrow = max(s), ncol = length(s))
for (i in seq_along(s)) result[1:s[i], i] = 1
result
# [,1] [,2] [,3]
# [1,] 1 1 1
# [2,] 0 1 1
# [3,] 0 0 1
Keeping rowsums as 1
s <- c(1,2,3)
result = matrix(0, nrow = sum(s), ncol = length(s))
result[cbind(1:sum(s), re... | |
d6022 | Only Standard, Enterprise and Datacenter editions support clustering:
SQL 2008 - Compare Edition Features | |
d6023 | 1. Prerequisites:
Download and Install the following modules.
First install the Microsoft Online Services Sign-In Assistant for IT Professionals RTW from the Microsoft Download Center.
Then install the Azure Active Directory Module for Windows PowerShell (64-bit version), and click Run to run the installer package.
... | |
d6024 | Just because you don't have joins implemented by the DBMS doesn't mean you can't have multiple tables. In App Engine, these are called 'entity types', and you can have as many of them as you want.
Generally, you need to denormalize your data in order to avoid the need for frequent joins. In the few situations where the... | |
d6025 | Yes, you can mark conversion operators explicit since C++11.
explicit operator double() { /* ... */ }
This will prevent copy-initialization, e.g.,
double y = x;
return x; // function has double return type
f(x); // function expects double argument
while allowing explicit conversions such as
double y(x);
double y = ... | |
d6026 | I rewrite the sample from Apple, you can see I comment self.tableView.tableHeaderView = self.searchController.searchBar; then set it to navigation bar's title view, just like you. You can find search bar is here in snapshot.
- (void)viewDidLoad {
[super viewDidLoad];
APLResultsTableController *qresultsTableCon... | |
d6027 | Your command is not working because you don't have underscores separating the columns; further, you wanted the data ascending but you told it to sort in reverse (descending) order. Use:
grep "abc" *.txt | sort -n -k 2
Or:
grep "abc" *.txt | sort -k 2n
Note that if there are multiple files, your grep output will be p... | |
d6028 | If you want the move and animate action to run paralel you can use:
Option1: use CCSpawn instead of a CCSequence. CCSequence is needed because you would like to call a function after completion.
id action = [CCSpawn actions:
[CCMoveTo actionWithDuration:moveDuration position:touchLocation... | |
d6029 | There is a fast split optimization, depending on the circumstances. However from your description, I would simply do the INSERT /+* APPEND */
You may want to employ some parallelism too, if you have the resources and you are looking to speed up the inserts. | |
d6030 | The way to do this quickly is to use a bulk-insert in a stored procedure. You end up running a query to get back all the IDs but it reduces the main bottleneck: the number of trips to the database. | |
d6031 | Use next command:
docker run -it your_image
The root cause is you missed -i, see this which make the container can't receive your input:
--interactive , -i Keep STDIN open even if not attached
And if you use docker-compose, remember to add next to compose file:
stdin_open: true
tty: true
stdin_open same to -... | |
d6032 | I posted my similar question in the gradle forums and was able to solve the issue:
https://discuss.gradle.org/t/unit-test-plugins-afterevaulate/37437/3
Apparently afterEvaluate is not the best/right place to perform the task creation. If you have a DomainObjectCollection in your extension and want to create a task for ... | |
d6033 | The way to achieve this is simply by using List as return value. So for example for a repository defined like this:
interface CustomerRepository extends Repository<Customer, Long> {
List<Customer> findByLastname(String lastname, Pageable pageable);
}
The query execution engine would apply the offset and pagesize as... | |
d6034 | Is it possible to run background tasks in Cloud Run ? i thought it operates only on request, and therefore after a request is handled it stops working, until the next requests comes in.
A: The trick is to pass a custom container command in Cloud Run with the value /usr/bin/supervisord to actually start the supervisor/... | |
d6035 | Forget about apache poi HWPF. It is in scratchpad and without any progress since decades. And there are no useable methods to insert or create new paragraphs. All Range.insertBefore and Range.insertAfter methods which take more than only text are private and deprecated and doesn't work properly also since decades. The ... | |
d6036 | you can use timthumb.php if would like
<img src="<?php echo path/to/timthumb.php?src="path"&h=100&w=100&q=500 ?>"/> | |
d6037 | I extended the WC_Form_Handler class in my functions.php file, copied a method I needed and edited it, and gave it higher hook priority in my extended class than it's in the original class:
class WC_Form_Handler_Ext extends WC_Form_Handler {
/**
* Hook in method.
*/
public static function init() {
... | |
d6038 | What you are trying to call is an instance method. Call it this way:
if(isset($_POST["Method"]))
{
$function = $_POST["Method"];
$method = new ReflectionMethod('methods', $function);
$method->invoke($this);
}
A: Try forcing a content-type header before sending the output,
header("Content-type: appli... | |
d6039 | char (*string)[100];
OK, string represents a pointer to 100 char, but it's not initialized. Therefore, it represents an arbitrary address. (Even worse, it doesn't necessarily even represent the same arbitrary address when accessed on subsequent occasions.)
gets(string[i]);
Hmm, this reads data from standard input to ... | |
d6040 | You need to declare selectedNote as optional like this:
var selectedNote: Note?
And later check if value exist before using it.
if let note = selectedNote {
// Set up the detail view controller to show.
let detailViewController = DetailViewController()
detailViewController.detailDescriptionLabel = not... | |
d6041 | Thanks to @jfriend00 for pointing me in the direction of websockets and this article for general guidance
I decided to use ws for the server:
const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: 3005 });
wss.on('connection', function connection(ws) {
ws.on('message', function incoming(message) {... | |
d6042 | It's because the value of this inside any Javascript function depends on how that function was called.
In your non-working example, this.hookNav is inside of the renderItem method. So it will adopt the this of that method - which, as I just said, depends on how it is called. Further inspecting your code shows that the ... | |
d6043 | Basically, I want to console.log() the name of the variable rather than root in the sum function.
You can't. When your sum function is called, it is passed a value. That value is a pointer to an object and there is no connection at all to the variable that the pointer came from. If you did this:
let tree = new Tree... | |
d6044 | First solution
Make sure your nodejs version is not superior than the latest stable one. For that you can use n package from npm:
npm install -g n
n stable
# if one of the commands does not pass, you may need to use sudo
sudo npm install -g n
sudo n stable
Then you would wanna use sass package instead of node-sass, as... | |
d6045 | There are two common ways to solve it.
1. add to your android/build.gradle file, under allprojects/repositoris sections
maven {
url 'https://maven.google.com'
}
so that it should looks like:
allprojects {
repositories {
mavenLocal()
maven {
url 'https://maven.google.com'
... | |
d6046 | The position of a node does not change when it rotates. Maybe you could look at connecting the nodes with a physics mechanism such as SCNPhysicsHingeJoint? I found this example which could be useful for your scenario:
http://lepetit-prince.net/ios/?p=3540
Another example:
http://appleengine.hatenablog.com/entry/2017/... | |
d6047 | Try using NSDecimalNumber. There's a good tutorial here:
http://www.cimgf.com/2008/04/23/cocoa-tutorial-dont-be-lazy-with-nsdecimalnumber-like-me/
A: If I'm not wrong and if I well remember the appropriate course at college i think it's a matter of conversion from reality (where you have infinite values) to virtual (w... | |
d6048 | you can use nth-last-child(2) or nth-last-of-type(2), this will select the 2nd last item.
li {
display: inline-block
}
li:nth-last-child(2) {
color: red
}
<ul>
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
</ul>
<hr />
<ul>
<li>test</li>
<li>test</li>
<li>te... | |
d6049 | You need to .encode() your Unicode strings before print:
print text.encode('utf-8')
print author.encode('utf-8')
print Tags.encode('utf-8') | |
d6050 | You can use a bool which allows you to specify the queries that must match to constitute a hit. Your query will look something like this
{
"query": {
"bool" : {
"must" : [
{ "match": { "user" : "dude" } },
{ "match": { "path" : "/" } }
]
}
... | |
d6051 | An application written in .NET C# should always be compatible with any version of windows that has the .NET Framework installed, there's only a small difference between the .NET Framework Client and Full versions (Has to do with certain features that the client version doesn't have, see it as a lightweight version of t... | |
d6052 | include_directories() populates a directory property called INCLUDE_DIRECTORIES:
http://www.cmake.org/cmake/help/v2.8.12/cmake.html#prop_dir:INCLUDE_DIRECTORIES
Note that CMake 2.8.11 learned the target_include_directories command, which populates the INCLUDE_DIRECTORIES target property.
http://www.cmake.org/cmake/hel... | |
d6053 | Based on another of your questions, it looks like the parameter item_in is a struct with several char * fields. There is a serious problem because the array temp only exists for the duration of this function. You are assigning the address of a temporary array to pointers in item_in. When the function returns, the array... | |
d6054 | Description
This regex will find td tags and return them in groups of two.
<td\b[^>]*>([^<]*)<\/td>[^<]*<td\b[^>]*>([^<]*)<\/td>
Summary
*
*<td\b[^>]*> find the first td tag and consume any attributes
*([^<]*) capture the first inner text, this can be greedy but we assume the cell has no nested tags
*<\/td> find t... | |
d6055 | To get the above code compiled the vector type has to be defined as an unsafe pointer.
TComponent* Comp = new TComponent(this);
std::vector<__unsafe TComponent*> Comps;
Comps.push_back(Comp);
I openened a support case for an other problem I had. The embarcadero support gave me the following information which I applied... | |
d6056 | Just initialize aantalslagen to 0 in JavaScript and don't mess with any <form> or POST request or anything like that because you don't need to since it doesn't seem like you're saving the value in some cookie so the value will stay if the user refreshes the page. If you do want the value to stay once the user refreshes... | |
d6057 | The comment from @tripleee inspired me to this approach which I wouldn't call a solution because it doesn't fit to all needs in my opening question. But it seems as a good compromise to me.
I combined recursive calls and a try..except block. The recursion is because I didn't want to separate the functionality into a se... | |
d6058 | vim is waiting a short time to allow for the possibility that the esc key might begin a special key (such as cursor-left or F1).
You can alter this behavior altering these settings: ttimeout, timeoutlen
and ttimeoutlen.
The timeoutlen mode is set by default to 1 second (1000 milliseconds). If you set that to a shorter... | |
d6059 | I would unpivot and aggregate:
select sum(Barcodes)
from t cross apply
(values (color1), (color2), (color3), (color4)) v(color)
where color = 'Red';
If you want this for each color:
select color, sum(Barcodes)
from t cross apply
(values (color1), (color2), (color3), (color4)) v(color)
group by color; | |
d6060 | Unless all your apps are going to be exactly the same, use a new gruntfile for each app. I'm guessing each of your apps will all be different as you've duplicated the src folder within each in anticipation.
I don't recommend a global dependency setup. As time goes on, each of your apps will diverge and the amount of yo... | |
d6061 | The url you give as an example "http://www.sonect.co.uk/Requests.php?accessToken=01XJSK", returns html with a frame that has "http://lvps92-60-123-84.vps.webfusion.co.uk/Requests.php?accessToken=01XJSK" as it's source:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<h... | |
d6062 | Github issue
This happens when using either MANY_TO_MANY or ONE_TO_MANY join in
your query then you cannot iterate over it because it is potentially
possible that the same entity could be in multiple rows.
If you add a distinct to your query then all will work as it will
guarantee each record is unique.
$qb = $... | |
d6063 | Dictionaries have a.values() method, and you can use it like so:
for myList in myDict.values():
print(myList) # Do stuff
Keep in mind camelCase isn't a convention in Python.
A: solution of you problem
a={1: [4, 2, 1, 3], 2: [4, 3, 1, 2], 3: [4, 3, 1, 2]}
mylist=a[1]
print(mylist) | |
d6064 | Look at using the Buffering Event and the BufferingProgress Property. According to the MSDN Link:
Use this event to determine when buffering or downloading starts or stops. You can use the same event block for both cases and test IWMPNetwork.bufferingProgress and IWMPNetwork.downloadProgress to determine whether Windo... | |
d6065 | You're actually setting the variable correctly, but the info statement is not being evaluated in the context of the recipe. You can check this by looking at the very lengthy output of make -d rule1. Notice that the info statement is evaluated before any rules.
You can have it print out in the context of the rule by ... | |
d6066 | Use list
sftp.list(remotePath);
It will (asynchronously) trigger an error if the file doesn't exist | |
d6067 | There are many "easy" ways, depending on your skills.
Maybe: "Write triggers, which are sending the notify on insert/update" is the hint you need? | |
d6068 | I think this is not possible but you can make better UI via progress dialog until web site open.You can use AsyncTask for this. That code works for me ;
public class MainActivity extends AppCompatActivity {
ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreat... | |
d6069 | i have update plunkr plunkr link
Change in dynamic-pipe.ts like this
const dynamicPipe = "";
//i have give one simple logic for example if your dynamic pipe is like
this.dynamicPipe = ['number','uppercase','customPipe']; //pipe,pipe1 ... pipeN
//now create a one variable like 'number' | 'uppercase' | 'customPipe'
for... | |
d6070 | The error is being caused by this line:
public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
Type parameters need to be added to both the return type and the object being created. The change to add type parameters is this:
public static final Parcelable.Creator<Response> CREATOR =
new Parcel... | |
d6071 | React will only re-render if a value that is a prop or part of the component's state changes. In your case, the deleteIt variable is not a state variable, so even if you change it with confirmationDeleteUser, your component won't re-render to trigger the popup.
Try to define your variable with useState instead, like th... | |
d6072 | Bluetooth 4.0 has all backwards compatibility with it's older versions.
BLE is a form of connect using low energy technology.
BLE = Bluetooth Low energy.
They are different technologies with different proposes. BLE tend to be used in heart rate monitors, bike computers, medicinal applications and etc. Whenever the powe... | |
d6073 | The problem could be that the ID you want is not loading before you do your next step. Try waiting for the element to load with the following "wait_for_load" function:
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
... | |
d6074 | TensorFlow tensors are read-only. In order to modify things you need to use variables and .assign (= can not be overriden in Python)
tensor = tf.Variable(tf.ones((3,3)))
sess.run(tf.initialize_all_variables())
sess.run(tensor[1:, 1:].assign(2*tensor[1:,1:]))
print(tensor.eval())
Output
[[ 1. 1. 1.]
[ 1. 2. 2.]
[... | |
d6075 | love.keyboard.wasPressed is not a standard Love2D API. Should be implemented somewhere else in your code? Check this first.
Then try to put some print("condition xxx is verified") in your conditions where your code is supposed to be executed, then you'll find where the condition is not verified.
Example:
if love.keyboa... | |
d6076 | I hope this helps. I wrote this code for myself in a new way. I have used recursion to keep the guess happening and simple used a while loop that will break when max attempts go beyond 3.
import random
elements = ["hydrogen", "magnesium", "cobalt", "mercury", "aluminium", "uranium", "antimony"]
nice_phrases = ["Nice j... | |
d6077 | For your example it works with bootstrap:
confint(model, method = "boot")
# 2.5 % 97.5 %
# .sig01 12.02914066 44.71708844
# .sigma 0.03356588 0.07344978
# (Intercept) -5.26207985 1.28669024
# prop1 1.01574201 6.99804555
Take into consideration that under your proposed model,... | |
d6078 | Denormalization is the magic password for your situation.
There are several ways to do this:
For example, store the ids of the last 10 users in the event and group.
Or create a new model NewsFeedItem (belongs_to :parent, :polymorphic => true). When a user attends an event, create a NewsFeedItem with denormalized inform... | |
d6079 | There is only minor differences these days in DOCTYPE declarations in html email. Although only minor, it is still recommended to test your emails via Email on Acid or Litmus or any other testing software prior to a send to ensure cross client compatibility and to find any unforeseen quirks.
The larger issues comes wi... | |
d6080 | Simply put, let the DB API do that formatting:
c.execute("INSERT INTO Data_Output6 VALUES (?, ?)", (xdates[i], Averages_norm[-1]))
And refer to the documentation https://docs.python.org/2/library/sqlite3.html where is mentioned:
Instead, use the DB-API’s parameter substitution. | |
d6081 | You should be able to invoke bcp.exe directly rather than trying to use cmd.exe /c. This should be all you need...
import subprocess
import pyodbc
server = r".\SQLEXPRESS01"
database = "test"
connection = f"driver={{SQL Server Native Client 11.0}};server={server};database={database};trusted_connection=yes;"
dbconn = p... | |
d6082 | I think you got the allow and deny the wrong way around:
order allow,deny
allow from 192.168.1.7
deny from all
which first processes all the allow statements and next the deny statements.
A: I just checked, your above example works fine for me on my Apache 2.
Make sure your IP really is 192.168.1.7. Note that if it's... | |
d6083 | It should be :
public static void add(String title) {
//add the item
return render("anitemtemplate.html", item);
}
or
public static void add(String title) {
//add the item
renderArgs.put("item", newitem);
return render("anitemtemplate.html");
}
And if the anitemtemplate.html is in /app/views/tags/ , like th... | |
d6084 | puppeteer Chromium do the proxy check by default, which is a waste of time if you do not use proxy.
Can disable it by
const browser = await puppeteer.launch({
headless: false,
args: ["--proxy-server='direct://'", '--proxy-bypass-list=*'],
});
then it will as fast as normal Chrome | |
d6085 | See the API for DMatch data type here:
http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_descriptor_matchers.html#dmatch | |
d6086 | On Unix, when you launch your process you can pipe it into tail first:
p=subprocess.Popen("your_process.sh | tail --lines=3", stdout=subprocess.PIPE, shell=True)
r=p.communicate()
print r[0]
Usage of shell=True is the key here. | |
d6087 | Finding and showing the maxima/minima for grouped data with a single formula in only one cell can be done with the following formula:
=UNIQUE(FILTER(MyArray,MMULT(((ValueRange>TRANSPOSE(ValueRange))+(ValueRange=TRANSPOSE(ValueRange))-(GroupRange=TRANSPOSE(GroupRange)))*(GroupRange=TRANSPOSE(GroupRange)),SEQUENCE(ROWS(G... | |
d6088 | My guess is that it has something to do with what you put into @style/TextLabel.
When you have an error with password or email you request focus programmatically. Which is fine, however when that happens something in your style is looking for a color resource which doesn't exist. That's what's causing the error.
A: ... | |
d6089 | Let's say $key is 'x'. You could then use getElementbyID('x'), because echoing $key is the same as putting id="x".
A: Oh, I see. you have series of rows with the different qty keys.
then try this.
in PHP:
<input type="number" min="0" max="500" value="" name="qty<?php echo $key ?>" id="<?php echo $key ?>" onChange="fin... | |
d6090 | You can use this code:
var place = $('#foo');
var delay = 3 * 1000; // 3 seconds
var url = 'http://www.somewhere.com/temp/busy.html';
(function recur() {
$.ajax({url: url, success: function(page) {
place.html(page);
setTimeout(function() {
recur();
}, delay);
}, error: function() {
... | |
d6091 | When I tried running this, I also got the error "TargetName property cannot be set on a Style Setter". Which indicates that you can't set a property of the Border control inside a style setter for the TextBox control (which doesn't honestly surprise me.)
What you can do instead is set it in the style of the border cont... | |
d6092 | The .filter() function will always return an array of the same type that was given as the argument. That is why reviewsWithRating is still a Review[], even after you filter it.
To change this, you can add a type guard to the callback:
const reviewsWithRating = reviews.filter(
(review): review is { rating: Required<Co... | |
d6093 | String in javascript is not formatted. You can only do that when you output to HTML. So basically you must write it like this
var str = "Not less than 30 net ft<sup>2</sup> (2.8 net m<sup>2</sup>)";
document.write(str);
You can do a find and replace for all string contain ft2 and m2 turn them into ft<sup>2</sup> and m... | |
d6094 | Your repository is just a directory/file structure. Go to your local repo, find the path (the group id is the path), and delete from the place where you start to see version numbers. When you rebuild, the artifact should be downloaded/replaced from your server/repo. | |
d6095 | Yes, the CLR is not really smart enough to ignore it but the difference should be negligible in most cases.
A method call is not a big deal and is unlikely to have a meaningful impact on the performance of your application.
A: If your application calls ChangeStatus thousand times per second, maybe it would be a probl... | |
d6096 | Since you're calling ToDictionary(), your method returns a Dictionary<>, not an IQueryable<>:
public Dictionary<discussion_category, List<discussion_board>>
GetDiscussion_categoriesWithBoards()
{
// ...
}
If you absolutely want to return an IQueryable<> you can write something like:
public IQueryable<Dictionary<di... | |
d6097 | In Swing, there are two different components. JTextArea and JTextPane. The JTextArea is easy to use, but doesn't allow formatting. If you do not plan on changing the formatting of different words, that is the one to use. The JTextArea is more robust but harder to use.
Check out the Java tutorial for more informatio... | |
d6098 | If you mean visually then the way is put endl or "\n" to the outer loop and remove endl from inner loop.But i do not know anythig about your Holder object and if you have [] operator defined there that is the answer.
vector<Holder> obj(N);
void savedata(string filename, vector<Holder> obj, int M, int N) {
ofstream... | |
d6099 | how about adding a new layer?
yourView.clipsToBounds = YES;
CALayer *topBorder = [CALayer layer];
topBorder.borderColor = [UIColor redColor].CGColor;
topBorder.borderWidth = 1;
topBorder.frame = CGRectMake(0, 0, CGRectGetWidth(self.frame), 2);
[yourView.layer addSublayer:topBorder];
replace yourView with whatever... | |
d6100 | This is more efficient:
required.replicates <- function (delta, sigma, z.alpha, z.beta) {
oo <- 1 / outer(delta, sigma, "/")
ceiling(oo ^ 2 * 2 * (z.alpha + z.beta) ^ 2)
}
practice1 <- required.replicates(delta.vec, sigma.vec, 1.959964, 0.8416212)
Fix to your original code
required.replicates <- function(delta, s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.