_id stringlengths 2 6 | text stringlengths 4 46k | title stringclasses 1
value |
|---|---|---|
d14001 | While you can use compact to eliminate the nil values from your array, I'm not sure why you need this in the first place.
Doing
case name
when 'a'
return "SQL statement"
when 'b'
return "SQL statement"
when 'c'
return "SQL statement"
when 'd'
return "SQL statement"
end
is way more intuitive.
... | |
d14002 | Change the code like below for second function as well.
int Matrix::operator()(int i, int j) const
{
int _size = (_vec.size() + 2) / 3;
if ((i >= _size || i < 0) || (j >= _size || j < 0)) throw OVERINDEXED;
if (i != j && j != 0 && j != _size - 1) return 0;
else {
if (j == 0)
{
... | |
d14003 | The range of elements is small. So create an array of counters for the possible values and increment the count for each value you find. For example, if you find 2, increment counter[2].
Then given your collection of numbers, just do an array lookup to get the count.
A: The time complexity is O(max(m,n)) where m is t... | |
d14004 | Okay, I found the solution to the problem and it was quite simple in reality.
I disabled the Visual Studio ClearCase integration on the build server.
VS is being used as we need to build deployment projects and so we call devenv to do this for us. However we are only using it as a build engine, there is never a need f... | |
d14005 | I suggest having a separate project (module) within your multi-module build for reporting on the whole project. You might need the JacocoMerge task too. Let's assume a, b and c are java projects. Eg
Eg:
def javaProjects = [':a', ':b', ':c']
javaProjects.each {
project(it) {
apply plugin: 'java'
apply pl... | |
d14006 | have you looked at all of the data flavors on the clipboard?
the plain string might not have the nonbreaking character, but one of the other more specific kinds might? in word/excel do "paste special" to see what other formats are available, or enumerate them in code.
I'm betting there are multiple kinds of data o... | |
d14007 | def gen_data():
subitems = []
for subitem in range(2):
subitems.append({
'title': subitem,
'prop': None,
})
data = []
for item in range(3):
data.append({
'title': item,
'subitems': subitems,
})
return data
You are ins... | |
d14008 | For some reason, it got stuck because I had manually created two named pipes in the same folder. Deleting the pipes allowed the make process to terminate successfully.
EDIT: I'm only posting this because Googling did not give me any good results, and I think it would save someone else some time if they could find it ea... | |
d14009 | Most likely driver1 doesn't exist.
Try this
var temp = data.exists ? data.data() : "Doc does not exist";
Print list should return [Doc does not exist] instead of null.
Check if there is a white space before driver1 i.e _driver1 or after it. Otherwise there's no other explanation. | |
d14010 | I don't think you can send file on server using AJAX, 'cause you don't have access to file system via JavaScript. I don't believe what you're trying to do is possible without Flash or Silverlight. Try SWFUpload, for instance. I was using it on my previous project, and it worked fine for me.
EDIT:
And about returning th... | |
d14011 | You can check the Keras FAQ and especially the section "Why is the training loss much higher than the testing loss?".
I would also suggest you to take some time and read this very good article regarding some "sanity checks" you should always take into consideration when building a NN.
In addition, whenever possible,... | |
d14012 | If the pattern doesn't match any path, the result will be empty indeed.
You have to split the MATCH in 2 and make the second one OPTIONAL, or in your actual case, stop matching the same u1 node over and over again:
MATCH (u1:User {user_id: 4})
OPTIONAL MATCH (u1)-[:FOLLOWS]->(:User)-->(r1:Rest {city_id: 1})
WITH u1, co... | |
d14013 | I'm not sure why this would be necessary, but I suppose you could wrap the tests you want to repeat in a for loop from 0 to N.
If you define N using int.fromEnvironment then you can pass in a value for N at the command line.
flutter test --dart-define=N=100
import 'package:flutter/material.dart';
import 'package:flutte... | |
d14014 | There are three scenarios where it is useful to use a character reference:
*
*When you aren't encoding the document in a Unicode encoding (hopefully you won't be this century)
*When you are using a character with special meaning in HTML (such as a ' inside an attribute value delimited by ' characters)
*When you do... | |
d14015 | try this, in your solution Twitter and Youtube are local variables in the function finished, after the function returns they no longer exist, if the function gets called again they are craeted again but of course they don´t have the value of last time since they are new variables, maybe google for 'javascript variable ... | |
d14016 | If you want to prompt the user for something from the terminal, the easiest way is probably to use java.io.Console, in particular one of its readLine() methods:
import java.io.Console;
...
Console console = System.console();
if (console == null) {
throw new IllegalStateException("No console to read input from!");
}... | |
d14017 | A very straightforward way is to use one of the rank functions from "dplyr" (eg: dense_rank, min_rank). Here, I've actually just used rank from base R. I've deleted some columns below just for presentation purposes.
library(dplyr)
mydf %>% mutate(bin = rank(BR))
# range X0 X1 total BR ... Index bin
#... | |
d14018 | If decimal.MinValue were only declared as a static readonly field, you wouldn't be able to use it as a compile-time constant elsewhere - e.g. for things like the default value of optional parameters.
I suppose the BCL team could provide both a constant and a read-only field, but that would confuse many people. If you'r... | |
d14019 | Assuming that the question is about the difference of Cipher.getInstance("AES") and Cipher.getInstance("AES/CFB/NoPadding"):
For Oracle JDK the default mode/padding when you do not specify them in the transformation string is "ECB/PKCS5Padding", meaning that Cipher.getInstance("AES") is the same as Cipher.getInstance("... | |
d14020 | If you need to use the ActiveCell, you can use something like the code below:
Dim ShtName As String
ShtName = ActiveCell.Value2 ' <-- save the value of the ActiveCell
Set wb = Application.Workbooks.Open(FilePath)
wb.Worksheets(1).Copy After:=activeWB.Sheets(activeWB.Sheets.Count)
' rename the sheet
activeWB.Sheets(ac... | |
d14021 | *
*java.io - difference between streams and writers. Buffered streams.
*java.util - the collection framework. Set and List. What's HashMap, TreeMap. Some questions on efficiency of concrete collections
*java.lang - wrapper types, autoboxing
*java.util.concurrent - synchronization aids, atomic primitives, executors,... | |
d14022 | I ran into this problem myself. Here is my solution which I have tested in Firefox and Chrome:
Ensure the contenteditable div has the css white-space: pre, pre-line or pre-wrap so that it displays \n as new lines.
Override the "enter" key so that when we are typing, it does not create any <div> or <br> tags
myDiv.addEv... | |
d14023 | I have made a small example to display with an image. like when you scroll down some animation will be shown and once you scroll back to up animation will be revert.
CSS STYLE:
.classname {
-webkit-animation-name: cssAnimation;
-webkit-animation-duration: 3s;
-webkit-animation-iteration-count: 1;
-webkit-animation-tim... | |
d14024 | I discovered that on my local machine there was Visual Studio 2013 Update 5 while on the server TFS there was Visual Studio 2013 RTM (no update).
I resolved with a update of Visual Studio 2013 at last version (Update 5) on server where is installed TFS. | |
d14025 | In your .getCompanies() call right after the .map add a .retryWhen:
.retryWhen((errors) => {
return errors.scan((errorCount, err) => errorCount + 1, 0)
.takeWhile((errorCount) => errorCount < 2);
});
In this example, the observable completes after 2 failures (errorCount < 2).
A: You mean somethin... | |
d14026 | Go to file -->project structure-->click on app-->and on the right side 4tabs will appear and select build in that and enter your detail. That's it
Also important are these in your build.gradle file
android {
signingConfigs {
ProdSigningKey {
keyAlias 'any alias name'
keyPassword 'you... | |
d14027 | Assuming that your properties names and the dictionary keys are the same, you can use this function to convert any object
- (void) setObject:(id) object ValuesFromDictionary:(NSDictionary *) dictionary
{
for (NSString *fieldName in dictionary) {
[object setValue:[dictionary objectForKey:fieldName] forKey:fi... | |
d14028 | since elastic search 2.3, FilterBuilders class has been removed from JavaAPI. you can use
QueryBuilder qb = QueryBuilders.boolQuery()
.must(QueryBuilders.matchQuery("_all", "JPMORGAN"))
.must(QueryBuilders.matchQuery(field, value)) ;
instead, and set it to
.setQuery(qb).
A: I think this will help.
... | |
d14029 | Remember : The Swing toolkit is pretty good at getting the system look and feel "almost right". If you really need the system feel, however, there are other options like SWT that are a little better suited.
If you want consistency then Swing can always default to the old school applet look which, although a little bo... | |
d14030 | Normally you would be able to set this with environment variables when you start the program or container. In Apache Superset, this is not possible. There is an ongoing discussion on Github about this issue. One GitHub user posts the problem and workaround, which is far from workable:
Daylight savings causes issues wh... | |
d14031 | Your page is not even remotely valid HTML. For one thing, you have two body elements.
Check out W3C Validation of your page for more problems.
If a browser gets invalid HTML it makes its best guess at what the DOM should be (as opposed to a deterministic interpretation). Since browsers are designed by independent teams... | |
d14032 | NAudio can read information out of SoundFont files, but it does not include a SoundFont engine. For that you would need a good pitch shifting algorithm, some filters, and some voice management, as well as a sequencer if you wanted to play back MIDI files.
The closest I have come to building something like this is a de... | |
d14033 | This looks like a bug in Chrome.
I searched Chromium bugs and found a few that are similar:
*
*Issue 516127: Rendering artifacts on osx when something moves above the browser (dock, other windows, etc)
*Issue 473933: Visual rendering issue
*Issue 476909: Page didn't redraw correctly
*Issue 245946: Con... | |
d14034 | Here is the comprehensive tutorial..
http://yajsw.sourceforge.net/
and one for windows service
https://docs.wso2.org/display/Carbon403/Installing+as+a+Windows+Service
A: You can play around with the scripts located in yajsw/bat, specifically with setenv.bat.
That is the script that creates your environment variables.
... | |
d14035 | Try this code:
-- declare a XML variable
DECLARE @XmlInput XML;
-- load the XML from the file into that XML variable
SELECT @XmlInput = CAST(c1 AS XML)
FROM OPENROWSET (BULK 'D:\Tasks\Test1.xml',SINGLE_BLOB) AS T1(c1)
-- extract the "Name" attribute and "INT10" element from the XML
SELECT
Name = XC.value('@Na... | |
d14036 | For anyone experiencing the same problem, I was finally able to find a solution.
The problem is that GCE auth is set by the "gargle" package, instead of using the "normal user OAuth flow".
To temporarily disable GCE auth, I'm using the following piece of code now:
library(gargle)
cred_funs_clear()
cred_funs_add(creden... | |
d14037 | Make sure you have following dependency on your pom.
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency> | |
d14038 | Write a method which will insert 1000 records and mark it as @Transactional(propagation = Propagation.REQUIRES_NEW)
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void saveData(List<Object> data)..
Then, call that method few times, whenever the method is called, new transaction will be created. | |
d14039 | Linux SGX SSL Crypto Lib has now been open sourced and it's available here: https://github.com/01org/intel-sgx-ssl
A: I found an alternative solution to OpenSSL namely mbedtls here.
It is available for Linux and Windows and the compiled libraries only need to be linked against the application and enclave.
A: TaLoS i... | |
d14040 | You can use http client axios
Performing a POST request
var axios = require('axios');
axios.post('/user', {
firstName: 'Fred',
lastName: 'Flintstone'
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
A: const request = require('request')... | |
d14041 | In C++, const is really just logical constness and not physical constness. func1 can do a const_cast and modify i. const is like the safety of a gun - you can still shoot yourself in the foot, but not by accident.
As T.C. and juanchopanza have pointed out in the comments, casting away the constness of an object and mod... | |
d14042 | The message is saying that the member AudioInputDevices and the member VideoInputDevices are not declared as static in the type DirectX.Capture.Filters, but you are using them as if they were static.
To reference a member that's not static, you need to instantiate that type, by calling the constructor (directly, or ind... | |
d14043 | Since you use VS++, you can use:
_splitpath and _wsplitpath functions to break apart path
A: You can use the Windows shell API function PathRemoveFileSpec to do this. Example usage is listed on the linked page. | |
d14044 | I have two components A and B which are both are integrated on one
page. Both components need access to data set C.
As long as they are being used in one page, why you are calling them from each components? I think you can call it from the page component and send it to children.
Children can get the data using @Input(... | |
d14045 | Use traceback module. | |
d14046 | The form is trying to submit the provided data to the url: 'file:///android_asset/www/submit'.
The url is submitted via the action attribute inside the <form> tag:
<form action="submit" id="login" name="login_form">
To prevent this from happening just take the action attribute out of the tag.
Since you are new to Phon... | |
d14047 | Using multiple GPUs
If developing on a system with a single GPU, you can simulate multiple GPUs with virtual devices. This enables easy testing of multi-GPU setups without requiring additional resources.
gpus = tf.config.list_physical_devices('GPU')
if gpus:
# Create 2 virtual GPUs with 1GB memory each
try:
tf.... | |
d14048 | As @jasonharper pointed out, it's much easier to use a Scale in your case:
from tkinter import *
on_update = lambda e: print(e)
# |in pixels| |resolution| |the slider, pixels| |switch value display
s=Scale(command=on_update, length=250, to=1000, sliderlength=50, showvalue=False)
s.pac... | |
d14049 | I have the same problem. It seems that greendao is currently not able to do that. I am resorting to using queryRaw() instead. | |
d14050 | You need to run it with quotes and capital TRUE:
install.packages("rvest_0.3.5.tar.gz", dependencies = TRUE)
Note this will only work if you have unix-like system and the file is located in your current working directory (check with running getwd() from your R session). Otherwise you need to provide full path to the f... | |
d14051 | Create a button after your content divs and call function on this button
<input type="button" value="Next" onclick="ShowNextTab();" />
function ShowNextTab() {
if ($('.nav-tabs > .active').next('li').length == 0) //If you want to select first tab when last tab is reached
$('.nav-tabs > li').first().find('a')... | |
d14052 | Try DumpRenderTree - headless chrome which outputs a textual version of layout.
eg:
Content-Type: text/plain
layer at (0,0) size 808x820
RenderView at (0,0) size 800x600
layer at (0,0) size 800x820
RenderBlock {HTML} at (0,0) size 800x820
RenderBody {BODY} at (8,8) size 784x804
RenderHTMLCanvas {CANVAS} a... | |
d14053 | i was expecting simple error, i missed to add permission for read storage. it is working now. | |
d14054 | This is most likely an optimization feature of your compiler. For example, when I compiled your code using CL (MSVC compiler) without any optimization option, I got the following results:
But turning on fast code option, resulted in a more optimized memory usage:
Commands for disabled and fast code options of CL, res... | |
d14055 | It is mainly for performance and well as ease of use.
When you use an external library inside PHP using system() for e.g., then the pros are that you will be able to use ALL of its options, which will make you a power user. The cons are that, each time you run it, you have to do like a parsing of the return string and... | |
d14056 | Right click on Add Reference of your project and browse to your path of Msctf.dll
link (Register COM) : http://msdn.microsoft.com/en-us/library/ms859484.aspx | |
d14057 | Or you could try the FaceDetector class. Its available since API Level 1.
A: Try attach native libraries for OpenCV to your project and use OpenCVLoader.initDebug(); to initialization. | |
d14058 | Move the assignment of
string item;
item = "Empty space";
Before the while loop.
Right now, every time you loop you overwrite the item value.
Here's how the whole code would look after the change:
static void Main(string[] args)
{
bool isRunning = true;
string item = "Empty space";
while ... | |
d14059 | H"
end tell
end tell
set cellNumber to 2
tell application "Microsoft Excel"
activate
repeat
set fileName to get value of cell ("B" & cellNumber) as string
set fncount to count characters of fileName
if fncount is greater than 13 then
... | |
d14060 | If you are stuck with starting with the StringBuilder then I think you've pretty much worked out what you need to do.
I would make it a little cleaner like this though:
var prefix = "SELECT ";
var suffix = " From fruit_table";
var result =
String.Format("{0}{2}{1}",
prefix,
suffix,
String.Jo... | |
d14061 | with open("testfile.txt", "r") as r:
with open("testfile_new.txt", "w") as w:
w.write(r.read(.replace(' ' , '\n'))
A: Example:
with open("file1.txt", "r") as read_file:
with open("file2.txt", "w") as write_file:
write_file.write(read_file.read().replace(" ", '\n'))
Content of file1.txt:
15.9 ... | |
d14062 | The default settings for ffmpeg do not always provide a good quality output when you encode, but this depends on your output format and the available encoders. With your output ffmpeg will use the default of -b 200k or -b:v 200k.
However, you can tell ffmpeg to simply copy the input streams without re-encoding and this... | |
d14063 | I copied your code into an ionic stackblitz project and was unable to reproduce your issue.
https://stackblitz.com/edit/ionic-ojdypw
Maybe there is something there that can help you. | |
d14064 | Specifics of the solution might depend on the Prolog dialect. Here I am using SWI-Prolog. SWI-Prolog allows you to open a file with open(SrcDest, Mode, Stream), where SrcDest will be your file name, Mode is read/write/append/update, and Stream is the "file descriptor" the system will return. The manual clarifies differ... | |
d14065 | User is a reserved word and must be bracketed:
"select * from [User]" | |
d14066 | <FormControl variant="outlined" className={classes.formControl}>
<InputLabel id="uni">UNI</InputLabel>
<Select
key={value}
defaultValue={value}
labelId="uni"
id="uni"
name="uni"
onBlur={onChange}
label="uni"
>
{unis.map((u, i) => (
<MenuItem value={u.value} key={i... | |
d14067 | Put the Grid inside of a Viewbox and change the size of the Viewbox instead of the Grid.
<Viewbox>
<Grid Clip="M10,10 L10,150 L150,150 L150,10 Z" Width="200" Height="200">
<Rectangle Fill="Red"/>
</Grid>
</Viewbox>
A: An alternative approach to this is to define the clipping path using element rather ... | |
d14068 | use this to fix the problem.
Pattern p = Pattern.compile("\\bthis\\b");
Matcher m = p.matcher("Print this");
m.find();
System.out.println(m.group());
Output:
this | |
d14069 | switch (a) will compare the code of a. If you typed digits, it should be;
case '0':
num_0++;break;
case '1':
num_1++;break;
...
switch on character values not integers (int value of 0 is not 0, for example in ASCII it is 48, but let's not use the value directly, so it's fully portable)
Maybe ... | |
d14070 | I'm not sure what your intent is with the GlobalEnv, but this might be of help:
swapped = data.frame(t(xts))
ordered = swapped[with(swapped, order(Historical.VaR..95..)),]
result = subset(ordered, select=Historical.VaR..95..) | |
d14071 | I have opened a bug report with Apple now; will see what their answer is... | |
d14072 | You will need to create a service to keep track of the anwers, yes you are correct when the route changes answers array will be overwritten.
calculonApp.service('AnswerService', function() {
var answers = [];
this.addAnswers = function(questionId, a) {
answers.push({
'question':questionId,
... | |
d14073 | I have still to test it, but the copytruncate option of logrotate should do. | |
d14074 | You can do everything you want with altering CSS class :
To hide event title:
.fc-event-time {
display: none;
}
If you want to keep time of events but keep the same background between title and body, you should unset opacity:
.fc-event-vert .fc-event-bg {
opacity: 0;
}
A: Somewhere along the lines of 3665 inside... | |
d14075 | Maybe that's because in your catch you are stating that valid is true when it should be false to repeat the block. | |
d14076 | Internet Explorer is surely using the MSXML library. Set the TXmlDocument.DomVendor property to MSXML_DOM (found in the msxmldom unit), and you should get the same behavior. You can also change the DefaultDOMVendor global variable to SMSXML to make all new TXmlDocument objects use that vendor.
A: Have you already trie... | |
d14077 | I will rather fix the design issue as a permanent fix rather than wasting time on the workaround.
Firstly, NEVER store DATE as VARCHAR2. All this overhead is due to the fact that your design is flawed.
'20100231'
How on earth could that be a valid date? Which calendar has a 31 days in FEBRUARY?
Follow these steps:
... | |
d14078 | Standard Drupal will only allow you to specify the placement of blocks once. To achieve what you're after you'll need to look into using a contributed module like Context or Panels.
Personally used Context a fair bit in the past. It's pretty powerful but relatively simple to use.
A: This module allows you to create se... | |
d14079 | You have an unclosed div at the end of your block (which should be the closing tag), the browser closes it automatically, as well as the parent one. So two last lines:
</div>\n\
<div>'
should be:
</div>\n\
</div>'
A: Ok, I found it:
</div>\n\
<div>' <!-- this one was extraneous -->
}; | |
d14080 | You can check docs and comments for shared_task on github https://github.com/celery/celery/blob/9d49d90074445ff2c550585a055aa222151653aa/celery/app/init.py
I think for some reasons you do not run creating of celery app. It is better in this case use explicit app.
from .celery import app
@app.task()
def add(x, y):
r... | |
d14081 | I can't answer your question about why your processing is getting delayed, but regarding your question about getting faster input, try using Raw Input instead. That will allow the keyboard to send its own keystroke events directly to you so you do not have to wait for the OS to receive, interpret, and dispatch the key... | |
d14082 | Yes, in settings, tap ssl verification off
File > Settings > General > SSL Certificate Verification > off | |
d14083 | As far as i know ProFTPD does not contain its own users, but rather uses external resources to authenticate. That means that if you want to edit a user (or it's password) you need to edit whatever source ProFTPD authenticated that user against (i.e. /etc/passwd, PAM, LDAP, etc).
This, unfortunately for you, means that ... | |
d14084 | Are you sure you are getting data ? Your substr() must be returning empty strings.
You are adding a slash to your day and month and putting them back together in the wrong order. Just run your code with a fixed string:
$dob = 'dd/mm/yyyy';
$dd = substr($dob,0,2)."/";
$mm = substr($dob,3,2)."/";
$yyyy = substr($dob,6,4)... | |
d14085 | Maybe something like a runnable:
private Handler handler = new Handler();
handler.postAtTime(timeTask, SystemClock.uptimeMillis() + 500);
private Runnable timeTask = new Runnable() {
public void run() {
//do stuff here
//do it again soon
handler.postAtTime(timeTask, SystemClock.uptimeMill... | |
d14086 | I'm afraid at this very moment Google Wallet only notifies the user when the subscription is cancelled.
I asked the same myself on google wallet for digital goods forum :
https://groups.google.com/forum/?fromgroups=#!topic/in-app-payments/YFaCBDwaF9g
See the 2nd answer from Mihai Ionescu from Google
EDIT: As suggested... | |
d14087 | It should be enough to have spring-boot-starter-web dependency, this by default includes Tomcat. You might be missing the dependencies when running the application e.g. see that SpringBootServletInitializer is present and running.
Take a look at bazel-springboot-rule project and springboot.bzl
Packager which package S... | |
d14088 | Use CSVRecordReader with the label appended to the end of each row as an integer with 0 to 9.
Use convolutionalFlat as the setInputType at the bottom.
Example snippet:
.setInputType(InputType.convolutionalFlat(28,28,1))
.backprop(true).pretrain(false).build();
Whole code example for the neur... | |
d14089 | You can use window functions. For each product, you can identify groups of adjacent matching rows by counting the number of non-10s before that row. This identifies the groups.
select name, sum(case when sale = 10 then 1 else 0 end0 as cnt
from (select t.*,
sum(case when sale <> 10 then 1 else 0 end) ove... | |
d14090 | After much work and research, I discovered that the file I was trying to check the Content-Length tag on was chunked encoded which takes that tag away. The Apache server the files are hosted on automatically chunks .txt files that are too large. A workaround to this problem was to simply change the file extension from ... | |
d14091 | Question 1: I'm not sure why, but having multiple versions of R on your PATH can lead to unexpected situations like this. /usr/local/bin is usually ahead of /usr/bin in the PATH, so I would've expected R 3.6.3 to be found. Perhaps it has to do with Question 2.
Question 2: Some distros (like CentOS/RHEL) don't put /usr/... | |
d14092 | If you expect the number of duplicate keys to be small, just keep incrementing the iterator until the key value changes. If you expect the number of duplicate keys to be large, just use upper_bound to get an iterator to the element with the next key value. | |
d14093 | I was constructing the JSON from PHP, something like:
$data = $autoQuery->fetch_array();
$autoData = array('CARS' => $data['CARS'],
'MOTORS' => $data['MOTORS'],
'BOATS' => $data['BOATS']);
echo json_encode($autoData);
This wasn't working. When I put intval() before e... | |
d14094 | As loulou8284 mentioned you can put it in your XML, or if it is fixed, define it with Color.rgb(), but to make your code running you need to get the reference to your Context as your class is not declared inside a context-class:
convertView.setBackgroundColor(getContext().getResources().getColor(R.color.purple));
A: ... | |
d14095 | For each index i find the previous index prev[i] that has the same value (or -1 if there's no such index). It may be done in O(n) average by going left to right with hash_map, then the answer for range [l;r) of indices is number of elements i in range [l;r) such that their value is less then l (it require some thinking... | |
d14096 | What you need to do in your resize-callback is the following:
var $carouselContainer = $('#caroufredsel');
var resizeCallback = function() {
var showThatManyItems = 3; // determine the number of items to be shown depending on viewport size
$carouselContainer.trigger('configuration', [
'items', {
... | |
d14097 | adding 'fixed' class to the cover pages solves the problem | |
d14098 | How about this
$('#delete').click(function() {
var checked = $('.inbox_check:checked');
var ids = checked.map(function() {
return this.value; // why not store the message id in the value?
}).get().join(",");
if (ids) {
$.post(deleteUrl, {idsToDelete:ids}, function() {
checke... | |
d14099 | Figured it out. GiftedChat requires that you use one of its own methods called append.
const onSend = (msg) => {
console.log("msg : ", msg);
// first, make sure message is an object within an array
const message = [{
_id: msg[0]._id,
text: msg[0].text,
createdAt: new Date(),
user: {
_id: us... | |
d14100 | This is the Babel's (targeted only to IE 11) answer:
"use strict";
function _createForOfIteratorHelper(o, allowArrayLike) {
var it =
(typeof Symbol !== "undefined" && o[Symbol.iterator]) || o["@@iterator"];
if (!it) {
if (
Array.isArray(o) ||
(it = _unsupportedIterableToArray(o)) ||
(allo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.