The following code is causing      java.util.ConcurrentModificationException   I am not sure how to solve the error please help !  ArrayList strList =  new ArrayList<String>(Arrays.asList(cmd.split(" ")));          if (strList.get(0).equals("LIST")) {          }          if (strList.get(0).equals("DEPEND")) {             strList.remove(0); // getting error at this point              cm.createComponent(strList);          }   Full Method The outer loop is not related to the List   public static void main(String[] args) throws IOException {         ComponentManager cm = new ComponentManager();      List<String> lines = Files.readAllLines(Paths.get("cmdList.txt"));     for (String cmd : lines) {         ArrayList strList =  new ArrayList<String>(Arrays.asList(cmd.split(" ")));          if (strList.get(0).equals("LIST")) {          }          if (strList.get(0).equals("DEPEND")) {             strList.remove(0);             cm.createComponent(strList);          }          if (strList.get(0).equals("INSTALL")) {          }          if (strList.get(0).equals("REMOVE")) {          }      }  }

We all know you can't do the following because of ConcurrentModificationException:  for (Object i : l) {     if (condition(i)) {         l.remove(i);     } }   But this apparently works sometimes, but not always. Here's some specific code:  public static void main(String[] args) {     Collection<Integer> l = new ArrayList<>();      for (int i = 0; i < 10; ++i) {         l.add(4);         l.add(5);         l.add(6);     }      for (int i : l) {         if (i == 5) {             l.remove(i);         }     }      System.out.println(l); }   This, of course, results in:  Exception in thread "main" java.util.ConcurrentModificationException   Even though multiple threads aren't doing it. Anyway.  What's the best solution to this problem? How can I remove an item from the collection in a loop without throwing this exception?  I'm also using an arbitrary Collection here, not necessarily an ArrayList, so you can't rely on get.


I came across this integral when helping some friends with a statistical mechanics assignment, Mathematica reports it as $\frac{\pi^2}{3}$.  So far I have noticed that the integrand is an even function so the integral is equivalent to, $2\int_{0}^{\infty} \frac{x^2e^x}{(e^x+1)^2}$.  My first idea is to run parts with $dv=\frac{e^x}{(e^x+1)^2}dx$ and $u=x^2$ with this the surface term is zero and we get the remaining integral $4\int_{0}^{\infty} \frac{x}{e^x+1}dx$.  This surely looks simpler and if I do $x=ln(u)$ then this turns into $4 \int_{1}^{\infty} \frac{ln(u)}{u(u+1)}du$.  Unfortunately I've tried for a couple days on the last two integrals and I cannot get either to budge.  I was hoping there is a method that avoids contour integration just because I've never really used that technique before but any answers would be appreciated.  Thanks to @LoganMaingi I've realized this is a duplicate.  To see that this integral is the same as the one linked make the following substitution that @LoganMaingi suggested in the comments.

In the course of solving a certain problem, I've had to evaluate integrals of the form:  $$\int_0^\infty \frac{x^k}{1+\cosh(x)} \mathrm{d}x $$  for several values of k. I've noticed that that, for k a positive integer other than 1, the result is seemingly always a dyadic rational multiple of $\zeta(k)$, which is not particularly surprising given some of the identities for $\zeta$ (k=7 is the first noninteger value).  However, I've been unable to find a nice way to evaluate this integral. I'm reasonably sure there's a way to change this expression into $\int \frac{x^{k-1}}{e^x+1} \mathrm{d}x$, but all the things I tried didn't work. Integration by parts also got too messy quickly, and Mathematica couldn't solve it (though it could calculate for a particular value of k very easily).  So I'm looking for a simple way to evaluate the above integral.


I am new to java and practicing java  programs. My code is as below:  String i;     String[] people={"Ronald","Donald"};  System.out.println("Whose information do you want?"+Arrays.toString(people)); Scanner s =new Scanner(System.in); **i=s.nextLine();**            if(i=="Ronald")      {          System.out.println("Ronald is CEO and is in Room No 20");       }           if(i=="Donald")      {          System.out.println("Donald is postman and is in Room No 10");       }       }     }   This is actually a simple program. What I wanted to know is whenever user inputs Ronald, its print statement should be printed in console. But the user should be asked whose information it wants to see. I wanted to know how to take string values from user.  Thank you in advance :)

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 part of df -h  Filesystem      Size  Used Avail Use% Mounted on /dev/md1        222G  5.5G  205G   3% /   222 - 5.5 = 205?  I also observe this in another physical machine  /dev/sda1       108G  3.9G   99G   4% / /dev/sdb1       688G   29G  625G   5% /storage   688 - 29 = 625  Ubuntu sucks at math lol  Jokes aside, why is this?

While creating a 250GiB backup partition for my data, I have noticed lots of discrepancies between reported partition size and free space in Nautilus, gParted, df, tune2fs, etc.  At first I thought it was a GiB / GB confusion. It was not.  Then I thought it could be ext4's reserved blocks. It was not.  Im completely puzzled. Here are some images. Here are the steps:   First, NTFS. 524288000 sectors x 512 bytes/sector = 268435456000 bytes = 268.4 GB = 250 GiB.      Nautilus say "Total Capacity: 250.0 GB" (even though its actually GiB, not GB). Apart from that minor mislabeling, so far, so good   Now, same partition, formated as ext4 with gparted:     First, Last and Total sectors are the same. It IS the same 250GiB partition. Used size is 4.11GiB (reserved blocks maybe?)    Nope. Looks like reserved blocks are 12.7 GiB (~5%. ouch!). But... why Total Capacity is now only 246.1 GiB ???. That difference (sort of) matches the 4.11 GiB reported by gparted. But... if its not from reserved blocks, what is it? And why gparted didnt report that 12.7GiB of used space?  $ df -h /dev/sda5 Filesystem            Size  Used Avail Use% Mounted on /dev/sda5             247G  188M  234G   1% /media/BACKUP   df matches Nautilus in reported free space. But.. only 188M used? Shouldnt it be ~12GB? And total capacity is still wrong. So i ran tune2fs to find some clues. (irrelevant output is ommited)  $ sudo tune2fs -l /dev/sda5 tune2fs 1.41.12 (17-May-2010) Filesystem volume name:   BACKUP Filesystem UUID:          613d592e-47f5-4206-96a7-210090d340ef Filesystem features:      has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize Filesystem flags:         signed_directory_hash  Filesystem state:         clean Filesystem OS type:       Linux Block count:              65536000 Reserved block count:     3276800 Free blocks:              64459851 First block:              0 Block size:               4096   65536000 total blocks * 4096 bytes/block = 268435456000 bytes = 268.4 GB = 250 GiB. It matches gparted.  3276800 reserved blocks = 13421772800 bytes = 13.4 GB = 12.5 GiB. It (again, sort of) matches Nautilus.  64459851 free blocks = 264027549696 bytes = 264.0 GB = 245.9 GiB. Why? Shouldnt it be either 250-12.5 = 237.5 (or 250-(12.5+4.11)=~233) ?  Removing reserved blocks:  $ sudo tune2fs -m 0 /dev/sda5 tune2fs 1.41.12 (17-May-2010) Setting reserved blocks percentage to 0% (0 blocks)  $ sudo tune2fs -l /dev/sda5 tune2fs 1.41.12 (17-May-2010) Filesystem volume name:   BACKUP Filesystem UUID:          613d592e-47f5-4206-96a7-210090d340ef Filesystem features:      has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize Filesystem flags:         signed_directory_hash  Filesystem state:         clean Filesystem OS type:       Linux Block count:              65536000 Reserved block count:     0 Free blocks:              64459851 Block size:               4096   As expected, same block count, 0 reserved blocks, but... same free blocks? Didnt I just freed 12.5 GiB ?  $ df -h /dev/sda5 Filesystem            Size  Used Avail Use% Mounted on /dev/sda5             247G  188M  246G   1% /media/BACKUP     Looks like I did. Avaliable space went up from 233 to 245.9 GiB. gparted didnt care at all, showing exactly same info! (useless to post an identical screenshot)  What a huge mess!  I tried to document it as best as I could... So, please can someone give me any clue on what's going on here?   What are those misterious 4.11 GiB missing from NTFS -> ext4 formatting? Why there are so many discrepancies between gparted, Nautilus, tune2fs, df? What is wrong with my math? (questions in bold scattered this post)   Any help is appreciated. While I can not figure what is going on, I am serilously considering giving up on ext4 in favor of NTFS for everything but my / partition.  Thanks!


I want to determine the 95% confidence interval of a mean.    I logged-transformed my data in order to achieve a normal distribution.  Several observations contained 0, so I changed these to 1 so that they would be represented as 0 after the transformation.  I then found the standard deviation of the log-transformed data.  I computed the SE of the transformed data by the equation (SD/sqrt(n)*1.96),  I back-transformed the SE with exp(SE) in order to get the SE on the scale of the original data. I then added and subtracted the back-transformed SE from the untransformed mean (calculated with the 0s) in order to find the lower and upper confidence limits of the mean.   I have a bad feeling my back-transformation (step 5) is either not done correctly, or in the wrong place. Could someone validate my method? Refute it maybe as well, with an explanation of any statistical rules I have violated with this method, and possible suggestions to solve the problem

I've heard/seen in several places that you can transform the data set into something that is normal-distributed by taking the logarithm of each sample, calculate the confidence interval for the transformed data, and transform the confidence interval back using the inverse operation (e.g. raise 10 to the power of the lower and upper bounds, respectively, for $\log_{10}$).  However, I'm a bit suspicious of this method, simply because it doesn't work for the mean itself: $10^{\operatorname{mean}(\log_{10}(X))} \ne \operatorname{mean}(X)$  What is the correct way to do this? If it doesn't work for the mean itself, how can it possibly work for the confidence interval for the mean?


I am a beginner in SQL and ASP.NET, basically i'm creating a website in that there is a contact us page. In that there are four textbox (Name, Email Address,Subject & Your Message). What ever i type in the text box it stored in the table's database in SQL. So now how to send the data (which is present in table) to gmail account.

Instead of relying on my host to send an email, I was thinking of sending the email messages using my Gmail account. The emails are personalized emails to the bands I play on my show.   Is it possible to do it?


Is there a way to find the history of any and all rollbacks that happened on a SQL Server database? Specifically, I would like to know the time and the user.  Thanks.

Is there anywhere I can look to find failed transactions in SQL server 2012?


I'm working on some calculus exercises and came across this one. It is familiar yet not the same as the $\mathcal e$ one. The question states:  Given $X_0 = 1$ and $X_{n+1} = 1+\frac{1}{X_n}$, for $n \geq 0$.  Show that it converges and find its limit.     So I tried to approach this by looking at its behave. Does $\frac{1}{X_n}$ converge to $0$ ? But it's not trivial answer. I also tried to look at $X_{n+1} $ expressed as a function of $X_0$ but was hard to see if I could simplify it in one-line formula. Any ideas?

