We have a view that is optimized for single item queries (200ms no parallelism):  select *      from OptimizedForSingleObjectIdView e2i    where ObjectId = 3374700   It also works on small sets of static ids (~5).      select *      from OptimizedForSingleObjectIdView e2i    where ObjectId in (3374700, 3374710, 3374720, 3374730, 3374740);   However if the objects come from an external source, then it generates a slow plan.  The execution plan shows that the execution branch for the view part is ignoring the predicate on ObjectId whereas in the original case it uses them to perform index seeks.  select v.*   from       (        select top 1 ObjectId from Objects         where ObjectId % 10 = 0         order by ObjectId      ) o     join OptimizedForSingleObjectIdView v -- (also tried inner loop join)     on v.ObjectId = o.ObjectId;   We don't wish to invest in "dual" optimizing the view for non-singular cases.  Rather, the solution we "seek" is to repetitively call the view once per object without resorting to an SP.  Most of the time the following solution calls the view row by row. However not this time and not even for just 1 object:  select v.*   from      (        select top 1 ObjectId           from Objects          where ObjectId % 10 = 0 -- non-trivial predicate         order by ObjectId      ) o    cross apply     (       select top 2000000000 *         from OptimizedForSingleObjectIdView v_        where ObjectId = o.ObjectId         order by v_.SomeField     ) v;   At one time I thought there was a claim  that cross apply was guaranteed for row by row execution when it calls a UDF but this also failed:  create function FunctionCallingView(@pObjectId bigint) returns table as  return select *   from OptimizedForSingleObjectIdView   where ObjectId = @pObjectId;               select v.*   from      (        select top 1 ObjectId           from Objects          where ObjectId % 10 = 0         order by ObjectId      ) o  cross apply FunctionCallingView(o.ObjectId) v   Adding option(force order) did not help--however there are two hash hints in the view already. Temporarily removing them did not help and slows down the single case.  Here is a snippet of the estimated plan for the function based slow case.  The estimation of 1 row is correct.  Far off to the right (not shown) is where there is a seek predicate that does not include that top 1 result.  This seems similar to other cases we have where singular probed values from table seeks are not used as seek predicates elsewhere.

I can understand that if I join individual queries that are "individually fast" the combination may become slow because the default execution plan may be non-optimal.  However when I know the number of rows for one query is very small I think I should be able to use hints to control the joins.  select cj.a, cv.b   from (select distinct a from complexJoin) cj -- 2 rows  inner loop join complexView cv     on cj.a = cv.a  order by cj.a, cv.b   If cj is <1s and cv <1s expect this to be <~2s but using any hint (merge/hash/loop) it is often > 1min.  I also tried to use CROSS APPLY because the docs claimed that the inner select is executed exactly once for each outer row. The query takes ~100x longer than running the inner query twice manually so perhaps I don't understand the docs.  select cj.a, cv.b   from (select distinct a from complexJoin) cj -- 2 rows  cross apply (select * from complexView                 where a = cj.a) cv  order by cj.a, cv.b   If I populate a temp table with results from "cj" and then join _with_no_hint_ or use the cross apply it is fast but do I really have to resort to that?  If I use the temp table and attempt "any" of the join hints (loop/merge/hash) it is slow so maybe that is a key point.  I don't believe diving into the depths of the query plan (both are complex to begin with) are required to solve this type of problem in general: I just want guaranteed isolation without resorting to a temp table--is that really not possible?


In macOS Sierra, it used to be Command + Shift + .. But that does not appear to work in macOS Mojave. Has something changed?  What is the keyboard shortcut to show/hide hidden files in Finder without restarting in macOS Mojave?

To see my /etc folder I've tried this command in Terminal:  sudo chflags nohidden /etc   followed by:  sudo defaults write com.apple.Finder AppleShowAllFiles true; killall Finder   also tried:  sudo defaults write com.apple.Finder AppleShowAllFiles YES; killall Finder   Neither of them seemed to work.


There are lots of popular games now-days that enable a player to construct a word while opposing some limitations. If player constructs a valid word successfully, he gets a point. For this a big amount of English words is needed so that the game would be able to check if such a word exists in English. Where can I take such a bank of words? And how big the size will be? Would it we good for mobile games?

I need a word list to use in a commercial game (even though the game will be free to download)  Something like this    Would be perfect (needs to be formatted .txt file) but obviously allowed to be used in a commercial game. I'm happy to pay if it's not too much.  Thanks for any advice.  UPDATE  After some more research (google), I came across this passage. Thought this might be useful for other people, although it still seems in contradiction to what the replies are saying on stack overflow   "The nearest thing to a licence text for ENABLE, of which ABLE forms a part, is as follows.   The ENABLE master word list, WORD.LST, is herewith formally released into the Public Domain. Anyone is free to use it or distribute it in any manner they see fit. No fee or registration is required for its use nor are "contributions" solicited (if you feel you absolutely must contribute something for your own peace of mind, the authors of the ENABLE list ask that you make a donation on their behalf to your favorite charity). This word list is our gift to the Scrabble community, as an alternate to "official" word lists. Game designers may feel free to incorporate the WORD.LST into their games. Please mention the source and credit us as originators of the list. Note that if you, as a game designer, use the WORD.LST in your product, you may still copyright and protect your product, but you may not legally copyright or in any way restrict redistribution of the WORD.LST portion of your product. This may under law restrict your rights to restrict your users' rights, but that is only fair.  M Cooper and Alan Beale "  From this site   Obviously I have no way of knowing if that's legit or not, so I was wondering what other peoples advice still is.


I've got table with different actions from users, it looks like that  | User_ID       | Action        |  | ------------- |:-------------:| | 10            | View          |  | 8             | Connect       |  | 10            | View          |    | 12            | View          |    | 10            | View          |      And i want to count how many users made "View" action. So i made Query  Actions.where( action: "View" ).group(:User_ID).count  But it showed me   {10=>3, 12=>1}  So I added second ".count" at the end  Actions.where( action: "View" ).group(:User_ID).count.count  And now it's working properly  Is double count here only and proper way?

I have a record set that includes a date field, and want to determine how many unique dates are represented in the record set.  Something like:  Record.find(:all).date.unique.count    but of course, that doesn't seem to work.


How can I run an external program automatically using Python script? I installed a program that can analyze demographics. Let's say the program name is Demograph I am doing the following commands in the Windows command prompt to extract specific people's information. Demograph hobby Baseball FileA > OutputfileA  FileA contains people's information. And this command can extract people who like baseball. I can change the baseball to soccer, swimming, etc. This command generates an OutputfileA. As the next step, I am doing the following command to further analyze the OutputfileA. Demograph age 10-15 OutputfileA > OutputfileA2  This command can extract people's information whose ages are 10-15 from OutputfileA and then generate the OutputfileA2 However, typing this information on the command prompt every time is a pain. I want to do this automatically using Python script. Should I use "subprocess" to run the external program automatically?

