So I wanted to install Windows 8.1 on my USB but I saw that I need to format it so I tried to format it but it says unable to format or something like that (Btw its Kingston's DT101 G2) I checked on internet and i tried every one they gave and none of it worked so I said ok im gonna try with my older smaller USB (I'm not sure what brand it is , it's some random USB) but that one for some reason has Write Protection on it and then I tried to look up on the Internet i tried one in regedit and one in cmd . What i found is that when in cmd i type ATTRIBUTES DISK it says : ReadOnly State-yes , ReadOnly-no . I think that it's write protected beacuse of That readonly state . I wanted to know if anyone could help with any of these USB Drives

When I plug in my USB flash drive, it shows up on my computer as write-protected or read-only. I am unable to transfer data to it, nor can I modify or delete any files already stored on it. I also cannot repartition or reformat the drive using Windows Disk Management, DiskPart, GParted, or other tools. The drive does not have a write-protect switch.  Why did this happen and what can I do about it? Is there a way to remove the write protection?  (Note that this can happen with some memory cards, too, as they often use controllers similar to those used in flash drives. In some cases, the system may report that the drive or card was formatted successfully even though it was never actually formatted; the original data reappears when the device is reinserted.)     This question comes up often and the answers are usually the same. This post is meant to provide a definitive, canonical answer for this problem. Feel free to edit the answer to add additional details.


So I've encountered a rather interesting, and likely highly math related problem to do with apple's implementation of the Bezier Curve.  So to cut to the chase, I've got a UIBezierCurve.  I've plotted 3 points to generate an curve.  A left point, the control point and the right point.  Here is an example:  UIBezierPath *bezierCurve = [UIBezierPath bezierPath]; [bezierCurve moveToPoint:leftCorner]; [bezierCurve addQuadCurveToPoint:rightCorner controlPoint:controlPoint];   Where leftCorner, rightCorner and controlPoint are all CGPoints.  Its pretty much an upside down parabola (with the values I am using usually, although this likely doesn't matter, its a parabola in some fashion that would pass the vertical line test).  Like this:    Now what I want to do is gather a list of points along this bezierCurve.  Not just the 3 points I used to create it.  For example, I would like to have, lets say a fine-grained list of probably hundreds of points along the curve that are all evenly spaced.  How I approached solving this:  Hill-climb algorithm.  My implementation of it was basically to start at the left of the curve (left corner) and walk along the curve until I got to the right corner.  While walking 1 unit to the right each time I would try to hug the curve using:  - (BOOL)containsPoint:(CGPoint)point   This worked reasonably well, I got a list of a few hundred points along the curve.  The problem however is they are certainly not equally spaced (equidistant is likely the term I am looking for here).  Where the slope of the curve is relatively flat I get many points, and they are reasonably evenly spaced.  When the slope is large however I get very few points compared to the length of the line in those areas.  Sometimes only a point or two in very steep areas (when there should be many).  How I think I should solve this problem is to go with my hill climb algorithm (doing a pass horizontally, by walking along the x-axis hugging the curve) and add a second pass vertically (walking along the y-axis, hugging the curve).  And then merge those 2 sets of points by sorting by x-value, and then within each x-value I sort by y-value.  However I am thinking there must be an easier, trivial way to do this.  On Android all you have to do on the similar class to UIBezierCurve (android's "Path" class) is:  for (int i = 0; i < pathMeasure.getLength(); i++)  {     float[] point = new float[2];     float[] tangent = new float[2];      boolean success = pathMeasure.getPosTan(i, point, tangent);      if (success)      {             curvePoints.add(new Point((int)point[0], (int)point[1]));     } }   In the end of that I basically have a list of points (curvePoints) that are all equidistant.  PathMeasure is the class that works on android's Path (they are both built-in Android classes).  I was hoping there was something similar to PathMeasure to easily get a list of equidistant points (of fine-grained granularity) on a UIBezierCurve and to avoid having to get heavy into the math of doing this all by hand.  Is there something I'm missing?  Thanks!

Currently, I'm attempting to make multiple beziers have equidistant points.  I'm currently using cubic interpolation to find the points, but because the way beziers work some areas are more dense than others and proving gross for texture mapping because of the variable distance.  Is there a way to find points on a bezier by distance rather than by percentage?  Furthermore, is it possible to extend this to multiple connected curves?


When flagging a question on the standard browser on android and chrome on android on a galaxy S3 the "second page" of the flagging dialogue is obscured by a white rectangle (see screen shot). (However the near identical close dialogue does not have the same problems) In this example I have flagged a question clicking "This question should be closed for another reason" being brought to the screen shot page where some of the options are obscured. The bug is not specific to the "other reasons" page and all second pages of the flagging dialogue show this problem.  The problem did not occure on dolphine mobile browser. Workaround The white rectangle appears to be your own answer box getting "stuck" to the dialogue. As such you can avoid it by ensuring your view is as scrolled up as possible (so what you're clicking is at the very bottom of the screen. This ensures that your answer box is out of the way when it gets stuck

The "Your Answer" textbox seems to be eating the flagging dialog as shown in Figure A.


I suppose the question is pretty self explanatory.  I can think of a plethora of examples (discussing mathematical algorithms: applied math: analysis of a problem, etc...) where math formatting would be helpful.  And sites such as math.stackexchange and cs theory.stackexchange support it.  So why not stack overflow?

in questions, answers, and comments. Can we get something like this going on Stack Overflow?  I think it’d be appropriate as I at least pretty often want to write something like n^2 and would benefit greatly from prettier markup.


Few days ago I noticed a new phenomena in chrome  1) Whenever I visit a new website, the first click on the site results in a new tap with ads in it and directs me to a website called the theadsgateway.com.  2) When searching in Google, some weird results appear on the top of the page with label "Strong Signal ads"  3) When visiting some websites, three ads appear at the bottom of the page. Two squares and one is rectangular in the middle. Also with label "Strong Signal ads".  Following some instructions I found on the Internet, I uninstalled Strong Signal(which I don't remember installing) from Control Panel and removed the extension Strong Signal from Chrome Extensions. This didn't help and the three things I mentioned above still happen and whenever I restart my computer I find the extension Strong Signal in my Chrome extension like I never removed it before.  Please help.

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


I tried so much different things of installing ntpq or other stuff but nothing works.  I dont can change it to yes. I hope someone can help here.  I had Ubuntu 16.04  This is my terminal output of the Command timedatectl         Local time: Tue 2017-06-27 20:52:45 CEST   Universal time: Tue 2017-06-27 18:52:45 UTC         RTC time: n/a        Time zone: Europe/Berlin (CEST, +0200)  Network time on: yes NTP synchronized: no  RTC in local TZ: no   Also tried this tutorial:   But when i make sudo timedatectl set-ntp on it only changes Network time on: yes/no.  Also installed ntp. But from the command sudo ntpq -p i get this error  ntpq: read: Connection refused

'timedatectl' is giving following output  -                        Local time: Wed 2018-06-13 18:08:51 IST                   Universal time: Wed 2018-06-13 12:38:51 UTC                         RTC time: Wed 2018-06-13 12:38:51                        Time zone: Asia/Kolkata (IST, +0530)        System clock synchronized: no systemd-timesyncd.service active: yes                  RTC in local TZ: no   How to set System clock synchronized to yes?


Or more generally, how does one derive the dot product in alternative coordinate systems? Since the unit vectors in polar coordinates are defined as $\hat{\theta}$ and $\hat{r}$. How can the dot product be defined when using these basis vectors without converting them to the cartesian unit vectors?

For a vector field $X$, the divergence in coordinates is given by $\nabla\cdot X=\sum_n\frac{X^i}{\partial x^i}$. In polar coordinates, the metric is $\begin{bmatrix}1 & 0\\ 0 & r^2\end{bmatrix}$, and so $\frac{1}{\sqrt{g(\frac{\partial}{\partial r},\frac{\partial}{\partial r})}}\frac{\partial}{\partial r}=\frac{\partial}{\partial r}$ and $\frac{1}{\sqrt{g(\frac{\partial}{\partial\theta},\frac{\partial}{\partial\theta})}}\frac{\partial}{\partial\theta}=\frac{1}{r}\frac{\partial}{\partial\theta}$ are unit vectors. Then for $X=X_{r}\frac{\partial}{\partial r}+X_{\theta}\frac{\partial}{r\partial\theta}$,  $\nabla\cdot X=\frac{\partial X_r}{\partial r}+\frac{\partial}{\partial\theta}\frac{X_{\theta}}{r}=\frac{\partial X_r}{\partial r}+\frac{1}{r}\frac{\partial X_{\theta}}{\partial\theta}$. But this disagrees with the usual formula given in vector calculus books. Does anyone see the error?


What is the simplest way to extract from a file a line given by its number. E.g., I want the 666th line of somefile. How would you do this in your terminal, or in a shell script?   I can see solutions like head -n 666 somefile | tail -n 1, or even the half-incorrect cat -n somefile | grep -F 666, but there must be something nicer, faster, and more robust. Maybe using a more obscure unix command/utility?

Say I have a huge text file (>2GB) and I just want to cat the lines X to Y (e.g. 57890000 to 57890010).  From what I understand I can do this by piping head into tail or viceversa, i.e.   head -A /path/to/file | tail -B   or alternatively  tail -C /path/to/file | head -D   where A,B,C and D can be computed from the number of lines in the file, X and Y.  But there are two problems with this approach:   You have to compute A,B,C and D. The commands could pipe to each other many more lines than I am interested in reading (e.g. if I am reading just a few lines in the middle of a huge file)   Is there a way to have the shell just work with and output the lines I want? (while providing only X and Y)?


I am looking for a way to disable/enable a specific key (e.g. backspace) from the command line.  Any suggestions?

I have a laptop with a full keyboard (it has numpad), but the laptop is not that big, and because of that the keys are relatively small, which means I am constantly finding myself pressing keys accidentally on the numpad part.  Is there a way to disable specific keys that I simply don't want?


I read  but the answers mention air travel. I'm interested in using 2 passports at a land border. At a land border crossing, can I use passport A to exit one country and use passport B to enter the neighboring country?  Example scenario   I live in country A and I have nationality A. I fly to country-1, which gives citizens of A a visa on arrival.   Country-1 does not give citizens of B a visa on arrival. B citizens must get an expensive visa before departure for country-1.  Now I want to travel overland from country-1 to country-2.   At the land border country-2 charges citizens of country A an expensive visa on arrival fee. At the land border country-2 gives B citizens a free visa on arrival.  (Another concern: eventually this overland journey arrives in country B, of which I have a passport. I'm worried what country B will do if the stamp of the neighboring country is not in my passport.)   A picture to illustrate the land crossing:    Can I swap passports at the land border? Or will the immigration officials of country 2 not allow this?

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