Let $\{a_n\}$ be defined by $a_1 =1  $ and $a_{n+1} = 1 + {\dfrac{1}{a_n}}$ with $n \in N$. Show that $a_{n+1}= 1 + {\dfrac{1}{a_n}}$ converges.  I know the limit but how can I show that is a Cauchy sequence or that this sequence converges.


I am running a very simple bash script on Macosx Yosemite  #!/bin/bash makefilePath=$(echo $(pwd)/make.sh | sed 's/ /\\ /') echo $makefilePath source "$makefilePath"   The first three lines work as expected, but the fourth line creates a returns an error No such file or directory, even though if I run the command from makefile directly in the shell by copy pasting it, it works fine.   I don't know what the problem is. Please help.

Or, an introductory guide to robust filename handling and other string passing in shell scripts.  I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some file names).  I encountered a problem such as the following:   I have a file name containing a space hello world, and it was treated as two separate files hello and world. I have an input line with two consecutive spaces and they shrank to one in the input. Leading and trailing whitespace disappears from input lines. Sometimes, when the input contains one of the characters \[*?, they are replaced by some text which is is actually the name of files. There is an apostrophe ' (or a double quote ") in the input and things got weird after that point. There is a backslash in the input (or: I am using Cygwin and some of my file names have Windows-style \ separators).   What is going on and how do I fix it?


I wish to install Ubuntu on my HP Pavilion g6-2232tx Notebook PC. What should I do? Also where do I get all the drivers from after installing Ubuntu. My laptop has a graphics card and altec lancing spekaers. 4 GB RAM and 500 GB HDD.

I would like to see a full how-to guide on how to install Ubuntu.


As we know, light travels in straight line in normal circumstances, but when exposed to gravity it bends. But does it actually bend? I actually mean to ask whether if we take light as wave creating itself at next point in space, it seems to be that it does not generate next field at a point that is not straight ahead of it, but actually the point that was straight ahead (at which it would generate next field) has shifted due to gravity. So isn't light moving straight in gravity?

As we know light travels in straight line in normal circumstances but when exposed to gravity it bends. But does it actually bends?


Apparently the 2014 X-mas trees in Clash of Clans spawn presents. The trees give you 50k  gold surplus when removed and are able to spawn presents which in turn are worth 5k Elixir. Also, a friend of mine just told me that he got 25 Gems from the tree.  What I did not find when searching for it is how the spawning of presents works in detail. The only data I found was that a tree can only have 5 presents around it at a given time. This is mentioned in an answer to the question "" but wrong. I raided a base which had three trees with two times seven and once six present around them.   Does each tree have its own spawn chance?   Is there a total limit of how many presents any given tree can spawn in total?

I noticed with the holiday patch that there are new trees and shrubs that spawn on my land.  One popped up today, being specifically an X-Mas tree - which costs 25,000 gold to remove.   Is there any benefit to removing this X-Mas tree?  Is there any benefit to leaving it there?    It is noticeably the most expensive obstacle to remove yet.


When Kosh was poisoned, Dr Benjamin Kyle saved him. How could a human doctor be able to save a Vorlon when the Vorlon biology is so different from humans'? In fact, the Vorlon had no physical form and seemed to exist in some kind of floating gaseous form like a ghost. How can that be even treatable in the first place by a human doctor?

The  in the Babylon 5 saga are very secretive. As far as we know, only two humans ever visited their empire and lived.  Vorlon territory was restricted to other alien species and (almost) every known expedition into Vorlon space failed to return to their respective governments. Much like the Shadow homeworld, Vorlon is protected by an array of highly advanced and automated defense systems designed to keep out intruders and primitive spacefaring races. These defense systems remain in place and active even after the Vorlons abandoned their home and left known space; evidence suggests that the systems will not allow outsiders entry to Vorlon until 1,000,000 human years have elapsed.  They wear encounter suits and very rarely leave the suits because they don't want others to see how Vorlons appear.    Despite their secretiveness about their empire, their history, and especially their physiology, somebody poisoned the Vorlon ambassador to . How would anybody know how to poison a Vorlon?  In the pilot episode, , ...      a member of the Wind Swords, a militant section of the Minbari warrior caste, disguised himself as station Commander Jeffrey Sinclair, and attempted to assassinate  with poison.   A person could not pick a chemical at random and hope it works. If they tried sodium-cyanide, they might discover it just makes Vorlons hallucinate, but does not injure them. Or if somebody tried, potassium-chloride, they might discover that Vorlons use that the way we use table salt, sodium-chloride.  Later in the episode ...      Doctor Benjamin Kyle decided to risk treating Kosh, which meant opening the encounter suit. Determining that a cure would be impossible without knowing where the poison entered the Vorlon, Dr. Kyle convinced newly arrived Psi Corps telepath Lyta Alexander to scan the Vorlon. Despite the very strict Psi Corps rules in such cases, Lyta performed the scan.   So we have a separate, but related question of how could a doctor know how to treat a Vorlon for poison if he doesn't understand Vorlon physiology, which poison was used, or the effect of the poison on the body? While this second question is intriguing, it's not the focus of this post.  I prefer answers backed by canon sources; such as comments from the producers, novelizations, or screenplays.


Let $I=\left]-1,\ 1\right[$ be an interval, and $\left(I,\ \star\right)$ be a magma such that:  $$\left(\forall\  \left(x,\ y \right) \in I^2\right)\ x \star y=\frac{x+y}{1+xy}$$  I need to prove that $\left(I,\ \star\right)$ is an Abelian group.  A simple way to prove it is by checking that the magma $\left(I,\ \star\right)$ satisfies the group axioms including commutativity.  Based on the following statement I would like to approach that problem:  Let $f$ be a homomorphism from $\left(X,\ \perp \right)$ to $\left(I,\ \star\right)$, then the algebraic structure of $\left(I,\ \star\right)$ is exactly the algebraic structure of $\left(X,\ \perp \right)$  So I would like to find out a usual Abelian group - ex. $\left(\mathbb{R},\ +\right)$ - and a homomorphism $f$ from that group to $\left(I,\ \star\right)$.  Assume that $f$ is a homomorphism from $\left(X,\ \perp \right)$ to $\left(I,\ \star\right)$, then  $$\left(\forall\  \left(x,\ y \right) \in X^2\right)\ f\left(x \perp y \right)= f\left(x\right) \star f\left(y \right)$$  $$\Leftrightarrow f\left(x \perp y \right)= \frac{f\left(x\right) + f\left(y \right)}{1+f\left(x\right) \cdot f\left(y \right)}$$  I got stuck on that. Could anyone support me with some hints how to get it done.

I am trying to prove that $(G, *)$ is an abelian group with $G=(-1,1)$ and $a*b=$$\frac{x+y}{1+xy}$.  Thus far I have found that the identity element $e=0$. From here, I set $a*b=0$ and found $a^{-1}$ to be $-a$.   My work for trying to prove closure and that the set is abelian is:  Let $a,b \in G$, where $a=e$ and $b=a^{-1}$. Does  $a*b=b*a$?  Evaluating, I see that $a^{-1}=a^{-1}$ which then proves that G is closed and G is an abelian group.  Did I go about this proof correctly and efficiently?


I love that you can hover your mouse over most of the blender settings and a help bubble pops up and lets you know where the python equivalent attribute lives. However if the location is long it is chopped down with '...' essentially making the-hard-to find attributes harder to find.    Is there a way to disable the chopping so I can see the full path? Or are there other means that people use to find out where stuff lives, aside from searching the code-base?  (searching the code base can suck if the same attribute name is used in many areas of Blender, and even if you find where it is defined, the full path may not be obvious.)  For example, I am looking for the Cycles bake settings attributes, such as "Selected to Active" which is different from the Blender Render "Selected to Active" which lives here: context.scene.render.use_bake_selected_to_active  The Cycles version is truncated to this: bpy.data.scenes["Scene"]...use_selected_to_active

I am trying to access a bool property in the python API to see if an option is enabled or not. The python tooltip for the option says this:  bpy.data.screens['Default']...show_grease_pencil   I try to use that in the console or in py scripts, and it says the ellipsis(...) is invalid syntax. What am I missing? (Ignore the tooltip text. I originally thought the '...' was just hiding some of the API). I tried it with double quotes and that didn't help.


This is from a document that used to compile. I want to use it as a template as it was a really good template.  However when I press compile it says that it cannot find the amsmath or amstools packages. I have included a screenshot.  Furthermore, I cannot see how these packages can be installed.

There have been a few questions regarding installing this package in the past, but they now seem to be out of date. I'm using MiKTeX 2.9 and TexMaker. When I try \usepackage{mathtools} in TexMaker it will try to install the package for me but will fail. I took the advice given in this thread:   As suggested I tried installing the mh package using the MiKTeX Package Manager, unfortunately I get the "unknown archive size" error, which I have read means that the package no longer exists. Another thread (lost the link) said you can use the MiKTeX Package Manager to directly install mathtools, however I do not see mathtools listed anywhere in the MiKTeX Package Manager...   So I ask, is the package under a different name? Are there any other ways to install this package?


I just got a new MacBook Pro and bought this USB-C to VGA adapter to connect it to an external display ().  Unfortunately, it created interferences with my wifi (precisely as described at ) to the point that I could not connect anymore and had to give up on the adapter.  I suspect the quality of the adapter's shielding is mainly to blame. But maybe something else is also at fault: the Dell external display I use, the quality of the VGA cable itself, my desk and cables "spatial configuration"?   Has anyone else faced that problem? How did you solve it? Does a higher quality adapter suffices, or is there something else I should consider? If a better adapter does the job, what is the cheapest option you would recommend?

I recently switched from my beloved MacBook Pro Retina (Late 2013) i5 2.6/16/512 to MacBook Pro (2017) Non-TB i5 2.3/16/512.  I purchased what from the build-quality looked like a good USB-C-to-DisplayPort cable with 4k/60Hz support, just to run into the very problem the Logicboard repair guru Louis Rossmann had described in : As soon as you plug in the USB-C dongle, the (2.4 GHz) Wifi stops working despite full antenna signal. Unplug the USB-C connector and you are immediately back in the game.  The big question I'm asking myself now: Who is to blame? Is this a design flaw in the current generation MacBooks with improper shielding or is it a design flaw in the various dongles?  I mean the fact that even Apple’s very own USB-C Digital AV Multiport Adapter is causing these WiFi issues (as you can learn from the many horrific ; but AFAIK have been fixed through a ), show that there’s something going horribly wrong.


You know current and voltage of a circuit. how would you calculate number of charge carriers or drift velocity of electron? through experiments/theoretically

Why it is not possible to measure the drift velocity for electron by timing their travel along a conductor? I know electron is very small and we cannot measure each electron time of collision but than how we measure drift velocity if we can't calculate time?


So I am demanded to offer a continuous bijection between two homeomorphic spaces that is not a homeomorphism. As a beginner for topology, I am completely stuck. Can anyone offer me a hint?

What are some examples of functions which are continuous, but whose inverse is not continuous?  nb: I changed the question after a few comments, so some of the below no longer make sense. Sorry.


I have an old house with a lath and plaster ceiling that has 1x4 battens installed on the lath and plaster ceiling with 3/8" drywall over those.   I want to install recessed lighting but there is approximately 1" gap between the can and the trim. Are there recessed light cans available that are adjustable to accommodate that?

We are in the middle of our home remodeling and we have just noticed that our ceiling seems to be a bit thicker than what the maximum our recessed lights allow for.  As shown within the picture link below, our ceiling is comprised of different layers (of different thicknesses):     Lower layer: (visible from the room) made out of sheetrock (5/8in thickness) Mid layer: Plaster (3/4in thickness) Top layer: Lath (1/8in thickness)   The recessed light container we are using has adjustable clips for different ceiling thicknesses although we have just noticed that our ceiling is too think so the clips would not really sit on top of the ceiling but rather create resistance on the hole.    My question here is if there is some sort of drill bit that, after drilling the initial hole diameter where the container is going to fit in, could expand the hole diameter above the lower layer of sheetrock.


The day before yesterday my hard drive has died (MBR could not be read; all attempts to recover it proved to be futile). All right, I was smart enough to back up all my data regularly (that included even system partition, just in case), so I did not loose any thing. So far so good. However, there is one thing that I may have lost. I am talking about tabs opened in Chrome (I belong to category of people who like to have a lot of tabs opened). It looks like there is a way to recover the tabs (the whole profile, actually, but I care about tabs only). It is described . It requires exporting/importing a specific registry key, though (copying the «User data» directory is not enough, I have tried). So here comes the question: can I access the registry of my Windows 7 backup?

I need to make changes on my registry without using the OS software, and need to do it with WINPE. However when WINPE is ready to work and I am trying to open regedit.exe it shows me only current OS information, actually the WINPE information.  So how to use WinPE as an offline registry editor?


When having a long rest, you regain all your hit points and half your spent Hit Dice (for use in future short rests). I know that normally when faced with fractions you round down. But then, I see no way to regain your 1 Hit Die at 1st level.  So basic question: if you are at first level, and you take a long rest, do you regain your Hit Die, or do you not because you had to halve 1 and round down?

I was reading a review of 5e game play  from our RSS Feed. And in it he makes an observation about a strange rule:     Weird rule thing. You recover half your level in hit dice during a   long rest, which means level 1 characters never recover hit dice.   That didn't make sense to me, and so I double checked the long rest rule and it reads:     At the end of a long rest, a character regains all lost it points.   The  character also regains spent Hit Dice, up to a number of dice   equal to half of the character’s total number of them. For example, if   a  character has eight Hit Dice, he or she can regain four spent Hit   Dice upon finishing a long rest.   And of course the rules state that in general you always round down.  Am I missing something? Is there a good explanation for why at first level you can't recover hitdice?


Caution, this one is a little complicated...  My girlfriend is searching for a book her father read long time ago. Here are the snippets I'm aware of:   The story was in a book containing multiple short stories The book is maybe from around the 70's The story has time travel or alternative timelines as topic   Here is what I know from the story:   When a book's position in a library is changed it causes real events to change. Due to this change, a civilization may rise or be destroyed This change is supervised from some sort of time-watcher, institution or similar   Thanks for your help

I originally read this book in the mid- to late '70s.   The premise was a bureaucracy whose job it was to manipulate events in human history by making the smallest possible change that would effect the desired outcome. Not time cops in the sense of going after law breakers.  The intent was to maintain a policy of non-interference as much as possible but when interference was warranted then to make the least possible change and to do so invisibly.  For example, they might take someone's keys off the dresser and put them just out of sight underneath the dresser where they plausibly might have fallen.  The subject would never know of the manipulation but would then be delayed getting out of the house and the ripples grew from there to avert a war or otherwise affect events on a large scale.  After reading that, whenever I would lose something - especially in an improbable way such as dropping a screw at my feet and then finding it on the other side of the room half an hour later - I would take some consolation in the thought that I had just averted some global catastrophe.  I was pretty scatterbrained as a kid (we call that ADHD nowadays) so I experienced this a lot.  Given that I've spent so much time pondering the ideas from the book, I'd love to re-read it.


Let's say a is a pointer, and after allocating memory for it, I want to check if the memory was allocated successfully, I've seen two ways doing this :  if(a != NULL)  if(a)   What is the difference between the first and second statements ?

Is it safe to assume that NULL always translates to false in C?  void *somePtr = NULL;  if (!somePtr) {   /* This will always be executed? */ }   Or should an explicit check against the value of NULL be made?


how can I set all the item into bullets (cobalt)?     \documentclass{beamer}  %\setbeamercolor{titlelike}{parent=structure,bg=cyan} %background color %\setbeamercolor{titlelike}{parent=structure,fg=blue} %colore titoli %\setbeamercolor{titlelike}{parent=structure,fg=yellow,bg=cyan} %colore e background in un comando   %%% duplicated <<<<<<<<<<<<<<<<<<<<<<<<< %%\usepackage{tikz} %%\usepgflibrary{arrows.meta} %%\usetikzlibrary{calc,quotes,angles}  %%\usepackage{pgfplots} %%\pgfplotsset{compat=1.16}  %%\usepgfplotslibrary{groupplots}  %%\usetikzlibrary{calc}   \usepackage{xcolor}  \definecolor{cobalt}{rgb}{0.0, 0.28, 0.67}  %\setbeamercolor{titlelike}{parent=structure,fg=cobalt,bg=violet!50}      \usepackage{tikz} \usepackage{subcaption} \usepgflibrary{arrows.meta} \usetikzlibrary{calc,quotes,angles}  \usepackage{pgfplots} \pgfplotsset{compat=1.16}  \usepgfplotslibrary{groupplots}   %\usetikzlibrary{calc} %rido <<<<<<<<<<<<<<  \setbeamercolor{itemize item}{fg=cobalt} % all frames will have cobalt bullets  \setbeamersize{text margin left=5mm,text margin right=5mm} %margini  %\usebackgroundtemplate{\includegraphics[width=\paperwidth]{logo.jpeg}} \title{\textbf{title } \\      \vspace{20pt}       \includegraphics[height=50pt]{logo.jpeg}}%<<<<<<<<<<<<<<<<<<<< changed \author{name}  \institute[VFU] % (optional) {% %  \inst{1}% <<<<<<<<<<<<<<<<   department\\   Uni   \and %  \inst{2}% <<<<<<<<<<<<<<<<<<<<   speker\\   speaker 2 }  \date[VLC 2013] % (optional) {date}  %\titlegraphic{\includegraphics[height=1.5cm]{example-grid-100x100pt}} %<<<<<<<<<<<<<<<<<<<<   \begin{document}  \maketitle  \setbeamercolor{background canvas}{bg=violet!20} %<<<<<<<<<<<<<<<<<<< added \setbeamercolor{titlelike}{parent=structure,fg=cobalt,bg=violet!50} %<<<<<<<<<<<<<<<<<<< added \begin{frame}  \frametitle{Title first slide} %<<<<<<<<<<<<<<<<<<< changed  %\begin{figure}[h]%<<<<<<<<<<<<<<<<<<< %\centering%<<<<<<<<<<<<<<<<<<< \begin{itemize} \item bla blla \item gla gla \end{itemize}  \end{frame}  \end{document}

Can anyone give me a list of the different styles of bullets in beamer?  I am looking for the command that will give me the typical 3d looking blue ball in a block I know where to input it in my  \item [\...?....]  I think I'm looking for \usepackage{boadilla} but i don't know how to get this.   help a newbie out?


I'm sure there's an identity or some known "trick" to solve this but I couldn't find it (Looked in Wikipedia, Wolfram and here):  $$ \sum_{k=0}^n (-1)^k{n \choose k} =0 $$  I want to know how this can be proven. I tried induction but I'm not sure what to do with ${{n+1}\choose k}$.  Thanks!

Let $n$ be a positive integer. Prove that   \begin{align} \sum_{k=0}^n \left(-1\right)^k \binom{n}{k} = 0 . \end{align}   I tried to solve it using induction, but that got me nowhere. I think the easiest way to prove it is to think of a finite set of $n$ elements, but I can't find the solution.


Do I have to own a Mac to upload games made by unity to the app store? How to test apps on IOS? Because in android its so easy just build the APK send it to your phone and test, but this cant be done with IOS so how thing work with IOS ?

Is there any way to tinker with the iPhone SDK on a Windows machine? Are there plans for an iPhone SDK version for Windows?  The only other way I can think of doing this is to run a Mac VM image on a VMWare server running on Windows, although I'm not too sure how legal this is.


I have written a program that calculates the GCD of 2 polynomials using long division (Euclid's algorithm/theorem).  I am trying to find the GCD of x^2 - 3 and x + 5, which I already know is 1. However, the division process does not give me this answer. I will step through what my program does.  Firstly, it divides x^2 by x to get x. x + 5 is then multiplied by x to get x^2 + 5x. It then subtracts x^2 + 5x from x^2 - 3 to get -5x - 3. It then divides -5x by x to get -5. x + 5 is then multiplied by -5 to get -5x - 25. It then subtracts -5x - 25 from -5x - 3 to get 22. The degree of 22 (0) is less than the degree of x + 5 (1), so it stops, and passes the remainder of 22 to the program.  The program then sets up another long division, but this time divides x + 5 by 22. Firstly, it divides x by 22 to get 1/22 x. 22 is then multiplied by 1/22x to get x. It then subtracts x from x + 5 to get 5. It then divides 5 by 22 to get 5/22. 22 is then multiplied by 5/22 to get 5. It then subtracts 5 from 5 to get 0. Remainder is 0, so program stops.  According to Euclid's algorithm/theorem, the GCD would then be 22, as it was the divisor when the remainder was 0, but the GCD is in fact 1 for polynomials x^2 - 3 and x + 5. Why doesn't this work, and how would I fix it? Thankyou.

I need to find the gcd of two polynomials: $f(x) = x^4+1$ and $g(x)=x^2-1$ using the Euclidean algorithm.  Wolfram shows that the gcd is equal to $1$, but for some reason I don't get the same answer.   First I divided $f(x)$ by $g(x)$ and got that the remainder is $2$. Then, I divided $g(x)$ by the remainder, $2$, and got a remainder of zero, hence concluding that the gcd is $2$.   What am I doing wrong?


I'm looking to disable my computers monitor and have it not turn back on no matter what until a reboot, I was thinking maybe a batch file or vbscript, thanks.

Are there any tools for Windows 7 that will allow me to enable/disable monitors from the command-line?  For example, my GTX 480 has three outputs (2x DVI and 1x HDMI) but only two displays can be active at any given time.  I'd like for a command-line to allow me to disable one of the DVI monitors and enable the HDMI monitor, etc.  (I've found NirCmd which is an amazing utility but it doesn't seem to support this...)  EDIT: UltraMon seems capable of doing this but I really hoping for a more light-weight command-line solution...


I am writing an installation script in PHP, where the user has to enter the username and password of the root MySQL user.   Currently I use:  fgets(STDIN)   to read the username and password, but this is not secure because other people might glance and see the password typed.  Is there a way to input the password from the user, such that it will look like this: "**", similar to how it looks like in a webpage?

I'm writing a command line tool to help my web app. It needs a password to connect to the service. I'd like the script to show a password prompt so I don't have to pass it as a command line argument.   That's easy enough, but I'd like it to not echo the password to the screen as it's typed. How can I do this with PHP?   Bonus points for doing it in pure PHP (no system('stty')) and replacing the characters with *.   EDIT:  The script will run on a unix like system (linux or mac). The script is written in PHP, and will most likely stay like that.  Also, for the record, the stty way of doing it is:  echo "Password: "; system('stty -echo'); $password = trim(fgets(STDIN)); system('stty echo'); // add a new line since the users CR didn't echo echo "\n";   I'd prefer to not have the system() calls in there.


I'm saving captured fingerprint image into my SQLite db as a byte array cos it really small size wise like this.  byte[] template = new byte[....];   Then i log and get a value like [B@41d25378. That's what's sent it my sqlite db in a blob column.  The problem now is that when i retrieve this value from my db,   byte[] photo = cursor.getBlob(cursor.getColumnIndex("fingerprint"));   i log the value and its totally different [B@420447f8 but this is what i want [B@41d25378. As such, i'm unable to match finger print as what is being returned is different. How can i get the same byte[] value back.   I've tried using strings too but can figure out a way to get an exact match back. Thanks in Advance...

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]


I unfortunately deleted .bash_profile file from my MAC. Accidentally I typed rm .bash_profile. Now how can I get my file back?

I accidentally deleted a file from my laptop. I'm using Fedora. Is it possible to recover the file?


Find out all interior points and limit points of $A=\{(x,y):x^2+2y^2<1\}$ ($(x,y) \in \mathbb R^2$)  I've got an answer from original post but as i'm not familiar with this subject, I cannot understand the solution. Is there any other solution?

Find out all interior points and limit points of $ A =\{(x,y): x^2+2y^2 < 1\}$  I understand this problem graphically, but i'm not quite sure how to prove the answer rigorously using mathematical word.  My try : Let k be an element of A, and suppose t is an element of $\{(x,y):x^2+2y^2 =1\}$, which makes minimum $||t-k||$. Then $N(k,\delta)\subset A$ when $\delta = \||t-k||$.  I suppose this will work, but I want more clear and detailed proof.  Thank you in advance.


I want to pass my dictionary "param1" as the keywords of my function "simulate_x_y"  Here is what I got so far, but I never used dict that way before so I don't no how to link it with my function.  myparam1 = {"amp":1*10**-12, "amp2":1*10**-12, "sfreq":1000, "nse_amp": 1,           "noise_mu": -1.60350220266e-29, "nse_kappa": 2.49419166853e-13,           "phase_mu": np.abs(np.deg2rad(45)), "phase_kappa": 10.,           "n_epochs":120, "epoch_length": 1, "nfft":512, "freq1_start": 150,           "freq1_end": 220, "freq2_start": 150, "freq1_end": 220}  times = np.arange(0,epoch_length,1/(sfreq))  freq_band1 = np.linspace(freq1_start, freq1_end, times.size) freq_band2 = np.linspace(freq2_start, freq2_end, times.size)  def simulate_x_y(times, param1['n_epochs'], amp, amp2, freq_band1, freq_band2, phase_mu, phase_kappa, nse_amp, noise_mu, nse_kappa):     x  = np.zeros((n_epochs, times.size))     y  = np.zeros((n_epochs, times.size))     phase_shift_y =  np.random.vonmises(phase_mu, phase_kappa, n_epochs)     for i in range(0, n_epochs):         print("Simulating Epoch %s complete"%(i+1))         for j in xrange(freq1_start,freq1_end):             x[i] = x[i] + (amp  * np.sin(2 * np.pi * freq_band1 * times))             y[i] = y[i] + (amp2 * np.sin(2 * np.pi * freq_band2 * times))         x[i] = x[i] + nse_amp * np.random.normal(loc=noise_mu, scale= nse_kappa, size=times.size)         y[i] = y[i] + (nse_amp * np.random.normal(loc=noise_mu, scale= nse_kappa, size=times.size)) + phase_shift_y[i]     return x, y, phase_shift_y   Does anyone know how to do it properly, all my approaches fail because I don't know how to do it. anyone has a code snippet or example in an adequate form for me ?!

I'd like to call a function in python using a dictionary.  Here is some code:  d = dict(param='test')  def f(param):     print(param)  f(d)   This prints {'param': 'test'} but I'd like it to just print test.  I'd like it to work similarly for more parameters:  d = dict(p1=1, p2=2) def f2(p1, p2):     print(p1, p2) f2(d)   Is this possible?


I had set a security password on my Samsung Galaxy S Duos mobile and unfortunately forgot the unlock password. I tried hundred's of times to unlock my phone with many possible passwords but was unsuccessful in each of my attempts. Please help me unlock my phone and send me the master code (if any) to unlock the 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?


The time when I studied probability theory was about three years ago, so I have forgot many things and want to refresh them.  I want to prove that if $X,Y,Z$ are independent and uniformly distributed on $[0,1]$ random variables then $(XY)^Z$ is also uniformly distributed on $[0,1]$.  As I know uniformly distributed on $[0,1]$ variable has density $\rho (t)= \begin{cases} 1, t \in [0,1]\\ 0, t \notin [0,1] \end{cases}$.  Denote $\xi = XY$. Since $X$ and $Y$ are independent $\rho_\xi (t) = \rho_X (t) \rho_Y (t) = \begin{cases} 1, t \in [0,1]\\ 0, t \notin [0,1] \end{cases}$, so $\xi$ is uniformly distributed on $[0,1]$.  Denote $\zeta = (XY)^Z$. Since $\xi$ and $Z$ are independent, we obtain in the same way that $\rho_\zeta (t) = \rho_\xi (t) \rho_Z (t) = \begin{cases} 1, t \in [0,1]\\ 0, t \notin [0,1] \end{cases}$ and we are done.  It seems to me that I'm wrong. Can anyone explain me why it is incorrect (I believe that it is) and show the right solution?

Let $X$, $Y$ and $Z$ be i.i.d. uniform (0,1) random variables. What is the distribution of $(XY)^Z$? I've tried to solve it via mgfs, and what I've found is:  $$E\left(e^{(XY)^Z}\right)=E\left(E\left(e^{(XY)^Z}|Z\right)\right)$$ $$=E\left(E\left(e^{(XY)}\right)^Z\right)$$ $$=E\left(2\left(\frac{e^t-1}{t}\right)^Z\right)$$ $$=2\int_0^1\left(\frac{e^t-1}{t}\right)^zdz$$ $$=2\int_0^1\exp\left({z\log\left(\frac{e^t-1}{t}\right)}\right)dz$$ $$=2\left[\frac{\exp\left({z\log\left(\frac{e^t-1}{t}\right)}\right)}{\log\left(\frac{e^t-1}{t}\right)}\right]_0^1$$ $$=2\frac{{\frac{e^t-1}{t}}-1}{\log\left(\frac{e^t-1}{t}\right)}$$  But I don't see where to go from here. It doesn't look like the mgf of any distribution that I know. How can I determine the distribution from this, or is there another way?


I am using propensity score matching with kernel matching to test for the average treatment effect on the treated.     The distribution of the bootstrapped differences is as follows:    I transformed them with the mean (as described in this ) and the SD to obtain z-scores. Afterwards, I counted how many observations (in abs. values) exceeded the 95% threshold of 1.65.  However, with this approach I get a p-value of 0.09.   How does this work with a (as in my case) skewed distribution?   If I simply count the observations exceeding the 2.5% and 97.5% seperately, then I obtain a summed p-value of 0.04 which is in line with the BCa confidence interval. Would this be a valid alternative?

I use "boot" package to compute an approximated 2-sided bootstrapped p-value but the result is too far away from p-value of using t.test. I can't figure out what I did wrong in my R code. Can someone please give me a hint for this  time = c(14,18,11,13,18,17,21,9,16,17,14,15,          12,12,14,13,6,18,14,16,10,7,15,10) group=c(rep(1:2, each=12)) sleep = data.frame(time, group)  require(boot) diff = function(d1,i){     d = d1[i,]     Mean= tapply(X=d$time, INDEX=d$group, mean)     Diff = Mean[1]-Mean[2]     Diff }  set.seed(1234) b3 = boot(data = sleep, statistic = diff, R = 5000, strata=sleep$group)  pvalue = mean(abs(b3$t) > abs(b3$t0)) pvalue    The 2-sided bootstrapped p-value (pvalue) = 0.4804 but the 2-sided p-value of t.test is 0.04342. Both p-values are around 11 times difference. How can this happen?


How can I make this kind of 3D paint stroke? Is it photoshop or C4D. please guide me through the process.

I have tried almost everything and scratched my brains over it but still, I am not able to figure it out. Please help me to achieve this lettering.


Earlier my edit suggestions when accepted fetched me 2 points. Now I have crossed the 2000 rep, I don't get 2 rep points on edit.  Is this normal?

When clicking "edit" I see:  Your edit will be placed in a queue until it is peer reviewed. We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.  Like:     Likewise, when I am not logged in, clicking "improve this question" or "improve this answer" shows:  You are not . Your edit will be placed in a queue until it is .  And when I click 'Save', I get:  Thanks for submitting an edit. It is only visible to you until it's been approved by trusted community members  Like:     Who can suggest an edit? Where do suggested edits go? Who can vote on a suggested edit? How do suggested edits get reviewed? Can I earn reputation? What about abuse or bad edits? Sometimes the Community user approves or rejects my edit. Why is that? When can I not suggest an edit? Is there a minimum change requirement for a suggested edit? How do I check my suggested edit history? I disagree with the reasons why my suggested edit was rejected. What can I do? How do I know whether there are edits waiting for review? Someone suggested an edit to my own post, and the reviewers took the wrong action. What can I do? Are tag wikis included in this scheme? What do the "Improve Edit" and "Reject and Edit" buttons do? Why are apparently valid links to rejected edits resulting in 404 errors?   For more information about editing, see "" in the .


I am trying to compile a document using fontawesome with XeLaTeX (see this template ). I have Texlive 2016 installed in Ubuntu (installed directly from Texlive's homepage - not Ubuntu repositories). Texlive's tlmgr claims fontawesome is installed. I seem to find evidence of it here:  $ kpsewhich fontawesome.map /usr/local/texlive/2016/texmf-dist/fonts/map/dvips/fontawesome/fontawesome.map   To debug the problem, I am trying to compile the following MWE (test.tex):  \documentclass{article} \usepackage{fontawesome} \begin{document} Test \end{document}   using the command xelatex test.tex. Where it seems to reach the critical point, the log says:  kpathsea: Running mktextfm FontAwesome /usr/local/texlive/2016/texmf-dist/web2c/mktexnam: Could not map source abbreviation F for FontAwesome. /usr/local/texlive/2016/texmf-dist/web2c/mktexnam: Need to update /usr/local/texlive/2016/texmf-dist/fonts/map/fontname/special.map? mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input FontAwesome This is METAFONT, Version 2.7182818 (TeX Live 2016) (preloaded base=mf)   kpathsea: Running mktexmf FontAwesome ! I can't find file `FontAwesome'. <*> ...our; mag:=1; nonstopmode; input FontAwesome  Please type another input file name ! Emergency stop. <*> ...our; mag:=1; nonstopmode; input FontAwesome  Transcript written on mfput.log. grep: FontAwesome.log: Ingen sådan fil eller filkatalog mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input FontAwesome' failed to make FontAwesome.tfm. kpathsea: Appending font creation commands to missfont.log.   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! fontspec error: "font-not-found" !  ! The font "FontAwesome" cannot be found. !  ! See the fontspec documentation for further information. !  ! For immediate help type H <return>. !...............................................     I have run updmap-sys and mktexlsr, but that did not seem to help. updmap-sys said (among other things):  Files generated:   /usr/local/texlive/2016/texmf-var/fonts/map/dvips/updmap:        15796 2017-05-10 16:22:38 builtin35.map        21269 2017-05-10 16:22:38 download35.map      1688569 2017-05-10 16:22:39 psfonts_pk.map      1903381 2017-05-10 16:22:38 psfonts_t1.map      1903376 2017-05-10 16:22:38 ps2pk.map           14 2017-05-10 16:22:39 psfonts.map -> psfonts_t1.map   /usr/local/texlive/2016/texmf-var/fonts/map/pdftex/updmap:      1903383 2017-05-10 16:22:39 pdftex_dl14.map      1901718 2017-05-10 16:22:39 pdftex_ndl14.map           15 2017-05-10 16:22:39 pdftex.map -> pdftex_dl14.map   /usr/local/texlive/2016/texmf-var/fonts/map/dvipdfmx/updmap:          319 2017-05-10 16:22:38 kanjix.map   Should there have been a xelatex folder as well? What can I do to fix this?

I'm using the latest version of MacTeX 2013 on OS X 10.8.4. All of my Tex Live packages are fully up-to-date. Tex Live also lists the fontawesome package as installed. I'm trying to use the FontAwesome font with XeLatex or LuaLatex and getting font-not-found errors. The exact message is: kpathsea: Running mktexmf FontAwesome ! I can't find file `FontAwesome'.  There's a longer traceback which I am omitting for brevity. Let me know if it's needed to resolve this problem. I have already tried running the following commands, to no avail: sudo -H mktexlsr sudo -H updmap-sys  Other than the above two commands, this is a 100% new out-of-the-box installation, with no modifications whatsoever. Here's a minimal broken example: \documentclass{article} \usepackage{fontawesome}  \begin{document} \faTwitter \end{document}  How can I add this missing font? Edit (Q1 2021): Please see Justin Curry's answer regarding an update to the package name from fontawesome to fontawesome5.


I need to make jello. Would psyllium husk work as a jello replacement?

Does anyone have experience using psyllium husk in place of gelatin. (My particular situation is making marshmallows)


What is the most efficient way to read the last symbol or line of a large text file using C#?

I need to process a large file, around 400K lines and 200 M. But sometimes I have to process from bottom up. How can I use iterator (yield return) here? Basically I don't like to load everything in memory. I know it is more efficient to use iterator in .NET.


I try to install menulibre, but i get this error Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  menulibre : Depends: python3-psutil but it is not installable E: Unable to correct problems, you have held broken packages.  When i try to install psutill, i got: flitzcore@flitzcore-Lenovo-G470:~$ sudo apt-get update Hit:1 http://ppa.launchpad.net/kdenlive/kdenlive-stable/ubuntu focal InRelease Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease                      Hit:3 http://ppa.launchpad.net/uget-team/ppa/ubuntu focal InRelease       Reading package lists... Done flitzcore@flitzcore-Lenovo-G470:~$ sudo apt install python3-psutil Reading package lists... Done Building dependency tree        Reading state information... Done Package python3-psutil is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'python3-psutil' has no installation candidate  Anyone know how to solve this problem?

There are now errors when updating and I cannot install most software due to a corrupted  /etc/apt/sources.list   file. Is there a copy I can download to replace it?  The file would be for Ubuntu 12.04 (Final Beta) in the United States.


"." files like ".bashrc" are invisible to the finder. How do you make them visible so you can open then inside editors like textedit or sublime?

How can I see the hidden files in Finder?  For instance, if I have a file named: .something  is is not listed.  Right now I have to open the terminal and type ls -la.


I'm new to Blender and I want to project an image on a plane from a spotlight but I'm having difficulty.  This  says to find Texture panel for the lamp which I can't find. There is a Texture panel in 2.80 but it doesn't seem connected to the spotlight. I presume these instructions are for 2.79 or earlier.  Can someone direct me to a useful link or at least give a general overview of how to do this in Blender 2.80?

What is the correct vector input for a texture connected to a Cycles lamp so that I can make a projector-like textured light?  I am trying to make an projector-like effect with a textured light in Cycles, currently trying it out with a Spot type of lamp, but I am open to any solution involving other lamp types if they work correctly.  The problem is that whatever vector input I use, the texture is always projected downwards, towards the global $-Z$ axis in scene world space, no matter where I point my spot light. I would like to have the texture always project "forward" towards the the direction the spot light is pointing, in the local $-Z$ axis.    The plan would then be to use this spot at several places in my scene, pointing at different directions, and as it currently stands I would have to have a different node setup for each spot instance, manually compensating for each unique rotation in the scene, which would quickly become unpractical.  I have searched around the internet and I am currently using a solution similar to the one on this .  Is there any better method, perhaps involving some funky Vector Math, or is this not currently supported?


I want to know Zero power to Zero equal to 1 or Indeterminable. I think it cannot be exist. Please explain with proper mathematical definitions.

Could someone provide me with a good explanation of why $0^0=1$?  My train of thought:  $x>0$  $0^x=0^{x-0}=0^x/0^0$, so  $0^0=0^x/0^x=\,?$  Possible answers:   $0^0\cdot0^x=1\cdot0^0$, so $0^0=1$ $0^0=0^x/0^x=0/0$, which is undefined   PS. I've read the  on mathforum.org, but it isn't clear to me.


I dragged a file to the recycle bin a few days ago. I have Windows 7 premium on a 245 GB partition, a 240 GB SSD, and a 250 SSD. And somewhere in the past few days I incidentally installed Delta Search. I know I should remove it right away, but I just switched to Windows on the partition of a 3.5 1 TB drive and would like to restore that file and deal with the malware after Christmas is over.  I'm pretty sure I know what drive that deleted files should be on, but what is the real name of the recycle directory and exactly where is it located? In other words, if I know the name of the drive what would the rest of the path look like so I can just paste it in my Explorer window and change the drive letter.

I was using another account before. Let me call it account A. And I deleted a lot of files to the Recycle Bin at that time. But before I removed account A I forgot to empty the Recycle Bin.   My question is, are my files still there? I've searched and found that the Recycle Bin may live in $Recycle.Bin, but I can't open files there so I can't know what they are. Any help how to open deleted files or how to delete them permanently?


At PCA why we find the Eigenvalues of the covariance matrix and not the eigenvalues of the matrix $A\times A^T$, where $A$ is the data matrix and $A^T$ its transpose? I saw a professor at YouTube who explained PCA but he said that the solution is the eigenvalues of $A\times A^T$.

Principal component analysis (PCA) is usually explained via an eigen-decomposition of the covariance matrix. However, it can also be performed via singular value decomposition (SVD) of the data matrix $\mathbf X$. How does it work? What is the connection between these two approaches? What is the relationship between SVD and PCA?  Or in other words, how to use SVD of the data matrix to perform dimensionality reduction?


Is it possible to retrieve the current download speeds on my desktop? For example, if I were to download a file, the network card will report the speed that it's downloading the file at - I've seen it's possible in various applications for Windows.  I've tried using nload but that's a continuous program. I'm looking for a simple command that will output an integer and that's it.

how to display the actual network traffic (wireless) in a terminal?  Additionally: Is it possible to add this info to the chart of top?


I am copying large files, started to copy and it said     "estimated time remaining: About 15 hours".    I had to restart the file copy after a while, emptying the destination folder and started the copy again, now it says      "estimated time remaining: About 17 hours".    I know this estimation is rough (right?), but is this normal?

I know that the Windows copy dialog (in Windows XP) stores the copy in memory first, and it is still copying after the dialog closes, so the time is off, but why is the estimation of the time it will take to make a copy so inaccurate, even when memory copying has been disabled (in Vista and Windows 7)? It seems so arbitrary! How does the whole copy procedure work, and why can't Windows estimate it correctly?


Recently I was reminded of a series of books that I never got round to finishing and I can't remember what it is to save my life Can anybody help me? Details I can remember  - A boy after discovering he has these weird abilities and enhancements is being pursued by some unknown group, (who helped create him)  - His parents were just scientists who helped create him and were tasked with bringing him up  - He eventually joins some sort of resistance  - At some point his "father" became the prime minister after murdering the previous PM  - Where I had gotten to there were three children known to have been "enhanced"   - There was the main character (who was a boy), I think what was meant to be his brother, and a french girl (who was working for the french government)     Any help would greatly be appreciated

I read this book a few years back (around 5?). It was part of a multibook series but I have only read one book.  It's about this teenager who I think had been programmed to be an assassin but then somehow retained his conscience and was out to get the people responsible for that.  I briefly remember a girl, and this one part where he realizes he can ride a horse and then there's a chase too. I think the guy's name was Jim or Jimmy, but not quite. I'm also quite sure he was either part computer, or had a chip or something in his brain which had been programmed to give him a host of mental and physical abilities which he retained and used as well as the series progressed.


$\sqrt {3} \in Q$. Then, $\sqrt{3} = \frac ab$ with the lowest term for $a,b \in Z$.   Then, $3b^2=a^2$, which implies that $a^2$ is divisible by 3.   That is, $a$ is also divisible by 3 (by fundamental theorem of arithmetic).   I don't understand here $a^2$ divisible by 3 implies $a$ divisible by 3.   Could you explain it?

I have seen the proof that  $\sqrt2$ is irrational However I'm a bit confused. The proof goes something like this. first assume $m$ and $n$ are integers such that $$ \frac{m}{n}  = \sqrt{2} $$ $$ \frac{m^{2}}{n^{2}}  = 2 $$ $$m^{2}  = 2 n^{2}$$  $\implies m^{2} $ is divisible by $2 \implies m$ is divisible by 2. Let $2q = m$. Then $$m^{2}  = 4 q^{2} = 2n^{2}$$ $$ n^{2}  = 2 q^{2}$$ This means that $n^{2}$ is divisible by $2 \implies n$ is divisible by $2$...... Hence $\sqrt{2}$ is irrational. $$$$If $ m^{2} $ is divisible by $2$ how do we know that $m$ is also divisible by $2$? If you say it's a prime number then I can argue that I didn't need to do all these steps. I could have just said that its factors don't multiply to $2$ hence $\sqrt{2}$ is irrational


I'm recording the duration of how long something takes in Java. To do that, I'm running:  long startTime = System.nanoTime(); ... long duration = System.nanoTime() - startTime;   Now, I would like to take the duration and print it out in a format of mm:ss.SSS. How do I do that in Java?

I'd like to format a duration in seconds using a pattern like H:MM:SS. The current utilities in java are designed to format a time but not a duration.


I don't mean the first encrypt password, but that login name that appears in logout from user mode, change user, etc. The second password where I wrote my real name.

Some time ago, when I installed Ubuntu, I chose a rather stupid username for my account that I do not want to use anymore. How do I change this (including the name of my home directory, and the name in the terminal) without losing settings for applications? How do I keep permissions and my keys for various authentification (e.g. email, SSH, GPG and more)? What settings could possibly get lost if I changed my username?


When we download a binary Debian program from repository by this command:  sudo apt-get install something   Where is this program store and all of executable files?

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


In the Thor movie series,      Loki, disguised as an Asgardian soldier, was left alone with Odin, and when "Odin" next appears in the movie, when Thor spoke to him at the end of the movie to report Loki's apparent death, it is revealed that this "Odin" is actually Loki in disguise. It suggests a possibility that Loki may have assassinated or at least held Odin captive and hidden to take his place in secret. The former is very possible, while the latter seems much more difficult to pull off considering Odin's powers and what little Loki seem to have on hand to use against Odin even despite the element of surprise.   So what really happened?

Sorry, not quite sure how to format spoilers so I tried to keep the title vague.  Here's for the new Thor movie (just watched it last night):      How did Loki fake dying (and managed to fool Thor, the reinforcements who found his body and possibly Odin since he would have wanted to see the body after it was brought back)?   And follow-up:      Also, in the end, he's shown to have pretended to be Odin on the throne while talking to Thor about Thor's decision to stay on Earth. Where is Odin and how did Loki manage to do this? Did he do something to Odin?


I have loaded a Assembly using following code  Assembly.LoadFrom(ProjectDllPath);   Now this asssembly contains only one namespace and some classes in that namespace and I want to fetch the name of that Namespace . What is the syntax to fetch that name.

Given an instance of System.Reflection.Assembly.


I generated a brand new (reformatted) USB Key to boot on Ubuntu. I generated the USB Key using the internet procedure accessing it from a Windows 7 PC with Google Chrome. I generated the USB KEY successfully.  Now I insert my USB KEY, called PENDRIVE (F:/) automatically, in my other laptop (installed on Ubuntu 8, but I can not just upgrade since the internet connection does not seem to work). Unfortunately my computer I want to re-install on the new Ubuntu has not the possibility to boot on the USB port (if I click on F12 I have 3 options: HDD, DVD, external disk), therefore it boots on Ubuntu 8. No pb, I can try to reboot after. But when I enter the USB KEY, the system detects it is a bootable key, and requests if I want it to autorun. I answer Yes, of course, and it says "Can not find autorun.exe"   If I look in the key, there is file called wubi.exe, but it seems the system does not identify it.

I tried to use the usb-creator.exe from Ubuntu 10.10 desktop i386 ISO image and it does create an USB stick that doesn't boot. When I try to boot from it I get:     Operating System not found.   I try to do this from Windows 7 x64. I'm not looking to create a live Ubuntu media, only an installation USB disk.  I repeated the process several times and I even tried to reformat the USB drive (FAT32), no success yet.  The USB stick is a 8GB one.


I've spent two days trying to install manually the cite.sty package in MiKTeX when nothing worked except putting it in the same directory as my .tex file. I run windows. I found the MiKTeX options (by searching "settings" in my computer), which display the following four root directories.   it says that sty file should be placed (respecting the structure tex/latex/cite) in the local texmf directory structure but  and  it says that it should be in the home texmf directory. Part of the problem is that I don't have any directory in my computer named "texmf" (or "localtexmf" or "texmf-local"). After putting the file in the right place one must refresh FNDB, which can be done on MiKTeX options or by typing "texhash" in the command prompt. When I did the latter I noticed that only the first three directories in the list were being searched. Now when you put the mouse over the different directories, on all of them except c:\mytexmf the following warning comes up.  This directory is maintained by MiKTeX. You should not install your own files here, because they might get lost when MiKTeX gets updated.  On the c:\mytexmf directory the message comes:  This directory can be used for local additions.  So I intended to put the file there, but, unlike with all the others, I cannot find this directory in my computer. I don't know if the fact that the "c:" in the address is lowercase means something. So I went back to trying to identify the home and local texmf directories. Following the advice in the last link I wrote the following commands in the command prompt.  -var-value=TEXMFHOME -var-value=TEXMFLOCAL  The first one yielded the error message "unrecognised option -val-value-TEXMFHOME" but the second one came back with "C:/Users/pablo/AppData/Roaming/MiKTeX/2.9". Piecing things together I guessed that the "C:\Users\pablo\AppData\Local\MiKTeX\2.9" directory was, despite the name, the TEXMFHOME directory. I included the correspoding directory tree and file (tex/latex/cite/cite.sty) there, refreshed FNDB with the command "texhash" and it worked. The problem though is that I'm still not sure whether this is the ideal place to put the file, and whether it might get lost when MiKTeX is updated. And the problem remains that I cannot find the c:\mytexmf directory. Extra information:  it states: "UserInstall: the installation destination for packages installed by the user", where "Userinstall" corresponds (see image above) to my TEXMF-LOCAL directory. This is a bit confusing considering the warning message, and the fact that it worked when I put my package in the other directory. I can't find the MiKTeX console and I'm not at all sure that I have it. I did find the package manager but when trying to use it to install the package it yields the following error message:  get host by name failed in tcp_connect()  The information  and  seems to contradict on whether MiKTeX includes by default a local texmf tree. In my case it seems that the answer is yes. Other useful links:

In TeX Live there are TEXMFLOCAL for admin and TEXMFHOME for user pre-defined, but in MiKTeX there’s by default no local texmf tree installed, though it is useful, cf. . Therefore my question:  How do I create a local texmf tree in MiKTeX?


I want to use Alt+Shift as keyboard layout switcher. The main configuration utility doesn't allow me to do that (it's a default switcher for almost all computer users). Ok, no problem, I can setup it in GNOME Tweak Tool.  But when I press Alt+Shift in e.g. Firefox, it shows me hidden main menu (like if I press single Alt). How can I fix it and make Alt+Shift combination work correctly in all applications?

I recently installed Ubuntu 17.10, and when I tried to set my keyboard layout to change with alt+shift, I hit a . There is  which works, but then it creates an unwanted behaviour on Firefox (perhaps other programs as well).   After setting alt+shift through gnome-tweak-tool as the combination to change language, whenever this combination is pressed within Firefox, it triggers a toggle that Firefox uses to show/hide the Menu Bar (with File/Edit/View etc.), and 'focus' is taken away from wherever the cursor was.   It's very frustrating, because one has to go and click again at the cursor.  The only solution I found was to permanently enable Menu Bar in Firefox because then alt doesn't do anything and I can use it to change languages. But I don't want to have Menu Bar on top always.  I hope you can understand what I'm trying to explain.  Any thoughts?


Probably mid to late 20th century story. I believe the title is something like "Farewell Ilya" or "Goodbye..."   The alien tells the story. Actually, perhaps the astronauts are the aliens, since I think it takes place on another planet. I think the narrator is injured, or somehow gets "taken in" by the ship's crew. They treat him sort of like a pet.   Anyway, the alien/narrator describes all sorts of human behavior. He ends up falling in love with human laughter. The alien is vehemently vegetarian and is disgusted when he is offered meat by the crew of the spaceship (something about not eating plant matter either unless covered under some treaty). I think he moves by folding in appendages and rolling?? Despite all the bad things he observes, he is so taken with human laughter that he leaves with the crew.   The story may be in a letter format.   I read this years ago and cannot find it in any anthologies I own nor through internet searches.

This poor creature is taken aboard the spaceship and the humans do not know that it is intelligent.  The alien can repeat what it hears, e,g, "pass the sugar".  It is able to escape at night and it communicates messages to its fellow aliens.  It directs that they turn up the heat of the atmosphere (somehow they can do this) so as to force the humans to leave.  The alien protagonist states that it will die w/ the humans or leave with them.


I have downloaded an asset that shows as the picture attached.   The image is slightly warped with the warp tool (U) (may not be the correct translation as English is not my main language).   I wonder how could be this done, as I'm double clicking it but I'm unable to get deeper in layers. Is it an imported picture?

I should create a vector rectangle filled with a gradient made of 4 colors, one for each corner. I could just find some very generic information about using live blends, but I am not sure that is the best tool and still I was not able to do this. How would you get that in Illustrator exactly? (And secondary in Photoshop?)


I have an image of 90x122 pixels i want to resize it to make it 512x512 pixels but the image loses it quality Is there any way of doing this without losing the quality?.

Is it possible to make a .jpeg photo larger without losing "quality"?  I have a photo that is 450px x 750px and would like to make it 3 times bigger for web not print?  I've been told that Illustrator is the tool to make it happen and I have Illustrator CS6.


I want to draw an arc centered at the center of a node (a), I have not been able to find how to draw te arc specifying its center as (a.center), the only option I found is either using cartesian or polar coordinates

It would be convenient sometimes to be able to draw an arc in tikz by specifying   the center of the corresponding circle its radius the initial/final angle   i.e., the "natural" way an arc is defined, instead of the "first point of the arc".  Is there a way to do it?


I tried with System.exit(0) but that neither executes the finally block nor rest code.  Also tried return that will execute finally block but not the rest code  private static void testMethod() {     try {         System.out.println("try Block");         // Skip Finally Block.         //return;          // System.exit(0);     } catch (Exception e) {         System.out.println("catch Block");     } finally {         System.out.println("Finally Block");     }     System.out.println("After Finally Block."); }   Output should be  try Block After Finally Block.   OR  try Block catch Block After Finally Block.

Is there any condition where finally might not run in java? Thanks.


I am well aware that  $$\frac{1}{1^2} + \frac{1}{2^2} + \frac{1}{3^2} + \frac{1}{4^2} + \cdots = \frac{\pi^2}{6}$$  and  $$\frac{1}{1^4} + \frac{1}{2^4} + \frac{1}{3^4} + \frac{1}{4^4} + \cdots = \frac{\pi^4}{90}$$  I'm curious. Are there other known identities like the ones above? For instance, what is the following?  $$\frac{1}{1^6} + \frac{1}{2^6} + \frac{1}{3^6} + \frac{1}{4^6} + \cdots$$  EDIT: This is not a duplicate as I'm not just interested in even powers - it would be nice to obtain insights on odd powers as well, like @Dietrich Burde has done in one of their comments.

I recently, out of interest, tried to prove Euler's formula $\zeta{(2n)}=(-1)^{n-1}\frac{(2\pi)^{2n}}{2(2n)!}B_{2n}$ for all $n\in\mathbb{N}$. I adapted  Euler's original proof for $\zeta(2)=\frac{\pi^2}{6}$:  We have the well known formulas $\sin(x)=\sum_{k=0}^{\infty}\frac{(-1)^kx^{2k+1}}{(2k+1)!}$ and $\sin(x)=x\prod_{k=1}^{\infty}\left(1-\frac{x^2}{k^2\pi^2}\right)$. The product formula can be transformed into a series expansion as well but in order to keep it neat, some definitions first:  For the real sequence $\left(a_i\right)_{i\in\mathbb N}$ with $\sum a_i$ convergent, define $$ A_n:=\sum_{i=1}^{\infty} a_i^n $$ $$ \alpha_n:=\sum_{(x_1,\dots,x_n)\in M_n}\prod_{r=1}^{n} a_{x_r} $$ Where $M_n:=\{(x_1,\dots,x_n)\in\mathbb N\space|\space x_1<\dots<x_n\}$. Now we write $c_i=-\frac{1}{i^2\pi^2}$. When we expand the product, we get only odd exponents of $x$ and the coefficient of $x^{2k+1}$ for $k≥1$ is $\gamma_k$. By comparison of the coefficients, we obtain $\gamma_k=\frac{(-1)^k}{(2k+1)!}$. Now, through telescoping, it can be shown algebraically that for every sequence $\left(a_i\right)_{i\in\mathbb N}$ with $\sum a_i$ convergent we have: $$\sum_{i=1}^{n}{(-1)^{n-i}\alpha_{n+1-i}\space A_{i}}=A_{n+1}+(-1)^{n+1}(n+1)\alpha_{n+1}$$ For all $n\in\mathbb N_0$. Since $C_n=\sum_{i=1}^{\infty} \left(-\frac{1}{i^2\pi^2}\right)^n=\frac{(-1)^n}{\pi^{2n}}\zeta{(2n)}$ we have: $$ \sum_{i=1}^{n}{(-1)^{n-i}\gamma_{n+1-i}\space C_{i}}=\sum_{i=1}^{n}{(-1)^{n-i}\frac{(-1)^{n+1-i}}{(2n-2i+3)!}\frac{(-1)^i}{\pi^{2i}}\zeta{(2i)}}=\sum_{i=1}^{n}{(-1)^{i-1}\frac{\zeta{(2i)}}{(2n-2i+3)!\pi^{2i}}}=\frac{(-1)^{n+1}}{\pi^{2n+2}}\zeta{(2n+2)}+(-1)^{n+1}(n+1)\frac{(-1)^{n+1}}{(2n+3)!}=\frac{(-1)^{n+1}}{\pi^{2n+2}}\zeta{(2n+2)}+\frac{(n+1)}{(2n+3)!} \iff \sum_{i=1}^{n+1}{(-1)^{i-1}\frac{\zeta{(2i)}}{(2n-2i+3)!\pi^{2i}}}=\frac{(n+1)}{(2n+3)!} $$ For all $n\in\mathbb N_0$. Now we are ready to prove the formula $\zeta{(2n)}=(-1)^{n-1}\frac{(2\pi)^{2n}}{2(2n)!}B_{2n}$ with induction. With the equation above we can easily verify that it is true for $n=1$; therefore we assume that it holds for all $1≤i≤n$. The assertion $\zeta{(2n+2)}=(-1)^{n}\frac{(2\pi)^{2n+2}}{2(2n+2)!}B_{2n+2}$ is then equivalent to: $$ \sum_{i=1}^{n+1}{(-1)^{i-1}\frac{(-1)^{i-1}\frac{(2\pi)^{2i}}{2(2i)!}B_{2i}}{(2n-2i+3)!\pi^{2i}}}=\frac{(n+1)}{(2n+3)!}\iff \sum_{i=1}^{n+1}{\binom{2n+3}{2i}2^{2i-1}B_{2i}}=n+1\iff \sum_{i=0}^{2n+2} \binom{2n+3}{i}2^iB_i=0 $$ This identity can be proven by comparing the coefficients in the equation $\frac{e^x-1}{x}\frac{2x}{e^{2x}-1}=\frac{2}{e^x+1}$.   Is this proof valid? Nonetheless, if it is, it isn't very elegant. Are there faster ways to prove it?


My old phone was lost or stolen so I'm trying to log into my Google account from a different phone but I dont remember my pass word and I didnt have a recovery email..I tried to use my girlfriends email but google said it couldn't verify it was me..so I dont know what to do

I have forgotten the password or username for my Google account, or I'm unable to access my account for other reasons.  How can I recover my account?  (This Q&A is meant as a general description for all Google and Gmail username/password questions. See: )


I am currently planning to reinstall my OS from scratch. Over the years, I installed a LOT OF packages via brew. Obviously, I'd like to reinstall those after setting up the system again, and I want to automate this as much as possible. Hence my question: How do I list all packages installed via brew, including casks, and how do I create an "install script" from those that will add all added casks for me and then install all packages again?"  asks a similar question, but doesn't address the creation of a automated install script, rather the port between two architectures.

I recently purchased a MacBook Pro 13" with the M1 chip and transferred all my data over using a Time Machine backup. Homebrew packages are currently installed in /usr/local/opt/ but it is my understanding that they should be under /opt/homebrew for Apple Silicon Macs. How can I:  Get the list of packages I currently have installed Remove those from /user/local/opt Reinstall them under /opt/homebrew  I kind of assumed Homebrew would be clever enough to do this automatically but apparently it needs some manual maintenance. Here's my Homebrew config if it helps: HOMEBREW_VERSION: 2.7.2 ORIGIN: https://github.com/Homebrew/brew HEAD: dad7dc6a1498b80770d98f2d7cd6fb927c300bbb Last commit: 3 days ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: 2b1d79d038bffdbfcee93283051d48919a4caf3d Core tap last commit: 16 hours ago Core tap branch: master HOMEBREW_PREFIX: /usr/local HOMEBREW_REPOSITORY: /usr/local/Homebrew HOMEBREW_CELLAR: /usr/local/Cellar HOMEBREW_CASK_OPTS: [] HOMEBREW_MAKE_JOBS: 8 Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby CPU: octa-core 64-bit arm_firestorm_icestorm Clang: 12.0 build 1200 Git: 2.30.0 => /usr/local/bin/git Curl: 7.64.1 => /usr/bin/curl macOS: 11.1-arm64 CLT: 12.3.0.0.1.1607026830 Xcode: N/A Rosetta 2: false  Thanks in advance!


I have a Stream in which there is uploaded text file. The file can have any encoding - ANSI, UTF8 without BOM, UTF8 with BOM. The file has characters which are specific for some languages - e.g. ąę. I need to save all files as UTF8 BOM files on the server side, but I can't force all users to upload me UTF8 BOM files. Special characters in saved file must maintain correct - so ąę. How can I do this?  I have:          using (Stream inputStream = file.InputStream)         {             byte[] bytes = ReadFully2(inputStream);             string utf8string = .....what here?.....             System.IO.File.WriteAllText("", utf8string, System.Text.Encoding.UTF8);         }   public static byte[] ReadFully2(Stream input) {     input.Position = 0;     using (MemoryStream ms = new MemoryStream())     {         input.CopyTo(ms);         return ms.ToArray();     } }

In our application, we receive text files (.txt, .csv, etc.) from diverse sources. When reading, these files sometimes contain garbage, because the files where created in a different/unknown codepage.  Is there a way to (automatically) detect the codepage of a text file?   The detectEncodingFromByteOrderMarks, on the StreamReader constructor, works for UTF8  and other unicode marked files, but I'm looking for a way to detect code pages, like ibm850, windows1252.     Thanks for your answers, this is what I've done.  The files we receive are from end-users, they do not have a clue about codepages. The receivers are also end-users, by now this is what they know about codepages: Codepages exist, and are annoying.  Solution:    Open the received file in Notepad, look at a garbled piece of text. If somebody is called François or something, with your human intelligence you can guess this. I've created a small app that the user can use to open the file with, and enter a text that user knows it will appear in the file, when the correct codepage is used.  Loop through all codepages, and display the ones that give a solution with the user provided text.  If more as one codepage pops up, ask the user to specify more text.


I have a C# program that uses objects from a class that has a method looking something like this:  public double TheMethod(double argument1, double argument2, ...,double argumentN) {      //method body: do something with the arguments     //return the result }   I would like to give the user the ability to write their own logic into the method body and then have that be used when the program is run.  It seems to me that scripting may be the way to go, but I am having trouble trying to get started. What is the best way to approach this situation?  Note: If it matters, the program would be run from within a larger main desktop application. I would like the user to be able to write their code when the application is already running through some sort of editor program. Their code would then be saved and used once they launch the program that actually uses the method.

We are writing a complex rich desktop application and need to offer flexibility in reporting formats so we thought we would just expose our object model to a scripting langauge. Time was when that meant VBA (which is still an option), but the managed code derivative VSTA (I think) seems to have withered on the vine.  What is now the best choice for an embedded scripting language on Windows .NET?


To be clear, by $\mathbb Z$ I mean the group $(\mathbb Z, +)$.  My intuitive answer would be no, but I haven't been able to find a proof for it. The basic invariants I know of (e.g. order of elements) are not useful here and my knowledge of infinite abelian groups is very limited.  In general, is it true that $\mathbb Z^n \cong \mathbb Z^m \iff n=m$?

Determine whether $\mathbb{Z}\times \mathbb{Z}$ and $\mathbb{Z}\times \mathbb{Z}\times \mathbb{Z}$ are isomorphic groups or not.  pf) Suppose that these are isomorphic. Note that $\mathbb{Z}\times \mathbb{Z}$ is a subgroup of $\mathbb{Z}\times \mathbb{Z}$ and $\mathbb{Z}\times \mathbb{Z}\times\left \{ 0 \right \}$ is a subgroup of $\mathbb{Z}\times \mathbb{Z}\times \mathbb{Z}$. Since $\mathbb{Z}\times \mathbb{Z}$ and $\mathbb{Z}\times \mathbb{Z}\times\left \{ 0 \right \}$ are isomorphic, $\mathbb{Z}\times \mathbb{Z}/\mathbb{Z}\times \mathbb{Z}$ and $\mathbb{Z}\times \mathbb{Z}\times \mathbb{Z}/\mathbb{Z}\times \mathbb{Z}\times \left \{ 0 \right \}$ are isomorphic. But the first one is isomorphic to the trivial group and the second one is isomorphic to $\mathbb{Z}$. It is a contradiction.  Is my proof right? If not, is there another proof?


I am working on making inverse kinematics for a game I am making so I decided that the best way to start would be to do it in 2D.   After asking some people how to do it, they said you need to calculate the intersection of 2 circles.   How would I go about doing this without using any trigonometric formula? I searched online, however the answers and solutions to get the answer are not very well worded and easy to understand.   If you know the two positions of the circles, the distance between them and the radius of the circles, how would you calculate the intersection? And if you are answering can you clearly explain each step and what each thing means please and it would help me very much, e.g if you are using $x_1^2$, $x_2^2$, $y_1^2$, $y_2^2$, $r_1$, $r_2$ etc as such they do not show much meaning to me as I do not understand what they are showing? If you could explain this in the very best way possible for me to understand that would be great! thank you very much!  I have searched far and wide, but anywhere I found the wording is too hard to understand and follow - I am asking for someone to answer in a way that is understandable.

Given the radius and $x,y$ coordinates of the center point of two circles how can I calculate their points of intersection if they have any?


So my program works fine until the end where it has to calculate and then show the results.It just show the result without calculating the "if" at the end.   public class Convertisseur1 {     public static void main(String[] args) {     String valeurInitial;     String valeurPoid;     String valeurDesire;     String valeurInitial2;     String valeurInitial3;      //seperation des string     valeurInitial = (args[0]);     valeurInitial2 = (args[0]);     valeurDesire = (args[1]);     valeurInitial3 = (args[0]);      valeurInitial = valeurInitial.replace("kg","");      valeurInitial = valeurInitial.replace("g","");           valeurInitial = valeurInitial.replace("t","");           valeurInitial = valeurInitial.replace("lb","");          double valeurdouble = Double.parseDouble(valeurInitial);      valeurInitial2 = valeurInitial2.substring(valeurInitial2.length()-2);     valeurInitial3 = valeurInitial3.substring(valeurInitial3.length()-1);            //convertion         System.out.println(valeurInitial2);     System.out.println(valeurDesire);     System.out.println(valeurdouble);     if(valeurInitial2 == "kg" &&valeurDesire == "g"){         valeurdouble = (valeurdouble*1000);          System.out.println("La convertion finale : " + valeurdouble);     }else if(valeurInitial2 == "kg"&&valeurDesire == "lb")         valeurdouble = (valeurdouble/2.2046226);      /*System.out.println(valeurdouble);     //System.out.println(valeurPoid);     System.out.println(valeurDesire);     System.out.println(valeurInitial2);     System.out.println(valeurInitial3);*/      } }

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?


I'm learning bash code and today I'm studying   the command grep.  if I run   $ ps -fU user | grep thunderbird   terminal shows:  user  17410     1  0 10:09 ?        00:00:20 /usr/lib/thunderbird/thunderbird user  18990 15896  0 12:25 pts/1    00:00:00 grep --color=auto thunderbird   But if I run:  $ ps -fU user | grep [t]hunderbird   terminal shows:  user  17410     1  0 10:09 ?        00:00:20 /usr/lib/thunderbird/thunderbird   why? I read the guide but I don't understand.

I saw this one-liner recently:  $ ps -ef | grep [f]irefox   thorsen   16730     1  1 Jun19 ?        00:27:27 /usr/lib/firefox/firefox ...   So it seems to return the list of processes with "firefox" in the data but leaving out the grep process itself, and therefore seems roughly equivalent to:  ps -ef |grep -v grep| grep firefox   I can't understand how it works though. I've looked at the man page on grep and elsewhere but haven't found an explanation.  And to compound the mystery if I run:  $ ps -ef | grep firefox  > data $ grep [f]irefox data  thorsen   15820 28618  0 07:28 pts/1    00:00:00 grep --color=auto firefox thorsen   16730     1  1 Jun19 ?        00:27:45 /usr/lib/firefox/firefox ....   the [t]rick seems to stop working!  Someone here will know what's going on I'm sure.  Thanks.


Seemingly every single document that I created in the previous version of Pages (I update regularly whenever I see that a new update is available) on this same MacBook Pro with Yosemite will now not open with Pages after the latest update (5.5.2). I am still on Yosemite and nothing has changed aside from updating Pages, Numbers & Keynote.  All of my documents are stored on my internal hard drive. When I attempt to open them I get a message stating the following:     This document can't be opened because it's too old. To open it, save it with Pages '09 first.   As I mentioned above, however, these documents were created in whichever version was right before the current version on the same computer with the same operating system (Yosemite).  Can anybody help? These are time sensitive documents. For now, I may try opening them with my iPad, but wow, if I knew this was going to happen I certainly would not have updated.

I have a document I created with an old Pages version. When I try to open it in Pages '13, I get the message :     This document is too old. Please open and save with Pages '09   I don't have Pages '09 and I don't know where that old version of Pages is and if it will run on Mac OS 10.9.   Is there an easy way to convert the document? If there is no easy way, is there a way to at least extract the text from the document?


It's always been a mystery for me while creating drop shadow effects that one layer changes the angle of its shadow automatically if I change the angle of the other.  For example: in Layer 1 I am setting the drop shadow angle as 0. In Layer 2 I want to set its angle to 90 degrees. As soon as I do this, the first layer changes its angle to 90 degrees.  Why is it dependent and how do I remove this link?

I am wondering how to have 2 different directional drop shadows in the one file with Photoshop. e.g. 2 different type layers — one has a drop shadow at 90 degrees, the other at -45 degrees.  Currently it seems Photoshop only lets me have 1 universal direction for the whole file, which I find really pointless.   I know how to apply different drop shadows and merge down layers to achieve the same thing, but its tedious and not exactly streamlined for making future changes to that layer.  How is this achieved?


I have used R programming language to perform Wilcoxon signed ranked test between two data:  47.96       13.8     23.44       25.84    38.98       31.84    15.45       18.87    18.91       19.46    45.21       38.47    21.16       10.17    13.14       11.61      The graphical representation of the result is showed in photo.  I am trying to understand how it is decided what will be the box range.  I understand that the horizontal lines on the graph are median values, while vertical lines on the graph present the range of my data, but I am curious what box range represents?  So in my case although there is no significant difference between two median values, the box range in the graph is very different.    This is the code I used:  #my_data <- read.csv(file.choose()) # Data in two numeric vectors # ++++++++++++++++++++++++++ # Weight of the mice before treatment Xray_holo <-c(47.96, 23.44, 38.98, 15.45, 18.91, 45.21, 21.16, 13.14) # Weight of the mice after treatment NMR_holo <-c(13.8, 25.84, 31.84, 18.87, 19.46, 38.47, 10.17, 11.61) # Create a data frame my_data <- data.frame(   P_str = rep(c("Xray_holo", "NMR_holo"), each = 8),   logAUC = c(Xray_holo,  NMR_holo) ) print (my_data) install.packages("dplyr") library("dplyr") group_by(my_data, P_str) %>%   summarise(     count = n(),     median = median(logAUC, na.rm = TRUE),     IQR = IQR(logAUC, na.rm = TRUE)   ) # Install if(!require(devtools)) install.packages("devtools") devtools::install_github("kassambara/ggpubr") install.packages("ggpubr") # Plot weight by group and color by group library("ggpubr") ggboxplot(my_data, x = "P_str", y = "logAUC",           color = "P_str", palette = c("#00AFBB", "#E7B800"),           order = c("Xray_holo", "NMR_holo"),           ylab = "logAUC", xlab = "Protein structures")   #install.packages("PairedData")  # Subset weight data before treatment #Xray_holo <- subset(my_data,  P_str == "Xray_holo", logAUC,                  drop = TRUE) # subset weight data after treatment #NMR_holo <- subset(my_data,  P_str == "NMR_holo", logAUC,                  drop = TRUE) # Plot paired data #library(PairedData) #pd <- paired(Xray_holo, NMR_holo) #plot(pd, type = "profile") + theme_bw()   res <- wilcox.test(Xray_holo, NMR_holo, paired = TRUE) res

Why 1st and 3rd quartiles don't match with boxplot in R?   a = c(3,12,15,16,16,17,19,34) boxplot(a, horizontal = T) range(a) quantile(a)  abline(v=quantile(a), lty=2)     @Henry:  abline(v=fivenum(a), col="green")


So this is my .bib entry  @book{FUR,     Author = {Furht, Borko; Villanustre, Flavio},     Publisher = {Springer International Publishing},     Title = {Big Data Technologies and Applications},     Year = {2016}}   I use  \usepackage[style=authoryear,citestyle=authoryear]{biblatex}   The result I want is:  Furht, Borko; Villanustre, Flavio (2016).     Big Data Technologies and Applications.     Springer International Publishing  what I get is:  Furht Borko; Villanustre, Flavio (2016).     Big Data Technologies and Applications.     Springer International Publishing  The first Authors first and lastname are not divided by a comma, any suggestion how i could fix that?   Thank you!

I use  to store all articles I need and bibtex4word add-on (in MS Word) to maintain the reference list. So, I would like to know how to properly fill the "author" field in Jabref with multiple authors to appear them correct in the reference list.  For example, I've got the article with several authors:      E. Orti, J.L. Bredas, C. Clarisse   And I would like them to appear in this manner. But instead I get this:     C. C. E. Orti, J. L. Bredas


So for example I have this class that outputs my detailed flight output that is in the java doc "Flight.java" :  public String toDetailedString() {     String output =         getDeparture() + " - " + getArrival() + "\n" + Airport.getAirportCity(source) + " (" +         source + ") - " + Airport.getAirportCity(destination) + " (" + destination + ")" +         "\n" + plane.getAirline() + " " + number + " * " + plane.getModel();     return output;  }   and I have an Itinerary class "Itinerary.java" and I want to pull the info from Flight.java without making toDetailedString static, is that possible? For added info, each of the variables you see "source, number, destination" are all private variables in Flight.java which I know are enclosed encapsulation. Any help is greatly valuable.   Example implementation in Itinerary.java  public String toString() {     return "The total cost is" + getTotalCost() + Flight.toDetailedString(); }   UPDATE:   In my Flight constructor I have:  public Flight(Plane plane, String number, double cost, Time departure, int duration, Airport source, Airport destination) {     this.plane = plane;     this.number = number;     this.cost = cost;     this.departure = departure;     this.duration = duration;     this.source = source;     this.destination = destination; }   In which I created the object "f1" in my ItineraryTest class:  Flight f1 = new Flight(new Plane(Airline.American, "Airbus A321"),         "495",         79,         new Time(7, 10), 100,         Airport.PHX, Airport.LAX);   Thus I linked my object to the toDetailedString() the object "f1" was renamed to "first" in my Itinerary.java and a second object was created called "f2" and moved to "second" (to avoid confusion) :  public String toString() {     return "The total cost: "              + getTotalCost()             + " "             + first.toDetailedString()             + second.toDetailedString(); }   I thought I answered my own question, but now receive an error of:     Exception in thread "main" java.lang.NullPointerException at   Itinerary.toString(Itinerary.java:117) at   java.lang.String.valueOf(String.java:2994) at   java.io.PrintStream.println(PrintStream.java:821) at   ItineraryTest.main(ItineraryTest.java:20)

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?