How do you call an external command (as if I'd typed it at the Unix shell or Windows command prompt) from within a Python script?


Is it possible to get the ip address of the user (visitor of my website) without using server side language like PHP?  I have a problem while using the server language (PHP) because of load balancer for my server. I tried http_x_forwared_for that is also not retrieving the perfect ip address.

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.


How to configure an email server so that outgoing emails are not classified as spam? I've spent the entire day on this and I'm puzzled by the results I'm getting.  Among other things, I have:   Added DNS record for SPF: v=spf1 mx a ptr ip4:35.666.24.123/32 ?all Added DNS record for SenderID: v=spf2.0/pra,mfrom a mx ip4:35.666.24.123 ~all Corrected reverse DNS records (so that when receiving servers want to verify that the IP address sending them mail actually belongs to the domain the mails are coming from) Set up my server to sign every message with a DKIM key and added respective DNS records: _domainkey       TXT   o=~; r=postmaster@thedevil.fi dkim._domainkey   TXT   v=DKIM1; p=MIG...QIDAQAB Changed the HELO of my server to match the DNS records.   Here is my SpamAssassin score from :  SpamAssassin Score: 2.973 Message is NOT marked as spam Points breakdown:   0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily valid  0.0 T_DKIM_INVALID         DKIM-Signature header exists but is not valid  0.0 TVD_SPACE_RATIO        No description available.  0.4 RDNS_DYNAMIC           Delivered to internal network by host with                             dynamic-looking rDNS  2.5 TVD_SPACE_RATIO_MINFP  Space ratio   The default threshold for marking as spam is score 5, so I'm barely below it. Throw one "viagra" in there and that's it! ;)  For comparison, here are the results using my ISP's email:  SpamAssassin Score: -0.719 Message is NOT marked as spam Points breakdown:  -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low                             trust                             [83.145.220.78 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)                             [83.145.220.78 listed in wl.mailspike.net]  0.0 TVD_SPACE_RATIO        No description available. -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders   I sent the exact same email from both my own server and my ISP's email. Somehow the TVD_SPACE_RATIO_MINFP was flagged with a 2.5 penalty for only the message sent from my own server. According to their wiki, it's "the ratio of spaces to non-spaces in each paragraph". Is this a bug? Or is it counting spaces from metadata as well or something?  According to the validator, my ISP doesn't have SPF or DKIM records. Yet somehow SpamAssassin is giving them -0.7 while giving me 3.0? Also, I'm somehow flagged for invalid DKIM, yet it's not affecting the score? Why am I flagged when the validator also says (in a different section of the results) that the validation of my DKIM resulted in "pass"?  Edit: this is not a duplicate. This question is not about "how to write an email", it's about how to configure an email server. The parts regarding SPF, DKIM and HELO I already covered in my original post and explained the problems I had with them. Such problems are not described in the "duplicate" posts.

This is a  about avoiding outgoing mail being classified as spam.   Also related:                    I'm wondering how to prevent my emails from my site being marked as spam? I'm using sendmail.  I'm trying to send emails through my ruby-on-rails application. The mails are all written in swedish (if that does make a difference?). I don't know why they keep getting marked as spam.  Are there any things that I can do to minimize the risk?


let two function $f(x),g(x):[0,1]\to [0,1]$ are Continuous function,and $f(x)$ strictly monotone increasing, show that $$\int_{0}^{1}(f(x)+g(x))dx\ge\int_{0}^{1}f(g(x))dx$$  I am not comfortable with compositions and don't have any idea on how to deal with the problem. Any help will be appreciated. Thanks! This problem is from analysis problem book excises by Min hui xie (This book exsice problem it is very hard)

Suppose $f(x)$ and $g(x)$ are continuous function from $[0,1]\rightarrow [0,1]$, and $f$ is monotone increasing, then how to prove the following inequality: $$\int_{0}^{1}f(g(x))dx\le\int_{0}^{1}f(x)dx+\int_{0}^{1}g(x)dx$$


How can I randomly choose a number from a list of given numbers in Java?  I have only these 5 numbers: 1000, 2000, 3000, 4000, 5000  Now I have to select any one number from this set of numbers randomly.  My code to try this  int ar[] = new int[4]; ar[0] = 1000; ar[1] = 2000; ar[2] = 3000; ar[4] = 4000;  int randomArrayIndex = num.nextInt(ar.length);

How do I generate a random int value in a specific range? I have tried the following, but those do not work: Attempt 1: randomNum = minimum + (int)(Math.random() * maximum);  Bug: randomNum can be bigger than maximum. Attempt 2: Random rn = new Random(); int n = maximum - minimum + 1; int i = rn.nextInt() % n; randomNum =  minimum + i;  Bug: randomNum can be smaller than minimum.


Is there an English adjective [A] such that the following two sentences are almost the same in meaning?   "Joe is a very [A] person" "Joe is always asking questions"   The phrase "always asking questions" has connotations of being nosey, but that's not what I mean. A question similar to mine was asked:    Assume Joe does NOT already know the answers to his question. I want an adjective to describe someone who innocently asks questions on a regular basis, and they don't already know the answer. "querulous" has negative connotations. I want something positive/friendly. A word similar to "curious" might work. However, "curious" people can sometimes be very quiet. I am searching for a word which literally means "asks questions often," implying that they are a bit of a motor-mouth, rather than a shy, quiet person.

I have an annoying friend that he frequently asks me questions in which he'll be the one to answer at the end if I can't answer his questions. Here the situation goes:       Friend: Hey Jay, do you know the medical term where the nerves intersect, i.e. in the spinal column, that's why right brain hemisphere controls the left side of the body and vice versa?   Me: No. I really have no idea. Sorry.   Friend: It is called "decussation".   Me: Oh okay.   Friend: Now, what do you call a person who frequently asks questions even though they know the answer?   Me: Hmmm I don't have the slightest idea.   Friend: It is ______, Jay. You really need to read books.   Me: WTF!   (annoyed)   Is there a way to describe this kind of personality?


I have a PHP script and this script loops thousands of lines. When I run the PHP file manually, this loop of thousands of lines returns successfully. But when a cron job does this, it turns around 143 times. What have I checked:  I checked if there was something to stop my code for the 143rd time. I checked if this is a timeout. Even if I extend the time, it stops after the 143rd turn.  What have I tried?:  I thought it might be a memory issue. and I increased the memory_limit. - Not working  Edit:  Even though I didn't make any changes, the situation improved. I need to know the reason for this. Please give your estimates and the measures I can take.

This is a  about using cron & crontab.   You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question.  The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below.  This addresses the cron system with the crontab highlighted.


In the terminal it's easy to find the md5sum of a single file, but how about for an entire directory? And would the same apply to sha256sum?

I want to verify integrity of folder. The folder has so many files and folders. How to calculate hash value of directory as a whole on Ubuntu. md5sum calculate at only file level.


I know that  is primarily used going to or from a char*.  But I was surprised to find that  could do the same with a void*. For example:  auto foo "hello world"s; auto temp = static_cast<void*>(&foo); auto bar = static_cast<string*>(temp);   What do we gain from using reinterpret_cast and char* over static_cast and void*? Is it something to do with the strict aliasing problem?

What are the proper uses of:   static_cast dynamic_cast const_cast reinterpret_cast C-style cast (type)value Function-style cast type(value)   How does one decide which to use in which specific cases?


I'm very new to this, this being only my second project for my class.  When I run this, no matter what my input is, x is always > 0. I ran the debugger and found that it increments x at both city 1 and 2, so I figured I do not have my if statements set up correctly. We were instructed to prompt the user for 3 cities, and if any are a match, we tell them. Thanks in advance!  import java.util.Scanner; public class PR2  {  public static void main(String[] args)  {     int x = 0;     Scanner input = new Scanner(System.in);     String[] City = new String[3];     City[0] = "Orlando";     City[1] = "New York";       for (int i = 0; i < 3; i++)     {         System.out.println("Please enter a city you have visited.");         City[i] = input.nextLine();     }      for (int i = 0; i < 3; i++)     {            if (City[i] == City[0])         {             x++;         }         else if (City[i] == City[1])         {             x++;         }     }     if (x > 0)     {         System.out.println("At least one city you have entered is a match.");     }     if (x == 0)     {         System.out.println("Sorry, none of the cities you have entered are a match.");     }   }   }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


This is my first time posting here, so if the code is too long, I'll be more than happy to edit it.  I'm making a cashier, a function that makes change.   The odd thing is: If I buy 1.14 for 1.15, I get a penny back. But if I buy .14 for .15 I get no pennies back.  Also, if I buy .15 for .20, I get a nickel back. But if I buy .20 for .25, I get 4 pennies back. I need help understanding why I'm getting four pennies back instead of 0 pennies and 1 nickel like I'm supposed to. I believe something has to be wrong with the division somewhere.  #include <iostream> #include <cmath>  using namespace std;  int main() {    double buyAmount = 0.0;   double paidAmount = 0.0;   double diffAmount = 0.0;   double smallChange = 0.0;   int dollars = 0;   int quarters = 0;   int dimes = 0;   int nickels = 0;   int pennies = 0;    cout << "Enter purchase amount: ";   cin >> buyAmount;   cout << endl;    cout << "Enter paid amount: ";   cin >> paidAmount;   cout << endl;    diffAmount = paidAmount - buyAmount;    if (diffAmount < 0 ) {      cout << "Error: Make sure paid amount exceeds purchase amount. ";      cout << endl;   }    dollars = floor(diffAmount);   smallChange = (diffAmount - dollars) * 100      quarters = (smallChange / 25);   smallChange = smallChange - (quarters * 25);   dimes = (smallChange / 10);   smallChange = smallChange - (dimes * 10);   nickels = floor(smallChange / 5);   smallChange = smallChange - (nickels * 5);   pennies = floor(smallChange / 1);     cout << "Total Change: $" << diffAmount;   cout << endl << endl;   cout << "dollars " << dollars << endl;   cout << "quarters " << quarters << endl;   cout << "dimes " << dimes << endl;   cout << "nickels " << nickels << endl;   cout << "pennies " << pennies << endl; }

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


What type of data should I use to store Lat and Lng from Google Map into my database?  I'm not sure how many decimal place should I put for length in mysql.   So should I use Decimal, Float etc?  and how much should I put for Length?  Meanwhile, is it good to put index for Lat and Lng in Mysql?

Bearing in mind that I'll be performing calculations on lat / long pairs, what datatype is best suited for use with a MySQL database?


is this all i need to protect myself from sql injections etc?      $statement = $db->prepare( "INSERT INTO blogs (blogtitle, blogdesc, coverimage, userID, frontpage, tags)  VALUES (:buildtitle, :builddesc, :buildcover, :userid, :frontpage, :addtags)" );  if ($statement->execute(array( ':buildtitle' => $_POST['addbuildtitle'],  ':builddesc' => $_POST['addbuilddesc'],  ':buildcover' => $_POST['addbuildcover'],  ':userid' => $_POST['adduserid'],  ':frontpage' => $frontpage,      ':addtags' => $_POST['addtags'])));   Anything else i should add or any other type of malicious activity i should be aware of?

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?


The infinite sum   $$ 1+ \frac{1}{3} + \frac{1\cdot3}{3\cdot6} + \frac{1\cdot3\cdot5}{3\cdot6\cdot9} + \frac{1\cdot3\cdot5\cdot7}{3\cdot6\cdot9\cdot12} +\dots $$ is   a.) $2^{1/2}$  b.) $3^{1/2}$  c.) $ \left(\frac{3}{2}\right)^{1/2} $  d.) $ \left(\frac{1}{3}\right)^{1/2} $    My Approach: I initially tried to write the general term of the following expansion but couldn't do so due to the fact that number of components in product change with each term.   I tried using the partial fractions but couldn't proceed with it much further.   In the final attempt I tried grouping the terms successively in pairs of two, and then trying to add them , that too however proved futile.   I am looking for a method to solve the above question, as well as a more general line of approach for the following type of questions.

How to find infinite sum How to find infinite sum $$1+\dfrac13+\dfrac{1\cdot3}{3\cdot6}+\dfrac{1\cdot3\cdot5}{3\cdot6\cdot9}+\dfrac{1\cdot3\cdot5\cdot7}{3\cdot6\cdot9\cdot12}+\dots? $$   I can see that 3 cancels out after 1/3, but what next? I can't go further.


I can join the server and sometimes the map would load for the server but i would just fall through the map and it would dissconect me and say timed out, any solutions?

My friend had hosted a Minecraft server before and brought it back up today with my help. He and anyone in his LAN can connect. However we have had a few people try to connect, including me, and when we try to connect it gives the message:  Failed to connect to the server Connection timed out: connect  What does this exactly mean? How do we fix this?


finding $$\int_{0}^{\infty }\frac{1}{1+x^4}dx$$ My attempt is:  let $x=\sqrt{u}$  $dx=\frac{1}{2\sqrt{u}}$ $$\int_{0}^{\infty }\frac{1}{2\sqrt{u}(1+u^2)}du$$ here I stopped because I don't know how to complete this solution. Any help please.

I have to compute this integral $$\int_{0}^{\infty} \frac{dt}{1+t^4}$$ to solve a problem in a homework. I have tried in many ways, but I'm stuck. A search in the web reveals me that it can be do it by methods of complex analysis. But I have not taken this course yet. Thanks for any help.


I wrote a pretty basic game for colleagues to play : the player shoots on an enemy which has 50 lives while other smaller enemies pop randomly on the screen. The goal is to kill the main enemy as fast as possible.  One important point : the game is written in javascript (using HTML5 canvas).  At the end of the game, I send the score and username to my php function in Ajax, and that's where I have trouble : I find it really hard to restrain my colleagues from cheating.  Here are the different ways of cheating I've noted so far :    Changing the score sent during the ajax call At the beginning of the game, reducing the number of lives of the enemy At the beginning of the game, reducing the probability for enemies to appear   Here are the solutions I implemented to counter that cheating :    Create an array that I fill each time I enter the game loop with "delta", the time between that frame and the previous. I send that list to my php save function and then check that the total time of the deltas is equal to the score sent. Create an array where I store the times when the Enemy loses 1 life. Then in the php save function I check that the list trully has 50 elements, and that the time between 2 elements is not less than a certain value Create an array where I store the time when an enemy appears. Then in the php save function I check the number of enemies is not less than a certain number.   The 2 first points seem good enough for me : it becomes too much trouble for anyone to try and cheat that. The last point is causing me much trouble. I cannot stop the user from changing apparition rate to 0, then in the ajax call just fill the array with 30 values, that seems pretty easy.  This is my first try with this kind of issue, so I have several questions :    Am I on the good way? Are there any "patterns" I am missing for this kind of issue? What would be your approach? What would you do? How to make it even more difficult for the players to cheat?