I have a feeling that this is a stupid question, but googling around I haven't found an answer to it.   Simply: What does it mean if a multiple regression model is significant but none of the individual predictors are significant? There are between 5 and 10 predictors in the model.   I would imagine that it's because of the high number of predictors in the model. One of the predictors almost passed the threshold of significance (p = .06). Most of the predictors, when isolated in separate simple regression models with the same independent variable, have significant p-values. In other words, the simple regression model with predictor A and variable Z is significant, the simple model with predictor B and variable Z is significant, etc., but the multiple regression model with predictors A, B, etc., and variable Z is non-significant.   My other thought would be multicollinearity, but I tested all of the assumptions, and the multiple regression model meets them. In particular, I tested for multicollinearity with the “vif()” function in R. As far as I understand, a VIF value over 5 or 10 for any predictor indicates a problematic level of multicollinearity. For this multiple regression model, none of the predictors exceeded a VIF value of 5. If it matters, the VIF values for each variable were: 2  2  4  4  1  2  1.5  and 3.5.   For theoretical reasons, I would expect there to be an overlap between the predictors, because there are theoretically causal relationships between some of the predictors that were used.   Thanks in advance. :)

I'm fitting a multiple linear regression model between 4 categorical variables (with 4 levels each) and a numerical output. My dataset has 43 observations.  Regression gives me the following $p$-values from the $t$-test for every slope coefficient: $.15, .67, .27, .02$. Thus, the coefficient for the 4th predictor is significant at $\alpha = .05$ confidence level.  On the other hand, the regression gives me a $p$-value from an overall $F$-test of the null hypothesis that all my slope coefficients are equal to zero. For my dataset, this $p$-value is $.11$.  My question: how should I interpret these results? Which $p$-value should I use and why? Is the coefficient for the 4th variable significantly different from $0$ at the $\alpha = .05$ confidence level?  I've seen a related question, , but there was an opposite situation: high $t$-test $p$-values and low $F$-test $p$-value. Honestly, I don't quite understand why we would need an $F$-test in addition to a $t$-test to see if linear regression coefficients are significantly different from zero.


I sometimes experience whole Ubuntu freezes (from 14.04 to 16.04, I upgrade by a clean installation), just mouse can move (that's why this question is different from others). I think this is caused by one of the cores stop working when 100% load by unresponsive Desktop Environment. There isn't any magic key combination like Ctrl+Alt+Del or Ctrl+Shift+Esc known from Windows. The only thing I could do is hold power button for 5-10 seconds and hard shut down. Is there any other recommended solution?  Could I e.g. with some keyword combination reset CPU or kill all additional services or reset Unity or force soft reboot or I don't know what else could help?

All operating systems freeze sometimes, and Ubuntu is no exception. What should I do to regain control when...   just one program stops responding? nothing at all responds to mouse clicks or key presses? the mouse stops moving entirely? I have an    In what order should I try various solutions before deciding to pull the power plug?  What should I do when starting up Ubuntu fails?  Is there a diagnostic procedure I can follow?


I trying convert some C code to Python and have problem with clearing buffer (data which will be send by UDP). Function to convert looks like: void func(Struct *data_1, Struct *data_2) {     data_p1 = data_1;     data_p2 = data_2;     memset(datap1, 0, sizeof(*data_p1));     memset(datap2, 0, sizeof(*data_p2)); }  And I have to problms,I don't know how to replace c pointers and is that crucial to replace them. Second problem is that memset, I know that is ctype but I don't know how to properly use it. Can anyone help?

First off, here is some code:  int main()  {     int days[] = {1,2,3,4,5};     int *ptr = days;     printf("%u\n", sizeof(days));     printf("%u\n", sizeof(ptr));      return 0; }   Is there a way to find out the size of the array that ptr is pointing to (instead of just giving its size, which is four bytes on a 32-bit system)?


I've been working on a WPF application and have come across some rather strange behavior concerning resources defined in the Application.Resources element of my App.XAML file.   I really only need a single string resource defined in my ResourceDictionary, and I attempted this with the following XAML:  <Application x:Class="MyClass.App"          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"          xmlns:sys="clr-namespace:System;assembly=mscorlib">     <Application.Resources>         <sys:String x:Key="htmlHelpFilePath">.\Help\glossary.chm</sys:String>     </Application.Resources> </Application>   And then attempted to access it with the following code:  ResourceDictionary resourceDictionary = App.Current.Resources; string htmlHelpFile = (string)resourceDictionary["htmlHelpFilePath"];   This unfortunately resulted in htmlHelpFile being set to null. The debugger also revealed that resourceDictionary had zero keysets.   I started to play around and found that simply adding another resource into my Application.Resource XAML element allows for the dictionary to properly populate, so I ended up settling with:  <Application.Resources>     <sys:String x:Key="htmlHelpFileName">glossary.chm</sys:String>     <sys:String x:Key="htmlHelpFileDirectory">.\Help\</sys:String> </Application.Resources>   This solution is works as expected and I have moved on with my work, but I am absolutely mystified by why this is behavior is occurring in the way that its occurring. My knowledge about the inner workings of XAML configured WPF applications is very basic, and would love to know the reason for this bizarre behavior.

Background: I'm creating a WPF app using MVVM, and using a DI container to build my ViewModels  My App.xaml looks like this:  <Application x:Class="WpfApp.App"     ...xmlns etc...     StartupUri="MainWindow.xaml">     <Application.Resources>         <app:ServiceLocator x:Key="serviceLocator" />     </Application.Resources> </Application>   MainWindow.xaml looks like this:  <Window x:Class="CompositeMefWpfApp.MainWindow"     ...xmlns etc... >     <Control.DataContext>         <Binding Path="MainWindowViewModel" Source="{StaticResource serviceLocator}" />     </Control.DataContext>   Now, this all works fine, but the StartupUri is hardcoded into the XAML, which I don't want. Following guidance of several blogposts and articles I found, I removed the StartupUri, and tried to create the MainWindow by hooking OnStartup in App.xaml.cs, like this:  protected override void OnStartup( StartupEventArgs e ) {     base.OnStartup(e);     new MainWindow().Show(); }   The problem is, the app crashes when trying to show the window, with this exception:     Cannot find resource named '{serviceLocator}'. Resource names are case sensitive.  Error at object 'System.Windows.Data.Binding' in markup file 'WpfApp;component/mainwindow.xaml' Line 8 Position 45.   As far as I can tell, the <Application.Resources> section is simply not being read out of the xaml file. I can put some code in the OnStartup to add the resource programatically like this:  Resources.BeginInit(); Resources.Add("serviceLocator", new ServiceLocator()); Resources.EndInit();   However that's an ugly hack, and doesn't help me if I wanted to put something else in the app.xaml file later on :-(  Should I be hooking some other event? Is there a way around this?


In the video, , a guy says:     I wasn't much of a big brother.   Isn't it incorrect to say? I think it should be elder brother.

If I'm 18 and my brother is 15, is he my little brother and I'm his elder brother? Or he is my smaller brother and I'm his bigger one?  Any clarifications?


There are a lot of questions on this site about the double slit experiment, none of them answer my question specifically. I am not asking about detection or detectors or anything just at the slit. My question is about the photons traveling as partial waves through both slits and the dots on the screen. A lot of the answers claim that:  the photon goes through both slits   That's why it goes through both slits.     one photon, one dot   In this case , the probability of the single photon to be absorbed by the intensifier completely is 1, by construction. In this case the energy of the single photon will not make a difference as long as it is within the energy levels available on the phosphor screen. One point will appear.     a photon can only be absorbed once  Yet if you think about it, if the photon travels as a wave, and partial waves travel through both slits, then these partial waves might reach and interact with the screen at different locations.  If you look at the image, you can clearly see a single photon shot at a time, traveling through both slits, as partial waves, and the partial waves reaching the screen at different (shown by two arrows) locations simultaneously. Why does this not leave two dots on the screen? Question:  If a photon truly goes through both slits, then why can't it make two dots (excite two atoms) in the screen?

There are a lot of questions about this topic on this site, none of them answer my question specifically. I have read this question:   I think of the emitted photon as a point particle (but with a polarization vector) traveling in a straight line from the atom to the measuring device.    For some people, a photon is a dimensionless point traveling on a world line (Eugene Wigner's definition of a particle).    The photons do not have a well defined trajectory. The diagram shows them as if they were little balls travelling along a well defined path, however the photons are delocalised and don't have a specific position or direction of motion.    because photons take all paths, but since their underlying physics is "wavey" different paths can "interfere.    This calculation assumes that light simultaneously travels over all possible paths. To what extent this is just a calculational device and to what extent it reflects an underlying physical reality is a matter of opinion.    Indeed, nothing in nature moves around on all possible paths, in reality it's a field that permeates the vacuum which has quantized solutions.  There are mainly two thoughts:  the photon travels in a straight line, and that explains why it only interacts with a certain atom, meaning, that the photon can only be detected once, and the photon will not interact with the other atoms because they are out of its trajectory  the photon takes all paths, and that is why it truly goes through all possible avenues, explaining experiments like interference     Now these lead to two different propagation pictures. On the top, you can see the photon (EM wavepacket) spreading spherically in all directions. On the bottom, you can see a photon traveling from A to B, taking all possible paths. But which picture could be experimentally proven to be correct? The picture on the top cannot explain why the photon misses all the other atoms, that is, why it is not interacting with other atoms, because all atoms are in its way basically (it spreads spherically). The picture on the bottom cannot explain diffraction, because the photons is shown not to spread like a wave (cannot interfere), but just like a billiard ball on different paths. After the question was closed, I am editing to clarify (to reopen), that (as I understand), the question was closed due to the word "really" and what it physically means for the photon to take all paths, or whether the picture on the top (spherical spread) physically describes what is happening. I now revise these words, and the "physically" is meant here to say "experimentally provable". Question:  Do photons take all paths or not?


In some languages we can remove the subject (and sometimes a verb too) from a sentence. In Toy Story 3, the kid says "Coming!" instead of "I am coming!" to her mother.  My questions are:   1.) Can I say "Coming!" instead of "I am coming!" in English? 2.) If I can, when can I remove the subject and verb? 3.) And would this be considered standard English?   (NOTE: The OP is asking about "ellipsis of subject pronoun + auxiliary", which is a topic that comes up often on grammar and linguistics forums/sites. It is a good question. -- F.E.)

