I understand that Python mutables like lists have different identities while "special situations" like certain strings and numbers will have the same IDs but I don't understand this situation:  >> a = [[0]*2]*2 >>> a [[0, 0], [0, 0]] >>> id(a[0]) 140387455550664 >>> id(a[1]) 140387455550664   Both [0,0] lists in the list a have the same ID  However, when I create a list like this, the IDs are different for each list element in that list  >>> b = [[0,0],[0,0]] >>> id(b[0]) 140387455550472 >>> id(b[1]) 140387456353480   I am using CPython/Python 3.6 on Ubuntu

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


I want to give labels to different topics created using LDA. I don't want to do it manually. I saw some papers on automatic labeling but I am still confused.   How can I use the information produced by LDA to automatically generate names to the topics generated?

I have categorized 800,000 documents into 500 categories using the Mahout topic modelling.  Instead of representing the topic using the top 5/10 words for each topics, I want to infer a generic name for the group using any existing algorithm. For the time being, I have used the following algorithm to arrive at the name for the topic:  For each topic   Take all the documents belonging to the topic (using the document-topic distribution output) Run python nltk to get the noun phrases Create the TF file from the output name for the topic is the phrase (limited towards max 5 words)   Please suggest a approach to arrive at more relevant name for the topics.


I am relatively new to the linux world. I use OSX at home and Windows at work. In those worlds, there is a default folder for applications (C:\Program Files, /Applications). Is there any such directory in Ubuntu?   I understand that this is not very important and any location in the file system should be ok, but was just wondering whether there are such standard locations (I think there would be one). For instance where is Firefox or Libre Office (that are installed by default)?  Got this question when I was trying to install eclipse. Downloaded the zip, and was wondering...

Under Windows, most applications and application data are stored in a special directory known as C:\Program Files (and occasionally C:\Program Files (x86)). What is the Ubuntu/Linux equivalent to this path? Is there even one?


Let's say I have a custom post type Books, and I tag the books with a custom taxonomy "Person". The taxonomy contains the name of a person and basically means the person has read that particular book.  So, a book can obviously be tagged with multiple "Persons".   I wanna list Books and order them by the number of "Persons" that have read it. Basically, count the number of "Person" tags, and order the Books by that.   I'm reading the documentation on wp_query but don't see a way to do this. Is it doable?

I am trying to order posts by tag count. I want to order posts with no tags first and posts with highest count last.  I tried and got posts with no tags only.       $tags = get_tags();     $tag_ids = wp_list_pluck( $tags, 'term_id' );      $args1 = array (        'orderby'          => 'DEC',        'post_type'        => 'post',        'pagination'       => true,        'posts_per_page'   => '1',        'tag__not_in'      =>  $tag_ids,        'meta_key'         => '_thumbnail_id',     );   How do I order posts based on the tags count?


Recent upgrades to the Ubuntu 16.04 kernel (4.4.0-89 and -91) failed badly on my laptop. Happily, I've got the previous, working version still installed (4.4.0-57).  For now I've got Grub configured to show me a menu, and I'm manually selecting -57 on boot, but this seems fragile, likely to break on a future sudo apt upgrade.  I think I want:   To remove -89 and -91, as they're not doing me any good. To make -57 the default for Grub, in a way that will persist through upgrades. To ensure the -57 stays installed, even if I install later kernel upgrade To be able to easily try later kernel updates, but revert back to -57 if it fails. My primary concern is -57 being automatically removed. If I find a functioning later update, an easy path to return to undo all of this and return to following kernel updates.   Trying to remove -91 with sudo apt remove linux-image-4.4.0-91-genericrequires me to remove linux-generic and linux-headers-generic. That seems Bad, so I haven't tried it.  I can find a variety of questions about the general problem, but none seem to address all of my goals, and most are old enough that I don't think they apply any more.  What's the best way to do this?  Addendum: This was flagged as a duplicate of  . That answer might address a portion of my question, but does not address the bigger picture.  Broadly, the issue is that the kernel is handled in an unusual way. It's installed via linux-generic, which is nothing but a dependency on linux-image-generic and linux-image-headers. Those in turn are only dependencies on linux-linux-image-VERSION-generic and headers-VERSION-generic, packages noteworthy for baking the version number into the package name (presumably to make it easy to install multiple in parallel).  Specifically not addressed in that answer are:   Does not address how to remove -89 and -91. Does not address how to make -57 the default for Grub, even if I install later updates. Does not address how to ensure that -57 stays installed, even if I install later updates. Even if the answer is to hold one or more packages, given the several packages involved, which ones would I hold? If it's a matter of holding linux-generic, how do I downgrade it first?

Because of  I'd like to prevent apt-get upgrade and Update Manager from updating the "libgtk2.0-0" package.   How can this be achieved?


I was attempting to make clotted cream with pure raw cream (jersey cows) from the dairy farm.   I had my temperature too low I think though. I had it "cooking" at 125 F for 12 hours. It should have been 160 F for 12 hours.  Can I increase the temperature and cook for additional time?  Some websites say temperatures as low as 110 F will work for clotted cream.

If I left food out of the refrigerator for some period of time, is it still safe? If I left it out too long, can I salvage it by cooking it more?


Weird lines appeared in my .docx documents, when I open them in Word 2013:    I know what  and .  Here I am asking, how did I get them in the first place? Because I am million percent sure that I haven't visited  neither in my Word 2010 nor Word 2013 for ages.  So, how it is possible that I see them now and haven't seen them yesterday or the day before yesterday? Is there some magic keyboard shortcut that I accidentally pressed that enabled them?

Suddenly these weird right angle lines started to appear in both headers and footers in MS Word.  Weird lines in Microsoft Word:    Does anyone have any idea how to get rid of them?


Helle everyone, I have a question regarding the exact definition of entropy.   When you look up te derivation (proof) of the Clausius-inequality, for example on wikipedia, the formula $$ d S = \frac{\delta Q}{T} $$ is used, without specifying the path to be reversible or not.   However, some definitions state that de change is entropy can only be calculated if the path taken is reversible i.e. $$ d S = \frac{\delta Q_{rev}}{T} $$  I am really struggling with this, so where am I wrong in my thinking?   Thanks in advance

I'm a little bit confused about calculating entropy changes along irreversible paths by integrating over a reversible path. When using the central equation I can understand the argument, entropy and all the quantities we use to calculate the entropy change are state functions that have well defined end points. So the process between these two states doesn't matter, we will get the same entropy change. I find it difficult to grasp how we can use dS=dQ/T to calculate entropy changes in irreversible processes. Since Q is path dependent I don't see how the original argument applies. We can take the free expansion as an example, if we try to use dS=dQ/T we will get zero entropy change as no heat flows into the system. But using the central equation where all quantities are state functions we get a entropy change which is larger that zero as expected.