Browser and mobile games commonly have global highscore tables. It's also common for those tables to contain scores of 2,147,483,647 — where people have figured out the webservice call that reports scores and used it to record a fictitious score.  For simple puzzle games, we can defend against this by including a record of every move the player made (and any random seeds used to generate the level) with the score-reporting call. The entire game can then be reproduced and verified on the server.  However, this quickly becomes infeasible for anything larger than Pac-man.  How else can cheating of this kind be prevented?


public class StrEqual {     public static void main(String[] args) {         String s1 = "hi";         String s2 = new String("hi");          System.out.println(s1);         System.out.println(s2);          if(s1 == s2){             System.out.println("s1 and s2 are equal");         }         else{             System.out.println("s1 and s2 are not equal");         }     } }   In the above code s1 and s2 both referring to the string "hi". But why the output of the program is- 's1 and s2 are not equal' ? Thank you


I have a setup where theorems are numbered automatically. Now I want a single theorem be numbered with special number, e.g. after Theorem 2 write Theorem 2'. Is it possible?

I am writing a paper where I have a stated a theorem, and then a short time later I state another theorem which is equivalent to the first. Is it possible to number them so that the second is a primed version of the first? In other words, if the first gets numbered as Theorem 7, I would like its equivalent version to be numbered as Theorem 7'. Ideas? Thanks.


Is there a way to have Skydrive/Onedrive completely restart the sync process and have all of the files as "online-only". I'm running Windows 8.1 Update 1.  While there is "make all files online-only" in the OneDrive metro app - it doesn't work for me. It seems that OneDrive state is corrupted on my machine, the service believes that some files are not synced when in fact they are.  I guess deleting the user account and adding it back would do the trick but I'm looking for an easier solution at this point.

Is there a way to empty SkyDrive/OneDrive without deleting the files in the cloud.  I'm running Windows 8.1 and would like to revert all of the files to "online-only" mode except that the function doesn't work. I'd like to completely restart the sync process but not lose any files.


I have a file in ~/file.txt.  I have created a hard link by :  ln ~/file.txt ~/test/hardfile.txt   and a symlink file :  ln -s ~/file.txt ~/test/symfile.txt   Now,   How can I find out that which file is hard link ? How can I find out hard link follows which file?   We can find symlink file by ->, but what about hard link?

I'm creating a shell script that would take a filename/path to a file and determine if the file is a symbolic link or a hard link.   The only thing is, I don't know how to see if they are a hard link. I created 2 files, one a hard link and one a symbolic link, to use as a test file. But how would I determine if a file is a hard link or symbolic within a shell script?   Also, how would I find the destination partition of a symbolic link? So let's say I have a file that links to a different partition, how would I find the path to that original file?


I'm quite unfamiliar with the electrical side of things, so I'd appreciate it a lot if I can get some basic help. I have a Behringer Pro Mixer DX 500 at home which would be used mostly in Bulgaria - where the voltage is at 220V. It came without a power supply adapter, in the photo (where it's a bit blurry) it says: POWER SORCE: 2 * 19 VAC 30W Here's also the manual for the mixer if it's helpful:   Turned out a power supply adapter is close to impossible to find quickly on the web and in a bit of a rush, I purchased the following from the US:  The model (which is cropped out in the picture) is MXUL2 specifically. Only later I realized it says 2 * 17.5 VAC. So I wanted to ask if that's gonna be in any way a problem and, in case it is, can I somehow compensate by purchasing a precise Down Voltage Transformer (which I need to get anyway for transforming 220 V to 115V)? Even if the 2 * 17.5 VAC discrepancy wouldn't be a problem (I so hope it wouldn't), feel free to suggest a respective Down Voltage Transformer, if you have something in mind that is a good choice on the low price end of things. Thanks a lot!

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


Derive the set identity of:  $A \cap (A \cup B) = A$  Really need help. I do not know how to reach end result.  Please assist.

I'm trying to prove $A \cap (A \cup B) = A$. I'm stuck on the last part of my proof, not sure how to show next:  $$x \in A \cap (A \cup B)$$ $$\iff x \in A \;\;\text{and}\;\; x \in A \cup B$$ $$\iff x \in A \;\;\text{and}\;\; (\text{either}\;\; x \in A \;\;\text{or}\;\; x \in B).$$


I am a little confused and looking for some clarification on the differences and different benefits for two different approaches for the declaration and instantiation of a Map.  What is the difference between  Map<String, String> myMap = new HashMap<String, String>;   AND  HashMap<String, String> myMap = new HashMap<String, String>;   What is the benefit or reason for declaring a superclass variable then instantiating it with a subclass?

I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible?


Let $n \in \mathbb{N}, \, X_i: (0,\infty)^n \rightarrow (0,\infty)$ so that $ X_i(x_1,...,n_n) = x_i \, \forall i \in \{ 1,...,n \}.$ Let $ ((0,\infty)^n, B((0,\infty)^n), (P_\theta)_{\theta \in (0,\infty)}) $ be a statistical modell, so that $ (X_1,....,X_n) $ is under $P_\theta$ a iid family of $ \exp(\frac{1}{\theta}) $ distributed rv´s.  Note that in this case $\forall i \in\{ 1,...,n \}$ and $ \theta \in (0,\infty) $ it holds that $ Var(X_i) = \theta^2 $.  a) Compute $ \forall x\in (0,\infty)^n $ the MLE $ \hat{\theta}_{ML} \in (0,\infty)$ for $ \tau(\theta) = \theta. $  b)Is $ \hat{\theta}_{ML} $ a variance minimizing unbiased estimator for $ \tau(\theta) = \theta $?  to a):  the density of a $ exp(\theta^{-1}) $ distributed rv is: f(x) = $ \theta^{-1} * e^{-\theta^{-1}x} $.  I get the maximum likelihood function:   $L(x,\theta) = \prod_{i=1}^n f(x)$ $= \theta^{-n} \prod_{i=1}^n e^{\theta^{-1}x_i} $  Now i build the log likelihood function and get:  $ \log(L(x,\theta)) = -n\log(\theta) - \frac{1}{\theta} \sum_{i=1}^n x_i $  I set the derivate of the $\log$ likelihood function $=0$ to find the maximum.  $\Rightarrow -\frac{n}{\theta}+\frac{1}{\theta^2} \sum_{i=1}^{n} x_i =0 $  $ \Leftrightarrow \frac{n}{\theta} = \frac{1}{\theta^2} \sum_{i=1}^n x_i $  $ \Leftrightarrow \theta = \frac{\sum_{i=1}^n x_i}{n} $  so i get that my estimator is: $ \hat{\theta}_{ML} = \frac{\sum_{i=1}^n x_i}{n} $  I don´t know why we get the hint that $ \theta^2 = Var(X_i) $. Does someone see my mistake?   to b)  I know how to check that a estimator is unbiased. How do i check if a estimator is a variance minimizing unbiased estimator? Do i have to use Cramer - Rao - Inequality?

I proceeded by finding $\operatorname E(\bar X).$ I considered $\bar X$ as a constant and simply got the term itself. This should suggest that $\bar X$ is not an unbiased estimator of $\theta$. That's obvious too cuz it's a constant(from what I assumed). However, I'm also aware that $\mu = \theta$ so that's probably not right.  I have to demonstrate first that $\bar X$ is an unbiased estimator of $\mu$.


The higher is the ratio of the current debt to total debt, the lower is your utilization rate, and consequently the fewer are the financial options available to you and vice-versa.  Is there any rule for such constructions? If this is correct, why is there 'the' before adjectives, higher, lower, fewer.

What is the type of sentence exemplified below called? Is it appropriate to use it in a scientific paper and formal written English in general?     1. The more pronounced the variation, the   more the waste.      2. The more you give, the more you get.      3. The longer I live, the more I realize the impact of attitude on life.


I have to find the remainder when $5^{99}$ is divided by $13$ without using modular arithmetic. I have to use Binomial Theorem only. Here's my attempt.    My Attempt $$\begin{aligned}5^{99}=125^{33}&=(117+8)^{33}\\ &=\sum_{k=0}^{33}{33\choose k} (117)^{33-k}(8)^{k}\end{aligned}$$  So the answer will be same remainder as obtained when $8^{33}$ is divided by $13$ which would be the same when $5^{11}$ is divided by $13$ which we get by writing $8^{33}$ as $(507+5)^{11}$.     I am not sure on how to proceed from here. Any hints would be appreciated. Thanks

How do I efficiently compute $a^b\bmod c$:  When $b$ is huge, for instance $5^{844325}\bmod 21$? When $b$ is less than $c$ but it would still be a lot of work to multiply $a$ by itself $b$ times, for instance $5^{69}\bmod 101$? When $(a,c)\ne1$, for instance $6^{103}\bmod 14$?  Are there any other tricks for evaluating exponents in modular arithmetic?  This is being asked in an effort to cut down on duplicates, see  and .


We know that $AA^{-1} = I$ and $A^{-1}A = I$, but is there a proof for the commutative property here? Or is this just the definition of invertibility?

If $A$ and $B$ are square matrices such that $AB = I$, where $I$ is the identity matrix, show that $BA = I$.    I do not understand anything more than the following.   Elementary row operations. Linear dependence. Row reduced forms and their relations with the original matrix.   If the entries of the matrix are not from a mathematical structure which supports commutativity, what can we say about this problem?  P.S.: Please avoid using the transpose and/or inverse of a matrix.


Let $a_n > 0.$ When $\sum a_n$ converges $\sum \sqrt{a_n a_{n+1}}$ converges or not? For, $$\frac{\sqrt{a_n a_{n+1}}}{a_n}=\frac {\sqrt{a_{n+1}}} {\sqrt{a_n}}$$ $\because$ By comparison test $\sum \sqrt{a_n}$ converges, $$\lim_{n\to\infty} \frac {\sqrt{a_{n+1}}} {\sqrt{a_n}}=1\neq0$$ Therefore by limit comparison test $\sum \sqrt{a_n a_{n+1}}$ converges. Is this proof correct? Corrections will be greatly appreciated...

Prove that if the positve term series $\sum^{\infty}_{n=1}a_n$ is convergent, also $\sum^{\infty}_{n=1}\sqrt{a_na_{n+1}}$ is convergent.  Prove that if the positive term series $\sum^{\infty}_{n=1}a_n$ and $\sum^{\infty}_{n=1}b_n$ are convergent, also $\sum^{\infty}_{n=1}a_nb_n$ is convergent.  I've tried to solve it using comparison test, but no results.


Prove that $$\int \int_S \hat n dS = 0$$ where $\hat n$ is the outward drawn normal to any closed surface S.   I have no idea how to start. For one, if $dS$ is scalar, what does it mean to integrate a vector anyway?  I thought of going about it as such:  $S:\vec r=x\hat i +y\hat j+z\hat k$  $dS=\sqrt {1+(z_x)^2+(z_y)^2}$  $\hat n dS$=$-\frac{\partial z}{\partial x}\hat i--\frac{\partial z}{\partial y}\hat j+1\hat k$  But this got me nowhere.  I'll be grateful if someone can guide me along this question.