I want to know firstly if it's grammatically correct to start a declarative sentence with "Am". For example:     Am excited about the game today.   Secondly, if it is grammatically incorrect, then I wanted to ask how much "head room" there is for the above usage. I can't think of an example now, nor find one here at english.stackexchange. However I imagine there are usages of the english language that grammatically are illegal, yet have somehow become accepted as colloquial or idiomatic perhaps.


I am trying to understand the permission usage for the cp command in unix.   What are the permissions required for copying a file into a directory What are the permissions required for copying out of a directory?   I'm assuming for my first question, the directory will need execute permissions to perform the operation and the file will need read permissions to read the binary of the file and then the output file will need write permissions.  For the second the directory itself would need execute permissions to perform the copy operation and the file would need read permissions to extract the data from the file.  Can anyone tell me if my logic is flawed?

In my CMS, I noticed that directories need the executable bit (+x) set for the user to open them. Why is the execute permission required to read a directory, and how do directory permissions in Linux work?


When we use uptime, it only shown us the up-time of ours machine since it started from the last time it turning on/shutdown/reboot.  But, what if I want to get the time when our machine started from the very first time when it installed?  Do Linux own this tools? Or any clues about how I can find out the answer of it?

I thought that I could easily check the timestamp of particular files. Then I realized that it wouldn't be so easy when I saw timestamps like 1991.


Many years ago, mid to late 1960s I came across a science fiction book in the local library. It is one of the first science fiction books I ever read, possibly even the very first. I have no idea who wrote it, what the name was or anything else, but I do remember parts of the story line. If anyone there knows this book and can furnish me with some info on it, I would like to try finding a copy.  The story starts with some sort of accident in a laboratory doing research on extreme cold. They experience a power surge in the cooling machinery and generate some sort of odd field that nobody can explain, the theory is that they somehow managed to create some sort of 'negative molecular motion'. For some reason they call in a juvenile delinquent girl, I think the name was Gail, and she is supposed to investigate this phenomenon. She manages to learn the trick, but decides that she doesn't want to tell her supervisors about it, so she fakes a trance. They doctors quickly catch on that she is faking and determine to give her some drugs to make her talk, but she uses the secret of the field to escape. The story jumps forward in time a bit, to where the girl, now grown and married, finds her own child involved with creatures from Jupiter who are experiencing some sort of crisis and need help. The field secret, passed on to the child is somehow used to communicate with these creatures.  That's about all I remember, but I would love to find the book again. If nobody there recognizes this description, can you think of any other places I might try?

In the 1960s I read book--an older children's book, I think--which I loved, and still remember, roughly.  I have no idea what the title is or who the author is, and I'm wondering if anyone knows this one:  Scientists had invented a device which they didn't fully understand, and which had puzzling effects.  For example, when a pencil was put into the machine, it disappeared, and then reappeared inside out: The lead was on the outside.  When people went into the machine, they came back dead, having died from fright.  Finally they sent a very open-minded person into the machine.  She was an artist, I think.  She was able to return alive, and described an alternate universe in which geometry was very different.  I distinctly remember that there were supposedly square triangles or four-sided triangles--or was it three-sided squares?  (This is, of course, a literally contradictory claim, but I didn't see the matter as clearly then.)  Thanks!


Self organizing maps are claimed to be able to visualize/cluster high-dimensional data in a smaller dimensional space.  I have some difficulties in understanding this statement.  Consider a six-dimensional data set; the codebook vector/reference vector is also six-dimensional.  According to the SOM algorithm, updating these reference vectors is also conducted in the six-dimensional vector space.  If we are considering a two dimensional map, how should I understand the map between the six-dimensional data space and two-dimensional map space?

Self-organizing maps are claimed to be an approach for dimensionality reduction. However, I am kind of confused about this claim.  Consider the following example, I have a data set with 200 data points and each data point is represented by a feature vector with 1000 dimensions. Assume I would like to train a map with a $1 \times 2$ grid. In other words, I will map these 200 points to two cells. Just for illustration purposes, suppose the first 100 points are mapped onto the first cell and the latter 100 points are mapped onto the second cell.  From the viewpoint of dimensionality reduction, we can say we use a 1-dimensional output space to represent the original 1000-dimensional space. But this really confuses me a lot. According to this example,  it looks to me that the first 100 points will share the same feature vector, which is just 1 in the one-dimensional space; and the latter 100 points will share the same feature vector, which is 2 in the same one-dimensional space. Is my understanding correct?


pls help     Caused by: java.lang.NullPointerException: Attempt to invoke virtual   method 'android.view.View android.widget.TextView.findViewById(int)'   on a null object reference           at com.example.c1.firebaselogin.ClockActivity.onCreate(ClockActivity.java:61)   AlarmManager alarmManager; private PendingIntent pending_intent;  private TimePicker alarmTimePicker; private TextView alarmTextView;  private AlarmReceiver alarm;   ClockActivity inst; Context context;  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);        this.context = this;      //alarm = new AlarmReceiver();     alarmTextView = (TextView) findViewById(R.id.alarmText);      final Intent myIntent = new Intent(this.context, AlarmReceiver.class);      // Get the alarm manager service     alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);      // set the alarm to the time that you picked     final Calendar calendar = Calendar.getInstance();      alarmTimePicker = (TimePicker) findViewById(R.id.alarmTimePicker);        Button startalarm;     startalarm = (Button)findViewById(R.id.start_alarm);     startalarm.setOnClickListener(new View.OnClickListener() {         @TargetApi(Build.VERSION_CODES.M)          @Override         public void onClick(View v) {              calendar.add(Calendar.SECOND, 3);             //setAlarmText("You clicked a button");              final int hour = alarmTimePicker.getCurrentHour();             final int minute = alarmTimePicker.getCurrentMinute();;              Log.e("MyActivity", "In the receiver with " + hour + " and " + minute);             setAlarmText("You clicked a " + hour + " and " + minute);               calendar.set(Calendar.HOUR_OF_DAY, alarmTimePicker.getCurrentHour());             calendar.set(Calendar.MINUTE, alarmTimePicker.getCurrentMinute());              myIntent.putExtra("extra", "yes");             pending_intent = PendingIntent.getBroadcast(ClockActivity.this, 0, myIntent, PendingIntent.FLAG_UPDATE_CURRENT);              alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pending_intent);               // now you should change the set Alarm text so it says something nice               setAlarmText("Alarm set to " + hour + ":" + minute);             //Toast.makeText(getApplicationContext(), "You set the alarm", Toast.LENGTH_SHORT).show();         }      });      Button stop_alarm= (Button) findViewById(R.id.stop_alarm);     stop_alarm.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View v) {               int min = 1;             int max = 9;              Random r = new Random();             int random_number = r.nextInt(max - min + 1) + min;             Log.e("random number is ", String.valueOf(random_number));              myIntent.putExtra("extra", "no");             sendBroadcast(myIntent);              alarmManager.cancel(pending_intent);             setAlarmText("Alarm canceled");             //setAlarmText("You clicked a " + " canceled");         }     });  }  public void setAlarmText(String alarmText) {     alarmTextView.setText(alarmText); }    @Override public void onStart() {     super.onStart();     inst = this; }  @Override public void onDestroy() {     super.onDestroy();      Log.e("MyActivity", "on Destroy"); }   my line 61 is startalarm = (Button)findViewById(R.id.start_alarm);  and my xml is  <Button         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="Set alarm"         android:id="@+id/start_alarm"         android:onClick="startTimer"         android:layout_alignParentLeft="true"         android:layout_alignParentStart="true"         android:layout_marginTop="8dp"         app:layout_constraintTop_toBottomOf="@+id/alarmText"         android:layout_marginLeft="63dp"         app:layout_constraintLeft_toLeftOf="parent"         app:layout_constraintBottom_toBottomOf="parent"         android:layout_marginBottom="8dp"          />   thank you

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?


I have a sentence and am trying to convert it into a question form.  The sentence goes like this:     Barack Hussein Obama is the 44th President of the United States.   Can  anybody please convert it into a question form?

How to ask the position(?) of a president (like 10th) of a country, correctly?


The  tag seems to having no meaning on it’s own. It has questions about:   Database tables HTML tables ADO.NET table class Generating tables in Word documents   (and that was only the first page of questions when I looked!)  The fact it has no wiki summary make me think no one can define what it means.  The fact it has about 16,000+ questions make it more important that it is sorted out.