Sometimes a comment can add great value to an answer once its content has been incorporated into the answer. Perhaps correcting an error to an otherwise good answer, plugging a logic hole, rendering a more elegant solution, making an important clarification to explanations, etc.  Once the answer has incorporated the comment/suggestion, it would be nice to credit the commenter with a "slice of the pie" - ie share reputation gains between the answerer and the commenter, as recognition of their contribution as "co author" to the final answer.  The simplest way would be to make upvotes on comments yield reputation, but that barrow has been pushed before.  A few possibilities I could think of for sharing rep are:   The commenter can be added to the answer as a "reputation sharer" - reputation gains from the answer are split 50/50 from then on The answerer can make a "donation" of reputation from the answer to the commenter - eg if the answer has 4 votes, they can donate up to 40 reputation (there may have to be a requirement that this donation comes off the rep cap, so answerers don't distribute their excess rep when exceeding their rep cap) Upvotes made by the answerer to comments on the answer do get reputation (maybe 5 - transferred as per previous point)     Why bounty doesn't quite fit:  The bounty process is just too long winded and doesn't have an on-going effect if the answer turns out to be a really good one. The bounty is too delayed. They didn't answer, they just added value - I just want to give the comenter a pat on the back right there and then, and I don't mind giving up some erep to do it.

Sometimes I post a "good" answer to a question, but then it turns out I missed something.  Someone else comes along and points out my error/omission in a comment, and I change my answer.  My answer is now better, freshly active, and I get more upvotes.    However, I kind of feel that I owe that commenter a little bit of the credit (and therefore rep) for having helped support my answer.  I can upvote the comment, but there's no rep gain for that.  Is there any way I can give the commenter a portion of the rep I gain from further upvotes to what is now our answer?  I don't mind some approved existing solution, or some new totally manual solution, but it seems like it could be automated as well.  A similar question was asked in a comment to an answer here:    and one suggestion (which was not popular) was to find some other questions/answers by the helpful commenter and upvote them.  I'm kind of in agreement that each post should gain upvotes of its own accord, and besides, there may not be enough other posts by that user to fully compensate them for their assistance.


I have a ssrs table report with row grouping and I would like to know how to change the colours of rows in groups without changing the background colour of the group column itself. With the answers I have found and implemented I get the effect of the second table in the picture when I want the effect of the first table:    Any help will be much appreciated.  This is a picture of the actual report and it's grouping:

How do you shade alternating rows in a SQL Server Reporting Services report?    Edit: There are a bunch of good answers listed below--from  and  to . Alas, I can choose only one...


Today I was scolded for leaving my access card at home for the second time. From my point of view, this causes about 10 seconds of work for the people at the reception. When I asked why this would be such a big deal, I got only evasive answers pointing to policies and power plays ("this is not up for discussion"). This leaves me with the impression that the person scolding me doesn't actually know of any negative impact, but just tries to overly strongly enforce policies. Is there a term describing such behavior?  EDIT: My use case for the term I am searching for is for writing a blog post about my experiences with this company. Example sentence: "The company is very hierarchical, beaurocratic, and  encourages ${TERM}."  EDIT2: I know it's a bad idea forgetting your key card. I am just trying to understand whether the harshness of the reaction is justified. Imagine you are 5 mins late for a meeting - you know it's bad behaviour, but you would probably consider it too harsh if you get fired for that.

What’s the word for people who act mindlessly,  accepting and  following the routine they have been told to follow by either society or government or something?


The installation went fine until I restarted. I remember enabling boot from removable disk and was thinking of disabling it as it boot up. Pressed F8 nothing happened. Instead it went straight to the Purple Ubuntu loading screen. If I try to boot without the usb, it just gives me a blank black screen with a blinking _.   I am fairly new to this and I am hoping for a fix. Thanks in advance.

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


I am from India, and recently moved to Germany for work. I would like to travel to Bulgaria for a conference next month. Can I go there without a visa as I am a resident in another EU country?  I can't find this information online. Any links/references will be much appreciated.

I have looked it up and the resources all talk about schengen visa, travelling with eu national family member etc. so I would like to get a more assuring answer about my situation:   I am a non-EU national with an Italian residence permit. My father is an Italian citizen. I will be travelling to Sofia and Bucharest next month with my girlfriend who is a British citizen. Do I need to get a visa to enter these two cities?


Let's say you like the theme/world of a franchise, for example SpongeBob SquarePants, and you want to make it into maybe a business game where you hold an underwater restaurant. Make burgers, invent recipes, have fishes as customers etc. How much can you borrow from the original franchise before crossing the red line ? I know that the names are the first to be copyrighted, but if for example your cook looks like a yellow square sponge, is that an infringement ? Even more, if you want to implement the concept of "Special Formula" as in the anime (without naming it in the same way), is that an infringement ?  Thanks.

Most games build on other games' successes and many are downright clones. Where is the limit of imitation before legal issues come into play? Is it down to literary or graphic work like characters and storyline that cause legal problems, or can someone actually claim to own gameplay mechanics?  There are so many similar clone games out there that the rules are probably very slack or nonexistent, but I'd like to hear the views of more experienced developers / designers.


I have Apache 2.4 running on Mac OS X. apachectl configtest give me: Syntax OK.  I have two virtual hosts set up, one called localhost, one called test.dev.  <VirtualHost *:80>     DocumentRoot "/Users/psychomachine/Development/_localhost"     ServerName localhost     ServerAlias www.localhost     <Directory />         Require all granted     </Directory> </VirtualHost>  <VirtualHost *:80>     DocumentRoot "/Users/psychomachine/Development/test"     ServerName test.dev     ServerAlias www.test.dev     <Directory />         Require all granted     </Directory> </VirtualHost>   localhost just works:  ↪ curl -I -L localhost                                                                                15:51:08 HTTP/1.1 200 OK Date: Tue, 08 Dec 2015 14:51:17 GMT Server: Apache/2.4.16 (Unix) Last-Modified: Tue, 08 Dec 2015 08:52:04 GMT ETag: "c-5265f1673f500" Accept-Ranges: bytes Content-Length: 12 Content-Type: text/html   whereas test.dev doesn't:  ↪ curl -I -L test.dev                                                                                15:51:01 curl: (7) Failed to connect to test.dev port 80: Connection refused   My hosts file has an entry for test.dev, which is why I can ping test.dev and hear back from 127.0.0.1.  ↪ ping test.dev                                                                                15:53:39 PING test.dev (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.069 ms 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.096 ms 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.111 ms ^C --- test.dev ping statistics --- 3 packets transmitted, 3 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.069/0.092/0.111/0.017 ms   I've spent hours looking at this, but I still don't understand how it is possible to ping test.dev but still get connection refused. Apache is listening on port 80, and I am not getting a page forbidden kind of error. There is nothing in Apache logs for test.dev, because the request for test.dev never makes it to Apache.  I am missing a crucial element of the puzzle — and I hope somebody will be able to point me in the right direction.  Many thanks in advance.  Edit: As I said, Apache is listening on 80:  sudo lsof -i ':80'                                                                                16:54:46 COMMAND  PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME httpd   2464   root    5u  IPv6 0x8883a2a43af0ca7f      0t0  TCP *:http (LISTEN) httpd   2466 daemon    5u  IPv6 0x8883a2a43af0ca7f      0t0  TCP *:http (LISTEN) httpd   2467 daemon    5u  IPv6 0x8883a2a43af0ca7f      0t0  TCP *:http (LISTEN) httpd   2468 daemon    5u  IPv6 0x8883a2a43af0ca7f      0t0  TCP *:http (LISTEN) httpd   2469 daemon    5u  IPv6 0x8883a2a43af0ca7f      0t0  TCP *:http (LISTEN) httpd   2470 daemon    5u  IPv6 0x8883a2a43af0ca7f      0t0  TCP *:http (LISTEN)   Additional info   scutil -r test.dev                                                    08:25:59 Reachable   telnet test.dev                                                       08:26:17 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused telnet: Unable to connect to remote host  telnet test.dev 80                                                    08:26:43 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused telnet: Unable to connect to remote host   127.0.0.1 test.dev is in /etc/hosts and Listen *:80 is in apache's conf.

This is a  about Connection Refused    We see a lot of questions to the effect      When I try to connect to a system I get a message      Connection refused      Why is this ?


Someone explain to me the differences between the following two statements?  A static final variable initialized by a static code block:  private static final String foo; static { foo = "foo"; }   A static final variable initialized by an assignment:  private static final String foo = "foo";

My question is about one particular usage of static keyword. It is possible to use static keyword to cover a code block within a class which does not belong to any function. For example following code compiles:  public class Test {     private static final int a;         static {         a = 5;         doSomething(a);     }     private static int doSomething(int x) {         return (x+5);     } }   If you remove the static keyword it complains because the variable a is final. However it is possible to remove both final and static keywords and make it compile.   It is confusing for me in both ways. How am I supposed to have a code section that does not belong to any method? How is it possible to invoke it? In general, what is the purpose of this usage? Or better, where can I find documentation about this?


I am working on a problem that requires proving both regressions have the same R^2. The question is: Suppose you run a regression of Yi and Xi and obtain parameter estimates beta hat 1 and beta hat 2. Then using the same data, you decide to run a regression of Ybar 1 on Xi, where Ybar = 2yi. How do I prove this>

Summary:  Am I correlating two independent variables?   Is that the problem?  Let's say I have data point for square footage of a house and the asking price.   Now, I can ask "Does square footage (x) determine price (y)?"  This is intuituve, and makes sense.  R-squared would end up saying "Square footage explains X% of the variation in price".  So far, so good.  But, what if I want to predict the square footage from the price?  That seems valid.  Now, I ask "Does price (x) determine square footage (y)?"  So far, it seems either can function as the independent or dependent variable.  However, the wording or r-squared seem off.  "Price explains X% of the variation in square footage".  Huh?  Square footage is not some sort of multi-factor variable.  It's more static.  Nothing "explains" the square footage, it just is.  Get what I'm saying?  Like if price only explains x% of square footage, what else would explain square footage?  Square footage is just square footage.  It's not like price, which can be determined by many things (square footage, renovations, size of yard, etc).  Another example can be age (x) and the mileage on a car (y).  With a regression equation, I can use one to predict the other.  Either order seems to work.  However does age "explain" the mileage, or does mileage "explain" the age?  In this case, both seem weird.  Both are just static independent variables.  Neither explains the other, if you ask me.  What am I missing here?  Thanks!


An error occurred when try to use the override toString method  public class Test { public static void main(String args[]) {     Account a = new CheckingAccount(1, 100, 0.1, 200);     System.out.println(a.toString()); } }  class Account { int id; double balance; double annuallntegerRate; Date dateCreated;  public Account() { };  public Account(int id, double balance, double annuallntegerRate) {     this.id = id;     this.balance = balance;     this.annuallntegerRate = annuallntegerRate;     Date dateCreated = new Date(); }  public void setRate(double annuallntegerRate) {     this.annuallntegerRate = annuallntegerRate; }  public double getRate() {     return annuallntegerRate; }  public double getBalance() {     return balance; }  public void withDraw(double change) {     balance -= change; }  public void deposit(double change) {     balance += change; }  @Override public String toString() {     return "id: " + id + "balance：" + balance + "annuallntegerRate：" +  annuallntegerRate + "date："             + dateCreated.toString(); } }     class CheckingAccount extends Account { double limit;  public CheckingAccount(int id, double balance, double annuallntegerRate,  double limit) {     this.id = id;     this.balance = balance;     this.annuallntegerRate = annuallntegerRate;     this.limit = limit;     Date dateCreated = new Date(); }  public void setLimit(double limit) {     this.limit = limit; }  public double getLimit() {     return limit; }  @Override public void withDraw(double change) {     balance -= change; }  @Override public String toString() {     return "id: " + id + "balance：" + balance + "annuallntegerRate：" +  annuallntegerRate + "date："             + dateCreated.toString() + "limit：" + limit; } }   I want to override the Object's toString method. It seems a doesn't exist  Exception in thread "main" java.lang.NullPointerException at test.CheckingAccount.toString(Test.java:82) at test.Test.main(Test.java:8)

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


Stack Exchange sites are useful for providing an indication of quality of answers and questions via votes. But what about using the voting system to assess the quality of pre-existing resources? I envision this as working almost like the (admittedly imperfect) system of  in academia, but with better incentive structures and transparency.  To put this in context, I'm looking to set-up a site to bring together knowledge on appropriate technology into a single site and was wondering if the SE approach or something similar would be suitable. What we need is some sort of 'peer review' for online 'instructables' type plans and a community forum to ask questions and discuss things. I've set up a  in Area 51, I was told about this: "We want to be a knowledge base, not a link directory".

Stuff like polls, recommendations based on subjective constraints, puzzles, webcomics etc. do not belong on the serious main SE sites, where professionals should be considered at work and having just a few spare minutes ("code's compiling") to answer questions, so they should not be distracted by such things. However, I'd also like to have a home for these things still using the SE engine. For the reason I mentioned before, this needs to be a separate place though. Let's call it four.[sitename-here].com.


I've upgraded my desktop computer from Windows 7 to Windows 10 long time back. So initially I had Windows 7 Pro license. Now I need to re-install Windows10 on the same desktop computer. Question - do I need to go through Windows 7 -> Windows 10 upgrade chain or I can directly install Windows 10? If last, would it accept Windows 7 serial or it will recognize my computer/license when I sign in to my Microsoft account?

I have a Windows machine (laptop) that needs fixing. The current installation is really badly broken (e.g. the taskbar is unresponsive, but the Explorer windows work, booting takes literally half an hour) and when I try to access the settings app and click on the tile to access the reset settings it instantly crashes. The same happens in Safe Mode.  I have created a USB install medium using the tool offered by Windows on my own Windows desktop machine. I've ensured that both the laptop and the USB tool have the same version of Windows (Home, 64-bit, NL). When I want to reinstall Windows on the laptop with this stick I am asked to enter a serial number which I obviously don't have. I don't want to try and see if I can phone activate it, because if it fails the install is gone.  I need to reinstall this Windows machine from a USB stick. There are a few problems I can't find an immediate solution for on the .   If I use a tool such as  to extract the serial number, will this work? If the above does not work, how can I reinstall this Windows machine?


The problem states: "Let $X = (X_1, X_2, \dots, X_n)^T$ be a multivariate normal random vector. Show that $X_i$ and $X_j$, $i \neq j$, are independent if and only if $X_i$ and $X_j$ are uncorrelated."  Going from pairwise independence to uncorrelated is easy: Just use the fact that $E(X_i X_j) = E(X_i)E(X_j)$ to show that $\mathrm{Corr}(X_i X_j)=0$. But how to prove the converse? Uncorrelated doesn't imply independence, does it?

Let $X,Y$ be jointly normally distributed and uncorrelated. Why are they independent?


I'm trying tp display Emojis from my database to Web Browser.  I tried to input emoji from my phone to my app and it is saved to database as 'ðŸ˜'. How can I display it to PHP as emoji like this 😍. Thank you in Advance.

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


When presenting the stress tensor (say in a non-relativistic context), it is shown to be a tensor in the sense that it is a linear vector transformation: it operates on a vector $n$ (the normal to a surface), and returns a vector $t_n$ which is the traction vector. It is then shown that conservation of angular momentum leads to symmetry of the matrix.  However, tensors are more more naturally presented a multilinear functions. I wonder:   What type of tensor is the ? Is $n$ a vector or a co-vector? What about $t_n$? Is there a way to understand the symmetry when thinking of the stress tensor as a function of two vectors (or two co-vectors), under which it will seems intuitive why $\sigma(A,B) = \sigma(B,A)$?   Edit: To clarify, let's look, for example, at the 1st coordinate of the traction vector $t_n$ of an arbitrary normal $n$: This is $\left<e_1, \sigma(n)\right>$. From symmetry, this is equivalent to $\left<n, \sigma(e_1)\right>$ - the inner product of $n$ with the traction vector of a surface orthogonal to $e_1$. Mathematically, I understand why this is correct. But is there any intuitive meaning as to why these two quantities are the same?

From :     "[...] the stress vector $T$ across a surface will always be a linear function of the surface's normal vector $n$, the unit-length vector that is perpendicular to it. [...] The linear relation between $T$ and $n$ follows from the fundamental laws of conservation of linear momentum and static equilibrium of forces, and is therefore mathematically exact, for any material and any stress situation. The components of the Cauchy stress tensor at every point in a material satisfy the equilibrium equations (Cauchy’s equations of motion for zero acceleration). Moreover, the principle of conservation of angular momentum implies that the stress tensor is symmetric."   What is the more detailed explanation for this, and/or where can I find it?


Surely there can be no real collision resistant Hash function since hash values are of finite size which means there are finitely many of them, but there are an infinite number of messages we could hash, which means (using the pigeon-hole principle) that some messages must lead to the same hash value.

What is "preimage resistance", and how can the lack thereof be exploited? How is this different from collision resistance, and are there any known preimage attacks that would be considered feasible?


We define a function that uses a type defined elsewhere:  auto some_func(const some_type var) -> bool  { ... }   Let's say that currently some_type is an enum.  But it's defined elsewhere in the codebase, and arguably could be changed.  I believe because the type of "some_type" isn't necessarily guaranteed to be an enum primitive type, the const makes sense.  My code reviewer believes that it's a mistake to use const because some_type is an enum.  Does it make sense to leave the "const" in here because someday some_type may change, or does it make sense to leave it out because it is an enum and will likely always be an enum?  For those marking this question as a duplicate, the question is NOT "should I use const on enums" - the question IS "should we use const if we the definition of the type is in another part of the codebase and we can't guarantee that the type will stay an enum"

How far do you go with const?  Do you just make functions const when necessary or do you go the whole hog and use it everywhere?  For example, imagine a simple mutator that takes a single boolean parameter:  void SetValue(const bool b) { my_val_ = b; }   Is that const actually useful?  Personally I opt to use it extensively, including parameters, but in this case I wonder if it's worthwhile?  I was also surprised to learn that you can omit const from parameters in a function declaration but can include it in the function definition, e.g.:  .h file  void func(int n, long l);   .cpp file  void func(const int n, const long l)   Is there a reason for this? It seems a little unusual to me.


I need to prove that   $$\lim_{n\to \infty} \sum_{k=1}^n \frac{n}{n^2 + k^2} =  \frac{\pi}{4}$$  using definite integrals. I would like to get a explanation about to do it , and whats the reasons. thanks!!

How do you calculate that: $$\lim_{n \to \infty} \sum_{k=1}^{n} \frac {n}{n^2+k^2} = \frac{\pi}{4}$$ ? In general I would look for a formula for the expression inside the sigma, and then calculate. But I have no idea what kind of formula there is for this expression. Hint?


How can one extract the exit code of a command and use it in a condition? For example look at the following script:  i=4 if [[ $i -eq 4 && $(command) -eq 0 ]]     then             echo "OK"     else             echo "KO"     fi   If both the conditions are satisfied the script should do something. In the second condition, I need the check on the exit status (and not the command output as is the case in the script given above), to know if the command was successful or not.

I started learning Bash a couple of days ago.  I'm trying to obtain an exit status of grep expression into a variable like this:  check=grep -ci 'text' file.sh   and the output that I got is   No command '-ic' found   Should I do it with a pipe command?


I tried looking for an answer which is specific to situation on the boards but have not been able to find one or they are for different countries and may have a different policy.  I am travelling to the US from the Philippines and hold both a US and PH passport. For the sake of this example my name on my birth certificate is as follows: Jonh Mike Cruz Smith, broken down as  First Name: John Mike // Middle Name: Cruz // Family Name: Smith  My PH Passport lists my name as First Name: John Mike // Middle Name: // Family Name: Smith  My US Passport lists my name as First Name: John Mike // Family Name: Cruz Smith  The US passport combined by middle and last names and the PH passport omitted the whole name altogether. My ticket is issued under my US Passport name since I am travelling to the US.   When I leave Manila, I will need to present my PH passport to prove that I have not overstayed in the Philippines; however, immigration also requires that I am able to prove that I have the ability to legally enter my final destination which is my US Passport, thus having to present both passports.  Will this be a problem for me if I present both passports and my birth certificate?   I am assuming that I need to use the PH Citizen lane at the airport leaving Manila, is this correct?  PS. I am transiting through Singapore, but doubt that presenting just my PH passport will be sufficient since I'm booked on a one-way ticket with no return.

I am a citizen of two different countries, and have two passports.  How should I use my passports when traveling?


I am trying to animate a tape to roll on the floor. I figured out how to make the tape cylinder part to rotate around as it goes to the arrowed direction, and now I want the bottom part (taped onto the blue ground) to gradually appear as it follows the tape cylinder part. But this is my first time ever animating something, all I know is adding keyframes, so I have no idea how to do so. Which modifier or function should i use for this? Thank you as always! let me know if I need to explain more.

I'm a newbie to Blender. I would like to know if we can create reeling effect (Cloth spooling around a cylindrical object).  I found couple of tutorials in which a map is rolled up... but it rolls up inside the circle. (Eg. ).  But I want the effect to be Turning & Growing in size as below.    Can anyone please guide me how it can be done (or if it can be done)   If possible, any links of the tutorials to follow would also be awesome.  Thanks in Advance!


Let Y(1), Y(2), Y(3), Y(4), Y(5) denote the order statistics of a random sample of size 5 from a distribution having p.d.f. f(y) = e^(-y), 0 < y < ∞, zero elsewhere. Show that Z1 = Y(2) and Z2 = Y(4) − Y(2) are independent. Hint: First find the joint p.d.f. of Y(2) and Y(4).

Help me to solve this problem please..  Let $Y_{(1)}, Y_{(2)}, Y_{(3)}, Y_{(4)}, Y_{(5)}$ denote the order statistics of a random sample of size 5 from a distribution having p.d.f. $f(y) = e^{(-y)}, 0 < y < \infty$, zero elsewhere. Show that $Z_1 = Y_{(2)}$ and $Z_2 = Y_{(4)} − Y_{(2)}$  are independent. Hint: First find the joint p.d.f. of $Y_{(2)}$  and  $Y_{(4)}$.


I'd like to know an introduction to classical statistics, that:   Emphasizes connections and unifying principles (I checked  question and the links posted therein, but didn't find an introduction textbook) Concisely presents the solid basics of core techniques and concepts, like: linear regression, MLE, hypothesis test, confidence interval, unbiasedness, consistency, sufficiency, etc. (pretty much like the point 2 & 3 , but I am not a mathematician) At a level between a first and a second course (or a first course for an honors class?) And preferably, briefly introduces some modern computation-intensive techniques, maybe through code (like R).   For some background and books have looked at, see  post.