I am confused by a problem from Schey's Div, Grad, Curl and All That:     Use the divergence theorem to show that   $$\iint_S\hat{\mathbf{n}}dS=0,$$ where S is a closed surface and   $\hat{\mathbf{n}}$ the unit vector normal to the surface $S$.   The whole discussion of surface integrals in this text so far has dealt with scalar-valued integrands, like:  $$\iint_S\mathbf{F}\cdot\hat{\mathbf{n}}dS.$$  So it would seem the author is either introducing vector-valued integrands for the first time, or suggesting $\mathbf{F}=1$, which I assume is a typo.  Any ideas about how to resolve this issue? I guess I could just say that, over a closed surface, for every surface normal there will be a normal elsewhere on the surface pointing in the opposite direction so they all cancel. But this approach doesn't use the divergence theorem.


A friend of mine updated a certain app and I don't like the choices the devs made. I'd rather stay on the current version. I know that I can set Google Play to not update apps automatically.  Thing is, I love being able to press UPDATE ALL to update all my apps with one press. Except for this app...  How can I make sure that this app does not appear in the Google Play updates section anymore?

General question I have an app X installed on my device in version Y. I don't want to update it to any newer version (Y+z) for some reason. Still, the Google Play Store app always lists updates for X, which keeps me from a simple "update all". My question, put to a single sentence:  How to hide updates for X permanently from the "available updates" list?   Specific examples First, I know there are alternatives as e.g. the , which can handle this quite well (skip this update, skip all future updates). I prefer a "generic solution", which does not depend on a 3rd party's market app. Second, I know that  includes a "Market doctor", which can be used to disconnect an app from Google Play.1 However, in my specific case that only worked for a few hours: I disconnected GTalk, as I don't want it replaced by Hangouts. The update notification disappeared for a few hours, then it was back. No idea what restored the "link". Third, just to make sure: I'm not talking about the "auto update" feature as discussed e.g. in . I was rather hoping for something close to , but without the need to "freeze" the app in question (which I still want to use, but in the version installed, not in a "future version" available). Fourth: No, uninstalling the app in question is no option here, though it would perfectly hide any future updates from being displayed :) Nor is "freezing", as the app is used regularly. Fifth: There is a related question for my GTalk example:  However, I want the opposite: No update.  It might very well be that "Google Apps" (and other pre-installed apps) are handled in some specific way, and restore their "market links" themselves somehow. For this case, my question includes: How to prevent that from happening?  Update There's a  discussing the very same issue. Until recently, a work-around for "user installed apps" was to uninstall them and then sideload the .apk – but even that stopped working. Well, re-signing the .apk with a different key might work for user-apps. But both would fail for pre-installed apps (can't sideload them to override; different signature would refuse that install completely). Moreover, there's an  on this by some "joel.bou..". Not hard to guess, though blanked out: that would be Joël Bourquard. If it's really him, then that's really an issue (for those who don't know: Joël is the dev behind Titanium Backup). Let me quote from the issue:  For the record: in the Android Market days it was possible to "Attach" or "Detach" apps (on rooted devices) with a system tool such as Titanium Backup. But nowadays (with the Google Play Store app) this has become nearly impossible to do, because the complete app list seems to sync from Google's servers and the user has no control over that.  Which explains why detaching with apps like Titanium Backup is no longer permanent. And I'm afraid I've asked the impossible. But I thought the same in the past with other questions, and surprisingly got solutions here. So I do not yet give up hope on this one!  1: what that does is explained by eldarerathis  (thanks to  for digging that up!)


This morning, I went to submit my documents at the VFS office. The VFS officer informed me that my passport looks damaged. Until she said that, I never noticed anything abnormal. My pages are holding good, my cover is intact. The only thing I noticed was there is a bit of gap between first and second page at the top.  I went ahead and submitted my passport, with an undertaking letter. Hopefully, my visa will come through fine.   Does this count as damaged? In case my visa is approved, is it advisable to apply for new passport before travel?

My Indian passport threading is coming off i.e. the cover of the passport is coming off, there are only 2 threads remaining.   Will it be a problem at the airport when going abroad ? Also anyone who has experience of getting a replacement passport fairly quick ? Because I need to get a passport in like 15 days.


I want to show that no group of order $90=2 \cdot3^2 \cdot5 $ is simple. Part (iii) of Sylow's Theorem gives $$n_2 \in\{1,3,5,9,15,45\} $$ $$n_3 \in \{1,10\} $$ $$n_5 \in \{1,6\} $$ I am aware of the solution that appears , but I wonder if a more "brute force" approach is possible, as follows: Assuming $G$ is a simple group of order $90$, we have $$n_2 \in\{3,5,9,15,45\} $$ $$n_3=10 $$ $$n_5=6 $$ G then has $6(5-1)=24$ elements of order $5$, and $n_2$ elements of order $2$. The remaining $66-n_2$ elements must be exactly those in the union $$\bigcup_{i=1}^{10} P_i $$ of the Sylow 3-subgroups. We now try to estimate the size of that union: The inclusion-exclusion principle gives $$\left| \bigcup_{i=1}^{10} P_i \right|=\sum_{n=1}^{10} (-1)^{n+1} \sum_{i_1 <i_2<\dots <i_k} \left|P_{i_1} \cap P_{i_2} \cap \dots \cap P_{i_k} \right| $$ Obviously, the $n=1$ term in the sum above is $90$, and every intersection has possible order $1$ or $3$ (According to Lagrange's Theorem). Is is possible to find the minimal value of this expression? I thought about splitting each inner sum into two, the sum over trivial intersections, and intersections of size $3$. But the calculations seem hard to handle. Thank you!

Can comeone help me? How do I show that every group of order 90 is not simple?


In each user's profile, number of helpful flags is displayed - so this is a public information. However, I did not find this number in the .  Question: Is there some simple way to find the users who have the biggest number of helpful flags? Possibly also ordered by number of flags and showing the number of flags somewhere?  I know that I could look at the  to see all users who have at least 500 helpful flags. However, if I wanted to find out who is the "leader" in this statistic, I would have to check each user profile individually.  This question is to some extent motivated by curiosity. Still, the numbers of flags by individual users give some insight into which users help with curating and moderating the site. (Similarly as number of reviews and some other tasks - which can be obtained from , as far as I can tell.)  Proposal: If currently there is no way to do this (using website interface or SEDE), let me also add a feature request to include this possibility somewhere.  EDIT: Glorfindel directed me in comments to another question where he provides a script getting the list of top flaggers. So I suppose that only the feature request part of this question now remains.

There are a few members of Stack Overflow especially who have a ridiculous number of helpful flags.  At the moment, there does not appear to be any way to display the top users with the most helpful flags. Even though this information is already available publicly, there does not seem to be any way to query all users and make a custom leaderboard, using SEDE, or other programming tools.  A quick search on main META did not yield anything related to this topic.  This is not limited to Stack Overflow (although that site will no doubt prove to be the most voluminous).   Is there any way to see a short list of top flaggers on the Stack Exchange sites?    See this? This is what I'm talking about! Totally awesome.


I just cloned a SanDisk 4GB Sandisk micro SD card onto a Samsung Evo 64GB card, and now my new card shows a 4GB.  I used HDDRawCopy to do this. Can anyone tell me how to reverse this back to 64GB?  Thank you.

I'm using Ubuntu 12.04. I have an old 4GB SD card, and have just bought a new 16GB SD card. I would like to copy everything from my old 4GB SD card onto the new 16GB SD card. I was afraid that the usual copy-and-paste trick would miss out something, so I wanted to clone the old 4GB SD card onto the 16GB SD card. I used the dd command in a shell, following instructions in .  This worked with one small caveat. The new SD card now appeared to be 4GB. I later found out this is because the primary partition on the 16GB SD card has now shrunk to 4GB. I have solved this problem, and I think I understand it. However, my question now is, how do I clone my old 4GB SD card onto my new 16GB SD card without making the primary partition on the 16GB SD card shrink to 4GB?


I'm in my second year at uni. There's a professor whose group I want to get into. My question relates to what's appropriate to send in a "hey can I join" email. For example, this man quite recently (in the last 7 months) published a paper relating surveying different search algorithm techniques to find ideal locations in a molecular lattice w/ xray diffraction (this is a made-up research topic for privacy haha). I really like this approach and wanted to use similar techniques in my graduate studies. However, he's so far only published this paper based on it. Should I not mention my specific interest in my email? Also in general, there are a few people at my school who explore a similar "scale" of physics as this man. I'm unsure about how much detail I'm meant to put in my emails. Are professors looking for someone who's completely in-tune to their specific subfield of the subfield, or do they expect "someone who wants to work with physics on this scale and thinks your papers are cool"? Obviously the former is preferred, but I'm wondering if the latter is the usual. Thank you for reading.

When needing to ask a professor about something important and potentially delicate, what is an appropriate way to phrase the question or write the email?  Examples include:   Requesting a recommendation letter Asking for exceptions to policy (e.g., ignoring a course prerequisite, rescheduling an exam) Asking if you can do research with them, join a group, get into a program Scheduling a meeting, exam, or defense Letting them know about a change of plans Letting them know about a life event affecting your work or studies (e.g., wedding, funeral, sickness, vacation)


Let $(X_1,\dots,X_n)$ be a random sample from a population $X$ having probability density function $$f(x;\vartheta,\lambda)=\lambda\,\vartheta^\lambda\,x^{-(\lambda +1)}$$ $$\vartheta>0\qquad\lambda>0\qquad x\geq\theta$$ If $\lambda$ is known (hence fixed):   Find $\hat{\vartheta}_n$, the MLE (Maximum Likelihood Estimator) of the parameter $\vartheta$ and verify if it is unbiased Find the distribution of $\hat{\vartheta}_n$ If $\hat{\vartheta}_n$ is biased, propose an unbiased estimator in the class of the estimators of the type $c\cdot\hat{\vartheta}_n$, with $c$ an appropriate constant   While I'm pretty confident on how to solve the first and last point, I'd like some advice on the second one.    1.  To find the MLE $\hat{\vartheta}_n$, the likelihood function is calculated: $$\mathscr{L}(\underline{x};\vartheta) = \lambda^n\,\vartheta^{n\lambda}\,\left( x_1 \times\dots\times x_n \right)^{-(\lambda +1)} \qquad\qquad(\vartheta\leq x_i,\, \forall\,i=1,2,\dots,n)$$ Given the condition on $\vartheta$, the value that maximizes the likelihood function can be starightforwardly seen to be $\hat{\vartheta}_n = \min{\left(x_1,\dots,x_n\right)} = x_{(1)}$ where $\left(x_{(1)},\dots,x_{(n)} \right)$ is the sample re-arranged in non-decreasing order.  We have to verify if $\mathbb{E}\left(\hat{\vartheta}_n\right)=\vartheta$, so we calculate $$\mathbb{E}\left(\hat{\vartheta}_n\right)=\mathbb{E}\left(x_{(1)}\right)=\mathbb{E}\left(x\right)=\int_\vartheta^{+\infty} x\,\lambda\,\vartheta^\lambda\,x^{-(\lambda +1)}\stackrel{\lambda>1}{=}\frac{\lambda}{\lambda-1}\vartheta\neq\vartheta$$  So the MLE is biased.  2?  $\hat{\vartheta}_n = x_{(1)}$ has the same distribution of every $x$ random variable, that is $f(x;\vartheta,\lambda)$.  Am I right about this? No, I'm not!  3.  Given what was calculated at point 1, if $c=\frac{\lambda -1}{\lambda}$ we have that $c\cdot\hat{\vartheta}_n$ is an unbiased MLE.  Any help/correction would be greatly appreciated!