Related questions:     (This led to founding of )   The tag  has become cluttered with all kinds of questions ranging from sql tables (for all DBM systems, HTML tag <table>, outputting content in any language (PHP, C#, LaTeX to name a few) as a table and several plugins of various languages and/or IDEs (like jTable, tablesorters and the kind).  The current count stands at 18,315 questions having this ambiguous tag. A few of possible suggestions for cleaning process:    +  to  |   +  to  |   +  to  |   +  to  |   + other-specific-DBM systems to whatever_DBM_it_is-table  +  to  |    Since I've no idea about other languages and their specific features regarding table, I'd ask the community for their input on this (such as , ,  and ). The other questions are either tagged with arrays or sql and similar tags, and in my opinion, just removing  from such questions would be enough!


I'm currently using the updated OSM tools to generate isochrones in QGIS 3.4, which works well (example below).  My question is just what methods other people use and whether there is something better (e.g. live traffic information - I can dream). I have seen a variety of methods online, but I am specifically interested in methods with QGIS 3.4 - I know it can be done other ways of course but I want to make sure I'm not missing anything.

I'm new to QGIS and have tried to create isochrones around points for quite some time. Is there any option to create isochrones on the GUI in QGIS?    I know how to create them using pgAdmin (using eg underdark's explenation and example ()), but I would like to be able to create them using only QGIS.    There is one layer which contains the geocoded addresses around which I need to create the isochrones. It would be great to be able to create different sized isochrones  I've tried to find a plugin or any other option to do this, but nothing seems to work.  I'm using QGIS 2.4.0 on Ubuntu.


I have a transform matrix which works as intended for game objects I want to be completely controlled by my camera:  _transform = Matrix.Identity *     Matrix.CreateTranslation(-_position.X, -_position.Y, 0) *     Matrix.CreateRotationZ(_rotation) *     Matrix.CreateTranslation(origin.X, origin.Y, 0) *     Matrix.CreateScale(new Vector3(_zoom, _zoom, _zoom));   I expose this to my drawing and use the following SpriteBatch.Begin() overload:  sb.Begin(SpriteSortMode.Deferred,      BlendState.AlphaBlend,      SamplerState.PointClamp,      DepthStencilState.None,      RasterizerState.CullCounterClockwise,      null,      view.Transform);      This works as expected. No problems.  However, I have an object which controls it's own translation as it's a fake star field. I didn't want to have to generate potentially millions of stars to be drawn in order for it to be translated about, so the star field just loops them back to the opposite side if they past the edge of the screen. Zoom just acts really bizarrely. It's not being zoomed into the middle of the screen like it should. At some high zoom value it just swipes off the screen. I initially was having an issue with the rotation but after reordering via trial and error I was able to use the correct sequence of transforms. Here's what I'm currently doing:  _transformNoTranslation = Matrix.Identity *     Matrix.CreateTranslation(origin.X, origin.Y, 0) *     Matrix.CreateRotationZ(_rotation) *     Matrix.CreateScale(new Vector3(_zoom, _zoom, _zoom)) *     Matrix.CreateTranslation(-Origin.X, -Origin.Y, 0);   And here's what it looks like:    How do I get the zoom to work correctly?  As a side question, any ideas as to why the ship jutters at high speeds? I don't plan to ever be at those high speeds during game play so it's not a huge cause for concern. Some kind of precision error with the high translation values?

I have some models that I want to rotate using quaternions in the normal manner, except instead of rotation about the origin, I want it to be offset slightly. I know that you don't say, in 3d space, that you rotate about a point; you say you rotate about an axis. So I'm visualizing it as rotating about a vector whose tail is positioned not at the local origin.  All affine transformations in my rendering / physics engine are stored using SQT (scale, quaternion, translation; an idea borrowed from the book Game Engine Architecture.) So I build a matrix each frame from these components and pass it to the vertex shader. In this system, translation is applied, then scale, then rotation.  In one specific case, I need to translate an object in world space, scale it, and rotate it about a vertex not centered at the object's local origin.  Question: Given the constraints of my current system described above, how can I achieve a local rotation centered about a point other than the origin? Automatic upvote to anyone who can describe how to do this using only matrices as well :)


So, I'm creating an optimized Rogue-Druid combination for an extremely in-depth homebrew campaign. Normally I wouldn't use this kind of build, but there are flavor reasons for doing so. This is the lay-out I have currently (+2 Racial LA from Fey'ri fully bought off):  Druid 2 (Dragon Compendium Urban Druid variant -- 1st level only) / Rogue 1 (Wilderness Variant) / Planar Shepherd 10 / Face in the Dark 2 [Campaign homebrewed PrC -- 9/10 divine progression, 1st level no casting progression]  I'm using these items to help with the prereqs for classes:  Wild Shape Amulet [40,000 GP, Throat] (Faerun, 167): You can wild shape as if you were a druid of four levels greater, to a maximum of 20. A pair of +2 Deadly Precision Daggers (Complete Adventurer, 127)  As it stands I've traded away 2 levels of my druid progression. With the Natural Bond feat and Wild Shape Amulet I can handle the animal companion/wild shape progression, since those compensate for it. Please also note: The feat from Complete Scoundrel that combines Rogue/Druid levels is not allowed by the DM. My problem, however, lies in that I'm not fond of losing 2 levels of spell-caster classes.  So, to the root of my question: Is there any way (Items, Feats, etc) I can regain these two levels? This really applies to all multiclassing losses of caster levels. In all my research and reading I do not recall coming across anything that boosts actual Spell Casting, not just CL. Note: It must come from one of these sources:  Core: DMG I-II, PHb I-II, MM I-IV and the EPH Deities & Demigods Races of: The Wild, Stone, Destiny, Ebberon, Faerun & Dragon Complete: Adventurer, Arcana, Scoundrel, Mage, Divine, Champion, Warrior & Psionic Tome of: Battles & Magic Stormwrack Sandstorm Dragon Magic Magic Items Compendium Spell Compendium Draconomicon Drow of the Underdark Campaign Setting: Ebberon and the Forgotten Realms Fiend Folio Unearthed Arcana Libris Mortis Heroes of: Horror & Battle Fiendish Codex I & II Lords of Madness Book of: Exalted Deeds & Vile Darkness Dragon Compendium Miniatures Handbook

I am making an arcane/divine multiclass to later prestige as a mystic theurge. I have 'practices spellcaster' twice, as to have full caster level in both spellcaster classes. My question is if there is something similar I could do so I could advance spells known like my full character level. Or is that an unavoidable drawback with the arcane/divine multiclass-prestigeclass? When I get to lvl 7, I could get the first level of mystic theurge, but is counted as lvl 4 of his both base classes when determining spells known & per level. If there was something to make it Count that as lvl 7 as well, it would truly be super


When you evolve a pokemon its moves are randomized and you get a new set of moves based on the new evolution.   Are the moves completely random or is there any correlation, any way to predict what moves there might be except checking for possible moves in websites like:

You may already know that if you catch two Pidgeys, they may have a different skillset.  I've also seen that evolving them from different skillsets will also create Pidgeottos with different skillsets.  Are those skills chosen randomly or do they follow a specific pattern? (Like Pidgey pattern 1 will always evolve into Pidgeotto pattern 1.)  If they are specific, is there a website to check for them?


Question: Look at already answered question.  Same.

Let $f$ be differentiable on $\Bbb{R}$ and let $\lim_\limits{x\to \infty}f(x)=\lim_\limits{x\to -\infty}f(x)=0$. Prove there exists $a\in \Bbb{R}$ such that $f'(a)=0$.  Attempt: If $f$ is constant we are done. Otherwise, $f$ is not constant. Suppose there is no such $a$. Then, in particular, $f$ has no extremum $\implies$ $f$ has no point where is goes from increasing to decreasing or from decreasing to increasing. $f$ is continuous since it is differentiable. Hence, since $\lim_\limits{x\to \infty}f(x)=\lim_\limits{x\to -\infty}f(x)=0$, $f$ must be constant. A contradiction. Therefore either $f$ is constant and $f'(x)=0$ everywhere, or $f$ has an extremum at $x=a$ and $f'(a)=0$.   I feel like my attempt is not formal enough, any correction?  I would appreciate your help.


Currently i have an Acer Aspire 2930 with 3 GB RAM,and according to the net,Lubuntu is the lightest Ubuntu derivative.  Can you guys tell me technically (But not to technical) how could Lubuntu become lighter than normal Ubuntu ? What are advantages and disadvantages of each OS ?  Should i choose Lubuntu or Ubuntu to be Dual-booted with Windows 7 on my Aspire ?  Sorry for this such question,i'm just new to Ubuntu

With the plethora of potential interfaces available   lxde, openbox, fluxbox xfce, gnome2, gnome3, unity-3d, unity-2d etc,    my question is - what is meant by "the lightest desktop interface" - and can you now consider Unity-2d as "Light"?  Any guidance on the pro's and con's would be extremely useful for my evaluation - my target computer is a    Pentium 4 1.3Ghz, 512Mb, 32GB HDD, 1024x768 Monitor, Geforce FX5500 256Mb AGP    I would like to use it for web-browsing such as youtube, google-earth, simple graphical picture editing and word processing - all aimed for school student aged 10-15 yrs.


want to search sting and need part of string  example.txt:  CREATE MULTISET TABLE $$ENV$$_TEMP_ESM.EMPASGMTAMPTMPRTRSE ,NO FALLBACK , NO BEFORE JOURNAL, NO AFTER JOURNAL, CHECKSUM = DEFAULT, DEFAULT MERGEBLOCKADSRATIO   its should find $$ENV$$_TEMP_ESM.EMPASGMTAMPTMPRTRSE and i need only TEMP_ESM.EMPASGMTAMPTMPRTRSE or after $$ENV$$_ in what ever string is there need that string, i don't want to print next string

want to search string and need part of string  file.txt:  CREATE MULTISET TABLE $$ENV$$_TEMP_ESM.EMPASGMTAMPTMPRTRSE, NO FALLBACK ,      NO BEFORE JOURNAL,      NO AFTER JOURNAL,      CHECKSUM = DEFAULT,      DEFAULT MERGEBLOCKADSRATIO   while using below sed command getting extra value  Output:   bash-4.3$ sed -n 's/.*$$ENV$$_//p' file.txt  **TEMP_ESM.EMPASGMTAMPTMPRTRSE** ,NO FALLBACK ,   I need only TEMP_ESM.EMPASGMTAMPTMPRTRSE


I would like to quote something and then add another point in the text for example:  first part [other stuff] second part  I would like to be able to use first part and then second part in the same quote without using the filler in the middle, how can I do this?

Imagine I want to quote this text (the parts in bold):     If there were such a thing, I think I'd be a champion. You know, baking under dangerous conditions, high-speed frosting... all hypothetical examples, obviously. Of course assuming I don't live in a madhouse.   Should I quote it with 4 dots, because I'm skipping a full sentence?     If there were such a thing, I think I'd be a champion. . . . Of course assuming I don't live in a madhouse.


I have a project which consists of multiple .tex files, which I am typesetting using Texworks. Clicking the source code in any file while holding the Alt key shows correctly the corresponding position in the pdf and vice versa. However, clicking the typeset button only works in main.tex or main.pdf but does not work e.g. in chapter1.tex (does not have the header and is not a standalone .tex file and Texworks does not realize it needs to start building main.tex which includes chapter1.tex).  It is quite upsetting as I am mostly editing the chapters and clicking the button in the toolbar just gives me errors and then I have to go and search for main.tex and click it there. Is there a way to script Texworks or annotate the .tex files so that the typeset button works from any file?   For now I have hidden the toolbar in the chapter windows so that I dont click it by mistake but it is still not very user-friendly.

Occasionally, I see other people's documents starting with two lines like that:  % !TEX TS-program = xelatex % !TEX encoding = UTF-8 Unicode   It's clear to me that the first line declares the engine that should be used for compilation, and the second lines states the text encoding of the input file. It's not clear to me, however, when and why I should use such expressions.  More detailed questions on this subject matter would be:   How can I compile without determining which engine I want to use so that I would even need that comment? Which editors/programs pick up on these directives? Who introduced them? Is there any "documentation" of possible values etc.? Are there more such expressions? Are they standardized in any way? Can I add options to the compilation engine, e.g. pdflatex -enable-write18 or xelatex -interaction=nonstopmode? What does the "TS" in TS-program stand for? What additional value does the encoding line provide if I'm already using inputenc? Are there any downsides to using them or reasons not to use them?   Meta: Even though it technically contains multiple questions, I'm pretty sure this question conforms with our standards as a catch-all question on a narrow topic. I guess I know some partial answers to some of my questions, but I'll leave that up for people who have experience with these expressions. I just wanted to provide a question that allows for a maximal amount of information on this subject matter.


How will we add this series?  Any simple process? This is one of the equation derived from the equation to find intesity of ray at any particular point in Fraunhofer diffraction. I think this can be solved using simple series but my teacher told any process involving Imaginary part iota, which I couldn't understand.

How can we sum up $\sin$ and $\cos$ series when the angles are in arithmetic progression? For example here is the sum of $\cos$ series:  $$\sum_{k=0}^{n-1}\cos (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \cos \biggl( \frac{ 2 a + (n-1)\cdot d}{2}\biggr)$$  There is a slight difference in case of $\sin$, which is: $$\sum_{k=0}^{n-1}\sin (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \sin\biggl( \frac{2  a + (n-1)\cdot d}{2}\biggr)$$   How do we prove the above two identities?


The word "please" is similar to "kindly". But somehow when I thought of using them, the approach is kind of different.   When using "please" you'd like to ask for assistance. While using "kindly", somehow seems like giving a direct command.  Do they really have difference or it just has to do with how you deliver it?

Manager to player       Kindly practice every day     Please practice every day    Teacher to student       Kindly wipe the blackboard     Please wipe the blackboard    Student to teacher       Kindly give me a blank paper     Please give me a blank paper    Sister to brother      Kindly pass the butter     Please pass the butter    Which is correct usage in the above contexts?


$A \triangle C = B \triangle C$ then $A = B$.  I am a bit stuck because how can I show that both $A$ and $B$ relate since as I see it, they only relate to $C$?

I don't quite yet understand how $\oplus$ (xor) works yet. I know that fundamentally in terms of truth tables it means only 1 value(p or q) can be true, but not both. But when it comes to solving problems with them or proving equalities I have no idea how to use $\oplus$.  For example: I'm trying to do a problem in which I have to prove or disprove with a counterexample whether or not $A \oplus B = A \oplus C$  implies $B = C$ is true.   I know that the venn diagram of $\oplus$ in this case includes the regions of A and B excluding the areas they overlap. And similarly it includes regions of A and C but not the areas they overlap. It would look something like this:    I feel the statement above would be true just by looking at the venn diagram since the area ABC is included in the $\oplus$, but I'm not sure if that's an adequate enough proof.  On the other hand, I could be completely wrong about my reasoning.    Also just for clarity's sake: Would $A\cup B = A \cup C$ and $A \cap B = A \cap C$ be proven in a similar way to show whether or not the conditions imply $B = C$? A counterexample/ proof of this would be appreciated as well.


I'm new to the Parallel class in .NET. I have this basic code:          List<Action> actions = new List<Action>();          for (int iter = 1; iter <= 5; iter++)         {             actions.Add(() =>             {                 // create a local copy of iter, and an action to write it to the console                 int theProblem = iter;                 Console.WriteLine(theProblem);             });         }          Parallel.Invoke(actions.ToArray());          /*         Output:         6         6         6         6         6         */   I would expect this to print 1..5 in some random order, but instead it prints out the value of iter after the loop ends.  Why is this? At what point are the actions actually created, and the line int theProblem = iter; executed?  I found a TON of information online about Parallel.For and Parallel.ForEach (not so much for Parallel.Invoke), but nothing explaining specifically what goes on in a very basic case like this one.  What modifications do I need to make to have the code above print 1..5 (in some random order)?  Thanks a lot!  EDIT:  This question has been marked as a duplicate, but I don't think it is:   All except one of the responses in the other question refer to sigle-threaded code, this is multi-threaded. None of the responses refers to Parallel.Invoke (or to any other method in the Parallel class for that matter). My code sample already implements the solutions proposed in the other question (create a copy of the variable inside the loop), and yet it's not working.   So, clearly not a dupe.  EDIT 2:  Turns out that this is actually a dupe under the hood. The gist of it is to create the local copy of the variable inside the loop but outside the lambda (duh!) and then everything works just as expected.  Thanks everyone!

I met an interesting issue about C#. I have code like below.  List<Func<int>> actions = new List<Func<int>>();  int variable = 0; while (variable < 5) {     actions.Add(() => variable * 2);     ++ variable; }  foreach (var act in actions) {     Console.WriteLine(act.Invoke()); }   I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s.  It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output.  Is there a way to work round this limit to have each action instance have its own captured variable?


I'm noob in database. So don't mind if its a silly question.This is used in my application and is the first one. I need a database design for it.    value 4 is dependent on the other value 1,2&3. even if one of the value changes the combination changes and the fourth value is affected. Each of the value 1,value 2,value 3 are independent on each other. Many-to-many relation between value 1,value 2 and value 2,value 3. value 4 is not derived or computed but a distinct value for all the combinations. So how can I design a database for it?

I have four columns. All columns are varchar fields. Three of them are independent and distinct fields having many to many relation between them and the fourth one is dependent on the combination of first three. so for all the combinations of three columns there is different value for the fourth column. Now I want a design for data like this. Any help is appreciated.


I am facing issue with script execution in cron. Same script working fine on terminal and cron under bash version 4.3. But cron is failing for lower bash version.  I want to save command output in file in script like  #!/bin/bash newendcount=$(/bin/cat error_files.log | wc -l) echo $newendcount > /tmp/var.txt   with terminal it is working fine but with cron it not storing line count value, instead giving 0 as result. But same script working properly on terminal.  cronjob is like  * * * * * /bin/bash script.sh > /tmp/output.txt   I editing this question. As I got a solution to my issue. it was because of environment variable mismatch. I have added a line " . /root/.profile " at top of script and now cron is working as expected

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


I am new to Ubuntu, using 14.04. I have installed XAMPP but when I am trying to run it, I get an error about another web server already running.

I want to find a list of all network services running on my system, including details of the port and services and the users. I know that I need to use netstat, ps and fuser. but I don't know how to write the command. Do I need to write a shell script to find all of them? or I can use in a line of commands? Thanks for your help.


My   can make three attacks per round using Greater Two-weapon Fighting. I'm debating taking the feat —I already meet the prerequisites—which grants 2 wing attacks that are secondary natural attacks. Can I make, in the same round, three normal attacks and the two wing attacks?

I have a level 1 Synthesist Summoner.  Since he has the Quadruped base Eidolon, when fused, my Summoner has a bite attack (Primary). In addition, I have spent evolution points on a tentacle (Secondary). Finally, my Synthesist carries around an Axe, with which he can make weapon attacks.  If I were to use the Full-Attack option, what attacks could I make, and at what penalties? Let's assume I want to always use the Axe, where possible.  How does this interact with the eidolon's natural attack limit? (3 at first level)


I have the following struct   struct vertice_t{     char city;     char connectedBy;     unsigned short airportCost;     unsigned short primKey;     int queueIndex;     struct adjacency_list_t * adjacencyList; };  struct adjacency_list_t{     struct adjacency_list_node_t *  first;     struct adjacency_list_node_t *  last; };  struct adjacency_list_node_t{     unsigned short weight;     struct vertice_t *  vertice;     struct adjacency_list_node_t * next; };   When I do sizeof(struct vertice_t) I get the value 24. But I can see by myself that this struct only takes 1 + 1 + 2 + 2 + 4 + 8 = 18Bytes  Why does this happen? Is there anyway I could compress the data in the struct above to make it smaller? This is for a project and I need to reduce the whole memory usage by 30%.  Thanks!

Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members?


I was wondering how can I remove all empty values when I explode a string using PHP for example, lets say a user enters ",jay,john,,,bill,glenn,,,"?  Thanks in advance for the help.  Here is part of the code that explodes user submitted values.  $tags = explode(",", $_POST['tag']);

PHP's explode function returns an array of strings split on some provided substring. It will return empty strings when there are leading, trailing, or consecutive delimiters, like this: var_dump(explode('/', '1/2//3/')); array(5) {   [0]=>   string(1) "1"   [1]=>   string(1) "2"   [2]=>   string(0) ""   [3]=>   string(1) "3"   [4]=>   string(0) "" }  Is there some different function or option or anything that would return everything except the empty strings? var_dump(different_explode('/', '1/2//3/')); array(3) {   [0]=>   string(1) "1"   [1]=>   string(1) "2"   [2]=>   string(1) "3" }


I'd like to understand better the assertion that planets are spheres because of gravity.  The thing which I believe is true, but don't completely get, is that any arrangement of a sufficient number of molecules, all with zero velocity, in isolation from anything else, will over time form a sphere due to gravitational attraction between the molecules.  If this is true, what is the argument for why this will happen? (i.e. what is the proof that I can't construct a weird initial arrangement of molecules for which it won't happen?) Can we do some math and see it pop out? If this is false, what additional stipulations do I need?

Is it possible to use the Lagrangian formalism involving physical terms to answer the question of why all planets are approximately spherical?  Let's assume that a planet is 'born' when lots of particles of uniform density are piled together, and constrained only by the Newtonian gravity of the $N$ particles with no external gravity.    My question is: Is it possible to use the variational calculus starting from this situation to prove that planets should be spherical?


We know Euler's formula  $$e^{i \theta} = \cos(\theta) + i \sin(\theta)$$   Let say $$\theta=\frac{\pi}{2}$$ Then we will get $$e^{i \frac{\pi}{2}} = \cos(\frac{\pi}{2}) + i \sin(\frac{\pi}{2})$$ As we can see    $$e^{i \frac{\pi}{2}} =  i$$  Then we can wright...       $$i^i = i^{e^{i \frac{\pi}{2}}}$$  or $$i^i = (e^{i \frac{\pi}{2}})^i = e^{-\frac{\pi}{2}} \approx 0.208$$ As we can see the result is as Real number. It is not an imaginary number! Did I compute it correctly? I think that I made little mistake above instead of $\theta=\frac{\pi}{2}$ I should wrote $\theta=\frac{\pi}{2} +2\pi k $ ,  $ k\in N\cup {0}$ $$e^{i {(\frac{\pi}{2}+2\pi k})} =  i$$  $$i^i = (e^{i (\frac{\pi}{2}+2\pi k)})^i = e^{-\frac{\pi}{2} - 2\pi k}$$ So... $$k = 0 \implies e^{-\frac{\pi}{2}} \approx 0.208 $$ $$k = 1 \implies e^{-\frac{\pi}{2} - 2\pi} \approx 3.882*10^{-4} $$ $$k = 3 \implies e^{-\frac{\pi}{2} - 6\pi} \approx 1.354*10^{-9} $$  Is it true that: As we can see $ {i}^{i} $ has a lot of answers!? I mean it has as many answers as many natural number exists! Are all answers as a real number?

According to WolframAlpha,  but I don't know how I can prove it.


How to sum the series: $$\sum_{1}^{\infty}\frac{1}{n^2(n+1)}$$ I do not see any pattern if I try to see it for induction. How to solve this problem?

I am looking at some homework where I have:  $\sum_{n=1}^\infty \frac{1}{n^2(n+1)}$  How can I sum this?   I know that   $\sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}$  and also that  $\sum_{n=1}^\infty \frac{1}{n(n+1)}=1$  But I just can't see or find the connection


I need shell script to delete all files older than 30 days from FTP server directories. I need to delete files from 5 different directories which are older than 30 days, should not delete the directories because they might have other files, have to delete only files older than 30 days. This is the first time I am working on shell script. tried following link no luck. can anyone help me on this.    below is the code I am using in my .sh file but I am facing invalid command error  ftp -inv $HOST <<EOS user $ftp_user $ftp_pass find /path/somefolder/ -type f -iname '*' -mtime +30 -exec rm {} \; quit EOS   Need to check if file is older than 30 days if it is older delete it from the directory.

I'm writing a bash script that needs to delete old files.  It's currently implemented using :  find $LOCATION -name $REQUIRED_FILES -type f -mtime +1 -delete   This will delete of the files older than 1 day.  However, what if I need a finer resolution that 1 day, say like 6 hours old? Is there a nice clean way to do it, like there is using find and -mtime?


I am making high poly model for a gun using subdivision surface modifier, in the pic you can see the barrel with a hole in it but the control loops deform the curvature of the barrel as in it isn't round anymore. How do you make holes in a cylinder sharp using subdiv? Or you shouldnt use subdiv?

I'm trying to delete those ugly lines visible in the cylindrical shape of the lens. What is causing them is the added edge loops I made for the protruding detail with the switch. The problem is that if I delete those edges, it'll look even worse because of the n-gons. Any ideas?


I am trying to make a script that creates or modify a series of users in batch in several servers, this by means of ssh. The point is that the encrypted keys that I put in it, it does not take them completely because it cuts them due to special characters. And I tried to place in various ways, changing quotes, putting backslashes and I can't find the issue. ssh root@$i usermod -p '$5$aayZzgdx$udJJR1KWiDQbRBLSQAdCwDO.41nPSQ6La6mZacqA5H\' ogm021  The password is taked like this: .41nPSQ6La6mZacqA5H\  Please, can give me a hand.

ssh has an annoying feature in that when you run:  ssh user@host cmd and "here's" "one arg"   Instead of running that cmd with its arguments on host, it concatenates that cmd and arguments with spaces and runs a shell on host to interpret the resulting string (I guess that's why its called ssh and not sexec).  Worse, you don't know what shell is going to be used to interpret that string as that's the login shell of user which is not even guaranteed to be Bourne like as there are still people using tcsh as their login shell and fish is on the rise.  Is there a way around that?  Suppose I have a command as a list of arguments stored in a bash array, each of which may contain any sequence of non-null bytes, is there any way to have it executed on host as user in a consistent way regardless of the login shell of that user on host (which we'll assume is one of the major Unix shell families: Bourne, csh, rc/es, fish)?  Another reasonable assumption that I should be able to make is that there be a sh command on host available in $PATH that is Bourne-compatible.  Example:  cmd=(   'printf'   '<%s>\n'   'arg with $and spaces'   '' # empty   $'even\n* * *\nnewlines'   "and 'single quotes'"   '!!' )   I can run it locally with ksh/zsh/bash/yash as:  $ "${cmd[@]}" <arg with $and spaces> <> <even * * * newlines> <and 'single quotes'> <!!>   or  env "${cmd[@]}"   or  xterm -hold -e "${cmd[@]}" ...   How would I run it on host as user over ssh?  ssh user@host "${cmd[@]}"   obviously won't work.  ssh user@host "$(printf ' %q' exec "${cmd[@]}")"   would only work if the login shell of the remote user was the same as the local shell (or understands quoting in the same way as printf %q in the local shell produces it) and runs in the same locale.


I have a VERY long list of tuples e.g. [(1,2), (18,485), (284,475)....]. I also have a for loop, which will perform a function on groups of these tuples. I want the loop to be executed on the first 68 tuples, then the next 68 tuples, then the next 68 tuples, and so on until it has been done on all tuples (the total number of tuples is divisible by 68, by the way).  I thought first to group the tuples into separate lists of 68, but then wondered if it is more efficient to do something using the "in range(68)" function? I just do not know how to get the for loop to then move onto the next set of 68 tuples and to not re-read the first 68 tuples.   I do not yet have much code, just       tuple1= new_tuple # changing tuple of tuples to list of tuples     list_of_tuples = list(tuple1)      # here I want to either split the list into mini-lists of 68, or start the for loop for the first 68 tuples, then the next 68 etc.       #the for loop:       for z in SOMETHING?       d = z       mdata = []        for p, k in combinations(d,2):          distance = math.sqrt( ((p[0]-k[0])**2)+((p[1]-k[1])**2) )         mdata.append(distance)   I dont think this helps much though. Would really appreciate any help or even just advice. Thanks in advance.

I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question:


*NOTE, this question has been asked before here, yet I wasn't any less confused after reading the answers. *  Is the k-nearest neighbour algorithm a discriminative or a generative classifier? My first thought on this was that it was generative, because it actually used Bayes's theorem to compute the posterior. Searching further for this, it seems like it is a discriminative model, but I couldn't find the explanation.   So is KNN discriminative first of all? And if it is, is that because it doesn't model the the priors or the likelihood?

It seems that KNN is a discriminative learning algorithm but I can't seem to find any online sources confirming this.  Is KNN a discriminative learning algorithm?


I am looking for some simple explanation about the representation of finite groups more specific of lie groups. So far I know it's a display from the group $\mathbb{G}$ to the $GL_n(\mathbb{F})$, but this doesn't tell me much to have a good understanding. Why this functions- displays are important what they tell us about the group? Why they are useful? Thanks!

Representation theory is a subject I want to like (it can be fun finding the representations of a group), but it's hard for me to see it as a subject that arises naturally or why it is important. I can think of two mathematical reasons for studying it:   The character table of a group is packs a lot of information about the group and is concise. It is practically/computationally nice to have explicit matrices that model a group.   But there must certainly be deeper things that I am missing. I can understand why one would want to study group actions (the axioms for a group beg you to think of elements as operators), but why look at group actions on vector spaces? Is it because linear algebra is so easy/well-known (when compared to just modules, say)?  I am also told that representation theory is important in quantum mechanics. For example, physics should be $\mathrm{SO}(3)$ invariant and when we represent this on a Hilbert space of wave-functions, we are led to information about angular momentum. But this seems to only trivially invoke representation theory since we already start with a subgroup of $\mathrm{GL}(n)$ and then extend it to act on wave functions by $\psi(x,t) \mapsto \psi(Ax,t)$ for $A$ in $\mathrm{SO}(n)$.   claims that if our physical system has $G$ as a symmetry group, then there is a correspondence between particles and representations of $G$. I'm not sure if I understand this correspondence since it seems to be saying that if we act an element of G on a state that corresponds to some particle, then this new state also corresponds to the same particle. So a particle is an orbit of the $G$ action? Anyone know of good sources that talk about this?


I'm reading about copy-constructors and the differences between copy initialization and direct initialization. I know that copy and direct initialization differ only for (user-defined) class types and that the first implies sometimes an implicit conversion (by a converting constructor).For example if I could initialize an object of class A:  class A {   public:     // default constructor     A() : a(1) {}     // converting constructor     A(int i) : a(i) {}     // copy constructor     A(const A &other) : a(other.a) {}   private:     int a; };  int main() {   // calls A::A(int)   A a(10);   // calls A::A(int) to construct a temporary A (if converting constructor is not explicit)    // and then calls A::A(const A&) (if no elision is performed)   A b=10;   // calls copy constructor A::A(const A&) to construct an A from a temporary A   A c=A();   // what does this line do?   A d(A()); }    I read that the last line does not create an A by direct initializing d from a temporary A() but it declares a function named d,which returns an A and takes an argument of function type ( a pointer to a function really ). So my question is, is it true? and if it's true, how can I perform direct initialization of an object from a temporary like:  type_1 name(type_2(args));   assuming that type_1 has a contructor that takes a parameter of type type_2  is it something that can not be done?

Is there any good reason that an empty set of round brackets (parentheses) isn't valid for calling the default constructor in C++?  MyObject  object;  // ok - default ctor MyObject  object(blah); // ok  MyObject  object();  // error   I seem to type "()" automatically everytime. Is there a good reason this isn't allowed?


How can I revert the following: (running  Kubuntu 14.10)  This is what I did before my WiFi and LAN both got their untimely death.  I did a:  sudo apt-get install --reinstall linux-headers-generic build-essential   After that, I compiled and install the driver as follows -   Download the latest backported driver package from  Copy the downloaded tar.bz2 package to your Ubuntu Desktop > Right-click > Extract here. Open a terminal and run the following commands one-by-one:  cd Desktop/backports-3.18-rc1-1 make defconfig-ath9k make sudo make install

I used source code to build one package such as below:  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libexecdir=/usr/lib --with-package-name="Myplugin" --with-package-origin="http://www.ubuntu.org/" --enable-gtk-doc --disable-static make make install   But unfortunately, i discovered that its the latest version, and has lot of bugs, so i need to remove it/uninstall it. But how can i do so? I tried make clean; make uninstall but still i see it exist:  # pkg-config --list-all | grep Myplugin myplugin-.... $ ls /usr/lib/myplugin/libXYZ.so exist....   How do you remove this now?


I've recently upgraded my notebook from Ubuntu 18.04 to 20.04.1. After the upgrade, I experience this:  If an external monitor is attached during logging in or turning on, I get very small font sizes on the top bar, desktop icons, and activities. I can resolve this manually every time by going to Settings -> Universal Access and then enable and disable LargeText. (LargeText is disabled by default.)  If I log in without an external monitor, the font size is normal, even when I attach a monitor after logging in.   Both built-in and external displays have resolutions 1920×1080. This is annoying, so is there any way to log in with the attached monitor and get normal font sizes?

So I was configuring VS code on my Notebook when suddenly I noticed that my interface font got really small on my desktop, terminal and files. I use Gnome Tweaks Tool to increase my scaling factor to 1,15 , but, even though it was active, the font stayed tiny. The solution I found was moving my scaling factor, which instantly fixed my font issue, however, every time I restart my Notebook the font gets tiny again and I have to repeat the process. I tried reseting my font configuration using this command, but had no success. gsettings reset org.gnome.desktop.interface text-scaling-factor  I also tried using the command dconf reset -f /  Finally, I tried using dconf-editor, but still had no success altering the font rendering DPI or changing the scaling factor. All of the steps I mentioned fixed my fonts temporarily, but the issue still persists when I restart my Notebook I am out of ideas and even considered getting a fresh Ubuntu install by now... My video card: NVIDIA GeForce GTX 1050 GPU


How to write this symbol (ξ) in latex in overleaf?

I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?


I looked at "Windows log > Application" and "Windows log > Security". In both cases, I can not find any processes that indicating that the notepad was just launched by me. Does Event Viewer not log the event of launching the application such as notepad?

I need to get a history of which processes have run on my Windows machine, and when they were run.  However, I cannot use any third-party software, as I cannot guarantee that it will always be running.  Is there any way to get this information only using Windows built-in functionality?


Why was $\vec{A}\cdot\vec{B}$ defined as $|\vec{A}||\vec{B}|\cos \theta$? Historically what is the underlying idea?

The fact that the dot product and the cosine of the angle between two vectors are mutually computable is easy to show (see the two sides in the two answers at ).  But looking at the dot product, I would never have thought that it somehow captures something about the angle (and vice versa).  How did the connection get discovered? Who were the major players? Did it just fall out of the development of matrix operations for linear algebra (or did the dot product come first) or are these only related by hindsight or what?


INFO - This is Biber 2.12 INFO - Logfile is 't01_txt.blg' INFO - Reading 't01_txt.bcf' ERROR - Error: Found biblatex control file version 3.6, expected version 3.5. This means that your biber (2.12) and biblatex (3.13a) versions are incompatible. See compat matrix in biblatex or biber PDF documentation. INFO - ERRORS: 1  HOw can i solve this problem. I am using TexMaker.

I'm trying to compile a document that only works with an up-to-date distribution, so I'd like to know: how do I update my distribution? Please provide screenshots where appropriate.  List of answers           To keep an eye on what’s going on at CTAN you may subscribe to the  or the RSS feed feed://www.mail-archive.com/ctan-ann@dante.de/maillist.xml


In my physics class, for deriving the Lorentz transformatuons my professor assumed that there is a linearity relatioin between the coordinates of the two systems. But why is that?? Can anyone please give a simple explanation? I couldn't find any.

In almost all proofs I've seen of the Lorentz transformations one starts on the assumption that the required transformations are linear. I'm wondering if there is a way to prove the linearity:  Prove that any spacetime transformation $\left(y^0,y^1,y^2,y^3\right)\leftrightarrow \left(x^0,x^1,x^2,x^3\right)$ that preserves intervals, that is, such that  $$\left(dy^0\right)^2-\left(dy^1\right)^2-\left(dy^2\right)^2-\left(dy^3\right)^2=\left(dx^0\right)^2-\left(dx^1\right)^2-\left(dx^2\right)^2-\left(dx^3\right)^2$$  is linear (assuming that the origins of both coordinates coincide). That is, show that $\frac{\partial y^i}{\partial x^j}=L_j^i$ is constant throughout spacetime (that is, show that $\frac{\partial L_j^i}{\partial x^k}=0$).  Thus far all I've been able to prove is that $g_{ij}L_p^iL_q^j=g_{pq}$ (where $g_{ij}$ is the metric tensor of special relativity) and that $\frac{\partial L_j^i}{\partial x^k}=\frac{\partial L_k^i}{\partial x^j}$. Any further ideas?


I was using Java Eclipse and imported jsoup package, in order to scrape from the Amazon website.  The program simply goes to a search page, see the number of results and if any changes make notifications on the left side of the screen and constantly reload pages with a timer. Well it was working well and after a while, it shows me an error constantly. Sometimes it executes properly.    I have tried to use if(select=!null), but it shows me an empty result.  This means that selector sometimes scrapes data sometimes gets nulls.       package main;         import java.awt.AWTException;        import java.awt.SystemTray;        import java.io.IOException;        import java.net.MalformedURLException;         import org.jsoup.Jsoup;        import org.jsoup.nodes.Document;        import org.jsoup.nodes.Element;        import org.jsoup.select.Elements;        import java.util.Timer;         import java.util.TimerTask;        class amazon1 extends TimerTask{                public static int result1;                public static int result2;                public static int result3;          public void run() {            try {             final Document doc =          Jsoup.connect("http://www.amazon.com/s?k=hello&i=stripbooks-intl-          ship&ref=nb_sb_noss")                     .userAgent("Mozilla/17.0")                     .get()                      ;       Elements select = doc.select("div.a-section.a-spacing-                small.a-spacing-top-small>span");             Element first = select.first();             String contentText = first.text();             amazon1.result1 =               Integer.parseInt(contentText.replaceAll("[\\D]",""));                 } catch (IOException e) {             // TODO Auto-generated catch block             e.printStackTrace();         }           //            if(amazon1.result1>amazon1.result2) {         System.out.println(amazon1.result1);         amazon1.result2 = amazon1.result1;         amazon1.result3 = amazon1.result1 - amazon1.result2;            if (SystemTray.isSupported()) {                 DisplayTrayIcon td = new DisplayTrayIcon();                 try {                     td.displayTray();                 } catch (MalformedURLException | AWTException e) {                     // TODO Auto-generated catch block                     e.printStackTrace();                 }             } else {                 System.err.println("System tray not supported!");             }          } else {          ;         }             }     }         public class Main {        public static void main(String[] args) throws IOException {           Timer timer = new Timer();              TimerTask task = new amazon1();              timer.schedule(task, 3000, 5000);         }         }   Error is..       Exception in thread "Timer-0" java.lang.NullPointerException    at main.amazon1.run(Main.java:31)    at java.util.TimerThread.mainLoop(Timer.java:555)    at java.util.TimerThread.run(Timer.java:505)   NullPointer exception comes from selecting class element. The output should be 11620000 and notification from the right side of the screen.

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?


If we drop a bowling ball from one meter above the earth's surface, we are converting its gravitational potential energy to kinetic energy.   When it hits the floor, it transfers its kinetic energy to the earth, so now the earth is moving directly downward at a larger (but imperceptible) speed.  But let's say we dropped a hollow bouncy ball  (eg a ping-pong ball) with the same mass. Now the ball can bounce back, elastically. Is this energy supposed to come from the compression and decompression of the inner gas molecules?

Why is there conservation of kinetic energy in  and not in ? What would be the difference that lead to conservation of kinetic energy in elastic collision and not in inelastic collision? We also know that mechanical energy is not converted to heat, light, sound etc. in elastic collision but converted to heat, light, sound etc. in inelastic collision. Why is mechanical energy converted as total energy is conserved in inelastic collision?


I would like to create similar diagrams to these:    I am quite new to Latex. What package or tools should I use? Thank you for your help.

What packages do you use and recommend for creating graphics in your LaTeX documents?     As this is a community wiki post, please add your package to the accepted answer (or add a comment, and someone with >100 rep will add it to the CW answer), and include a brief description of what differentiates it from others and how it can be used (GUI drawing tool which generates code, type in raw text, or generates image for inclusion in document).   We'll eventually sort these answers under headings.


I'm drawing a fairly complex picture with many overlapping areas. Is there a way to pass each \draw snippet to a layer specified in the options? Or even better, based on its axis position?  I know of the backgrounds library but only offers two layers. In the  section 108.3 (pg. 1080) pgfonlayer is introduced. That would meet my needs but it requires encapsulating each command (or block of commands) with a begin{pgfonlayer}{<layer>}…\end{pgfonlayer} so that is cumbersome and reduces readibility. I want something like \draw[layer=<layer>], in the way the backgrounds library does. How would I go about achieving that?    A small MWE to illustrate:  \documentclass[tikz,border=10pt]{standalone} \begin{document} \pgfdeclarelayer{backlayer} \pgfdeclarelayer{backlayer2} \pgfdeclarelayer{frontlayer} \pgfsetlayers{backlayer,backlayer2,main,frontlayer} \begin{tikzpicture} \begin{scope}[xshift=-5cm] \draw (0,0) rectangle (2,2); \fill[red] (1,1) rectangle (3,3); \fill[blue] (-1,-1) rectangle (1.5,1.5); \fill[green] (0,0) circle (1.5); \end{scope} %with layers \begin{pgfonlayer}{frontlayer} \draw (0,0) rectangle (2,2); \end{pgfonlayer} \begin{pgfonlayer}{backlayer} \fill[red] (1,1) rectangle (3,3); \end{pgfonlayer} \begin{pgfonlayer}{main} \fill[blue] (-1,-1) rectangle (1.5,1.5); \end{pgfonlayer} \begin{pgfonlayer}{backlayer2} \fill[green] (0,0) circle (1.5); \end{pgfonlayer} \end{tikzpicture} \end{document}     Note the order change even though the code is still ordered in the same way.

This is an idle question, but neverthless, I think it's interesting.  Does TikZ have a simple way to implement a "z-level" specification. By this, I don't mean 3D drawing, I mean specifying which parts of the picture are on top of what.  So I'd write something like this:  \draw[fill, blue,zlevel=1] (0,0) circle (2); \draw[fill,red,zlevel=2] (0,0) circle (1);   and have the red circle appear on top of the blue one (since it has a higher z-level). I know I could just reverse the order, but I can imagine that being able to specify things this way round might make incremental changes to a TikZ picture in beamer easier by simplifying the overlay specifications...  I suppose you could do something with remember picture, but it seems a "z-level" key would be the easiest solution (from the end user perspective).  Is there anything like this? Is it possible?


When I type in bash (Linux Mint 20) abc I get output same as typing /usr/bin/abc, different from /usr/local/bin/abc. I have done web search, have read , then , . Below what I tried to check and still no idea for the reason: which -a abc  /usr/local/bin/abc /usr/bin/abc  echo $PATH  /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin  alias abc  -bash: alias: abc: not found  echo $BASH_VERSION  5.0.16(1)-release  Anything else to try?

When I execute a program without specifying the full path to the executable, and Bash must search the directories in $PATH to find the binary, it seems that Bash remembers the path in some sort of cache. For example, I installed a build of Subversion from source to /usr/local, then typed svnsync help at the Bash prompt. Bash located the binary /usr/local/bin/svnsync for "svnsync" and executed it. Then when I deleted the installation of Subversion in /usr/local and re-ran svnsync help, Bash responds:  bash: /usr/local/bin/svnsync: No such file or directory   But, when I start a new instance of Bash, it finds and executes /usr/bin/svnsync.  How do I clear the cache of paths to executables?


Studying a proof of Markov's inequality on  and I'm stuck at this part:     $$\int_a^\infty xf(x) \, dx \ge\int_a^\infty af(x) \, dx\,, \quad  a>0, \, f\ge0$$   How do I convince myself that this is satisfied? I mean is $xf(x) \geq af(x)\,,\forall x\geq a$?

Markov inequality,   $$\Pr(X \ge a) \le \frac{E[x]}{a}$$  Proof  $$\begin{aligned}      E(X) &= \int_0^\infty xp(x)\,dx = \int_0^a xp(x)\,dx + \int_a^\infty xp(x)\,dx \\       &\ge \int_a^\infty xp(x)\,dx \ge \int_a^\infty ap(x) \, dx  \end{aligned}$$  Why is the last inequality true? Why is it ok to change $x$ to $a$, and we know it is less than or equal to? How did they figure it out? Thanks!


I have the following code:              <script type="text/javascript">             $(function () {                 $('#js-news').ticker({                     speed: 0.10,                     htmlFeed: false,                     fadeInSpeed: 600,                     titleText: 'DASHBOARD ALERTS',                     direction: 'ltr',                     displayType: 'reveal',                     controls: false                 });             });         </script>   I would like to alter it such that it only fires if #js-news is present. In older IE V10 browsers I am getting the error: "Element does not exist in DOM", and the relevant pages do not have the js-news element. Newer browser seem to cope, but not IE7,8,9.  Thoughts on code alteration appreciated.  Thanks.

How can I check the existence of an element in jQuery?  The current code that I have is this:  if ($(selector).length > 0) {     // Do something }   Is there a more elegant way to approach this? Perhaps a plugin or a function?


I am not looking for a regex to match phone numbers. This is simply my use case. I want to know why my regex isn't including an optional non-matching group within the capture.  To better illuminate my specific use case, a bit of an introduction. I  am trying to match phone numbers. I have a working regex with the exception of when an extension is used.  My regex (a bit long, but comprehensive):  ((?:\+{0,2}\d{1,3})?[-.()\/* ]*?\d{3}[-.()\/* ]*?\d{3}[-.()\/* ]*?\d{4}[-.()\/* ]*?(?:(?:x|ext)[:]?[ ]*\d+)?)   A shortened version to illustrate my issue:  (\d{4}[-.()\/* ]*?(?:(?:x|ext)[:]?[ ]*\d+)?)   Where:  (...) is my capture group  \d{4} four digits  [-.()\/* ]*? various separators 0-infinite times (non-greedy)  (?:...) non-capture group  x|ext extension identifier  [:]? ":" 0-1 time  [ ]* " " 0-infinite times  \d+ digit 1-infinite times  (?:...)? non-capture group 0-1 time  So 1234 ext 567 should match, but only 1234 does  Regex101 link:   If I remove the ?, to make the group not optional it works just fine:  (\d{4}[-.()\/* ]*?(?:(?:x|ext)[:]?[ ]*\d+))   It seems like the ? is making it lazy but then also won't match numbers that do not have an extension.  Any help or insights would be greatly appreciated

I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following:   1-234-567-8901 1-234-567-8901 x1234 1-234-567-8901 ext1234 1 (234) 567-8901 1.234.567.8901 1/234/567/8901 12345678901   I'll answer with my current attempt, but I'm hoping somebody has something better and/or more elegant.


Does someone knows how to install Docker with PPA packages to Ubuntu 20.10?

Does someone knows if it exists some ppa packages source for the newest Ubuntu version 19.10 i had problem with that when i upgraded from Ubuntu 19.04 to 19.10 i didn't work?


I am looking for a way to convert strings to a float for a division and then convert back to strings afterwards.  Strings;      scalavars.ExchangeValue scalavars.Rate   int:  scalavars.CurrencyAmount   All contain values and I am trying to complete this equation;  scalavars.ExchangeValue = scalavars.CurrencyAmount / scalavars.Rate   How can I convert all three to floats for the division and then convert back to their orignal types and store the result in scalavars.ExchangeValue as a string again?

In Python, how can I parse a numeric string like "545.2222" to its corresponding float value, 545.2222? Or parse the string "31" to an integer, 31?  I just want to know how to parse a float str to a float, and (separately) an int str to an int.


It's rather tedious to show using Fubini's Theorem and induction on $n$ that the volume of the region $x_1+x_2+...+x_n \leq 1$ with $x_1,...,x_n$ nonnegative is $\frac{1}{n!}$.  Is there an easier way to see this?

Let $T_n=\{x_i\ge0:x_1+\cdots+x_n\le1\}$. I know $T_n$ is tetrahedron.  My question: How can I compute the volume of $T_n$ for every $n$?


I have a directory with a bunch of .dcm files (they are medical scans) that looks like this:  J6071c1.dcm  J6071d7.dcm  J6071ed.dcm  J607203.dcm  J607219.dcm  J60722f.dcm J6071c2.dcm  J6071d8.dcm  J6071ee.dcm  J607204.dcm  J60721a.dcm  J607230.dcm J6071c3.dcm  J6071d9.dcm  J6071ef.dcm  J607205.dcm  J60721b.dcm  J607231.dcm J6071c4.dcm  J6071da.dcm  J6071f0.dcm  J607206.dcm  J60721c.dcm  J607232.dcm J6071c5.dcm  J6071db.dcm  J6071f1.dcm  J607207.dcm  J60721d.dcm  J607233.dcm J6071c6.dcm  J6071dc.dcm  J6071f2.dcm  J607208.dcm  J60721e.dcm  J607234.dcm J6071c7.dcm  J6071dd.dcm  J6071f3.dcm  J607209.dcm  J60721f.dcm  J607235.dcm J6071c8.dcm  J6071de.dcm  J6071f4.dcm  J60720a.dcm  J607220.dcm  J607236.dcm J6071c9.dcm  J6071df.dcm  J6071f5.dcm  J60720b.dcm  J607221.dcm  J607237.dcm J6071ca.dcm  J6071e0.dcm  J6071f6.dcm  J60720c.dcm  J607222.dcm  J607238.dcm J6071cb.dcm  J6071e1.dcm  J6071f7.dcm  J60720d.dcm  J607223.dcm  J607239.dcm J6071cc.dcm  J6071e2.dcm  J6071f8.dcm  J60720e.dcm  J607224.dcm  J60723a.dcm J6071cd.dcm  J6071e3.dcm  J6071f9.dcm  J60720f.dcm  J607225.dcm  J60723b.dcm J6071ce.dcm  J6071e4.dcm  J6071fa.dcm  J607210.dcm  J607226.dcm  J60723c.dcm J6071cf.dcm  J6071e5.dcm  J6071fb.dcm  J607211.dcm  J607227.dcm  J60723d.dcm J6071d0.dcm  J6071e6.dcm  J6071fc.dcm  J607212.dcm  J607228.dcm  J60723e.dcm J6071d1.dcm  J6071e7.dcm  J6071fd.dcm  J607213.dcm  J607229.dcm  J60723f.dcm J6071d2.dcm  J6071e8.dcm  J6071fe.dcm  J607214.dcm  J60722a.dcm  J607240.dcm J6071d3.dcm  J6071e9.dcm  J6071ff.dcm  J607215.dcm  J60722b.dcm  J607241.dcm J6071d4.dcm  J6071ea.dcm  J607200.dcm  J607216.dcm  J60722c.dcm  J607242.dcm J6071d5.dcm  J6071eb.dcm  J607201.dcm  J607217.dcm  J60722d.dcm J6071d6.dcm  J6071ec.dcm  J607202.dcm  J607218.dcm  J60722e.dcm   I followed  and installed dicomscope in order to view the images.   Typing dicomscope J6071c1.dcm opens that particular image.  In the GUI for dicomscope itself, there seems to be no way to open multiple files and view them (sort of like as in a slideshow).  I want to type something like dicomscope *.dcm in order to open every file in the directory, but it doesn't work.  Similarly, ls | dicomscope doesn't work.  In both cases, dicomscope starts but only displays a black screen in the image viewer.  Would a kindly bash/zsh wizard please help me out? Cheers.

I have a set of files on which I would like to apply the same command and the output should contain the same name as the processed file but with a different extension.  Currently I am doing rename /my/data/Andrew.doc to /my/data/Andrew.txt I would like to do this for all the .doc files from the /my/data/ folder and to preserve the name.  I tried several versions but I guess I have something wrong in the syntax as I an new to linux.


I have a Dell inspiron about a year old.  It has a 32 GB solid state hard drive.  I'm having problems with it that make it not worth the trouble to fix, unless, that is, if I can wipe Windows10 and all files completely from the SSD, absolutely clean, and then install ubuntu.  I have investigated numerous programs for cleaning hard drives but they are for standard mechanical hard drives, not solid state hard drives.  I'm at the point where I'll toss this piece of equipment into the trash, except that if the problem has to do with windows itself, rather than the hardware, then I'd love to use this little laptop for my first experience with ubuntu.

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


I have been fussing around with my PHP code and SQL statements and while I do know that one could use prepared statements when dealing with this, I still wonder how a SQL injection could be performed here.  $name = mysql_real_escape_string(htmlspecialchars($_POST["Name"])); $age = (int) mysql_real_escape_string(htmlspecialchars($_POST["Age"])); $amount = (int) mysql_real_escape_string($_POST["Amount"]);  $sql = "insert into nice_table set                     name='{$name}',                     age='{$age}',                     amount='{$amount}'";   $db->sql_query($sql);   I don't know a lot about all different methods when performing a SQL injection, but all the stuff I've looked up passes just fine through this without any database errors. Would it actually be safe to use this instead of the classic prepared statements?  What would be passed right through, for example? I must be missing something, because it can't be this simple and still hold as tight as prepared statements, right?

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