I did a science PhD doing applied bayesian statistics, and I liked it so much that I decided to shift to statistics.  For the last 2-3 years have been working at a firm that has more of a frequentist focus.  It seems to me that the bayesian approach (at least what I learned) has an underlying theory that was laid out and I could understand.  Now I find this - more classical - field fascinating but I am looking for some resources to get a unified view of the matter.  For example, I am learning and applying anovas, F-tests and chi-squares, thinking about degrees of freedom, etc but part of me is looking for deeper understanding that would make it more than just methods.  Does anyone have any suggestions on books or more resources that provide such a unified, deeper focus?


I did my English homework and I searched this sentence. They said that it's "Elvis has died age 79"   Can I use "Elvis died at the age of 79" instead? Is it still correct? Can you explain? (I hope my grammar isn't wrong.)

Most instructions for equipment and software make a habit of shortening sentences by dropping words of certain parts of speech - usually definite and indefinite articles.  For example:     PULL (THE) LEVER TO OPERATE      CARS MAY BE TOWED WHEN (THEY ARE) PARKED ILLEGALLY      PLEASE USE (THE) OTHER DOOR   Is there a name for this custom? And what is the best way to describe it?


I've been playing a 4e dungeons and dragons campaign for a while now, and it's the first campaign I've ever played in. The DM seems to keep pampering one player in particular. He usually only gives plot hooks to that player, never blames that player for anything, gives that player any and all magical items he wants, and let that player start out the game with a feat that allows him to take two standard actions per turn without spending an action point. The player claims that us other players are just bad at the game, even though his character sheet has multiple very clear errors. The thing is, this player is the only reason that we can win any battles since he's a higher level than any of us and the DM scales bosses to him. The DM has recently started giving plot hooks to other players, but the only time this has happened was when he gave my character a single hook one session ago. I'm sorry for ranting, I would just like to know how to deal with this.