Let $X_1,...X_n$ be a random sample from the Pareto distribution with parameters $\alpha$ and $\theta$, where $\alpha$ is known.   Find the maximum likelihood estimator for $\theta$ and say if it is unbiased, if not find an unbiased estimator  My Approach:  $$f(x;\alpha, \theta) = \alpha \theta^\alpha x^{-(\alpha +1)},\quad x \ge \beta$$  $$L(\theta) = \alpha^n \theta^{\alpha n} \left(\prod_{i=1}^n x_i\right)^{-(\alpha+1)}$$  Taking log for $L(\alpha)$ gives  $$\ln L(\theta) = n \ln(\alpha) + \alpha n \ln(\theta) + \sum_{i=1}^n -(\alpha+1) \ln(x_i)$$  Then since $\ln L(\theta)$ is an increasing function if $\theta$ increases, and for a Pareto distribution we have that $\theta \le x$ we conclude that the maximum likelihood estimator is $\hat\theta=\min {x_i}$ (the first order statistic) Am I right?  Then to prove that it is and unbised statistic we have to prove that $E(\hat{\theta}) = \theta$.  I donot know how to do it I just thought using the p.d.f of the firs order statistic and integrate from $\theta $ to infinite but I'm not sure about this.  Any ideas?


Here is the problem: Integration of  $$\int\frac{1}{1+\sqrt{x^2+x+2}}.$$  I started by completing the square and then substituting but it became too complicated.  So I want to solve in a shorter way. Any help would be appreciated.

Integrate $$\int \frac{1}{1+\sqrt{x^2+2x+2}}dx$$   I have tried by using Euler substitution, but that gave me a wrong answer.  So can somebody help?


I have this 2 array:  $array = [ 'one', 'two', 'three' ];  $anohter_array = [ 4, 6, 8 ];   Now, how can I change the variable $array keys to 4, 6, 8 instead of 0, 1, 2?

I've got two arrays of the same size.  I'd like to merge the two so the values of one are the key indexes of the new array, and the values of the new array are the values of the other.  Right now I'm just looping through the arrays and creating the new array manually, but I have a feeling there is a much more elegant way to go about this.  I don't see any array functions for this purpose, but maybe I missed something?  Is there a simple way to this along these lines?  $mapped_array = mapkeys($array_with_keys, $array_with_values);


I use Oracle 11 and want to find out the size of my tables (like in megabytes). What should I do? Should I check the file size on server? Or is there any query to run?

Being used to (and potentially spoiled by) MSSQL, I'm wondering how I can get at tables size in Oracle 10g. I have googled it so I'm now aware that I may not have as easy an option as sp_spaceused. Still the potential answers I got are most of the time outdated or don't work. Probably because I'm no DBA on the schema I'm working with.  Would anyone have solutions and or recommendations?


In the Wonder Woman movie she was born before WWI and in the BvS she was fighting doomsday. It doesn't look like she is aged a little bit.   Is she immortal or having a slow aging rate?   Whether she will get old?

In the movie Wonder Woman, we see Wonder Woman as a child who grows into an adult. During the same time we see the people around her - the Amazons - not seem to age at all. It's revealed that Wonder Woman is special.      She's actually a God and presumably immortal   The Amazons are, well, not quite human, but they aren't the same as WW.   It's also revealed that:      A long time ago there was a war between the Gods and all of them perished by the hands of Ares. Before Zeus died, he created Wonder Woman out of clay.   All of the Amazons have bronze aged weaponry and do not seem aware of the changes to the outside world. This suggests that they are several thousand years old.   Presumably Wonder Woman has a normal life span as a child and has just become an adult at the beginning of the film. This seems very incongruent to me. Maybe I missed something though.  So, does the film or the DC Extended Universe give any indication of how old Wonder Woman is? Or is my assumption that she's several thousand years old (based on the weaponry) correct, despite the apparent incongruity I brought up?


I've a regex pattern to get some HTML tags in my code. The problem is that the pattern is getting more than just a tag, bringing all the part of code between the first match and the lastest match.  Here is my regex tests:   This is how my current regex looks:  <option_(.*)_[0-9]>   And in the following text and need two different matches (<option_teste_2>,<option_teste_1>):

<option_teste_2>

<input_nome_funcionario>

	<option_teste_1>

   Thanks.

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


I remember a book from school where a girl was being raised by a robot on an alien planet. The robot genetically altered the girl to deal with the environment of the planet. She didn't know she was different until other humans arrived and.....I can't remember what happened after that.   This would have been early 90s but not sure if book was a bit older.

I read a series of books written in English (possibly a trilogy) in the early 1980s and was hoping to find them again for my children. The details I remember are:   It was set on a planet and spanned many, many years over the course of the books There was a sort of 'housekeeper/protector' robot that featured in all of them but was slightly the worse for wear by the end One of the books had a young dark-skinned boy who made the hike up to the house where the robot was, and someone made reference to the fact that his dark skin protected him from the incredibly fierce sun found in the higher regions of the planet.


Also if I have:  "23" and I want to print that out as 23p  How can I get Java to see if the string has 2 digits that are less than 99(p) or, "234" and see that there are more than 2 digits and convert the "234" to "£2.34"  Thanks

How do I format a number in Java? What are the "Best Practices"? Will I need to round a number before I format it?  32.302342342342343 => 32.30 .7323 => 0.73  etc.


I realized, that on Unix - systems a lot of weird interface acronyms exist:    lo = loopback interface eno = ethernet interface, network interface card  ens = ethernet interface, on newer Ubuntu version   What is the rule behind this namings and is there any?  What do the short-hand "nick-names" mean?

Under consistent network device naming scheme, what does 'eno' stand for in network interface name eno16777736 for CentOS 7 or RHEL 7?


I have windows 7 system where virtual box is installed and virtualization is enabled.    In virtual box I have installed ubuntu image that is also have installed virtualbox. But within that box virtualization is not avaible.     Is it possible to enable virtualization for such case?

What I do: I want to write a kernel module that does stuff to the KVM data structures. But I don't want to run it on the real machine, so I run one guest, inside it I run another two guests, and want to test my module.  The problem: VirtualBox (which now runs the outer guest), doesn't support nested virtualization, and when I cat /proc/cpuinfo | grep vmx I get no output.  What can I use that has nested virtualization?  You may look at my  to get an idea of what I want to do.


In the famous book Counterexamples in topology by Steen and Seebach, is proved that Arens space is not a Urysohn space (in that book, a Urysohn space is the space in which any two distinct points can be separated by a continuous function). The proof from the book is as follows:  We can show that X is not Urysohn by considering a function $f:X \to [0,1]$ such that $f(0,0)=0$ and $f(1,0)=1$. If $f$ is continuous we note that the inverse images of the open sets $[0,\frac{1}{4})$ and $(\frac{3}{4},1]$ of $[0,1]$ must be open and hence contain $U_n(0,0)$ and $U_m(1,0)$ for some $m$ and $n$, respectively. Then, if $r\sqrt{2}<\min(\frac{1}{n},\frac{1}{m})$, $f(\frac{1}{2}r\sqrt{2})$ is not in both $[0,\frac{1}{4})$ and $(\frac{3}{4},1]$, so suppose it is not in $[0,\frac{1}{4})$...  before this everything is clear for me. But I can't understand the next sentence:  ... then, there exists about $f(\frac12 r\sqrt{2})$ an open interval $U$ such that $\overline{U}$ and $[0,\frac14)$ are disjoint. But then the inverse images of $\overline{U}$ and $\overline{[0,\frac14)}$ under $f$ would be disjoint closed sets containing...... etc.   I can't understand, why does such a $U$ exist? There is no chance that $f(\frac12 r\sqrt{2})=\frac14$.  Please, help me!  P.S. The definition of Arens square:

Example 80 in Steen-Seebach1 is called Arens Square. It is defined in the book as follows:     Let $S$ be the set of rational lattice points in the interior of the unit square except those whose $x$-coordinate is $\frac12$.    Define $X$ to be $S\cup\{(0,0)\}\cup\{(1,0)\} \cup \{(\frac12,\sqrt2r); r\in\mathbb Q, 0<r\sqrt2<1\}$.   We define a basis for a topology on $X$ by granting to each point of $S$ the local basis of relatively open sets which $S$ inherits from the Euclidean topology on the unit square, and to the other points of $X$ the following local bases:   \begin{align*} U_n(0,0) &= \{(0,0)\} \cup \{(x,y); 0<x<\frac14, 0<y<\frac1n\},\\ U_n(1,0) &= \{(0,0)\} \cup \{(x,y); \frac34<x<1, 0<y<\frac1n\},\\ U_n(\frac12,r\sqrt2) &= \{(x,y); \frac14<x<\frac34, |y-r\sqrt2|<\frac1n\} \end{align*}   The authors claim that:     With this topology $X$ is $T_{2½}$.    This may be seen by direct consideration of cases noting that neither any point of $S$ nor $(0,0)$ nor $(0,1)$ may have the same $y$ coordinate as a point of the form $(\frac12,r\sqrt2)$.   A  or $T_{2½}$-space is a space in which any two distinct points can be separated by closed neighborhoods. (I.e., they have disjoint closed neighborhoods. In Steen-Seebach such spaces are call such spaces completely Hausdorff. As far as I can say, the name Urysohn space is more frequent.)  The problem I see with the above claim is the following: Let us take two points $a=(\frac38,y)$ and $b=(\frac58,y)$, $y\in\mathbb Q$, which have the same $y$-coordinate and belong to the "middle part". If we take any neighborhoods $O_a\ni a$ and $O_b\ni b$ then they contain neighborhoods of the form $B(a,\frac1n)\cap S$, $B(b,\frac1n)\cap S$ for some $n$. Now let $c$ be any point of the form $(\frac12,r\sqrt2)$ with $y-1/n<\sqrt2r<y+1/n$. Then every basic neighborhood of $c$ intersects these two balls and, consequently, it intersects $O_a$ and $O_b$. Which means that $c\in \overline{O_a} \cap \overline{O_b}$. So the points $a$ and $b$ do not have neighborhoods with disjoint closures.  What am I missing here? Or is it a mistake in this book? (In fact, the above problem was found by a colleague of mine. But since I was not able to answer his doubts, I decided to ask here.)  The authors also say that this is a modification of an example given in a paper by Hewitt. I had a look at that paper, but I did not find there exactly the same example as this one.        Hewitt [51] credits Arens with constructing an example of this type; we present a modified version, and then a simplified version.   Arens square is both semiregular and completely Hausdorff but not regular.         [51] Hewitt, E. On two problems of Urysohn. Annals of Math. 47 (1946) 503-509.    It is perhaps also worth mentioning that π-Base list this space as $T_{2½}$-space:   1 Lynn Arthur Steen and J. Arthur Seebach, Jr., . Springer-Verlag, New York, 1978. Reprinted by Dover Publications, New York, 1995.


