Dataset Viewer
Auto-converted to Parquet Duplicate
qid
int64
1
74.7M
question
stringlengths
1
63.3k
date
stringdate
2008-08-01 00:00:00
2023-03-04 00:00:00
metadata
listlengths
3
3
response_j
stringlengths
3
51.9k
response_k
stringlengths
0
41.5k
541,600
As far as I understand, first-order arithmetic incorporates first-order logic. It is a fact that a first-order logic with at least two binary predicates is undecidable. Doesn't this imply immediately the undecidability of arithmetic?
2013/10/27
[ "https://math.stackexchange.com/questions/541600", "https://math.stackexchange.com", "https://math.stackexchange.com/users/31363/" ]
Suppose you have two binary predicates $R$ and $S$. If you add the axiom $(\forall x)(\forall y)[R(x,y) \land S(x,y)]$, the resulting theory is complete and decidable. Basically, with that axiom $R$ and $S$ are always true, so you can replace them with "True" and ignore all quantifiers. So, adding axioms to an undecid...
One can make an argument along those lines, by making "incorporates" precise enough. However, note that the first-order theory of algebraically closed fields of characteristic $0$ is decidable, as is the theory of real-closed fields.
47,289,543
I'm wrangling some data where we sort fails into bins and compute limited yields for each sort bin by lot. **I have a meta table that describes the sort bins.** *The rows are arranged in ascending test order and some of the sort labels come in with non-syntactic names.* ``` sort_tbl <- tibble::tribble(~weight, ~lab...
2017/11/14
[ "https://Stackoverflow.com/questions/47289543", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5767043/" ]
This problem becomes a bit easier if you think of it as "first replace all the NAs with 1, then replace all 1s after the first 0 with NA." Here are two approaches, one using matrix operations and one using dplyr. --- In the matrix approach, you'd extract the values as a numeric matrix, use `apply` to find the positi...
To generate the output table I have written the following function: ``` library(rlang) library(dplyr) fill_ones <- function(df, meta) { fail_labels <- meta[meta$weight == 0, ]$label last_val <- NULL for ( i in length(fail_labels):1) { if (is.null(last_val)) last_val <- df$pass else last_val <- eval_tidy...
1,485,592
Reference : [2nd question](http://www.placementexpress.com/collegepdf/amazon_mock_d.pdf) - . > > From a spherical ball of 10cm radius, how many complete cubes of 5cm > side can be extracted out, if sphere cannot be molten > > > What I have tried. > > * Volume of sphere = $\frac43 \pi 10^3$ > * volume of cub...
2015/10/18
[ "https://math.stackexchange.com/questions/1485592", "https://math.stackexchange.com", "https://math.stackexchange.com/users/82744/" ]
Here is a solution with $13$ cubes, $6$ of them colored blue: [![enter image description here](https://i.stack.imgur.com/uYRiN.jpg)](https://i.stack.imgur.com/uYRiN.jpg) According to my calculations the blue squares fit into a circle of radius $r\doteq6.44$, and $r^2+7.5^2\doteq 97.754<100$.
Your computation yields only an upper bound of $33.51\ldots$ (so actually of $33$), but that is by sheer volume (so "with melting"). As the suggested answer show, this bound seems to be *way* too big. Arranging $8$ cubes in a $2\times 2\times 2$ pattern produces a larger cube of side length $10$ and diameter $10\sqrt ...
4,483,734
```java long a = 1111; Long b = 1113; if (a == b) { System.out.println("Equals"); } else { System.out.println("not equals"); } ``` The above code prints `"equals"`, which is wrong. How do I check whether a `long` value equals a `Long` value?
2010/12/19
[ "https://Stackoverflow.com/questions/4483734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/526073/" ]
You can use the `equals` method to compare `Object` values. **Mismatch example**: ```java Long first = 12345L, second = 123L; System.out.println(first.equals(second)); ``` This returns `false`. **Match example**: ```java Long first = 12345L, second = 12345L; System.out.println(first.equals(second)); ``` This re...
**First option:** ```java public static void main(String[] args) { long a = 1111; Long b = 1113L; if (a == b.longValue()) { System.out.println("Equals"); } else { System.out.println("not equals"); } } ``` **Second option:** ```java public s...
53,784,816
I am trying to make a web page that allows the user to draw lines in an SVG image. The drawing part is fine, but each line needs to carry a label that fills the width of the line (the lines are 15px wide). I have tried to use a `<textpath>` referencing the line they drew, but the baseline of the label ends up running ...
2018/12/14
[ "https://Stackoverflow.com/questions/53784816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10790722/" ]
I understand that the *lines need to carry a label that fills the width of the line (the lines are 15px wide)*. In order to move the text I use `dy="4"` ```css text{fill:white;stroke:none;font-family:consolas;} path{stroke-width:15px;fill:none;} ``` ```html <svg viewBox="50 150 350 150"> <defs> <path id="path" d="...
You can use the [`dy`](https://www.w3.org/TR/SVG11/text.html#TextElementDYAttribute) attribute to move glyphs in a string - either individually or together - in a vertical direction relative to their orientation. The spec chapter on [`<tspan>`](https://www.w3.org/TR/SVG11/text.html#TSpanElement) elements has a lot of ...
41,100,766
I want to map ranges of float to strings. In details I would like to convert the degree direction of wind for example, in the corresponding string with the cardinal direction: 220 -> SW It is possible to create a computed property declared of type `Float` with the custom `get` declaration in order to return the corres...
2016/12/12
[ "https://Stackoverflow.com/questions/41100766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2064585/" ]
As far as I know this is impossible. A computed property is still a property which can only be of a single type. That said, perhaps you'd be better by having your own type for this: ``` struct WindDirection { var degrees: Float var stringValue: String { get { // compute the correct string ...
Don't do this! Do not do this!! Never ever ever do this. I don't have the words to explain how bad of an idea this is. ``` private var _windDirection: Float? var windDirection: Any? { get { guard let windDirection = _windDirection else { return nil } switch windDirection { ...
18,081,048
I am writing results i return from stored procedure into json. I did it but i am not sure if there is a simpler cleaner way other than what i have. Also how can i check that it really wrote to json? ``` var results = mySvc.GetInfo("Environment"); StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWri...
2013/08/06
[ "https://Stackoverflow.com/questions/18081048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/743308/" ]
Install [Json.NET](http://james.newtonking.com/projects/json-net.aspx) and you simply do this: ``` var results = mySvc.GetInfo("Environment"); var json = JsonConvert.SerializeObject(results); ``` The inverse: ``` var results = JsonConvert.DeserializeObject<Result>(json); ```
try this ``` var results = mySvc.GetInfo("Environment"); var js = new System.Web.Script.Serialization.JavaScriptSerializer(); var jsonObj = js.Serialize(results); ```
15,773,139
I am having problems with exec and shell\_exec i have looked at every post on here and cant seem to find the problem. the code i am using : ``` chdir('/'); $handle = shell_exec("/usr/bin/php /home/donor/public_html/batch/testlaunch.php 2>&1"); echo $handle .":". gettype($handle) . "\n"; $read = fread($handle, 2096); e...
2013/04/02
[ "https://Stackoverflow.com/questions/15773139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1697918/" ]
Try passthru intead, that way there aren't any limits on the execution if it takes a while: ``` <?php passthru("/usr/bin/php /home/donor/public_html/batch/testlaunch.php 2>&1",$pass_result); echo $pass_result; ?> ``` or this: ``` <?php passthru("/usr/bin/php /home/donor/public_html/batch/testlaunch.php",$pas...
Try adding your webserver user to a group with rw permissions to the batch directory. Either as root or using sudo: ``` usermod -G groupname username ``` then on the batch directory: ``` chmod -R g+w batch ```
9,632,152
I want to have a data structure of following type in c++. ``` map<string,pair<string,vector>>. ``` Any Suggestions?
2012/03/09
[ "https://Stackoverflow.com/questions/9632152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/788711/" ]
``` map<string,pair<string,vector>> ``` No. You cannot have a data structure like that. The reason is : `vector` is a class template, which means it requires you to pass *type* as template argument to it. If you do that, then you can most certainly have a data structure like this: ``` map<string,pair<string,vector...
Yes you can ``` std::vector<string>cache_entry std::tr1::unordered_map<string,cache_entry> ```
21,520,026
I dont know how to fixe this error ``` Warning: preg_match(): Unknown modifier '[' in ``` my code is ``` while(list($k,$v)=each($con2)) { $patt="($this->block_start_word|$this->block_end_word)[[:blank:]]*([0-9a-zA-Z\_]+)[[:blank:]]*$this->block_end_delim(.*)"; if (eregi($patt,$v,$res)) { ``` I want to ...
2014/02/03
[ "https://Stackoverflow.com/questions/21520026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3264544/" ]
As you can see in this answer preg\_match treats the first character as a delimiter [How to change PHP's eregi to preg\_match](https://stackoverflow.com/questions/1374881/how-to-change-phps-eregi-to-preg-match) Specifically you get the error because preg\_match uses '(' as the delimiter and thus ends the pattern after...
OK, let's go over this regex: `"($this->block_start_word|$this->block_end_word)[[:blank:]]*([0-9a-zA-Z\_]+)[[:blank:]]*$this->block_end_delim(.*)"` I presume you want: * either the literal string `$this->block_start_word` or `$this->block_end_word` * followed by 0 or more blankspace characters * followed by 1 or mor...
31,760,269
I installed XAMPP-Win32-5.6.11-0-VC11. In phpinfo() I can see that : PHP Version : 5.6.11 PHP Extension Build : API20131226,TS,VC11 Apache Version : Apache/2.4.12 (Win32) OpenSSL/1.0.1m PHP/5.6.11 I downloaded PHP mongo drivers from here : [Drivers](https://s3.amazonaws.com/drivers.mongodb.org/php/index.html) The ...
2015/08/01
[ "https://Stackoverflow.com/questions/31760269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3050006/" ]
The problem is you create a new array everytime the `".addtocart button"` is clicked. Just declare your array outside the click handler and it should work. ``` $(document).ready(function () { var offerIdArray = []; // <-- $(".addtocart button").click(function () { var offerId = $(this).attr(...
Move offerIdArray outside the function. Right now it's a local variable. So you're recreating it every time you call that function. You need a global variable. I hope that helps.
63,087,070
I have my controller code like this: ``` system("PGUSER=#{ENV["DATABASE_USER"]} PGPASSWORD=#{ENV["DATABASE_PASSWORD"]} pg_dump db_name_#{ENV["RAILS_ENV"]} > /location/db_name_#{@backup.name}.dump") ``` When I run it in rails console in production its ok and dump is right, but when it called from controller dump crea...
2020/07/25
[ "https://Stackoverflow.com/questions/63087070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13012132/" ]
Second test is actually failing because you are working with string's. You'r algorithm will find minimum number 0 put it in front and therefore it create's following string: "029917" but since you are testing against a string with value "29917" test will fail. Your obtained number is lowest number you can get from prov...
Really, the question is : What makes that an edge case ? What are the general features of this specific example that we need to address ? For example, an initial reaction might be "well, we're putting the zero up front, so resulting in a number with a smaller number of digits ...... so, solution is : check if we're mo...
25,101,619
I am writing a script in Python for login to ssh and read the output of commands just executed. I am using paramiko package for this. I am trying to execute command "top" and get its output printed on the console. However, I am not able to do this. Please find the snippet: ``` import sys import time import select impo...
2014/08/03
[ "https://Stackoverflow.com/questions/25101619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2568204/" ]
as [Jason S](https://stackoverflow.com/a/25101714/1729555) pointed out ``` stdin, stdout, stderr = ssh.exec_command("top -b -n1") print stdout.read() ``` works just fine.
`top` normally uses curses for display rather than just printing. Try the `-b` for batch option along with the `-n 1` you have (top options vary by platform, check the manpage). And in the future, try isolating the problem more - if you were to invoke `top` via `ssh` on the command line without your script you would st...
18,073
I'm trying to develop on my old netbook but the emulator never completely loads. It keeps working and sometimes it freezes but then it doesn't finish booting. I'm not really skilled in Android development and I would like to know if I can tweak the emulator to require less computational power. I'm learning new stuff s...
2012/01/09
[ "https://android.stackexchange.com/questions/18073", "https://android.stackexchange.com", "https://android.stackexchange.com/users/11444/" ]
I would say the simple answer is no. The emulator performs fairly poorly on high-end computers, so even if you got it to start up the performance would be beyond horrible.
There is a minimum possible processor speed for Android to run correctly. If you don't get that speed, part of the system thinks another part has crashed (it gives it about 5 seconds to finish initialising and panics if it doesn't) and terminates it, which leaves the system in an unusable state. On the emulator, proces...
14,435,429
I am dynamically loading data in the input type text and triggering alert if the value of the text box is changed. But my code does not seem to work. Please provide suggestions. visit this page for code: <http://jsfiddle.net/NbGBj/103/> ``` I want the alert to be shown when the page is loaded ```
2013/01/21
[ "https://Stackoverflow.com/questions/14435429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1177966/" ]
You should remove your `"` around `document` ``` $("document").ready(function(){ ... ``` should be ``` $(document).ready(function(){ ... ``` or use the shortcut ``` $(function(){ ... ``` From the official documentation: > > All three of the following syntaxes are equivalent: > > > > ``` > - $(document).re...
You can just fire the change function directly after you set the value in the text box like this: ``` .... $("#upload").val("sample"); $("#upload").change(); .... ```
103,385
> > **Possible Duplicate:** > > [How do I change the default session for when using auto-logins?](https://askubuntu.com/questions/62833/how-do-i-change-the-default-session-for-when-using-auto-logins) > > > Every time I restart my computer it auto-logs me into the Unity desktop, is there some way to make Gnome ...
2012/02/11
[ "https://askubuntu.com/questions/103385", "https://askubuntu.com", "https://askubuntu.com/users/45990/" ]
To make Ubuntu 11.10 auto log-in gnome-shell, open up a terminal window and run this command: ``` sudo /usr/lib/lightdm/lightdm-set-defaults -s gnome-shell ``` If you want to change back to Unity, run: ``` sudo /usr/lib/lightdm/lightdm-set-defaults -s ubuntu ```
`gksu gedit /etc/lightdm/lightdm.conf` and you will see something similar to ``` [SeatDefaults] user-session=xubuntu ``` just change the session and save
1,337,413
I'm using S#arp Architecture (which uses NHibernate). I have some entities mapped to tables in one database and others mapped to a different database. Disclosure: Databases already exist so i can't do model first. How do I configure this to work? EDIT: Would the SchemaIs method in Fluent NHibernate be the recommended...
2009/08/26
[ "https://Stackoverflow.com/questions/1337413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8088/" ]
You should use NHibernateSession.AddConfiguration instead for additional database. The call to NHibernateSession.AddConfiguration goes immediately under NHibernateSession.Init(). An explicit session factory key will have to be defined for the second initialization. The whole process is explained here in detail. <ht...
The way I have done this is to initialise multiple NHibernateSessions in InitializeNHibernateSession within global.asax.cs using multiple nhibernate config files. I then used [Transaction("nhibernate.dbname")] (dbname being names assigned to WebSessionStorages) in the controllers against each appropriate action method.
7,136,597
I'm trying to work on a demonstration about multithreading. I need an example of a computationally-intensive function/method. But at the same time, the code that does the computing should be simple. For example, I'm looking for a function that maybe does something like calculate the nth digit of pi or e: ``` function...
2011/08/21
[ "https://Stackoverflow.com/questions/7136597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/875736/" ]
How about a little perl magic? The `++` operator will work even on strings, and `0000` will magically turn into `0001`. Now, we can't modify `$1` since it is readonly, but we can use an intermediate variable. ``` use strict; use warnings; my $string = "xg0000"; $string =~ s/(\d+)/my $x=$1; ++$x/e; ``` Update: I ...
This is a really bad task to solve with a regexp. Increasing a number can change an unlimited number of digits, and can in fact also change the number of non-zero digits! Unless you have sworn an oath to use only regexes for a year, use regex to extract the number and then `sprintf "%06d" $x+1` to regenerate the new nu...
70,960,504
I'm using RStudio to perform some analysis. I have this data frame: | Residue | Energy | Model | | --- | --- | --- | | R-A-40 | -3.45 | DELTA | | R-A-350 | -1.89 | DELTA | | R-B-468 | -0.25 | DELTA | | R-C-490 | -2.67 | DELTA | | R-A-610 | -1.98 | DELTA | I would like to filter the first column ("Residue") based on ...
2022/02/02
[ "https://Stackoverflow.com/questions/70960504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12097238/" ]
An approach using `stringr`s `str_extract` ``` library(stringr) val <- as.numeric(str_extract(df$Residue, "[[:digit:]]+")) df[val > 300 & val < 500,] Residue Energy Model 2 R-A-350 -1.89 DELTA 3 R-B-468 -0.25 DELTA 4 R-C-490 -2.67 DELTA ``` #### Data ``` df <- structure(list(Residue = c("R-A-40", "R-A-350", ...
``` # convert character to integer df$x <- as.integer(substr(df$Residue, 5, nchar(df$Residue))) # subset df[df$x %between% c(300,500), ] ```
10,155,901
AdMob has been working in my Android app for a while now until recently when I tried to update. I tried to update the app itself but I saw that it kept crashing. I tried debugging what happened. The app seems to work once I removed the ads. I've now published the app without any ads and it works fine. Any reasons why ...
2012/04/14
[ "https://Stackoverflow.com/questions/10155901", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1279899/" ]
Make sure your jar files are checked in Properties --> Java Build Path --> Order and Export.
You didn't post error so I am just guessing, admob had a bug on android os 2.1+, and I had a admob crashing issue, I found a suggestion to not calling adview.destroy on OnDestroy because it causes crashing. If you have adview.destroy() on your onDestroy override, just remark it and try. ``` @Override protected vo...
1,241,860
I think that $\lim\limits\_{x\to \infty }\frac{1}{x}\int \_0^x\cos\left(t\right)dt\:$ is divergent, I can prove with taylor series?
2015/04/19
[ "https://math.stackexchange.com/questions/1241860", "https://math.stackexchange.com", "https://math.stackexchange.com/users/227060/" ]
It can't be, since $\lvert \cos{t} \rvert<1$, so the integral is bounded between $x$ and $-x$. It could oscillate, but not diverge. However, $$ \frac{1}{x}\int\_{0}^{x} \cos{x} \, dx = \frac{1}{x} (\sin{x}-\sin{0}) = \frac{\sin{x}}{x}, $$ which tends to $0$ since it is absolutely bounded by $1/x$, which tends to $0$.
Note that $$\int\_0^x \cos(t)dt=\sin(x)$$ Hence, we have $$\lim\_{x \to \infty} \dfrac{\displaystyle \int\_0^x \cos(t)dt}x = \lim\_{x \to \infty} \dfrac{\sin(x)}x = 0$$ since $\dfrac{\sin(x)}x \in \left[-\dfrac1x,\dfrac1x\right]$.
58,845,700
I'm trying to gather max and min temperature of a particular station and then finding the sum of temperature per different day but i keep getting an error in the mapper and Have tried a lot of other ways such as use stringtokenizer but same thing, i get an error. Sample Input. Station Date(YYYYMMDD) element temperatu...
2019/11/13
[ "https://Stackoverflow.com/questions/58845700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7966331/" ]
I was getting my list repeated in ASP.net core as in custom model I put `[key]` so using `modelBuilder.Entity<ProductByKeyword>().HasNoKey();` resolved my issue.
I was able to resolve it, here is what I did. 1. changed the code back to the old way and saved it. 2. cleaned solution, and build again. 3. changed the code to the 3.0 version. 4. cleaned solution, and build again. And now I don't get any errors anymore about adding migration.
62,613,822
I have a date column in below varchar format. How to convert it to datetime format and replace the time as 00:00:00? ``` Dateformats (varchar) 2011-08-01 00:00:00 2000-11-16 07:39:44 2020-06-06 07:51:42.644 2020-05-26 06:55:38.08 ``` Expected result ``` Dateformats (datetime) 2011-08-01 00:00:00.000 2000-11-16 00:0...
2020/06/27
[ "https://Stackoverflow.com/questions/62613822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13419711/" ]
here some example: ```js const App =()=>{ const [state,setState] = React.useState({bgColor:"",textColor:"",color:"white",backgroundColor:"red"}); const handleChange = (e)=>{ const {target} = e setState(current =>({...current,[target.name]:target.value})) } const onSubmit = (e)=>{ e.preventDefault(); if(state.bgColor....
Two places you can wire with `onSubmit`, 1. wire it with a button directly ``` <button onClick={onSubmit} /> ``` 2. wire it with form ``` <form onSubmit={onSubmit}> <button type="submit" /> </form> ``` Your function needs to look like ``` const onSubmit = (e) => { // do something. here } ``` In your ...
40,987,063
I am trying to declare typechecking on a React component such that the children of the component can be one or more of certain types. I followed the React documentation [here](https://facebook.github.io/react/docs/typechecking-with-proptypes.html) and declared the expected propType to be an array of union of types bu...
2016/12/06
[ "https://Stackoverflow.com/questions/40987063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1298871/" ]
You're changing the `bounds` and the `transform` of your `UISlider` and are using Auto-Layout at the same time so it can be a little confusing. I suggest you don't modify the `bounds` but use Auto-Layout instead. You should set the slider width to its superview height, and center the slider inside its superview. This ...
*(as of July 7, 2017)* ``` self.customSlider = [[UISlider alloc] init]]; self.customView = [[UIView alloc] init]; //create the custom auto layout constraints that you wish the UIView to have [self.view addSubview:self.customView]; [self.customView addSubview:self.customSlider]; self.slider.transform = CGAffineTransf...
13,458,499
I am trying to POST JSON to a Node app, which will simply return it via a GET. Client side, I generate a JSON string of the model, and POST it to the server: ``` $.post(serverURL, ko.mapping.toJS(viewModel), function(data) {}, "json"); ``` This yields a string that looks like: ``` {"switches":[{"id":1,"name":"Livin...
2012/11/19
[ "https://Stackoverflow.com/questions/13458499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/151794/" ]
I see a couple of issues: Your `post` call is not telling the server what kind of data you're sending. In particular, the last argument to [`post`](http://api.jquery.com/jQuery.post/) (`dataType`, for which you're supplying `'post'`) is **not** the format of the data you're sending ***to*** the server, it's the format...
I had the same problem I think, and got around it by calling JSON.stringify on the request body. If anybody has a more proper solution I'd like to hear it, because this seems a bit weird. But OTOH it works 8P. My controller produced these logs: ``` ------ req.body here ---------- [ { name: 'My Watchlist', stocks...
13,837,023
I am using the below code to show the date difference in Day:Hour:Minute format. ``` Function TimeSpan(dt1, dt2) Dim seconds,minutes,hours,days If (isDate(dt1) And IsDate(dt2)) = false Then TimeSpan = "00:00:00" Exit Function End If seconds = Abs(DateDiff("S", dt1, dt2)) m...
2012/12/12
[ "https://Stackoverflow.com/questions/13837023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2767755/" ]
Take a look at this sample from an open source project for notification which does what you need <http://code.google.com/p/tridion-notification-framework/source/browse/NotificationService/NotificationService/CoreService/Client.cs> Here is the working line which impersonates ``` public static SessionAwareCoreServiceC...
You are connecting to an old Core Service wsHttp endpoint. If you are using the 2011 SP1 client, you need to connect to the following endpoint instead: `http://hostname/webservices/CoreService2011.svc/wsHttp`
59,518,949
I want to set up my MFA profile credentials(i.e AceessKeyId, SecrectAccessKey, SessionToken) in `~/.aws/credentials` file. Is there any shell command to do this thing? For example: if I execute `aws configure set default.aws_secret_access_key 'myaccesskey'` then credentials file is getting updated with this given acce...
2019/12/29
[ "https://Stackoverflow.com/questions/59518949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5822768/" ]
you can pass the profile to the `aws configure` command using `--profile` argument. ``` aws configure set aws_secret_access_key 'myaccesskey' --profile mfa ``` Reference: <https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html>
I use [this](https://github.com/broamski/aws-mfa) aws-mfa project. This is a super easy python project for this exact kind of thing. **Usage Example:** Using command line arguments: ``` aws-mfa --duration 1800 --device arn:aws:iam::123456788990:mfa/dudeman INFO - Using profile: default INFO - Your credentials have e...
15,265
From my microarray data I have selected three subsets of probes. I would like to display these subsets as a Euler diagram to visualize the overlaps, but am struggling with inputting the combinations into Eulerr. All three subsets need to be nested within the full set of probes; one subset is fully contained within anot...
2021/01/25
[ "https://bioinformatics.stackexchange.com/questions/15265", "https://bioinformatics.stackexchange.com", "https://bioinformatics.stackexchange.com/users/3505/" ]
Since you are in R, consider using the UpsetR library. It doesn't make Venn diagrams but it helps to visualize overlaps between any number of groups. [http://gehlenborglab.org/research/projects/upsetr/#:~:text=UpSetR%20is%20an%20R%20package,based%20on%20groupings%20and%20queries](http://gehlenborglab.org/research/proj...
You might consider different ways of using the `venneuler` package. I'm not super thrilled with its usability (or with the accuracy of the overlaps), but you can get it to make custom Venn diagrams. [Here](https://stat.ethz.ch/pipermail/r-help/2010-May/239639.html) is a thread with some suggestions along these lines. ...
1,270,549
These are *known definitions*: We have a probability space $(\Omega, A, P)$ Conditional probability is defined through $P(A|B) = \frac{P(A \cap B)}{P(B)}, P(B) > 0$. This is a **real nunmber**. Then also where is conditional expectation $E[X|A\_0]$ with $A\_0$ being some subalgebra. This is a random variable. In the ...
2015/05/06
[ "https://math.stackexchange.com/questions/1270549", "https://math.stackexchange.com", "https://math.stackexchange.com/users/229652/" ]
Let $X, Y$ be random variable, then the condition expectation is given by $$ E(Y|X=x)=\int\_{Y}yf\_{Y|X=x}(x,y)dy=\int\_{Y}y\frac{f\_{X,Y}(x,y)}{f\_{X}(x)}dy=\int\_{y\in Y}y\frac{f\_{X,Y}(x,y)}{\int\_{t\in Y}f\_{X,Y}(x,t)dt}dy $$ where $x$ is any element in $X$. Therefore $E(Y|X=x)$ is function of $x$. Here the inner t...
It is true that *if* $X$ *is an indicator of* $A$, then the expected value happens of $X$ is the probability of $Z \in A$ (and this is true regardless of whether one conditions on $Y$). But that is not equivalent to saying that the definition of (conditional) expected value is equal to the definition of (conditional) p...
23,094,607
I am working on two different applications. I am calling Application 2 process (.exe file ) in Application 1 Solution. When Application 2 throws an “Invalid Username and Password” error I want to catch that error exception in Application 1 solution. Is there a way to capture error in one application in other applicat...
2014/04/15
[ "https://Stackoverflow.com/questions/23094607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3537759/" ]
You cannot throw-catch between process boundaries. You have to use an inter-process communication technique. There are many of them to choose from depending on your situation. Here is a list of some options... 1. File: Process A writes to a log file that process B is listening to. Very easy to implement. 2. Named pip...
Adding on to Jordan's Solution, you can read the console out stream of Application2. Ref: [http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput(v=vs.110).aspx](http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput%28v=vs.110%29....
55,096,099
[![enter image description here](https://i.stack.imgur.com/9qTE1.png)](https://i.stack.imgur.com/9qTE1.png) I have a table view cell in which I am using an action sheet to change the language of the app. After the action has happened I want to change the displayed language title. How can I access that cell? Can I use ...
2019/03/11
[ "https://Stackoverflow.com/questions/55096099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10720831/" ]
The above two syntax are totally different, In one the actual sub-document(children ) is stored in the parent document, but in the other one, a new document is stored in the children collection and only its reference is stored in the parent document. **Case 1:** ``` var childSchema = new Schema({ name: 'string' }); ...
Difference is pretty simple. The **former one where you are just defining schema** for child **won't create a separate collection** for the children in the database instead you will embed the whole child document in the parent. And in the **later one you are defining a model** for the child schema by calling mongoose....
1,429,131
The given vectors are $v = (3,0,1)$ and $u = (3,1,0)$. I have used the following formula and plugged in what I have been given using vector $v$ as the variables for $i,j,k$ and vector $u$ for $x\_0,y\_0,z\_0$ and have worked out the solution as follows: $$3(x-3) - 1(y-1) + 1(z-0) = 0$$ ultimately having $3x - y - 8 = ...
2015/09/10
[ "https://math.stackexchange.com/questions/1429131", "https://math.stackexchange.com", "https://math.stackexchange.com/users/261895/" ]
The plane perpendicular to $(a,b,c)$ and passing through $(x\_0,y\_0,z\_0)$ is $$a(x-x\_0)+b(y-y\_0)+c(z-z\_0)=0\ .$$ For your vectors, $$3(x-3)+0(y-1)+1(z-0)=0$$ which simplifies to $$3x+z-9=0\ .$$
Based on David's answer, the concept behind this formula is the following picture: [![enter image description here](https://i.stack.imgur.com/sXI5P.png)](https://i.stack.imgur.com/sXI5P.png) Since $\hat{n}$ is orthogonal to the plane, we have $$\begin{bmatrix}a\\b\\c \end{bmatrix}^T\begin{bmatrix}x-x\_0\\y-y\_0\\z-...
47,765,691
I am developing an app and add the room for database but it shows the error is > > java.lang.RuntimeException: Unable to start activity > ComponentInfo{com.app.android/com.app.android.activities.AttendanceActivity}: > java.lang.RuntimeException: cannot find implementation for > com.app.android.db.AppDatabase. App...
2017/12/12
[ "https://Stackoverflow.com/questions/47765691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8506315/" ]
I have added `@Database(entities = {Class_.class}, version = 1)` in AppDatabase.java . The @Database annotation for your database class, and @Entity for your entity. I have given as correct. Then the issue solved.
I faced the same problem even after adding correct dependency in my `build.gradle` of my **app** module. My problem was ,I have used different module for separating database layer and **I have moved my dependency to `build.gradle` of corresponding module solved my problem**. Hope this will helpful to someone else !!...
59,385,907
I created a site (<https://www.dsobolew.me/>) using blogdown and the Academic hugo theme. I want to remove the Academic and Demos sections on the main page so the first thing that appears is the Biography section. I see the markdown sections for each in the content/home folder. I expected to see a way to change the mai...
2019/12/18
[ "https://Stackoverflow.com/questions/59385907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6732244/" ]
Duh. There is a setting in each md file within content/home that can be set = false.
Also for other people interested in that question: They changed it in the meantime. Yes, the md files are under content/home but you have to add the option "active" now yourself (in an old version I used, the active option was already in the file). So for example you take projects.md and just add the line: active: fa...
166,542
Why do the **"Copy to"** and **"Move to"** context menu options in Nautilus only include **"Home"** and **"Desktop"** as options? Is there a way to add other places and even mounted external devices as options?
2012/07/21
[ "https://askubuntu.com/questions/166542", "https://askubuntu.com", "https://askubuntu.com/users/74307/" ]
10.04 to 11.04 ============== You could also try editing the file `/usr/share/nautilus/ui/nautilus-directory-view-ui.xml` which has the entries for the Move To menu. Note there are two copies of the Move To menu in that file and I think you would have to edit both.
10.04 to 11.04 ============== This already exists in 10.04 from what I can tell. When I navigate to Documents in Nautilus I have a Copy to and Move to context menu which allows me to choose Desktop, Home and other. If not you could use something like Nautilus Actions Configuration (`sudo apt-get install nautilus-acti...
69,231
I've just started reading [Foundation](http://en.wikipedia.org/wiki/Foundation_(novel)) and Gaal Dornick has landed on Trantor for the first time and notices that: > > The air seemed thicker here, the gravity a bit greater, than on his > home planet of Synnax... > > > This prompted me to wonder, **what is the hig...
2014/10/07
[ "https://scifi.stackexchange.com/questions/69231", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/12830/" ]
Not as much gravity as a neutron star, but Iain M Banks's [The Algebraist](http://en.wikipedia.org/wiki/The_Algebraist) features a race called the Dwellers who float around inside of gas giants throughout the galaxy. ZanLynx mentioned in the comments the Hades Matrix from Alastair Reynolds's [Revelation Space](http://...
Stephen Baxters Flux tells a story about a "human" civilization living on a neutron star. Not really humans, but made by humans to be able to live on the neutron star.
34,175,393
I am working with beacons and want to display all the registered beacons on a same web page by making the `request` in python. I am confused, After setting up the scope of OAuth2, how to send the `request` or `discovery.build()` to get list of all the requests. I am setting up the scope by this: ``` @portal.route('/...
2015/12/09
[ "https://Stackoverflow.com/questions/34175393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3889771/" ]
Restarting Xcode fixed the issue for me. The folder those warnings reference is a per-user temporary file/folder cache. If restarting Xcode doesn't fix the issue, I'd suggest restarting OSX.
Depending on what you want, you can opt to not sign your software (for e.g. local builds, simply playing around). Select your project in the tree view (item at the top), then in the main window, select "Build Settings", navigate to the section "Code Signing", which is where the error occurs ("code signing entitlements...
45,240,412
```js function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } function init(){ var resArr = []; for (var i = 0; i < 10; i++) { var obj = new Object(); obj.q = getRandomInt(3,5); obj.r = getRandomInt(1,10); resArr.push(obj); } var str = '<tab...
2017/07/21
[ "https://Stackoverflow.com/questions/45240412", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8293819/" ]
I created a function simply to check for duplicate objects in the array ```js function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } function checkDuplicate(arr, obj) { for (var i = 0; i < arr.length; i++) { if (arr[i].q == obj.q && arr[i].r == obj.r) { retur...
Try with [`Array#filter()`](https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwi_m5Cuz5rVAhVKjZQKHcWTCA0QFggoMAE&url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FJavaScript%2FReference%2FGlobal_Objects%2FArray%2Ffilter&usg=AFQjCNHTybPLK3GeAl_0DVx-FLbAD2mWtw) method...
11,971,651
I have a generic type that I am injecting into a service. Because of the way generics are implemented in Java, I need to have a constructor arg (or property setter) that holds the Class information of the generic type parameter. My question is -- Can I, via property injection or specifying a constructor arg, pass in a...
2012/08/15
[ "https://Stackoverflow.com/questions/11971651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834607/" ]
Try: ``` <bean id="dataMartService" class="com.someClass"> <constructor-arg> <value type="java.lang.Class">someotherclass</value> </constructor-arg> </bean> ```
Use spring el: ``` <constructor-arg value="#{ T(java.lang.Math) }" /> ``` (you'll need spring 3.0 for this) That being said, if you pass a string into an argument where a class is expected during a property set, spring should automatically convert it, though i'm not sure how this works when matching constructors. T...
49,237,334
I installed material-ui "^1.0.0-beta.36". The documentation says there's date-picker. But I can't find it in `node_modules\material-ui` , nor in any of the subfolders. The change log suggests that a datepicker is planned to be supported in future releases: > > 1.0.0-beta.17 - *Oct 16, 2017* > > > As this garbage...
2018/03/12
[ "https://Stackoverflow.com/questions/49237334", "https://Stackoverflow.com", "https://Stackoverflow.com/users/690954/" ]
Material-ui v1 currently provides several date pickers. However, there's no specific `DatePicker` component. Instead, you use the `type` prop of the `TextField` component to specify that you want a date picker rather than your typical text input. Here's an example that will give you a classic date picker: ``` import ...
``` import TextField from 'material-ui/TextField'; <TextField id="date" label="Birthday" type="date" defaultValue="2017-05-24" className={classes.textField} InputLabelProps={{ shrink: true, }} /> ```
66,142,536
I'm unable to find out how to get the api key out of an apigateway key. I can get its ID and its ARN but not the value. I know you can specify the value when creating the key, but not how to retrieve it once created--short of logging into the AWS GUI and finding it that way. I've looked at the documentation for aws-ap...
2021/02/10
[ "https://Stackoverflow.com/questions/66142536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7902967/" ]
We can't retrieve the auto generated key via cdk/cloudformation without a custom resource. But we can generate the key , store it in a secret manager or an ssm secret and use that to create api key. ``` const secret = new secretsmanager.Secret(this, 'Secret', { generateSecretString: { generateStringKey: 'a...
I'm going to use <https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SecretsManager.html#getRandomPassword-property> to generate the 20 characters and set the API key. Since nothing outside of my stack needs the key I'm ok with regenerating it and updating my resources every time I do a deploy. However if there ar...
58,108,019
I have a cell that sums up a decimal count of minutes - for example "105", as in 105 minutes (decimal value). All I wish to do is convert this decimal value to a duration-formatted value which includes hours, minutes, and seconds. So the result I am looking for is a cell which has the following value: "01:45:00" and...
2019/09/26
[ "https://Stackoverflow.com/questions/58108019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9561506/" ]
try like this: ``` =TEXT(A1/1440, "hh:mm:ss") ``` [![0](https://i.stack.imgur.com/5Io2E.png)](https://i.stack.imgur.com/5Io2E.png) --- ``` =ARRAYFORMULA(IF(A1:A<>"", TEXT(A1:A/1440, "hh:mm:ss"), )) ``` [![0](https://i.stack.imgur.com/AIGS1.png)](https://i.stack.imgur.com/AIGS1.png) --- however **true duration*...
The `TIME( hour, minute, second )` function will work for this. The function allows values outside the usual `0-23` (h), `0-60` (m), `0-60` (s) range by recalculating other components accordingly, so `=TIME( 0, 120, 0 )` is equivalent to `=TIME( 2, 0, 0 )`. In your case: ``` =TIME( 0, A1, 0 ) ``` ...then select the...
14,082,881
I've created two android library projects with shared code and resources for 3 apps. One of the libraries (I'll call it library A) has code and resources that are shared by all 3 apps and the other has code and resources that are shared only by two of the three (let's call it library B). So I made library B depend on ...
2012/12/29
[ "https://Stackoverflow.com/questions/14082881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473181/" ]
The problem turned out to be that the AndroidManifest.xml in both library projects had the same default package ``` <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.testlib" ``` this caused problems when generating R.java. So to fix the issue I just had to change the defa...
In BActivity you are calling `super.onCreate(savedInstanceState);` After this following in AActivity is called ``` super.onCreate(savedInstanceState); doStuff(); ``` doStuff(); is overrided by BActivity so Button b = (Button) findViewById(R.id.button1); is called, but setContentView(R.layout.activity\_main\_b); sti...
39,534,902
I upgraded my Sprite Kit game to X-Code 8.0 and Swift 3 yesterday. Deployment target is currently set to iOS 9.3. I play sound effects the following way: ``` self.run(SKAction.playSoundFileNamed("click.caf", waitForCompletion: false)) ``` The sound effect is not played correctly (only about the half of the samples)...
2016/09/16
[ "https://Stackoverflow.com/questions/39534902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1198474/" ]
The problem disappeared when I removed this preload code. Do you have something similar? But now I get a short delay the first time a sound is played. Don't know how I shall handle that. ``` -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Preload sound...
I found a solution that works with me. I use a computed SKAction sound property instead of preloaded sounds: ``` var enemyCollisionSound: SKAction { return SKAction.playSoundFileNamed("hitCatLady.wav", waitForCompletion: false) } ```
61,250,528
I am trying to code of network scanner and further once I try to print the response, it does not show anything. ``` import scapy.all as scapy def scan(ip): packet1 = scapy.ARP(pdst=ip) etherpacket = scapy.Ether(dst = 'ff:ff:ff:ff:ff:ff') broadcast_packet = etherpacket/packet1 ans, unans = scapy.srp(...
2020/04/16
[ "https://Stackoverflow.com/questions/61250528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6865612/" ]
Actually in your specific case you don't even need `struct`. Below should be sufficient. ```py from binascii import b2a_hex # open files in binary with open("infile", "rb") as infile, open("outfile", "wb") as outfile: # read 4 bytes at a time till read() spits out empty byte string b"" for x in iter(lambda:...
To answer the original question: ``` import re changed = re.sub(b'(....)', lambda x:x.group()[::-1], bindata) ``` * Note: original had `r'(....)'` when the `r` should have been `b`.
43,918,829
Hi we are working in Team Foundation Server 2015, today I was trying to open a backlog item (yesterday I did it without any problem) but I got this error message "RecursionLimit exceeded ", then I noticed all backlog items have the same problem, what should I do to avoid it? Is there any limit configuration? [Backlog i...
2017/05/11
[ "https://Stackoverflow.com/questions/43918829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7202556/" ]
As this is currently not possible I created a [feature request](https://jira.mesosphere.com/browse/DCOS_OSS-1479) asking for this feature. --- In the meantime, I created workaround to be able to update the image tag for all the registered jobs using typescript and request-promise library. Basically I fetch all the j...
I think the `"forcePullImage": true` should work with the `docker` dictionary. Check: <https://mesosphere.github.io/marathon/docs/native-docker.html> Look at the "force pull option".
547,023
I have a latency issue on certain requests to an address on localhost. I suspect there's something going on with the DNS lookup. Is there a way that I can profile DNS lookup on OSX? For example, is there a log I can watch as it tries to do the lookups?
2013/02/05
[ "https://superuser.com/questions/547023", "https://superuser.com", "https://superuser.com/users/1457/" ]
You could just run tcpdump to dump DNS packets and look at how DNS traffic is behaving. Something like the following, entered in Terminal, should do the trick: ``` sudo tcpdump -i en0 -n udp port 53 ``` The `-i en0` should reference your active interface. On Macs, this is usually `en0`, but if you have both an ether...
> > I have a latency issue on certain requests to an address on localhost. > > > When you say "localhost" do you really mean localhost? as in 127.0.0.1 or ::1? You can use tcpdump to look for resolver traffic as the previous poster has suggested but if you literally mean localhost there's a quite good chance the...
23,635,398
I am new to .Net and SignalR. I am looking at some code written by a former coworker and he added this line to the Route Config which is now throwing errors saying its obsolete but all the [documentation](https://github.com/SignalR/SignalR/wiki/QuickStart-Persistent-Connections) I have read suggest mapping connections ...
2014/05/13
[ "https://Stackoverflow.com/questions/23635398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3073079/" ]
Yes, you have to use `IAppBuilder`. Add a Owin `Startup` class, and in its `Configuration` method call `MapConnection<T>` on the `app` argument you receive. That should work. Check [here](http://www.asp.net/aspnet/overview/owin-and-katana/owin-startup-class-detection) and [here](http://www.asp.net/signalr/overview/sign...
To enable SignalR in your application, create a class called Startup with the following: using Owin; namespace MyWebApplication { public class Startup { public void Configuration(IAppBuilder app) { app.MapSignalR(); } } }
2,110,388
Problem: Use the Binomial Formula to show that if $n$ and $r$ are integers with $0 \leq r \leq n$, then $\binom{n}{r}=\binom{n}{n-r}$. My attempt: I am using the general binomial expansion formula to establish the following. $(n+r)^{n}=n^{n}+nn^{n-1}r + ...$ But am not sure where to go from here. Should I do a proof...
2017/01/23
[ "https://math.stackexchange.com/questions/2110388", "https://math.stackexchange.com", "https://math.stackexchange.com/users/382939/" ]
**Hint**: The polynomials $(x+y)^n$ and $(y+x)^n$ are the same. Expand and equal their coefficients. **Full answer**: The polynomials $(x+y)^n$ and $(y+x)^n$ are equal. If we apply the Binomial Formula to both of them, we obtain $$\sum\_{k=0}^n\binom nk x^ky^{n-k}=\sum\_{j=0}^n\binom nj y^jx^{n-j}$$ Fix a degree $r$...
In the binomial expansion of $(x+a)^n $, multiplying together $n $ factors, $(x+a\_1), (x+a\_2), \cdots (x+a\_n) $, the indices of the factors of each term added together equals $n $. The coefficient of the term $x^r $ consists of terms $a\_1, a\_2, \cdots $ such that the sum of indices in each term is $n-r$, and since...
47,031,768
Suppose I have the following array: ``` a = np.array([0,1,0], [1,0,0], [0,0,1]) ``` Would it be possible to do something like the this: ``` a[==0] = -1 ``` to set all zeros to -1? I know you could something like the following to achieve the same effect: ``` b = a == 0 a[b] = -1 ``` bu...
2017/10/31
[ "https://Stackoverflow.com/questions/47031768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6164883/" ]
As per your code attempt it seems you are waiting for the [WebElement](https://stackoverflow.com/questions/52782684/what-is-the-difference-between-webdriver-and-webelement-in-selenium/52805139#52805139) through [WebDriverWait](https://stackoverflow.com/questions/48989049/selenium-how-selenium-identifies-elements-visibl...
You are using [presenceOfElementLocated](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html#presenceOfElementLocated-org.openqa.selenium.By-). As per documentation: > > An expectation for checking that an element is present on the DOM of a > page. This does not...
35,402,030
**Situation:** I have a searchview widget in my appcompat toolbar that allows custom suggestions via sqlitedatabase. **Problem:** I am having trouble expanding the drop down suggestions list to be the full width of the screen. At best, the list width is almost the width of the screen except for small margin/paddin...
2016/02/15
[ "https://Stackoverflow.com/questions/35402030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5496237/" ]
The size of the width you want, can be achieve by using Wrap content . Try this code: searchAutoCompleteTextView.setDropDownWidth(ViewGroup.LayoutParams.WRAP\_CONTENT); I came to this answer when i went through this link: > > <https://www.youtube.com/watch?v=408pMAQFnvs> > > >
You must get reference to SearchAutoComplete object which SearchView using , then set its size and change the background resource which has padding's, please refer to my answer here : <https://stackoverflow.com/a/43481639/5255624>
1,468
The question: [Is racisim a natural instinct?](https://skeptics.stackexchange.com/questions/8130/is-racisim-a-natural-instinct) has been closed, I feel incorrectly. The question was closed as unfalsifiable, and no justification for why the moderator considered it unfalsifiable was given. I think it is an important po...
2012/02/22
[ "https://skeptics.meta.stackexchange.com/questions/1468", "https://skeptics.meta.stackexchange.com", "https://skeptics.meta.stackexchange.com/users/3332/" ]
While I do not concede the onus is on the reader (let alone a moderator) to show a question is unfalsifiable, I shall respond. I can see no way in which "racism as an instinct" and "racism as a socially-conditioned response" can be distinguished experimentally. (I'll concede "racism as a conscious decision" can be.) ...
I think this article answers the question - [Three-month-olds, but not newborns, prefer own-race faces](http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2566511/). > > preferential selectivity based on ethnic differences is not present in the first days of life, but is **learned** within the first 3 months of life. The fi...
46,800,020
I'm trying to add more tests to my code with Mocha, Chai and Sinon, however I'm struggling to understand why this second stubbed function isn't recognised as being called. I have a function that sends an email to a user (I'll test the email functionality later - for now I just want to get a handle on stubbing dependen...
2017/10/17
[ "https://Stackoverflow.com/questions/46800020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6459978/" ]
The has\_many association tells Rails that the objects are related and adds methods to the object for querying the associated objects. You could live without it, but it makes things easier. See the first chapter here: <http://guides.rubyonrails.org/v2.3.11/association_basics.html> Another reference: <https://apidock....
When you use one-to-many associations you are telling your User model that he has zero or more instances of the model Advice, while Advice belongs to only one model User and its reference to it. This is how your models should be: ``` class User < ApplicationRecord has_many :advices end class Advice < Applicatio...
1,766,461
All the examples I have seen of neural networks are for a fixed set of inputs which works well for images and fixed length data. How do you deal with variable length data such sentences, queries or source code? Is there a way to encode variable length data into fixed length inputs and still get the generalization prope...
2009/11/19
[ "https://Stackoverflow.com/questions/1766461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/117527/" ]
Some problems could be solved by a recurrent neural network. For example, it is good for calculating parity over a sequence of inputs. The [recurrent neural network for calculating parity](http://github.com/pybrain/pybrain/blob/master/examples/supervised/backprop/parityrnn.py) would have just one input feature. The bi...
To use a neural net on images of different sizes, the images themselves are often cropped and up or down scaled to better fit the input of the network. I know that doesn't really answer your question but perhaps something similar would be possible with other types of input, using some sort of transformation function on...
38,472,679
I tried printing the Score to ensure it was receiving the value I entered and it was which was even more baffling. Ex. I tried entering in 0.85 and it printed A. Why is that? ``` try: Score = raw_input("What is the Score? ") if Score >= 0.90 < 1.01: print Score print "A" elif Score >= 0.80 ...
2016/07/20
[ "https://Stackoverflow.com/questions/38472679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6611766/" ]
**UPDATE** (I had this wrong in my first answer.) In addition to @Alex's point that you need `float(raw_input(...))` to get a numeric type... this `if` statement: ``` if Score >= 0.90 < 1.01: ``` is equivalent to: ``` if Score >= 0.90 and 0.90 < 1.01 ``` You probably want this instead: ``` if 0.90 <= Score < 1...
### Problem 1: `raw_input` [From the docs](https://docs.python.org/2/library/functions.html#raw_input): `raw_input` "reads a line from input, converts it to a string (stripping a trailing newline), and returns that". You need to cast it to a `float` to compare it with numeric types. ``` Score = float(raw_input("What...
46,926,403
I'm trying to write a HTML file in Java, however the bw.newLine(); is not working. It's all displaying in one line. ``` File f = new File("quote.html"); BufferedWriter bw = new BufferedWriter(new FileWriter(f)); bw.write("Client : " + clientID + " - " + creditLimit[1]); ...
2017/10/25
[ "https://Stackoverflow.com/questions/46926403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7602712/" ]
``` bw.newLine(); // write a platform-dependent new line character (\n for unix) ``` For HTML you need use the `<br/>` HTML element: ``` bw.write("<br/>"); ```
In HTML newlines in the source code are not rendered. To display a newline in HTML your need to add the `<br>` tag
943,606
I'd like to make a drop-down list that looks like this: [![alt text](https://i.stack.imgur.com/Q7tBs.png)](https://i.stack.imgur.com/Q7tBs.png) JComboBox provides the functionality I need, so I shouldn't need to write a custom component. But I can't find a way to customise the entire appearance of a JComboBox to achi...
2009/06/03
[ "https://Stackoverflow.com/questions/943606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2959/" ]
JComboBox UI is composed from textfield, list and arrows. To customize them you can use some ready L&F or implement your most easily with Synth L&F. Initialize L&F: ``` SynthLookAndFeel lookAndFeel = new SynthLookAndFeel(); try { lookAndFeel.load(YourClassAlongWithSynthXml.class.getResourceAsStream("synth.xml"),...
If you don't want to create an entire look and feel, the simplest answer is to subclass jcombobox and override the paintComponent method and draw whatever you want. fill the background with your gray color, then draw your text and arrow in your lighter color. if you go this route, you may also need to override the up...
2,040,489
Is there a simple way for Firefox to send a simple flag value to the local machine, so a program inside the local machine can react upon the flag. I have put so much effort in cookies, extensions and even Javascript read/write file .. all of it failed. i just wanted a way that the Firefox can give signal to local mach...
2010/01/11
[ "https://Stackoverflow.com/questions/2040489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247864/" ]
you can write to a file on disk, the application on your local machine can monitor for this file existence and act upon it. I also suggest that the "other" application rename the file as soon as it find it so firefox can single again. see [here](http://simon-jung.blogspot.com/2007/10/firefox-extension-file-io.html) a...
Try using Applets to access the clients machine, this doesn't limit you to use Firefox other browsers as well.
24,644
I am working on a domain decomposition code in C that uses CHOLMOD to approximate grid values for a PDE in each sub-domain. The issue I have is that the methods use Matrix Market format, which is not an issue in general, but I already have a method that computes a 2D array which is the sparse matrix A in the Ax=b solve...
2016/08/07
[ "https://scicomp.stackexchange.com/questions/24644", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/20973/" ]
The most efficient way will be to directly use the C API of CHOLMOD and call it directly, without saving the matrix to disk, see my answer to [this question](https://scicomp.stackexchange.com/questions/24579/linear-solve-using-chlomod-in-c/24607#24607) for an example (see also CHOLMOD documentation). CHOLMOD uses the s...
I do hope that your `A` that you assemble is a sparse matrix. Otherwise the use of sparse cholesky factorizations would not make sense. Then, if you didn't do this during the assembling process, you should turn it into a sparse matrix format as soon as possible. Then -- and not knowing in what environment you are so t...
8,441,555
I click a button and launch an activity with a soft keyboard: ![enter image description here](https://i.stack.imgur.com/wuf26.png) When I click on the Cancel button, it calls finish() to exit to the first page. Then when I launch the activity again i get this: ![enter image description here](https://i.stack.imgur.co...
2011/12/09
[ "https://Stackoverflow.com/questions/8441555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/659906/" ]
Never mind, I seem to have made a mistake that, in retrospect, should not have taken me several hours to figure out. The problem was not with hibernate, or anything to do with Hibernate (other than that Hibernate was using standard java serialization). Not only do the fields need to be marked with JPA @Transient annot...
This just happened to me and I also lost hours on it. While adding the `transient` Java modifier got rid of the immediate error, I kept getting more and more weird serialization errors until final Hibernate complained that it could not jamb a binary representation of my object into the field (because it was too long: ...
4,528,660
Problem: Let $0<n<1$ be a real number, then define for $x>0$ : $$f(x)=\left(1+x\right)^{\frac{1}{x^{n}}} \quad \text{ and }\quad g(x)=f(x)+f\!\left(\frac{1}{x}\right).$$ What is the minimum value of $n$ such that $g(x)\leq 4$? This problem is a direct follow up of [Prove that $(1+x)^\frac{1}{x}+(1+\frac{1}{x})^x \leq ...
2022/09/10
[ "https://math.stackexchange.com/questions/4528660", "https://math.stackexchange.com", "https://math.stackexchange.com/users/698573/" ]
If you perform a Taylor expansion around $x=1$ $$g(x)-4=\Big[1-2n\left(1+\log(2)\right)+2n^2 \log(2)\left(1+\log(2)\right)\Big](x-1)^2+O((x-1)^3)$$ Cancelling this first coefficient leads to the result $$n=\frac{1}{2\ln 2}\left(1-\sqrt{\frac{1-\ln 2}{1+\ln 2}}\right)$$ already given by @Gary and @mohamedshawky. Using...
Notice that $g(1)=4$, so we are essentially interested in $x=1$. We can see $g'(1)=0$ regardless of what $f$ is: $$g(x)=f(x)+f\left(x^{-1}\right)\\ g'(x)=f'(x)-x^{-2}f'\left(x^{-1}\right)\\ g'(1)=f'(1)-f'(1)=0$$ This means $x=1$ produces a critical point, one which is a potential maximum or minimum for $g$. Now, we ...
59,367,505
I want to make a list of all checked values in the checkbox if I check somwething from xyz it should be pushed in a list If i uncheck something from list xyz and template,It should be pulled from a list {{item}} {{item}}
2019/12/17
[ "https://Stackoverflow.com/questions/59367505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12364707/" ]
You can use `(change)` handler to push and remove items from array. ``` <div *ngFor="let item of items"> <input type="checkbox" name="{{item}}" (change)="$event.target.checked ? selected.push(item) : selected.splice(selected.indexOf(item),1)"> {{item}} </div> ``` Demo : <https://stackblitz.com/edi...
I have created two Demo: <https://stackblitz.com/edit/angular-qfxe3j> Out of which below is the simplest one, without any functional code. menu.component.html ``` <div style="display: inline-flex;"> <div style="padding: 5px;border: 1px solid;margin-left: 30px;width: 120px;height: 200px;"> <p>list 1</p> <ul...
252,301
Let $M$ be a Riemannian manifold with boundary. Can it isometrically embed into a Riemannian manifold without boundary of the same dimension?
2016/10/16
[ "https://mathoverflow.net/questions/252301", "https://mathoverflow.net", "https://mathoverflow.net/users/99808/" ]
[This paper](http://arxiv.org/pdf/1606.08320.pdf) by Pigolla and Veronelli contains a proof of that, with the additional constraint that the larger manifold is complete (which is not difficult to achieve). Let me note that the main point of the paper is to consider this problem when we ask the extension to satisfy som...
This paper [at the annals](http://annals.math.princeton.edu/wp-content/uploads/annals-v161-n2-p12.pdf) describes such an embedding on page 1097 for compact Riemannian manifolds, although the main results are embeddings between manifolds with boundaries.
59,671,943
I'm working through exercises in Graham Hutton's book "Programming in Haskell" and as part of one exercise I've re-implemented Haskell's `last` function like so: ``` lasst xs = drop (length xs - 1) xs ``` Now this works nicely for a non-empty list: ``` > lasst [1,2,3,4,5] [5] ``` But, surprisingly to me, for an e...
2020/01/09
[ "https://Stackoverflow.com/questions/59671943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33404/" ]
The [Haskell report '10](https://www.haskell.org/onlinereport/haskell2010) specifies the the [*standard Prelude*](https://www.haskell.org/onlinereport/haskell2010/haskellch9.html#x16-1720009.1). In this section, we see: > > ``` > drop :: Int -> [a] -> [a] > drop n xs | **n <= 0** = xs > dro...
`drop` and `take` are total functions: they always return something without causing a runtime error, no matter what the (total) arguments are. Their definition makes it so that ``` take k xs ++ drop k xs == xs ``` holds for every `k` and (finite) `xs`. Note that `k` can be negative, or even larger than the length of...
72,672,993
Complete Error: ``` Using TensorFlow backend. Traceback (most recent call last): File "file.py", line 32, in <module> pickled_model = pickle.load(open('model.pkl', 'rb')) ModuleNotFoundError: No module named 'keras.saving' ``` I am not able to solve this error. Thanks for the help:)
2022/06/18
[ "https://Stackoverflow.com/questions/72672993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7833616/" ]
Consider adding the [`profile` configuration](https://www.terraform.io/language/settings/backends/s3#profile) to the `backend` block. The associated profile will need to be setup in your `~/.aws/config` file. Also, you can add the [`profile` configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/do...
As suggested by Terraform documentation, you should be using an IAM role delegation: > > * Each role's Assume Role Policy must grant access to the administrative AWS account, which creates a trust relationship with > the administrative AWS account so that its users may assume the role. > * The users or groups within ...
2,542,179
How many ways can you put: a) two bishops b) two knights c) two queens on a chessboard in such a way that one piece does not attack the other?
2017/11/29
[ "https://math.stackexchange.com/questions/2542179", "https://math.stackexchange.com", "https://math.stackexchange.com/users/398199/" ]
Let $R$ ($H,\ B,\ Q$) be the number of ways you can put two rooks (knights, bishops, queens) on the $8\times8$ chessboard so that they ***do*** attack each other. $R=\frac{64\cdot14}2=448.$ $H=2\cdot2\cdot7\cdot6=168,$ since a pair of mutually attacking knights determines a $2\times3$ or $3\times2$ rectangle, there a...
This is a question for "Problem of the Week 16" in my school. Specifically, it asked, "How many ways are there for two bishops to never be able to attack each other on a chessboard?". I solved it yesterday with my friend and published it. Our answer to this is as follows: Since a bishop can only move diagonally, We ca...
60,538,396
When using React+Redux do parent props overwrite props from state, or do props from state overwrite props from parent components (this is, if the names of the props clash)? ``` interface OwnProps { //The type for the props provided by the parent component } function mapDispatch(dispatch: AppDispatch<any>) { retur...
2020/03/05
[ "https://Stackoverflow.com/questions/60538396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can control this behaviour by using the second parameter in `mapStateToProps`, which provides you with the component's own props. Here is an example: ``` function MyComponent({ myProp }) { return ( <div>{myProp}</div> ); }; const mapStateToProps = (state, ownProps) => ({ // use myProp from props...
``` const Component = ({ testProp }) => ( <div>testProp: {testProp}</div> ); const mStP = () => ({ testProp: 'testProp from mapStateToProps', }); const ConnectedComponent = connect(mStP)(Component); ``` Then do this somewhere in your App component: ``` <ConnectedComponent testProp="testProp from parent compone...
54,293,404
I would like to resize any downloaded images so they maintain their aspect ratio, however are all as wide as the `UITableViewCell` they are rendered in. My UIImageView is configured with the `contentMode` as `AspectFit` and I have the following anchors on my cell: [![enter image description here](https://i.stack.imgu...
2019/01/21
[ "https://Stackoverflow.com/questions/54293404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10823240/" ]
You could simply try to resize the image view after setting its `image` property. For example: ```swift class ResizableImageView: UIImageView { override var image: UIImage? { didSet { guard let image = image else { return } let resizeConstraints = [ self.heightAnchor.constraint(equalToConst...
Tried to recreate your project with provided code and everything worked as expected until I noticed that your image view is constrained to cell content view margins. Then it started to throw those layout errors and the cells became unreasonably high. So my guess is that you need to make sure your image view constraints...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
21