I actually have two situations but they are interconnected. Our group is currently playing a Dresden game. The GM and one of the players are married. Along with that, he is a new member to the group. I can understand her (the GM) wanting to make him feel welcome but it has gone into the the realm of blatant favoritism. A few examples:   Every idea he has is deemed fantastic, wonderful, awesome and is always successful. Most of the time he doesn't have to roll to see if he succeeds; he just does. After a series of major setbacks to the other player's characters, I joked that her husband was the only one left to mess with. Her answer to that was that she would absolutely not be messing with him in the game. He and his character were safe from that. In the last session, he and another player had to make the same roll using the same skill for the same information. He needed a fair to succeed. The other player needed a great. Not the first time that has happened.    The second part of this has to do with him as well. As I said, he is new to the group. When we were discussing a game to play, it was made clear that it would be cooperative. We would all be working together to a common end. However, he will not- I mean ever- share any information with the rest of the group. No matter how vital or needed that information is to advance the story, he just smiles and says he's got nothing. To try and get around this problem, a group aspect was created. That way if a situation or information that everybody needed to know came up, a fate chip could be played and anyone who wanted to be a part of it could be present. He is totally abusing it. Now, instead of just not telling us anything, he adds give me a fate chip and maybe I'll tell you something. It's like he is trying to beat us at the game and that is not the way it was set up.    So, the question to these two situations is what do I do? How do I handle this in a rational and sensitive way? To complicate things further, the GM is my best friend. He is her husband. I don't want to put her in the middle but I am about ready to quit the game. I am tired of it being his game and everyone else being bit players. Should I talk to her or should I talk to him? If anyone has had experience with this, any advice would be appreciated.


In what way may I alter the list of "Linked" questions appearing aside? Explicit links (from the question's body) are always put on the list, but these are not the only ones existing there – a few strongly related questions also appear on the list. Is it done automatically, through moderator tools, or by some other means unknown for me?  I is sometimes useful to point at a question which presents a useful example or shows the same problem from a different point of view. Also, it would be a good way to promote own questions which could enrich a discussion on other user's topics.

As per the title, what is this new feature?


I couldn't think anything about this question from a book by Bass:      Does there exist a $σ$-algebra which has countably many elements, but not finitely many?   May I get a hint please? Thanks!

I am going over a tutorial in my real analysis course. There is an proof in which I don't understand some parts of it. The proof relates to the following proposition: ($S$ - infinite $\sigma$-algebra on $X$) $\implies $ $S$ is uncountable. Proof:  Assume: $S=\{A_{i}\}_{i=1}^{+\infty}$. $\forall x\in X: B_{x}:=\cap_{x\in A_{i}}A_{i}$. [Note: $B_{x}\in S$ $\impliedby$ ($B_{x}$ - countable intersection]. Lemma: $B_{x}\cap B_{y}\neq\emptyset \implies B_{x}=B_{y}$. Proof(of lemma): $z\in B_{x}\cap B_{y} \implies B_{z}\subseteq B_{x}\cap B_{y}$. 1.$x\not\in B_{z} \implies x\in B_{x}\setminus B_{z} \wedge B_{x}\setminus B_{z} \subset S \wedge  B_{x}\setminus B_{z} \subset B_{x}$ (contradiction:$\space$ definition of $B_{x}$) $\implies$ $B_{z}=B_{x}$ 2.$y\not\in B_{z} \implies y\in B_{y} \setminus B_{z} \space \wedge \space B_{y}\setminus B_{z} \subset S \space\wedge\space B_{y} \setminus B_{z}\subset B_{y} $(contradiction: definition of $B_{y}$) $\implies$ $B_{z}=B_{y}$ $\implies B_{x}=B_{y} \space \square$ Consider: $\{B_{x}\}_{x\in X}$. If: there are finite sets of the form $B_{x}$ then: $S$ is a union of a finite number of disjoint sets $\implies$ $S$ is finite $\implies$ there is an infinite number of sets of the form $B_{x}$. $\implies$ $|\bigcup\limits_{i\in A \subseteq\mathbb{N}}B_{x_{i}}| \geq \aleph_{0}$.(contradiction) $\square$  There are couple of things I don't understand in this proof:  Why the fact that we found a set ($B_{x}\setminus B_{z}$) in $S$ containing $x$ and is strictly contained in $B_{x}$ a contradiction ?  Why if there are only a finite number of different sets of the form $B_{x}$ then $S$ is a union of a finite number of disjoint sets and is finite ?


I'm in the process of writing a CDN plugin for WordPress and am trying to integrate it with the Advanced Custom Fields plugin. I need to filter the output of the "File" field type on the edit post screen so I can display the correct file size for an attachment not hosted locally.  Unfortunately, ACF doesn't provide a way to filter the output so I'm having to resort to completely overriding the ACF callback which outputs the field  To do this, I need to first remove the ACF callback from the action, then add my own. I'm not able to use remove_action() because the ACF callback is an object method and I cannot access the object variable  I don't want to use remove_all_actions() because it could potentially break other plugins hooking on to the action so I have come up with the following:      global $wp_filter;      if(isset($wp_filter['acf/create_field/type=file'])) {         foreach($wp_filter['acf/create_field/type=file'] as $priority => $filters) {             foreach($filters as $key => $filter) {                 if(is_array($filter['function']) && ($filter['function'][0] instanceof acf_field_file)) {                      // If the function is an array, and the first part is an instance of the acf_field_file we have found what we're looking for                     unset($wp_filter['acf/create_field/type=file'][$priority][$key]);                      break 2;                 }             }         }     }      // Now add our own callback     add_action('acf/create_field/type=file', array($this, 'create_file_field'));   There's just something about looping through the wp_filters global that I don't like. Is there a better way of doing this or am I going to have to stick with this ugly bit of code?  EDIT: I'd like to stress that this is NOT a support request/question for a 3rd party plugin (ACF). The plugin being used is not relevant to the question. The question, in it's most basic form, is how to remove a callback from an action which happens to be an object method where the object variable cannot be accessed

In my functions.php file I would like to remove the below filter, but I'm not sure how to do it since it's in a class. What should remove_filter() look like?  add_filter('comments_array',array( &$this, 'FbComments' ));   It's on line 88 .


I have searched and tried a number of methods but I can't find one that works with the coding I currently have (which was learned from here,  thanks).   Might I ask you to indulge me and lend a hand please.  I am suffering with the apostrophe when a textbox gets something like harry's typed into it.  The form data is sent to a php file that adds the record like this :-    if ($stmt = $mysqli->prepare("INSERT lists (group, owner, pattern, gender) VALUES ('$_POST[Group]','$_POST[Owner]','$_POST[Pattern]','$_POST[Gender]')")) { $stmt->execute(); $stmt->close(); } // show an error if the query has an error else { echo "ERROR: Could not prepare SQL statement."; }     So how do I use "mysqli_real_escape_string" in the above?  Of course, if there is a better solution I would be only too pleased to hear.  Thanks for your help.  Obviously I am an absolute dim git.  The page says "If this question is different, please edit it to explain how it is different".  I can't even see how the linked page is even similar!  I have now spent three days trying to sort this but without success  (yes I did try before I posted here) and I can't see anywhere any example of what I should be doing.  Can anyone please,  please, please,  explain how I should do this?  Example code would help me immensely.  It seems that this site helps when someone has at least some understanding of the whole but not when one is absolutely thick.  The replies,  though well intended and appreciated,  were as helpful as a reply simply saying "The number 7 bus doesn't go this way".  Sorry guys.

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


I would like to check for multicollinearity in logistic regression analysis. Independent variables are categorical (always binary) and continuous. Sample has limited size (N=176, 36 events), so I can use 2, max. 3 variables.  Can I use VIF as an indicator for multicollinearity in final model? What if I have in final model 2 categorical (binary) and one continuous? Does it make sense to use VIF? Are there any others SIMPLE options? (SPSS)  I have searched all over internet but could not find an SIMPLE (excluding complicated formulas) answer concerning VIF with categorical variables.  I am using SPSS 22.0 and my field is heart surgery, not statistic. Any suggestions? (instead of finding a statistician).

I like Peter Flom's answer to an earlier question about multicollinearity in logistic regression, but David Garson's Logistic Binomial Regression states that there is no valid test for multicollinearity for binary-dependent logistic regression, even if the independent variables are ratio scale. Can anyone supply one or more references? My own experience is that OLS correlation matrices and VIF worked for me, as my logistic coefficients went haywire before removing entangled independent variables based on the OLS tests for multicollinearity. But I have to publish my results and methods, and would like a reputable way to cite the practice, if one or more exist.


So I've tried to do this  for x in {1..7000} do    echo $x done   The output is {1..7000}   I've also learned that the C-style for loop doesn't work in mksh  I've done a bit of googling but mostly there is information about ksh, not mksh  So what is the correct way to iterate through a range in mksh ?  NOTE: I am more interested in proper way to create iterations and c-like behavior rather than printing a string.

I found the following command to repeat a character in Linux:  printf 'H%.0s' {1..5000} > H.txt   I want, for example, H to repeat 5000 times. What does %.0s mean here?


I have heard alot about , I have downloaded it and it is running fine. But the problem is I want to update my existing firefox which came installed by default, so as to have all my history, password etc to be on the latest i.e. Quantum one. Currently, it does not have any browsing history or any other data I had on my old-school browser.

I want to install the latest Firefox on my Ubuntu (64bit) box.  What is the best way to do this? Is there a specific update site or should I download the binaries manually? If doing manually, in which directory should I put the files? In my home directory, or is there a better place?


When does Windows clear this directory? The only time it seems to is when running disk cleanup tool one is given the option..

We are thinking to make our web application hosted on a windows server 2003 machine create temporary files, and "leave" it there as such. We won't manually take any action on them. So will these files get automatically deleted? Or is there some sort of policy we have to configure - like these files should get deleted after 30 days or so...  Update:  A production server will hardly get shutdown. What to do then if the files have to be deleted somehow?


I m generating one chinese report and getting following error.  Unicode char \u8:动 not set up for use with LaTeX.   i m using including following packages.   \usepackage[LGRx,T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[greek,english]{babel} \usepackage{CJKutf8} \usepackage[T1,T2A]{fontenc} \usepackage[english,russian]{babel}   How to fix this pblm?

No matter how I try to do it I always get the following error :      ! Package inputenc Error: Unicode char \u8: not set up for use with LaTeX.    I have tried using $^{\circ}$, \deg, \textdegree, pasting the ° symbol directly, to no avail.  Here is the header of my document, in case one of those could be causing the errors :  \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[francais]{babel} %\FrenchItemizeSpacingfalse \frenchbsetup{CompactItemize=false} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amsthm}