I have run logistic regression on data. The concordant percentage is coming out 45. That is too low. However, Hosmer–Lemeshow test is coming out insignificant. It means we cannot reject the null hypothesis stating model fits the data well. That's good! The ctable also shows 70% of the data correctly predicted.   How contradictory results of concordant and Hosmer-Lemeshow test should be considered? How should I interpret this model?

As we all know, there are 2 methods to evaluate the logistic regression model and they are testing very different things  Predictive power: Get a statistic that measures how well you can predict the dependent variable based on the independent variables. The well-known Pseudo R^2 are McFadden (1974) and Cox and Snell (1989).  Goodness-of-fit statistics The test is telling whether you could do even better by making the model more complicated, which is actually testing whether there are any non-linearities or interactions that you have missed.   I implemented both tests on my model, which added quadratic and interaction already:     >summary(spec_q2)      Call:     glm(formula = result ~ Top + Right + Left + Bottom + I(Top^2) +       I(Left^2) + I(Bottom^2) + Top:Right + Top:Bottom + Right:Left,       family = binomial())       Coefficients:                  Estimate Std. Error z value Pr(>|z|)         (Intercept)  0.955431   8.838584   0.108   0.9139         Top          0.311891   0.189793   1.643   0.1003         Right       -1.015460   0.502736  -2.020   0.0434 *       Left        -0.962143   0.431534  -2.230   0.0258 *       Bottom       0.198631   0.157242   1.263   0.2065         I(Top^2)    -0.003213   0.002114  -1.520   0.1285         I(Left^2)   -0.054258   0.008768  -6.188 6.09e-10 ***     I(Bottom^2)  0.003725   0.001782   2.091   0.0366 *       Top:Right    0.012290   0.007540   1.630   0.1031         Top:Bottom   0.004536   0.002880   1.575   0.1153         Right:Left  -0.044283   0.015983  -2.771   0.0056 **      ---     Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1     (Dispersion parameter for binomial family taken to be 1)     Null deviance: 3350.3  on 2799  degrees of freedom     Residual deviance: 1984.6  on 2789  degrees of freedom     AIC: 2006.6  and the predicted power is as below, the MaFadden is 0.4004, and the value between 0.2~0.4 should be taken to present very good fit of the model(Louviere et al (2000), Domenich and McFadden (1975))                                                :  > PseudoR2(spec_q2)     McFadden     Adj.McFadden        Cox.Snell       Nagelkerke McKelvey.Zavoina           Effron            Count        Adj.Count     0.4076315        0.4004680        0.3859918        0.5531859        0.6144487        0.4616466        0.8489286        0.4712500           AIC    Corrected.AIC  2006.6179010     2006.7125925   and the goodness-of-fit statistics:  > hoslem.test(result,phat,g=8)       Hosmer and Lemeshow goodness of fit (GOF) test    data:  result, phat   X-squared = 2800, df = 6, p-value < 2.2e-16  As my understanding, GOF is actually testing the following null and alternative hypothesis:   H0: The models does not need interaction and non-linearity   H1: The models needs interaction and non-linearity  Since my models added interaction, non-linearity already and the p-value shows H0 should be rejected, so I came to the conclusion that my model needs interaction, non-linearity indeed. Hope my interpretation is correct and thanks for any advise in advance, thanks.


I can declare an array of size 10^6 globally in c, but when I declared it inside the main() function it doesn't work.Why is it so? this statement causes runtime error:  int main() {     long long arr[1000001];     return 1; }   but this runs perfectly:  static long long arr[1000001]; int main() {     return 1; }

The following code is generating a stack overflow error for me  int main(int argc, char* argv[]) {     int sieve[2000000];     return 0; }   How do I get around this? I am using Turbo C++ but would like to keep my code in C  EDIT:  Thanks for the advice.  The code above was only for example, I actually declare the array in a function and not in sub main.  Also, I needed the array to be initialized to zeros, so when I googled malloc, I discovered that calloc was perfect for my purposes.  Malloc/calloc also has the advantage over allocating on the stack of allowing me to declare the size using a variable.


For some reason, there seem to be 2 overlapped images of letters inside \pmb{} of the tikz draw feature. Here is a MWE  \documentclass[11pt]{article} \usepackage{amsmath} \usepackage{tikz} \begin{document}  \begin{tikzpicture}[scale=10]     \draw (0,0) node {$\pmb{B}$}; \end{tikzpicture}  \end{document}   I didn't notice it at first, but if you zoom in, you can see two of the same letter overlapped.. Any idea how to make only one bold letter appear? Any help or work-arounds are appreciated!

To make Latin-letter variables bold I can use e.g. \mathbf{a}, but while putting Greek letters or symbols such as \nabla inside \mathbf doesn't cause any errors or warnings, it also doesn't do anything else.  What is the best way to make bold math symbols, in particular Greek letters and \nabla?


I would like to ask a question about developer's experiences with different Windows Dedicated Server hosting providers.  Assuming that my question is technology-specific, and worded as objectively as possible, Is this off-topic for SO?  Where is the most appropriate place to ask such a question?

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.


We have internet connection problems on my country. For security reasons blocked almost all social networks and app store aswell.(app store blocked to stop downloading vpn). For this period i noticed, that my macbook pro is too slow. Some application opens in 1-2 minutes. When i turn off wifi everything works fine. What to do in this case? Why macos tries to connect to apple servers?

I'm a software developer and as such I build and run programs hundreds of times per day. I've noticed that since I started using Catalina, after compiling and linking there is a delay (which can be seconds) when the internet is slow or having problems (I have bad internet often). If I disable wifi and rebuild, the delay goes away. How can I disable this so my builds run faster?


I just learned about the volatile keyword in Java.  Essentially it seems that if a variable is read from or written to in one CPU, then it is saved in that CPU's cache but not necessarily immediately written to memory.    In some cases I pass an object reference or primitive variable to another thread, but I have not used the volatile keyword because I didn't know about that keyword until now.  I believe that if a new Thread reads that variable for the first time there is no issue. However, if my understanding is correct, then if a second thread changes the variable, then the first Thread's CPU may have it in cache and report an out of date value. Is this a true understanding of the effects of omitting the volatile keyword?  Example:   Thread A sets an object's variable value to "First". Thread B reads the value of that variable for the first time ever. Thread A changes the value to "Second". Thread B reads the value again shortly thereafter, but it still reports "First" because of CPU cache.   Is this the main consequence of omitting a volatile keyword when it is necessary? Thread reporting an out of date value?  Is my understanding here correct? Also I am open to any other suggestions about when it is NOT necessary to use the volatile keyword for a non-final variable that is accessed by another thread. I know when to use it, but I need to have a good understanding about when not to.

At work today, I came across the volatile keyword in Java. Not being very familiar with it, I found . Given the detail in which that article explains the keyword in question, do you ever use it or could you ever see a case in which you could use this keyword in the correct manner?


I have Nikon D7000 and I know the basic relation of shutter speed, aperture, and iso.  All I want to know is focal length and aperture relation.  As I zoom in the camera the f/stop increases (e.g. it starts 3.5 and then to 5.6)  Some one told me that having large aperture gives more blurry background.  (ie: f3.5 will give me more blur than f5.6, if I am not wrong)  However, when I zoom my lens to 140mm minimum f value available becomes 5.6 and it gives me more blurry background than f3.5 at 18mm  Why is this?

I am new to the photography field, there are few things which I am not able to understand. I am playing around with my Nikon D90 along with its kit lens (18-105mm).  While reading about Depth of preview, the author asks to do some basic exercise to better understand DOF, like this:   set your aperture to smallest number f/2.8, f/3.5, f/4 with 70mm or longer lens.   When I tried to set aperture to f/3.5, and tried to change focal length, my camera is setting aperture automatically in every possible mode (which I know of). It is changing aperture in the following fashion:  1. 18-24 ----> 3.4 to 4 2. 18-35 ----> 4.5 3. 18-50 ----> 5 4. 18-105 ---> 5.6   But if i set my aperture to 5.6 or higher, it does not change when I change the focal length of my camera. I know I am not doing some basic thing right, but I'm still not sure why this is happening. Can some one help me to understand this?


I have an LG Optimus P500 phone with Gingerbread.   Suddenly I am not able to unlock it by drawing the pattern. I remember the exact pattern, but its not showing what I draw there. It's not even turning its light on when I draw it.  Removed battery, re-inserted, and done every primary thing.   Strangely I can receive phone call by swiping to answer.  Tried turning it on by pressing power button + home button, but it went to some fast reboot mode and nothing happened.  Can anybody help me in repairing my phone?

I have an Android device which is running Android 4.0.3 (or something like that).  My little brother decided to try and guess my lock screen pattern the other day, and ended up locking me out.   I have since been unable to log back in to the tablet using my Google Account details. I provided the correct login details, however it says they are incorrect. Could this be connected to the fact I have no internet connection?  I have no internet connection as the device is WiFi only, and the WiFi is currently turned off. I cannot turn it on, as I am locked out.  How can I log back into my tablet without wiping the user data?


I have two rooted Huawei P9 Plus phones running Android 7. Now I would like to copy the apps, the settings of the apps, the system settings etc. from one phone to the other phone so that both phones are exactly the same.  How can this be easily done? I have root, so I could also use an app requiring root.

Can anyone recommend a good way to backup Android devices? Ideally I would like to do this wirelessly and, not only backup my data, but also my user settings. Is it possible to backup an image of an Android device - so that one doesn't even need to reinstall apps? It would be particularly useful to hear from users that have restored backups, as to how easy, and complete, their processes were. Thanks


Redirection is not allowed here. Is cat not allowing? But isn't redirection independent of any command running with it?  $ cat bk > bk cat: bk: input file is output file  Why does the following redirect empty the file:  $ less  bk > bk   awk also works in the similar way as less in regard to redirection. awk is the one with which I actually found the problem, while the above examples are meaningless   In general, what are the right way to use redirect?