Is it correct to turn the sentence "He'll be her sixth husband" into a question like this:Which successive/consecutive husband will he be? Best wishes, Boguslaw

I want to make a question having an answer as follows:     5 is the third prime number.   The bold part is the answer. How to phrase the question?


By using below code i am able to get client ip address, but i want to get client ip in js without using any external http:// or https:// url,   how do i get client ip address?   $.getJSON("http://jsonip.com?callback=?", function (data) {     alert("Your ip: " + data.ip); });   java is server side language. Please help me.

I need to somehow retrieve the client's IP address using JavaScript; no server side code, not even SSI.  However, I'm not against using a free 3rd party script/service.


Whenever I review Close Votes, I sometimes stumble upon something that I don't think should be closed, but just to make sure I haven't missed something, I press the "Close" button to see how many people have actually voted that something is e.g. off-topic or what is going on.  Unfortunately, this method is faulty, because from time to time I'll be met with this message which I'm sure we're all familiar with.    And all of a sudden, I feel bad and feel like I've done something wrong, even though I haven't actually voted to close anything, I just wanted to peak.  Therefore, I have a question and a request:  Question: Are those times where I apparently don't pass the test getting recorded? If I keep using this method, will it eventually have some effect on my voting?  Request: Can we not make the error message show up until reviewers have clicked "Vote to close"? In the dialog, it shows many people have voted. Just adding random votes in here will only further my confusion to the close reason, but not having any votes in there will also be "suspicious". Exactly how this can be changed, I don't know; I just know that I don't like getting told to stop and listen for no reason...sob.

Having just  from any of the queues, it was reviewing close votes; however, this audit was flawed in that I didn't even cast a close vote.  Often I press the Close button to preview greater detail and sentiment of the closure, spawning the Why should this question be closed dialog box:    Especially for duplicates, where functionality is solely dependent on spawning this dialog.  From Closing > Duplicate, I can search or view selected duplicates:    Although, I realize general closure reasons are summarized on the page:    This question had 6-upvotes, but seemed very localized referencing subjective query is "taking too long" and even had a sqlfiddle link.  Maybe overly broad regarding performance tuning, the OP was posting like a forum with two answer posts to his own question  and  with one of those answers asking follow-up questions.    Wanting to gauge community response, current closure totals struck my curiosity.  So, I pressed the Close button and boom - oh, the humanity!  I failed, and didn't even cast a close vote.    Votes are not cast until a reason for closure is selected and Vote to Close is pressed.  Taking any review very seriously on this site, it only seems fair that my review quality is tested through actionable steps instead of clicking for more detailed information, leveraging the functional design of the close vote user interface.  Sure, it's complex to seed fake vote totals, and then there's controversy of mindless voting in the majority or people who simply cherry pick 4-vote questions.  Still though, it seems unfair I should hesitate to review further information of vote totals and duplicates before skipping due to the implementation of this audit.


I want to get the sum of hours an employee, whose name is in Cell D1, was absent by referring to a table.  The table is on a sheet named Sep.  The word Sep is a string typed in A97. I am able to accomplish the query within my workbook, with the formula:   =QUERY(indirect(concatenate($A97,"!A2:$F")), "Select sum(F) where A = '"&$D$1&"' label sum(F)'' ")   I also verified that my IMPORTRANGE formula is working. (Because my Stack Exchange account is new, it won't allow me to put more than two links in this posting.  So, I took out the full link in the formula below, even though I correctly use the full link in my actual formula.):    =importrange("1033hNIUutMjjdwiZZ40u59Q8DvxBXYr7pcWyRRHAdXk",concatenate($A97,"!A2:$F"))   But, when I try and put it all together, I get the error:     Error Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: F   This is the formula I'm attempting to use:  =Query(importrange("https://docs.google.com/spreadsheets/d/1033hNIUutMjjdwiZZ40u59Q8DvxBXYr7pcWyRRHAdXk",concatenate($A97,"!F2:$F300")), "Select sum(F) where A = '"&$D$1&"' label sum(F)'' ")   Here is a link to the .

This is the problem I'm seeing:      Error - Unable to parse query string for function QUERY parameter 2: NO_COLUMND     The formula is of the form:  =query(importange("...", "Sheet!A:V"), "select D where V = 1", 1)   I imported data from another sheet, I want this current sheet to display column D when Column V is 1.  Is there a different way rather than my current formula?


The Axiom of Infinity states that at least one inductive set exists. Inductive sets are infinite, but not all infinite sets are inductive.  Suppose that we take ZFC with the negation of the Axiom of Infinity. Is it still possible for infinite sets to exist? I feel that this might be a dicey question, since ZFC's internal notion of an infinite set relies on ordinal numbers, and (I assume) the negation of the Axiom of Infinity precludes the existence of infinite ordinals. If this question is actually ambiguous as written, I'd be happy to have that be the answer to the question.  Thanks!

What mathematics can be built with standard ZFC with Axiom of Infinity replaced with its negation?  Can the analysis be built?  Is there special name for "ZFC without Infinity" set theory?  I also assume that using symbols like $+\infty$, $-\infty$ when dealing with properties of functions and their limits would still be possible even with Axim of Infinity negated (correct me if I am wrong).  UPDATE  In light of the answer by Andres Caicedo which suggested Peano arithmetic, I want to point out that Wikipedia says about Peano arithmetic "Axioms 1, 6, 7 and 8 imply that the set of natural numbers is infinite, because it contains at least the infinite subset". I do not know how this can be interpreted as having axiom of infinity but I am interested what if Peano arithmetic modified the following way:   Added an axiom 5a:   There is a natural number $\infty$ which has no successor, for any natural number n $S(\infty)=n$ is false.   Axiom 6 modified:   For every natural number n except $\infty$, S(n) is a natural number


I'm using Lodash...  coffee> _ = require("lodash") [stuff deleted]   This expression gives the right answer...  coffee> _.map("7-9".split("-"), (x)->parseInt(x)) [ 7, 9 ]   But this one gives something slightly different for the last result in the array:  coffee> _.map("7-9".split("-"), parseInt) [ 7, NaN ] coffee>   Why are the answers different? Surely (x)->paresInt(x) should behave the same as parseInt

From the :  [1,4,9].map(Math.sqrt)   will yield:  [1,2,3]   Why then does this:  ['1','2','3'].map(parseInt)   yield this:  [1, NaN, NaN]   I have tested in Firefox 3.0.1 and Chrome 0.3 and just as a disclaimer, I know this is not cross-browser functionality (no IE).  I found out that the following will accomplish the desired effect. However, it still doesn’t explain the errant behavior of parseInt.  ['1','2','3'].map(function(i){return +i;}) // returns [1,2,3]


Does anyone know if there is a configuration to allow the lockscreen widget to default to expanded view on Android 4.3 or higher?  I have a Note 3 and have not yet received the 4.4 update.  I prefer NOT to use a 3rd party app.  My preference is to use the stock email widget, but have it in expanded mode by default.

I am on Android 4.2.1 (Galaxy Nexus), when using Lockscreen widgets, they are always quite small until once drags them down, then they get maximized. Any way to maximize them by default? Thanks :-)


I recently saw this question about the convergence of $$\sum_{n=0}^{\infty} \sqrt[3]{n^3+1} - n$$  I tried finding the convergence of this series by factoring out an $n^3$ so that the sum became,   $$\sum_{n=0}^{\infty} n\sqrt[3]{1 + \frac{1}{n^3}}$$ but couldn't figure out any way to simplify and solve this. Is there a simpler or better way to solve this?

I have to test the convergence of the following series:- $$\sum_{n=1}^\infty\sqrt[3]{n^3+1}-n$$ My approach is as follows :- $$n^3+1>1=\sqrt[3]{n^3+1}>1=\sqrt[3]{n^3+1}-n>1-n$$ Now since$\sum 1-n$ diverges, the series under consideration diverges. Is this right or wrong?


I am referencing 2 classes with themselves using forward referencing however I am still getting errors with my class instance declarations in each class. Note: I'm using DirectX and version control if that has anything to do with it?  Game.h:  #ifndef GAME_H #define GAME_H  class Player;  class Game { public:      Player player;  // Undefined class error here //... };  #endif   Player.h:  #ifndef PLAYER_H #define PLAYER_H  class Game;  class Player { public:     Game game;  // Undefined class error here //... };  #endif   Obviously there is a lot more code but I thought including only essential code would make it easier for you to read.  Any help would be greatly appreciated.  Many thanks  Ash

I am looking for the definition of when I am allowed to do forward declaration of a class in another class's header file:  Am I allowed to do it for a base class, for a class held as a member, for a class passed to member function by reference, etc. ?


I have subfolders in current directory like this:  ls  apples  bananas  oranges  potatoes   Each subfolder includes different number of .jpg images.  cd apples  ls  000000522638.jpg  000000522713.jpg  000000522751.jpg   I have custom python program downloaded from different source which modifies images, and takes input image path and output image path as argument:  python modifyImage.py path/to/input/image.jpg path/to/output/image.jpg   Problem statement:  I want to apply this program for each image in given subdirectories(apples,oranges etc.). There are a lot of folders and images with arbitrary names, so I can not do this by hand. Possible solution would be, firstly finding all *.jpg image paths and send these as argument to python script.  And I made script for updating *.jpg files only in current directory like this   for file in *.jpg do   python modifyImage.py /"$file" /"$file" done   But I need above script to work with subdirectories. Please help.

I am trying to convert a bunch of images to thumbnails that might be in several subdirectories, and save a copy of the image as a thumbnail inside the subdirectory, but I can't figure out the syntax. Any advice would be welcome.   convert test/*/*.jpg -50x50 test/*/*_thumb.jpg


What would I need to look into form making a query on a table that looks like this:  +---+---+---+ | A | B | C | +---+---+---+ | 1 | x | 2 | +---+---+---+ | 1 | x | 3 | +---+---+---+ | 1 | x | 4 | +---+---+---+ | 2 | y | 5 | +---+---+---+ | 2 | y | 6 | +---+---+---+  Into results that looks like this:  +---+---+-------+ | A | B | C     | +---+---+-------+ | 1 | x | 2 3 4 | +---+---+-------+ | 2 | y | 5 6   | +---+---+-------+   The rows that have similar values from attribute A are grouped into one column though the different values from C are merged together.  Please let me know if you can help. Thanks

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)


From a group of 8 men and 4 women a team of 5 including atleast 1 woman is to be formed.Find the number of ways in which this team can be formed.      What i've done: No of ways to select one woman is 4 AND No. of ways to select remaining 4 members is C(11,4) since there are totally 11 people left now and there is no further restriction/condition for their selection ∴ Total ways to select team= 4*C(11,4)=1320 But the answer given in my textbook is 736 Can someone please explain what is wrong in my  approach and whats the correct way to do this? Thanks in advance :)

I have the following problem: A class has 20 students, 16 females, 4 males. Find all possibilities of choosing 6 students so that at least one is male.  I did the following, pick one male from the 4, you have 4 possibilities, then you are left with 19 students, pick 5, so I get 4*${19}\choose{5}$ possibilities.  However, one can notice that if you want no one to be male, then the possibilities are ${16}\choose{6}$, so, one could argue that the solution is instead ${20}\choose{6}$ - ${16}\choose{6}$.  So, which is solution is correct, and why?  $$4* {{19}\choose{5}}$$  or $${{20}\choose{6}} - {{16}\choose{6}}$$


So when I was promoted to president of the club, I took the opportunity to introduce new events.  From my experience as president of Pre-med Club, I can confidently say that leadership is about encouraging constructive interpersonal interactions between people.

I was taught at an early age in the USA that when we write about our President, we are supposed to capitalize the title in order to signify that it's on the federal level. Is it correct to always do this? And what about saying "the presidency" -- should that be "the Presidency"?


Can I upgrade the graphics card of the Toshiba Satellite S50T to Nvidia or anything more powerful than the stock AMD Radeon?  I haven't purchased it yet, although I'm hoping to in the next month.   The laptop's specs:   i7-451U 2Ghz CPU 8 GB DDR3 RAM 1TB HDD + 8 GB SSD hybrid 15.6" Full HD Touch display 2 GB AMD Radeon™ R7 M260** dedicated VRAM

As there's no definitive answer to this, and I would prefer not to be too specific about particular models, what are the things that determine whether this is possible or not?   What expansion slots would the laptop require to do this? How can you find out if a motherboard/chipset supports upgrades?  Is heat an issue? Could it void the warranty? How is battery life affected?


When using nodal analysis, my book says you will always end up with \$n-1\$ linearly independent equations, where \$n\$ is the number of nodes.  Can someone intuitively explain why this is true? If it's too hard too give intuition, I'll settle for a formal proof.

I'm looking for an intuitive explanation (not a proof) of why the equations produced by nodal analysis and mesh analysis are always linearly independent and always have a unique solution, if the circuit has a unique solution.  Again, please note, I'm not looking for a proof, rather an intuitive explanation.


How do I evaluate the following integral $$\int_{-\infty}^{\infty} \exp\left(-\frac{\sigma^2 x^2}{2}\right) \mathrm dx\;?$$  How is it even possible to find an antiderivative?  The integral is evaluated "silently" in a book leading to a theorem.  Using Wolfram Alpha (after trying to evaluate on my own) I get     and this is not what I want, since at my level we've never worked with such a function.  Hoping someone can clarify.

How to prove  $$\int_{0}^{\infty} \mathrm{e}^{-x^2}\, dx = \frac{\sqrt \pi}{2}$$


I  want to do some analysis on the emails I have sent and received in Gmail to compare it to other forms of communication. I am interested in things like average or median email length or the number of emails in a conversation.  I am trying to figure out the best way to get my emails from Gmail into a parsable format (e.g. a plain text format or ideally XML, but that is a reach) so that I can write a script to parse them. So far I am stumped. I assume it would begin with getting a desktop email client and downloading them with IMAP, but even then I am not sure how I would go about actually getting them into a parsable file.

I have a label that sorts all my email marketing from one company. I want to export the search results so I can grab the subject lines. There are about 350 messages, and I wanted to research the subject lines. Any ideas?


Let $a = \begin{pmatrix}x_a\\y_a\\z_a\end{pmatrix}$, $b = \begin{pmatrix}x_b\\y_b\\z_b\end{pmatrix}$, and $c = \begin{pmatrix}x_c\\y_c\\z_c\end{pmatrix}$. Show that $(x_a,y_a,z_a)$, $(x_b,y_b,z_b)$, and $(x_c,y_c,z_c)$ are collinear if and only if $$a \times b + b \times c + c \times a = 0.$$    I was thinking of proving that the area of the triangle formed by the three points is 0.  I thought the box product, $|(a \times b)\bullet c|$, would be helpful but I don't know how to relate that to the equation.  All help is greatly appreciated.

Let ${a} = \begin{pmatrix}x_a\\y_a\\z_a\end{pmatrix}$, ${b} = \begin{pmatrix}x_b\\y_b\\z_b\end{pmatrix}$, and ${c} = \begin{pmatrix}x_c\\y_c\\z_c\end{pmatrix}$. Show that $(x_a,y_a,z_a)$, $(x_b,y_b,z_b)$, and $(x_c,y_c,z_c)$ are collinear if and only if ${a} \times {b} + {b} \times {c} + {c} \times {a} ={0}.$  Hello,  Is there any other way to do this problem without bashing?  I can't seem to find a nice and slick solution to this.  Thanks in advance!


2 Hours ago I Installed Oibaf's graphics drivers and then i restarted, and from that point whenever i boot into ubuntu i get stuck on  /dev/sda2: recovering journal /dev/sda2: clean, 234417/30295728 files, 5171544/120946688 blocks   and gets stuck on that blinking _.  I will guess most of you will tell me to uninstall the drivers but i don't want because of gallium nine's native DX9 support, a solution or an alternative would be much appreciated.  Just in case, here are the specs:   4GB of DDR3 Ram Intel Core I5 4200u AMD Radeon HD 8670m 1GB of VRAM Screen Res: 1366x768 Intel HD Graphics 4400 Ubuntu 16.10 Yakkety Yak

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


If a for loop "iterates" a double from 0.00 to 0.40, for example, even when writing <=, the loop terminates when i=39. When performing essentially the same thing using integers, the program acts normally.  #include <iostream> using namespace std;  int main() {     for (double i = 0.00; i <= 0.40; i += 0.01) {         cout << i << " ";     }     return 0; }   This returns 1 2 3 ... 37 38 39.  You can test this here:   What causes this behavior and is there an ideal way to fix this, as just writing i <= 0.41 seems like a hacky solution. Even more so if the 0.40 was a user entered value, adding a small quantity certainly be considered bad practice.  Sorry if the title and question are poorly phrases, I'm not sure how to word this.

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


The original sentence is below.     When you are studying any matter, or considering any philosophy, ask yourself only what are the facts and what is the truth that the facts bear out.   I would like to know if the sentence below in a different order is correct as well.     When you are studying any matter, or considering any philosophy, ask yourself only what the facts are and what the truth that the facts bear out is.   I am not a native English speaker and there is so much basic stuff I am confused about like this. Any explanations will be greatly appreciated.

If the original question is "What time is it?" and I want to communicate it to another person, are these Embedded Questions OK?        I don't know what time is it.       or        I didn't know what time was it. (if communicated later)