1. Consider snippet#1:  $ cat test.txt > test.txt cat: test.txt: input file is output file   It seems that cat makes its input file descriptor point to test.txt and then when it tries to set its output file descriptor to test.txt it throws the above error. Here it seems that cat is aware of the redirect operator and so proceeds to attempt to set the output file descriptor to test.txt  2. Consider snippet#2:  $ cat 1.txt 1:CAT 2:dog $ sed 's/cat/CAT/g' test.txt 1:CAT 2:dog $ sed 's/cat/CAT/g' test.txt > test.txt $ cat test.txt # Note that test.txt is now empty $   Here we see that sed opens test.txt (last argument) in read mode and at the same time sets test.txt as its file output descriptor. Also the '>' operator overwrites the contents of the file BEFORE sed starts to read from it.   I am aware that commands in a pipeline execute in parallel but have not come across any info on how redirection operators behave. Any supporting links would be helpful.


I keep getting an error during installation saying  grub-efi-amd64-signed failed to install    Specs: Macbook 13-inch, Early 2008 4GB of RAM Macs work differently   Are there any solutions to this problem?

I am installing Ubuntu 16.04 in an Intel NUC computer with UEFI enabled. I am using an SSD from another computer. During the installation I chose Erase the disk and make a new full install  At the end of the process I see:  grub-efi-amd64-signed failed installation /target/ Ubuntu 16.04    And the system does not boot.  I tried to use boot-repair but apparently it does not solve the problem.


As per the tocloft package documentation, we should be able to use \renewcommand{\cftsecpresnum}{something} to insert some text before the section number in the table of contents (for example, should work for list of tables, list of figures, and a custom list using \newlistof).  However, when I use that command the I want to insert before the section heading entry in the table of contents overlaps with the section heading text. See MWE. Am I missing something here? I did not immediately see an answer to address this, specifically as to whether or not the \cftsecpresnum command from the tocloft works or not. As per below I would have to use \cftsecindent as a work around, but that was not mentioned in the package documentation and not sure if that is the intent.  Thanks in advance!  \documentclass{report}  \usepackage{tocloft} \renewcommand{\cftsecpresnum}{Something }  \begin{document}  \tableofcontents  \section{what}   Bananas  \section{is the deal}   Apples  \end{document}

Following minimal document:  \documentclass{report}  \begin{document} \renewcommand*\thechapter{\Roman{chapter}} \tableofcontents \setcounter{chapter}{6} % Problem starts at chapter 7 \chapter{Seven} \chapter{Eight} \section{Eight-one} \section{Eight-two} \end{document}   yields this output (cut to size for your convenience):    Clearly, the chapter (and section) headings hang into the chapter (section) numbers. For the previous chapter numbers, this isn’t a problem since all chapter titles are aligned to the same column and the numbers I–VI are sufficiently narrow.  (The same happens regardless of document type, I’m actually using scrreprt with the same result.)  How can I prevent this?


The question asks to evaluate the limit and discuss the continuity of the function. I think I made steps in the right direction, but I'm not sure how to go from there  $$\lim_{x, y\to(0, 0)} \frac{x^2y}{x^4+y^2}?$$  I divided the numerator and the denominator by $x^2y$ and got $$\lim_{x, y \to(0, 0)} \frac{1}{\frac{x^2}{y}+\frac{y}{x^2}}?$$  I was thinking of setting $a=\dfrac{x^2}{y}$ and $\dfrac 1a=\dfrac{y}{x^2}$. However, I'm not sure what $\lim_{x, y\to(0, 0)} a$ is. I suspect it's $0$, but I'm not sure. I'm also not sure if I even have to use the epsilon delta definition of a limit to prove that it exists before solving it.

I'm resolving the limit of $\frac{(2x^2).y}{x^4+y^2}$  when $(x,y)\to(0,0)$  We didn't study any special theorem, we did only approach.  I tried first the  changes $y=x^2$ and $y=0$.  In $f(x,x^2)$, operating I get that the $\lim =\frac{2x^4}{2x^4}=1$ So then I test the $f(x,0)$ operating I get $\frac{2x^2.0}{x^4+0}$, that is still $0/0$,but has a zero on the numerator, that is always enough to claim that the limit of $f(x,0)$ is $0$? Assuming that the limit $f(x,x^2)$=1 $f(x,0)$=0 so the limit don't exist.  Is right the procedure? Any way to do it easy? is right the assumption of the 0 on the numerator that the limit will be cero? Thanks.


If I have widget.net domain, I assume users are going to type in either www.widget.net or widget.net and expect to get to the same place in either case. But taking that as a given which is best practise:   In either case browser shows the url they originally entered If the user enters www.widget.net it should change to widget.net (widget.net remains unchanged) If user enters widget.net it should change to www.widget.net (www.widget.net remains unchanged)   Also if have widget.com domain as well what should happen.  (I know how to do this now using Amazon Route53 and Amazon S3, just not what I should do)

tl;dr : For SEO, should I redirect from one to the other or list both on the DNS records?    It seems that most experts think that both www and non-www should exist. (Please correct me if I'm wrong.) And Google Webmasters Tools lets you choose which is the main one.  But: will a redirect give all SEO weight to one of them instead of splitting it? (There are other search engines after all, so setting the main one in Google Webmasters Tools might not be enough.) Will having both on the DNS records give them more importance? No difference?


I am a student from India. I have a study permit (temporary resident visa). I was just checking a flight from New Delhi to Toronto. One of the flights I was interested in was New Delhi -> London, London -> Montreal, Montreal -> Toronto.  In Montreal it says I require a transit visa. Do I really need it even though I have a student permit?

I'm passing through Canada, on my way to somewhere else. I'm staying only a short time.   Is there a website, or some other way of find out out if I need a visa?


Is it  possible to only install the security updates.  If this is possible it needs to be done on several servers and ubuntu virtual machines (Manually in command line) .   I already tried a few solutions but nothing worked out for me. The goal is that by running a script of some sort to sort the security updates together and then update only the security updates.   It isn't possible to install them automatic because the servers and the virtual machines have great impact on the company.   Btw I am a noob on linux / ubuntu . Tried (sudo apt-get upgrade but this only upgrade the existing software , Tried this with no result apt-get -s dist-upgrade | grep "^Inst" | grep -i securi | awk -F " " {'print $2'} | xargs apt-get install , Also tried this sudo sh -c 'grep ^deb /etc/apt/sources.list |grep securi >> /etc/apt/sources.security.repos.only.list' with no result. The only option i see left i manualy download the updates and then sort them out. I already saw that article . sudo sh -c 'apt-get -o Dir::Etc::sourcelist="secsrc.list" \ -o Dir::Etc::sourceparts="-" update && \ apt-get --assume-no upgrade' . Maybe there is a possibility to workt together with this the command abbove ? So that i only need to download the security updates , and becouse it is a company servers i cant just shutdown rest of the reposotory .

sudo apt-get upgrade installs all updates, not just security updates. I know that I can use Update Manager to select only important security updates, but is there a way to do this from the command line?


I'm quite new to bash scripting, and I wrote the following script to emulate the wc -c command: (I know it doesn't count the end of the line)  #!/bin/bash  echo $1 len=0 cat $1 | while read line do     let len+=${#line}     echo $len done echo $len   the output is the following:  xyz.sh 11 11 18 27 51 53 70 79 83 92 0   why doesn't len stays changed after the loop, and hoe to make it to do so?

Why do I get different values for $x from the snippets below?  #!/bin/bash  x=1 echo fred > junk ; while read var ; do x=55 ; done < junk echo x=$x  #    x=55 .. I'd expect this result  x=1 cat junk | while read var ; do x=55 ; done echo x=$x  #    x=1 .. but why?  x=1 echo fred | while read var ; do x=55 ; done echo x=$x  #    x=1  .. but why?


I apologize if this question it too basic, but I have had this doubt for as long as I can remember. Consider the following sentence:  "The first thing that needs to be done is to set the trajectory."  Is it correct to use the "to" before "set the trajectory"? Or could I remove it, leaving me with:  "The first thing that needs to be done is set the trajectory."  I have tried searching for examples online, but I have not been successful.

I was speaking to an English learner and said, “All you have to do is read a lot.” And they thought that sentence wasn’t grammatically correct because I dropped the word to between is and read.  They thought it should be “All you have to do is to read a lot.” That sounds weird to me.   How do I explain to them the reason you drop the to? Or am I incorrect and it really should have a to?


I have been trying to write my first addon for Blender over the last couple of days. One error I came across quite often is the context is incorrect error for an operation of bpy.ops.  I learned that one can ask the poll function of an operator if the context is correct, but this does not tell why the context is correct/incorrect. What would be the best way to figure that out? Only way I could think of is to look into the code of the poll function. If that is the best way, what is the fastest way to find the appropriate piece of code?

I keep on getting context errors in the Blender Python API.  I don't understand the issue of the context in the API, how do I know which is the correct context?   Thanks!


Given any continuous map between topological spaces $f: X \rightarrow Y$, we can define the mapping cone $C_{f}:=((X \times[0,1]) \sqcup Y) / \sim,$ with the equivalence relation generated by $(x, 0) \sim f(x)$ for any $x \in X$ and $\left(x_{1}, 1\right) \sim\left(x_{2}, 1\right)$ for any $x_{1}, x_{2} \in X .$ Now let $f: X \rightarrow Y$ and $g: X \rightarrow Y$ be two homotopic maps. Show that then, the mapping cones $C_{f}$ and $C_{g}$ are homotopy equivalent.  I’ve made a search and have seen a few other similar questions. However, I’d like to ask some questions below, and hopefully can come up with the solution myself. Here’s the picture of $C_f$ and $C_g$. My task would be to find maps $\alpha, \beta$ such that $\beta \circ \alpha \simeq id_{C_f}$ and $\alpha \circ \beta \simeq id_{C_g}$.  Say we want to define $\alpha$ first. My guess is that there are three kinds of point that I need to consider: $\bullet p \in X \times (0,1]$ $\bullet p \in Y \setminus (f(X) \cup g(X))$, and $\bullet p \in X \times \{0\}$ I’m thinking of letting $\alpha(p) := p$ for the first two kinds. Doing the same for $\beta$ and we’d have $\beta \circ \alpha = id_{C_f}$ and $\alpha \circ \beta = id_{C_g}$, with the domains restricted to the first two kinds of points. As for the third kind, I’m not really sure. What would happen if I also use the identity map there? If that doesn’t work, any hints on how to use the homotopy between $f$ and $g$ here?

Let $f,g:X\to Y$ be maps of spaces such that $f\simeq g$. Is it true that the mapping cones $\operatorname{cone}(f)$ and $\operatorname{cone}(g)$ are homotopy equivalent?  Can we write down an explicit homotopy equivalence? It ought not to be too hard to get a map $\operatorname{cone}(f)\to \operatorname{cone}(g)$ from the existence of a homotopy $H:X\times I\to Y$, but I haven't been able to find a sensible candidate, despite trying for quite a while.