I just added a new battery to my laptop today, and a new webcam. Then suddenly about maybe 12 hours after it starts making the USB sound when you insert and remove it. It plays the 'IN' sound then the 'OUT' sound and then plays them both together at the same time, then a little pause, then it continues the loop. Please help me :( Especially this is on Christmas.

Throughout the day I notice that my computer makes apparently random device-connect and/or device-disconnect ("boink") sounds.    I suppose it is the same sound you hear when connecting or disconnecting a USB device such as a thumb drive.  I've noticed that this happens on each of three computers I work with at home, my wife's computer, and my machine at work.  It happens without any user action at all - i.e. I'll be just sitting there (hands off my mouse and keyboard), and the computer will make the sound.  There is no visual queue or anything.  Just the sound.  I have sometimes gone in pursuit of the sound - running virus scans, examining event logs and such, and observing task manager - but have never had any luck tracking this thing down, but have not had any luck.  I've been noticing this since Windows Vista and now the sounds have followed me through to Windows 7.   Surely someone else out there must be experiencing this and can explain what is happening.


I just know ProQuest which supplies some PhD dissertations. However, it's hard to find some the dissertations of French and German.   So are there any other good databases for dissertations of French, German, UK, USA? Any answer is encouraged.

Is there a global/worldwide database of dissertations? If not, how can I access French, German, Italian, etc. dissertations online?


Need a shell script to be called via cron job every day and see if it's 20th day,it should send a mail

Can some one tell me the logic or the entire script to create a shell script to send a mail to me once every 20 days


Euclid's Lemma: Let $p$ be a prime number, and let $a,b\in \mathbb{Z}$. Then $$p\mid ab\implies p\mid a\vee p\mid b$$  I know that there are proofs available in the websites. I'd like to get some feedbacks what you think about the proof i made here.  Proof: If $a,b=0$, the implication is clear. Now suppose $a,b\neq 0$. Suppose $p\mid ab$. We know that $(a,p)\mid a$ and $(a,p)\mid p$, which implies that $(a,p)\mid p$ (by Specialization). But $$(a,p)\mid p\iff (a,p)=1 \vee (a,p)=p.$$ Checking the cases $(a,p)=1$ and $(a,p)=p$, we see that $$(a,p)=1\implies p\mid b\implies p\mid b\vee p\mid a$$ where the first implication is used by the Bezout's lemma, and  $$(a,p)=p\iff p\mid a\wedge p\mid p\implies p\mid a\implies p\mid a\vee p\mid b.$$ Altogether, $$(a,p)=1 \vee (a,p)=p\implies p\mid a\vee p\mid b.$$ QED. Is this a valid proof? If there are mistakes in some directions, please let me know.

I saw on the internet the following Proof of Euclid's lemma, which states that if a prime number divides the product of two numbers, then it must divide at least one of the two numbers.     Since $p \mid bc$, there exists an integer $n$ such that $bc = np$.    Now, assume $p\nmid b$. I.e. there are integers $k, i$ with $0< i < p$, such that $b = kp + i$      And therefore, $$np = bc = c(kp +i ) = kpc + ci \implies ci = p(n - kc)$$    So, $p$ is a factor of $ci$ and since $0 < i < k$ , $p$ must be a factor of $c$.   I am particularly confused by the last statement:      ... since $0 < i < k$, $p$ must be a factor of $c$   This does not make sense to me... $i$ needs not be less than $k$.  This proof was selected as the best answer   I would be grateful if someone could explain me what is going on at the end of the proof or if it is wrong.  UPDATE: I need a proof that does not use the gcd algorithm.


I'm new to Javascript (2nd day :-)) and am struggling to understand why the message  'Error: Uncaught ReferenceError: discountPercentage is not defined'.  I thought that the naming of the function defines it?? Any help is greatly appreciated. Thanks in advance. //var salePrice = prompt("Sale Price") //var discountOne = prompt("Discount Amount (£)")   var salePrice = 200; var discountOne = 100;  function discountCalculation (salePrice, discountPrice) {          var discountedPrice = salePrice - discountedPrice;      return(discountedPrice);          function discountPercentage(discountedPrice,salePrice){                  var discountPercentageCalc = discountedPrice / salePrice;         return (discountPercentageCalc)     }      }   var discountApplied = discountPercentage;  var SalePrice = discountCalculation; console.log(salePrice);

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


I have a  on the battlefield and I played a vampire earlier this turn. Can I tap both to transform Chosen of Markov even though I just played the vampire?  Extra Example: I play  to put two 1/1 white bird tokens into play. Can I now tap a both of them and another creature I control to pay Battle Screech's flashback cost of tapping three white creatures?   Obviously these creatures couldn't use any tap abilities until my next turn, but since the tapping is coming from a different source, I figured the situation might be different.

Note: this is intended to be a canonical question about summoning sickness.  "Summoning sickness", broadly, is the rule that stops you from attacking or paying {T} costs with a creature that you just played. But how exactly does it work? How does it interact with other rules and effects?  For example, if I'm trying to figure out how a creature is affected:   Does the status matter (tapped/untapped, face down/face up, etc.)? What if it came into play, but I didn't cast it? What if it's a token? What if it was on the battlefield when my turn started, but it wasn't a creature? What if it stops being a creature? What if it's a creature and also another card type? What if it's a double-faced card that just transformed? What if it changes control? What if it's a copy of another creature? Which of the creature's activated abilities can I use? Are any of its other abilities affected? Can I tap the creature to pay a cost that is not a {T} cost?   (These examples are primarily taken from questions about summoning sickness that have already been asked on the site)


Let A be a set. Define D to be the collection of all functions f : A → {0, 1}. Prove that |P(A)| = |D| by constructing a bijection F : P(A) → D  I know the power set of A contains 2^(|A|) elements. To show that |P(A)|=|D|, I think I need to use CSB theorem.  From what I'm understanding, the set D would have values like {(a, 0),(a, 1)}.   How do I go about solving this problem? I would be very grateful if someone explained this to me or gave an answer.

I'm trying to prove that the power set of $X$ and the set of functions from $X$ to $2$ are equinumerous. I think the best way to do so is to define a bijection between the two, but I'm not sure how to construct such a function. How do I do this?


I am having a hard time interpreting what something means in a paper I'm trying to get through. If you care, this is the paper: Gender Differences in the Effect of Education on the Slope of Experience-EarningsProfiles: National Longitudinal Surveyof Youth,1979-1988. By KEVINC. DUNCAN*  In one of the tables of the regressions, it explains that a little "a" (next to the coefficient) means the coefficient is significantly different at the .05 level from the comparable coefficient for white males.  What exactly does this mean?  Here is my understanding: If there are 2 correlations with sample sizes n’s, they are each changed into z values. Under the null hypothesis that the population correlations are equal, the following has a standard normal distribution (one equation using both z’s). If the z is great than or equal to 1.96 or less than or equal to -1.96, the two correlations are significantly different at the .05 level of significance. If the z is not significant at the .05 level, sampling error is a possible explanation for the difference. If the two are significantly different, the null hypothesis is rejected! There must be fairy large sample sizes used. Coefficients with p value of .05 or less would be judged to be statistically different.  Is this correct? Can you explain it a little more if I'm wrong.  Here is a link to the paper?   Also which coefficients would you consider significant in Table 2?

After taking a statistics course and then trying to help fellow students, I noticed one subject that inspires much head-desk banging is interpreting the results of statistical hypothesis tests.  It seems that students easily learn how to perform the calculations required by a given test but get hung up on interpreting the results.  Many computerized tools report test results in terms of "p values" or "t values".  How would you explain the following points to college students taking their first course in statistics:   What does a "p-value" mean in relation to the hypothesis being tested?  Are there cases when one should be looking for a high p-value or a low p-value? What is the relationship between a p-value and a t-value?


I need to figure out how to block direct IP access to my website.  Example: I want it so that when people type my IP address 1.2.3.4 into the browser it doesn't work, but when they type www.example.com it does work.  I am using Apache 2.4.9, and my website is run using WampServer.   I have tried other solutions from some old questions on here, but none of them have worked for me. I have tried pasting virtual host stuff into the vhosts.conf, but I couldn't get it right, and I tried doing rewrite stuff with the htaccess file, but that didn't work either.

I'm having problems with apache server (CentOS VPS at Amazon). When apache starts, it starts to receive hundreds of requests, this is an example of the log:  173.208.216.165 - - [25/Jan/2015:18:23:11 +0000] "GET http://go.padstm.com/resources/img/iebt.png HTTP/1.0" 200 36023 "http://go.padstm.com/?id=173374&t=iframe&var=33110" "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)"   The path /resources/img/iebt.png is in my server, but not go.padstm.com. The strangest thing is that apache is accepting all the requests.  Other example: in this case, the entire resource is NOT in my server, but apache returns 200:  198.204.239.250 - - [25/Jan/2015:19:04:39 +0000] "GET http://fstads.com/show.php?z=26&pl=494&j=1&code=1422237874120 HTTP/1.0" 200 10819 "http://financezhen.com/?p=186#respond" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.2a1pre) Gecko/20110324 Firefox/4.2a1pre"   I don't know why these requests goes to my server, or why it returns 200...  Also, when apache starts and module prefork is enabled, it launches multiple httpd processes. If worker module is enabled, it launches multiple threads. Ok, but in both cases apache ends up consuming all the CPU and memory of the server, and there is not traffic directed to my server.  More info: ProxyRequests is Off. Also: I'm using ip-based vhosts:  NameVirtualHost xxx.xxx.xxx.xxx:80  <VirtualHost xxx.xxx.xxx.xxx:80>     ServerName mydomain.com     ServerAlias www.mydomain.com     DocumentRoot /var/www/html/w3prod     ServerAdmin admin@localhost     UseCanonicalName Off     CustomLog /var/log/httpd/w3prod.mydomain.com combined     ErrorLog /var/log/httpd/w3prod_error.mydomain.com </VirtualHost> <VirtualHost xxx.xxx.xxx.xxx:80>     ServerName picfarm.mydomain.com     ServerAlias www.picfarm.mydomain.com     DocumentRoot /var/www/html/picfarm     ServerAdmin admin@localhost     UseCanonicalName Off     CustomLog /var/log/httpd/picfarm.mydomain.com combined     ErrorLog /var/log/httpd/picfarm_error.mydomain.com </VirtualHost> <VirtualHost xxx.xxx.xxx.xxx:80>     ServerName test.mydomain.com     ServerAlias www.test.mydomain.com     DocumentRoot /var/www/html/engine-test     ServerAdmin admin@localhost     UseCanonicalName Off     CustomLog /var/log/httpd/test.mydomain.com combined     ErrorLog  /var/log/httpd/test_error.mydomain.com     ProxyRequests Off     ProxyPreserveHost On     <Proxy *>             Order deny,allow             Allow from all     </Proxy>     ProxyPass /bosh http://xxx.xxx.xxx.xxx:7070/http-bind/     ProxyPassReverse /bosh http://xxx.xxx.xxx.xxx:7070/http-bind/     ProxyPass / http://xxx.xxx.xxx.xxx:8080/     ProxyPassReverse / http://xxx.xxx.xxx.xxx:8080/ </VirtualHost>   Any help would be appreciated. Thanks!


My understanding is that cause and effect create a partial order of events in the universe (and that relatively prevents anything stronger).  My understanding is also that it’s generally useless to talk about “things” in the context of physics. The laws of physics describe events, not objects.  The Big Bang can be seen as the “greatest lower bound” of all events (it must happen before anything else can happen). Similarly the “heath death of the universe” could be seen as the “least upper bound” of all events. No event can happen after it, and all other events must happen before it.  So, the answer would seem to be yes (everything describable by physics forms a lattice).  Has anyone formulated such a notion: the universe is simply the lattice of all events?

On a quantum scale the smallest unit is the , which is a discrete measure.  There several question that come to mind:   Does that mean that particles can only live in a discrete grid-like structure,  i.e. have to "magically" jump from one pocket to the next? But where are they in between? Does that even give rise to the old paradox that movement as such is impossible (e.g. )? Does the same hold true  for time (i.e. that it is discrete) - with all the ensuing paradoxes? Mathematically does it mean that you have to use difference equations instead of differential equations? (And sums instead of integrals?) From the point of view of the space metric do you have to use a discrete metric (e.g. the ) instead of good old Pythagoras?   Thank you for giving me some answers and/or references where I can turn to.  Update: I just saw this call for papers - it seems to be quite a topic after all: Is Reality Digital or Analog? FQXi Essay Contest, 2011. , , . One can find some pretty amazing papers over there.


Supposing that $f(x)$ is continuous for positive values of $x$, what are the solutions to the equation $\int\limits_x^{x^2} f(t)\ dt=\int\limits_1^x f(t)\ dt$?  Attempt: We can write the LHS as $F(x^2)-F(x)$ for $F$ an antiderivative of $f$  We can write the RHS as $F(x)-F(1)$  So we have $F(x^2)-F(x)=F(x)-F(1)$. Now differentiate both sides,  $2 x f(x^2) - f(x) = f(x)$ Solve:  $x f(x^2) = f(x)$  Now, it seems like fucntions of the form $f(x)=\frac{c}{x}$ would solve this, but are these the only ones?

Assmue that $f(x)\in C(0,+\infty)$ and for any $x>0$ have $$\int_{x}^{x^2}f(t)dt=\int_{1}^{x}f(t)dt$$  Find this $f$  My try: we have $$2xf(x^2)-f(x)=f(x)\Longrightarrow xf(x^2)=f(x),\forall x>0$$ and then I can't works


When ssh-keygen -b 4096 creates a key pair, the public key (id_rsa.pub) looks like this:  ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDW6AL7knzbwEdPJR+QzMxuVEKI34+cNXX4xi7BF1xhNuI48T3xxB3C7utCXRc+jUzHY7aKmgrj8oWxtoqyS2MRLitBgYjcY9dEAJzay8os5RmdmwANHLsD4FAq6ONEq6wp+D0Mgs0sPGtzpgbpJ+ntxl59yv97G737M3yMXM4/DR20womomvdjeMPU7FDPTxrwxfgzmHQCwf/nTfLigv+ggbXMjJz+FBcZPhGFftn/XeuFskNx3+wJcLQXUplWHaDNoKyxWJjc2FCUjmg1iIHvFo29ppXwQEIPXHnrCjj3TFZ4dVgjTUtx+5W8lXR1GTuUAFRymDMmPeeqV9nJT83mu6H5kdpJ2nNRZPO8km+TMUXRxmzousMFiPq9tL9IAnXGq1MHwpWGZPdqR9hLOa7ESJtcZXcHf/vhqMEDvM2BxEVgEwMGuiSZfezC2PAg//jth1ft7C6nncRVQA16Z7m6gu74CuJj3/LZPisbSCAx+QdAUi0s28JnvlpFf+7UCXy2OBBJKEe3MzsmdUR8vZ8CqL5Sw+LLpt8XCKtcHxBQKkFu/ChsW3TYIhqQFA9mIX2jMTR8wO6C8TSa44lTNxTZclXlAyKy9DMT84Oj+GoK6ArETHqeExssN4Aw/f9oYbr2l9UJfu4kpjs3qWY0DkTPs6TZr7NwRiGPY6ZDD73uww== user@host  What are the practical consequences if I manually edit this public key, changing host to a different host name - so that user@host becomes user@differenthost? Will the key still work in the usual manner?

In a public key file "id_rsa.pub" generated by ssh-keygen, does the part after the == matter?  I ask because when I changed "root@somedomain.com" to "root", it seems to still work.  More generally, I am curious about what the purpose of that half is.


I know this is a long shot (and I'm going to have to go back and delete/recreate my arrays with a subsurf mod) but since I've already locked in most of them:  I was wondering if there is a tool that acts as an Edge Crease (for the smooth option) that'll allow me to sharpen up some of the edges on a tire.  Currently my rendered tire looks like this:    When smoothing things definitely get a little TOO smooth.    In the end, I'm ok if there's not, just hoping to save some time :)

I frequently come to the problem of having a mesh with parts I would like to render smooth and "hard" edges connecting them.   How can I set the mesh to show the sharp edges but render everything else smooth?  In the example I would like the sides of the individual cylinders render smooth but the intersection between bottom and top to be sharp/flat


I've issued a wildcard certificate in AWS to install on the company's website (which is stored in a CloudFront distribution).  There's a customer support service which the company uses and when you browse to support.company.com it takes you to that service site.  Up until today, the access to the support site has been done on HTTP protocol and we would like to change it to be on HTTPS.  For that, I need to upload to that customer support service provider site the new certificate, they require Private key, Public key and Intermediate certificate.  I've run the following command to get the certificates:  aws iam get-server-certificate --server-certificate-name wild_company.com_10072019   But the output shows me the "CertificateChain" - all the certificates are display in one line and another "CertificateBody" which is also displayed in one line.  The CertificateBody is easier to distinguish by the "--- Begin certificate ---" and "---END certificate---" which appear only once but in the CertificateChain there are lots of begin/end marks and I'm not sure how to transform it to Public/Private keys and Intermediate certificate.  Any idea how can it be done?

I am using aws certificate manager for managing SSL. Recently I purchased a wildcard ssl *.example-private.com Now I need that SSL certificate to deploy on enterprise git instance on aws.   How can i download ssl from aws?


I am writing a windows form app in C#. I have a label with a random word, e.g. "computer". User has to guess what is this word by guessing letter by letter. But word "computer" must be replaced with as many "x" as there is letters in a word, so in this example user should see "xxxxxxxx". I tried to replace it with regex like this: private void Form1_Load(object sender, EventArgs e) {     word.Text = Regex.Replace(word.Text, @"^[a-zA-Z]+$", "x"); }  But it only replace with single "x". I also tried with for loop, but the result is the same: private void Form1_Load(object sender, EventArgs e) {     for (int i = 0; i <= word.Text.Length; i++)     {         word.Text = Regex.Replace(word.Text, @"^[a-zA-Z]+$", "x");     } }

What it's the best way to generate a string of \t's in C#  I am learning C# and experimenting with different ways of saying the same thing.    Tabs(uint t) is a function that returns a string with t amount of \t's  For example Tabs(3) returns "\t\t\t"  Which of these three ways of implementing Tabs(uint numTabs) is best?  Of course that depends on what "best" means.     The LINQ version is only two lines, which is nice.  But are the calls to Repeat and Aggregate unnecessarily time/resource consuming? The StringBuilder version is very clear but is the StringBuilder class somehow slower? The string version is basic, which means it is easy to understand.   Does it not matter at all?  Are they all equal?   These are all questions to help me get a better feel for C#.     private string Tabs(uint numTabs) {     IEnumerable<string> tabs = Enumerable.Repeat("\t", (int) numTabs);     return (numTabs > 0) ? tabs.Aggregate((sum, next) => sum + next) : "";  }    private string Tabs(uint numTabs) {     StringBuilder sb = new StringBuilder();     for (uint i = 0; i < numTabs; i++)         sb.Append("\t");      return sb.ToString(); }    private string Tabs(uint numTabs) {     string output = "";     for (uint i = 0; i < numTabs; i++)     {         output += '\t';     }     return output;  }


I'm building an integration with S3 and I want to create a pre-signed URL so I can access S3 from SF with a single user. I use the method below to generate a URL: public static string getSignedURL(string file, String bucketName, String accessKey, String secretKey, String state) {     String filename = EncodingUtil.urlEncode(file, 'UTF-8');     Datetime now = DateTime.now();     Datetime expireson = now.AddSeconds(60);     Long Lexpires = expireson.getTime() / 1000;      String stringtosign = 'GET\n\n\n' + Lexpires + '\n/' + BucketName + '/' + filename;     Blob mac = Crypto.generateMac('HMacSHA1', blob.valueof(stringtosign), blob.valueof(SecretKey));     String signed = EncodingUtil.base64Encode(mac);     String url = 'https://' + BucketName + '.s3.us-east-1.amazonaws.com/' + filename + '?AWSAccessKeyId=' + AccessKey + '&Expires=' + Lexpires + '&Signature=' + signed;     return url;  }  The method works, but the downside as you can see is that I need to send my accessKey and secretKey and I wish to avoid that. So I want to use a Named Credential to authenticate, and then I want to call my method getSignedURL(). But I don't know how I can pass the secret and key to the getSignedURL() method using a Named Credential. I didn't find a merge field related to AWS Signature Version 4 in the . I was hoping to find something like: {!$Credential.acessKey} {!$Credential.secretKey}

I am trying to make a callout to AWS S3 using named credentials and Apex  The named credential is set up as follows  Label: AWS S3 Name: AWS_S3 URL: https://bucket-name.s3.amazonaws.com - Certificate: Identity Type: Named Principal Authentication Protocol: AWS Signature Version 4 AWS Access Key: AKIAxxxxxx AWS Secret Access Key: xxxxxx AWS Region: ap-southeast-2 AWS Service: s3 - Generate Authorization header: true Merge fields in header: false Merge fields in body: false   The Apex class is very simple  HttpRequest req = new HttpRequest(); req.setEndpoint('callout:AWS_S3'); req.setMethod('GET');                        Http http = new Http(); HTTPResponse res = http.send(req);                 System.debug(res.getBody()); return res.getBody();   The response body contains the following:     SignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your key and signing method.AKIAxxxxx   I have used the same bucket, endpoint and credentials using Postman and am able to successfully return the list of objects in the bucket so it is not an IAM permissions issue  There have been a couple of similar questions on stackexchange but unfortunately they do not provide any resolution or assistance in this case:    I've tried looking for code samples or further pointers in the Apex documentation but it doesn't really give any further guidance on how to proceed or correctly set this up so I'm a bit stuck


Answered: See comment section below. Seems I can't post a proper SO answer after this question was marked a duplicate...  Background: Using Winforms and C# Visual Studio 2012, .net 4.5, testing on Win7.  Desired behavior: On "maximize" button, size the main form so that it uses the entire screen except for the task bar, and preserves the title/caption bar.  This is NOT a duplicate. This question is about why this code DOES NOT WORK PROPERLY, despite being posted as a solution in other questions. Thanks!  I coded the following form method:      private void HSBmainForm_Resize(object sender, EventArgs e)     {         // On clicking Maximize, sender is main form, but event is "Empty" so useless...         // Instead, look at window state and adjust form size as appropriate         switch(WindowState) {             case FormWindowState.Maximized: {                 var workArea = Screen.FromControl(this).WorkingArea; // supposedly, screen size minus taskbars and bound toolbars, in pixels                 Debug.WriteLine(workArea);                 // Nope, eliminates desired caption bar and min/max/etc buttons: FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; // no border when maximized                 this.MaximumSize = new System.Drawing.Size(workArea.Width, workArea.Height); // supposedly, pixels               } break;             case FormWindowState.Normal:                 this.MaximumSize = new System.Drawing.Size(1600, 900); // Minimum workable size for layout of app's forms                 break;         };         base.OnLocationChanged(e); // process the event in base class (actually performs the resize)     }   Unfortunately after maximizing the task bar remains visible as desired, but the main form does not use the entire expected area as shown here (lower right of main form does not go to edge of screen):   Any idea what's wrong?   Thanks in advance, Best Regards, Dave  PS: In this test, Windows screen resolution reports 1823 x 978 and workArea reports {X=79,Y=0,Width=1744,Height=963} in debug output.  PPS: The above result is after clicking Maximize the first time. Minimize always works as expected. The second and subsequent Maximize clicks work correctly and use entire screen! Any ideas? Calling the base class event processor twice doesn't make it work on the first attempt...

I have a WinForms app that I am trying to make full screen (somewhat like what VS does in full screen mode).  Currently I am setting FormBorderStyle to None and WindowState to Maximized which gives me a little more space, but it doesn't cover over the taskbar if it is visible.  What do I need to do to use that space as well?  For bonus points, is there something I can do to make my MenuStrip autohide to give up that space as well?