We know how to make cross product of three dimensional vectors. $$ \vec A \times \vec B = \vec C$$  Where : $ \vec A = (A_i; A_j; A_k)$ $ \vec B = (B_i; B_j; B_k)$ $ \vec C = (C_i; C_j; C_k)$  $C_i = \left|\begin{matrix}A_j&A_k\\B_j&B_k\end{matrix}\right|$ $C_j = \left|\begin{matrix}A_k&A_i\\B_k&B_i\end{matrix}\right|$ $C_k = \left|\begin{matrix}A_i&A_j\\B_i&B_j\end{matrix}\right|$  But what about if we have four dimensional vectors? Is it possible to make cross product of four dimensional vectors? If it  is possible, then tell me when it can be possible?       Let say we have two vectors: $ \vec A = (A_i; A_j; A_k; A_l)$ $ \vec B = (B_i; B_j; B_k; B_l)$   Then how to compute a cross product of this two vectors? Will it again vector? $$ \vec A \times \vec B = \vec C$$  $ \vec C = (C_i; C_j; C_k; C_l)$ Then how to compute those coordinates?  We know that only square matrices have a determinant property! In this case it might not be correct if we will wright... $\color{red} {\text { $C_i = \left|\begin{matrix}A_j&A_k&A_l\\B_j&B_k&B_l\end{matrix}\right|$}    C_j = \left|\begin{matrix}A_k&A_i&A_l\\B_k&B_i&B_l\end{matrix}\right| C_k = \left|\begin{matrix}A_i&A_j&A_l\\B_i&B_j&B_l\end{matrix}\right| C_l = \left|\begin{matrix}A_i&A_j&A_k\\B_i&B_j&B_k\end{matrix}\right|}$   So tell me how to solve this problem?

I read that the cross product can't be generalized to $\mathbb R^n$. Then I found that in $n=7$ there is a Cross product:   Why is it not possible to define a cross product for other dimensions $ \ge 4$?


I know that when you roll an object instead of sliding it reduces the friction you can easily move an object. Consider the object to have a weight $W$ on a horizontal surface and the two objects have coefficient of friction of $\mu$. Thus the friction force $f$ should be: $$f=\mu W$$ In order for the friction to change, either $\mu$ or $W$ has to change and since $W$ does not change when rolling $\mu$ changes. My question is ,$\mu$ depends on the property of the materials not their orientation or their surface area of contact. So what has changed in order for $\mu$ to change? Does $\mu$ depend on other factors. The same question for static friction $\mu_{s}$and kinetic friction $\mu_{k}.$

When dragging an object, there is a greater start-up force than the force it takes to keep it moving. Why is this? Why are there two different values for friction?


Some questions happen to be solved for some reason (for instance, a new software version), and there's no answer it should be marked as accepted, but the question is not 'Open' anymore. And I don't think the question should be deleted because other users may have the same problem.   What's the best way to deal with this situation?  At least for me, it doesn't show up any option/action that would fit this situation on this question for instance:

Sometimes I hit some questions with code samples in the question or some of the answers that are deprecated.  Example:   In this question from 2009 about some feature of Ruby on Rails we find several details in the code samples which are deprecated in the latest versions of Rails.  For example:  def before_destroy   should now be  before_destroy :do_something  def do_something   ... end   or this one:  errors.add_to_base("A project with effort logged cannot be deleted")   should now be  errors.add(:base, "A project with effort logged cannot be deleted")   I'm sure other questions and technologies have similar problems. Is there a recommended way what to do about this? While an experienced developer won't have too much of a problem here, for some people it may be quite confusing if he tries to run some of this code and gets strange error messages or deprecation warnings from Rails.


Let $f$ be a continuous function in $\mathbb R$ satisfying the relation  $f(f(f(x))) = x$, for all $x \in \mathbb R$.  Prove or disprove that $f$ is an identity function.

If $ f: \mathbb{R} \to \mathbb{R} $ is continuous, and $\forall x \in \mathbb{R} :\;(f \circ f \circ f)(x) = x  $, show that $ f(x) = x $.  The condition that $f$ is continuous on $\mathbb{R}$ is crucial for the proof. I can find functions such as $\displaystyle\frac{x-3}{x+1}$ that satisfies  $ (f \circ f \circ f)(x) = x $. I have tried to negate the conclusion to see if there's a contradiction, but got stuck.


Let us have the differential equation $x\frac{dv}{dx}=f(v(x))$ and the solution $v$ s.t. $v(e)=2$. Let $v(1)=k$. Show that $$\int_{k}^{2} \frac{dy}{f(y)} = 1.$$  Can anyone please help me understand how to show that?  I was taught that $v$ is defined as $\frac yx$. I understand how to show that but how is it done if we assume that $v=\frac yx$?

I am trying to solve the problem:     \begin{array}{l}{\text { A particular solution of the differential equation }} \\ {x \frac{\mathrm{d} v}{\mathrm{d} x}=f(v) \text { has } v=2 \text { when } x=\mathrm{e} \text { . }} \\ {\text { If } k \text { is the value of } v \text { when } x=1, \text { show that } \int_{k}^{2} \frac{1}{f(y)} \mathrm{d} y=1}\end{array}   I realize that: $\int\frac{dv}{f(v)} = \int \frac{dx}{x}$. I am unsure of how to proceed.


I want to assign ctrl + c (copy) to button 4, I have previously done it in windows with a software called mouse manager but can't find any such software for macos.

If that's not possible, then a way to trigger the Dock on the screen with mouse without moving my cursor to the bottom of the screen is also an acceptable solution (I know that the launchpad appears on the screen with Dock)  Also i did see the  about this.


You are given two points (2,3) and    (3,1) on Parabola from where 2    tangents are drawn intersecting at    (-1,-2) . Find the locus of Parabola   This question is supposed to have some trick or some clever approach I have tried really hard but I am failing to see any gimmicky solution

Two lines drawn through $T$ at $(-1,-2)$ are tangent to a parabola at $P$ $(2,3)$ and $Q$ $(3,-1)$, respectively.  Find the equation of the parabola.  I tried using similarity of triangles to find the focus, but to no avail.


I have a mysql database and I added two entries in the table TvSeries. But I can't retrieve the the entries. Below are my Model Class, my Repository Class, my Service Class and the main method where I've tried to retrieve the information.  import javax.persistence.*; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; import java.util.Set;  @Entity public class TvSeries {     @Id     @GeneratedValue(strategy= GenerationType.IDENTITY)     private Integer id;      public Integer getId() {         return id;     }      @NotNull     @NotEmpty     private String title = "";      private String description = "";      @NotNull     @NotEmpty     private int noOfSeasons;      public String getTitle() {         return title;     }      public String getDescription() {         return description;     }      public int getNoOfSeasons() {         return noOfSeasons;     }      @ManyToMany(mappedBy = "watchedSeries")     Set<User> watches;      @OneToMany(mappedBy = "tvSeries")     List<Episode> episodes = new ArrayList<>();      @Override     public String toString() {         return "TvSeries{" +                 "id=" + id +                 ", title='" + title + '\'' +                 ", description='" + description + '\'' +                 ", noOfSeasons=" + noOfSeasons +                 '}';     } }   import com.example.tvseriestrackingwebapp.backend.models.TvSeries; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository;  @Repository public interface TvSeriesRepository extends JpaRepository<TvSeries, Integer> { }   import com.example.tvseriestrackingwebapp.backend.models.TvSeries; import com.example.tvseriestrackingwebapp.backend.models.User; import com.example.tvseriestrackingwebapp.backend.repositories.TvSeriesRepository; import org.springframework.stereotype.Service;  import java.util.List;  @Service public class TVSeriesService {     private TvSeriesRepository tvSeriesRepository;      public List<TvSeries> findAll() {         return tvSeriesRepository.findAll();     }  }    public class TvSeriesTrackingWebApplication {      public static void main(String[] args) {          SpringApplication.run(TvSeriesTrackingWebApplication.class, args);         TVSeriesService tvSeriesService = new TVSeriesService();         Iterator itr = tvSeriesService.findAll().iterator();         while (itr.hasNext()) {             TvSeries tvSeries = (TvSeries) itr.next();             System.out.println(tvSeries);         }     }  }   Also, I'm getting the java.lang.NullPointerException error and I think it's because there aren't any elements in the table.

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?


Let a function $f$ be defined in a hollow neighborhood of $a\in \mathbb{R}$, and suppose :  $$\lim_{x\to a}\left(f(x)+\frac{1}{|f(x)|}\right)=0$$  Find $\lim\limits_{x\to a}f(x)$ and prove that this is the limit by definition.  My approach: It is easy to see that if this limit exists it should be $-1$ but I can't prove it by definition. Please help.

Another question I am struggling with:  Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be defined in a neighborhood of $a$ (except maybe $a$ itself) and suppose that, $\lim_{x \rightarrow a}\left(f(x)+\dfrac{1}{\left|f(x)\right|}\right)=0$. Find $\lim_{x \rightarrow a}f(x)$, and prove by definition, that this is indeed the limit.    Thank you all for your answers!!  But.. How can I prove by definition that this is indeed the limit? take $\epsilon>0$, I have to show that there exists a $\delta>0$ such that, $|x-a| \leq \delta$ implies $|f(x)+1| \leq \epsilon$. now, I do know that there exists an $\delta_1>0$, such that $|f(x)+\frac{1}{|f(x)|}|< \epsilon$.Or, $\frac{\epsilon}{k}$ for some constant $k$ But, how can I continue from there?


In Excel, how do I tell it to compare two tables with SIMILAR primary keys, find a relatively close match, and then return the info from one of the cells (more than just a yes/no, 1/0, true/false.  For instance: Table 1 has "ajacob44@email.com".  Table 2 has "ajacob".  What is the function(s) to have excel look through all of the contents in Table 2, find the close match, and then return "ajacob44@email.com"?  Or, if no close match is found, then something like "No match"?

I am currently trying to reconcile “Name” fields from two separate data sources.  I have a number of names that are not an exact match but are close enough to be considered matched (examples below).   Do you have any ideas of how I can improve the number of automated matches?    I am already eliminating middle initials from the match criteria.    Current Match Formula:  =IFERROR(IF(LEFT(SYSTEM A,IF(ISERROR(SEARCH(" ",SYSTEM A)),LEN(SYSTEM A),SEARCH(" ",SYSTEM A)-1))=LEFT(SYSTEM B,IF(ISERROR(SEARCH(" ",SYSTEM B)),LEN(SYSTEM B),SEARCH(" ",SYSTEM B)-1)),"",IF(LEFT(SYSTEM A,FIND(",",SYSTEM A))=LEFT(SYSTEM B,FIND(",",SYSTEM B)),"Last Name Match","RESEARCH")),"RESEARCH")