An astronaut is travelling towards a black hole in a space ship traveling at 0.8 C. The guy’s position is not fixed relative to the black hole. He is travelling towards it from a distance. How to calculate the gravitational time dilation in this case, as the "relative time" keeps getting slower as one approaches the event horizon?  Please note that I have already factored the ‘time dilation’ due to the space ship traveling at 0.8 C. I just want to understand the ‘gravitational time dilation ‘ part of it.  Can some form of integration be applied on the gravitational time dilation equation for the case of motion in gravitational field?

Time dilation  using Schwarzschild metric for a non rotating spherical body is: $$t_0=t_f\sqrt{1-\frac{2GM}{rc^2}}$$  For such a non rotating spherical body, what would the time dilation of a clock in vacuum free-falling from infinity be?  (If the answer is non-trivial; a high level outline of the calculation would suffice / be appreciated)  Edit: I am currently working on an iOS app that is trying to model the mechanism underpinning relativity.  So, far the mechanism that I have created is shockingly simple and shockingly good at conforming to Relativity.  However, I am trying to break it.  I am trying to find any possible areas where the two may diverge.  I have noted that using my model a clock in freefall will experience no time dilation, i.e. $t_0=t_f$ and I want to make sure Relativity agrees.  I have noted the gravitational component of time dilation above.  Since my clock is moving one might also expect a kinematic time dilation.  I can calculate the velocity of my clock: $$E_k=\frac{1}{2}mv^2$$ $$E_p=\frac{-GMm}{r}$$ $$v=\sqrt{\frac{2GM}{r}}$$ Plugging this velocity into the kinematic time dilation equation: $$\Delta t'=\frac{\Delta t}{\sqrt{1-\frac{v^2}{c^2}}}$$ $$\Delta t'=\frac{\Delta t}{\sqrt{1-\frac{2GM}{rc^2}}}$$  At this point one might make the observation that the kinematic dilation is the inverse of the gravitational dilation and therefore conclude that: $$t_0=t_f$$


What is the function of bash shebang? What is the difference between executing a file using ./file or sh file?   How does bash understand it?

This may be a silly question, but I ask it still. If I have declared a shebang  #!/bin/bash    in the beginning of my_shell_script.sh, so do I always have to invoke this script using bash  [my@comp]$bash my_shell_script.sh   or can I use e.g.  [my@comp]$sh my_shell_script.sh   and my script determines the running shell using the shebang? Is it the same happening with ksh shell? I'm using AIX.


I am working on a Project for an assignment. Basically I want the points on the map to have a three mile radius around them. The places are from a shapefile. Once I try to set a radius I am selecting the Place pin and using Geo processing -> Buffer.   I set the buffer distance to 1 and I have also tried setting the buffer to different distances and still I end up with the same sized radius. Can anyone help?

I  have had no luck getting the buffer tool to accept anything but degrees as units of measure.  I have found lots of stuff saying the layer needs to be reprojected and saved but it hasn't worked at all for me.   Is there a way I could create a buffer without using ftools or at least force the units to meters somehow?  As a workaround I converted meters to degrees (lat) and used that but the final product needs to be as close to reality as possible.  Things I've tried:   setting every unit option I could find to meters (where possible). setting everything to NAD83/Maryland (data is for Washington, DC) and saving it as such (as layers in ESRI shape files). reimporting the reprojected layers setting relevant layers to Google Mercator   The was tried followed by creating a buffer. Many were tried in combination. QGIS 1.7.3 Slackware64 current (qgis from SBo-13.37 repo, tried on multilib and plain 64it with same results)


Mods: I believe the  you linked is the one duplicated. This suggestion was made 1 year ago, whereas the one that you may think it's older, has been made just 4 days ago.   Say for example I have 3 rooms opened as pinned tabs in my chrome (or browser).  I find the first room interesting and there's few people in there, so I set "Sound notifications: visible room".    Since changes in sound notifications are applied to all rooms at once, the problem comes when the other two rooms start spamming the sound (lots of people) as new messages are coming, and whenever I switch tab to them, sometimes they come up with something interesting or worth talking about... and sometimes not.  But what if I want to make this setting work for one specific room, and then the ones that I don't care at all I'd like to make them sound only when I'm mentioned or totally mute them.

At the top right of a chat room, just above the room title, there is a speaker icon. Clicking on this icon brings up the settings for "Sound notifications":    Currently, a change to this setting affects all chat rooms. Selecting "visible room" means that an audio notification is given for any activity in any room that is currently open in a browser tab (regardless of whether that is the active tab).  It would be useful to be able to adjust audio notification settings for individual rooms. For example, The Nineteenth Byte is quite a busy room, so I'd like to be notified only when mentioned. The Cornell Box is a much quieter room, and I'd like to be notified any time there is activity regardless of whether I am mentioned. Currently I can set all rooms to notify me of any activity, or I can set all rooms to notify me only when mentioned, but I can't choose a different setting for each room.  This would also be particularly useful when setting up a room for a very specific purpose, such as discussion of a particular question.


I am taking a Lie algebras course as a prerequisite to study Lie groups. The idea of a radical of a Lie algebra (maximal solvable ideal) has been defined in class but no other statements or theorems are available.  I have a question that asks me to calculate the radical of $\mathfrak{gl}(2,\mathbb{C})$, which is the general linear Lie algebra of $2 \times 2$ matrices with complex entries.  I just have no idea how to start the question; I know how to check something is an ideal of $\mathfrak{gl}(2,\mathbb{C})$ but I have no idea how to check it's a maximal ideal, or how to check that it's maximal with respect to solvable Lie algebras.  I thought of just guessing a maximal ideal (from a list of common ideals, like $\mathfrak{u}(2,\mathbb{C})$ (upper triangular matrices)) and using the correspondence theorem to prove no bigger ideal exists, but I couldn't get anywhere with it.

I find it intuitive enough that the radical of $\mathfrak{gl}_n\mathbb F$ is the scalar matrices, but I have trouble finding an easy, but complete proof:  Proof. Let $\mathfrak s$ denote the scalar matrices. Clearly $\mathfrak s\subset\mathrm{rad}(\mathfrak{gl}_n\mathbb F)$. Suppose that $\mathrm{rad}(\mathfrak{gl}_n\mathbb F)$ is generated by more than one element, so that $X\in\mathrm{rad}(\mathfrak{gl}_n\mathbb F)$, but $X\notin\mathfrak s$. We can change basis such that $\mathrm{rad}(\mathfrak{gl}_n\mathbb F)$ is upper-triangular. (The change of basis leaves the scalar matrices invariant.) Then $X$ is upper-triangular.  I want to conclude that there exists a $Y\in\mathfrak{gl}_n\mathbb F$ s.t. $[X,Y]$ is not upper-triangular. How can I see that $Y$ always exists, except by waving hands?


If I turn my router off for 24 hours or more I am always assigned a new dynamic IP address once I turn it on again.   Theoretical question for you guys; Does that mean I don't actually have an assigned IP address if I turn my home router off for a few days (given that it changes when when the router is off for 24 hours)

I have an ISP which assigns IP addresses dynamically. If I go out and turn my router off I am always assigned a new one once I turn it back on. Does that mean that...  1) my previous IP goes elsewhere when my router is turned off?  2) i dont actually have an IP address if my router is off for a day or more?


how do I solve this integral ?  $$\int_{0}^{\infty} \frac{\sin{x}}{x}\,dx$$  how to start ?

A famous exercise which one encounters while doing Complex Analysis (Residue theory) is to prove that the given integral: $$\int\limits_0^\infty \frac{\sin x} x \,\mathrm  dx = \frac \pi 2$$ Well, can anyone prove this without using Residue theory?  I actually thought of using the series representation of $\sin x$: $$\int\limits_0^\infty \frac{\sin x} x \, dx = \lim\limits_{n \to \infty} \int\limits_0^n \frac{1}{t} \left( t - \frac{t^3}{3!} + \frac{t^5}{5!} + \cdots \right) \,\mathrm  dt$$ but I don't see how $\pi$ comes here, since we need the answer to be equal to $\dfrac{\pi}{2}$.


This is my response data:  var data = [{             'id': '1',             'name': 'kamal',             'age': '21'         }, {             'id': '2',             'name': 'ram',             'age': '11'         }, {             'id': '3',             'name': 'karuna',             'age': '22'         }, ];   I getting this data in to  my response data. I need to remove field id inside of object. I want to splice the id field in each object .  expected result is:  var data = [{             'name': 'kamal',             'age': '21'         }, {             'name': 'ram',             'age': '11'         }, {             'name': 'karuna',             'age': '22'         }, ];

Say I create an object as follows: let myObject = {   "ircEvent": "PRIVMSG",   "method": "newURI",   "regex": "^http://.*" };  How should I remove the property regex to end up with new myObject as follows? let myObject = {   "ircEvent": "PRIVMSG",   "method": "newURI" };


I have a problem. When I import a stl file from solidworks into blender for rendering it doesn't match the scale of the scene. It is gigantic. The object is a chair and I have checked the scale in solidworks and here it is ok.  Hope someone can help.  Thanks  PrettyP74

I've set my Units (in scene properties) to Metric, and the Scene Scale to 0.01 hoping to get the Blender dimensions it mm's. While the (normal) scale is 1 for x,y,z, the standard cube has the dimensions 2x2x2 cm. When I export this to an STL and open it in a slicing program (Netfabb, Slic3r or Cura) they all give the dimensions: 2x2x2 mm. While exporting, the scale is 1.  What am I doing wrong? I hope you can help me.  Thanks!


Which Ubuntu version should I download for new Linux-certified laptop ?  Device Name: lc2430i MEMORY: 3.8GiB Processor:3rd Generation Intel Core i5-3210M CPU @ 2.5GHZ X 4 (3MB L3Cache,2C+HT) OS TYPE: 64-bit Graphics: Intel Ivy bridge Mobile Disk: 483.8GB  Note: This Laptop came with Ubuntu 13.04 but we ordered 12.04 LTS, I want the Long Term System not systems that only have support for 6 months.

I'm thinking about installing Ubuntu Desktop, but I don't know what flavor is the best for my system. What are the minimum and recommended hardware requirements? What kind of CPU? How much memory? Should I have Hardware Acceleration? What flavor should I use?  This is an attempt of a canonical answer. My answers have the "official  requirements", the recommended are a mix of official sources and opinion based (along with the answer it's told the source). You can comment or edit if you feel that the information is obsolete or incomplete. It is a good rule of thumb that any system capable of running Windows Vista, 7, 8, x86 (Intel) OS X will almost always be a lot faster with any Ubuntu flavor even if they are lower-spec than described below.


I have to choose an option from a html file: <select id="color">     <option>red</option>     <option>yellow</option>     <option>green</option>     <option>orange</option> </select>  for example i want to select green. I have already tried: var color = "green" document.getElementById("color").options.value = color; document.getElementById("color").value = color;  but they don't work. (option tag must be withouth name, id, ...)

I have the following HTML <select> element:  <select id="leaveCode" name="leaveCode">   <option value="10">Annual Leave</option>   <option value="11">Medical Leave</option>   <option value="14">Long Service</option>   <option value="17">Leave Without Pay</option> </select>   Using a JavaScript function with the leaveCode number as a parameter, how do I select the appropriate option in the list?


For any given class and its specified page layout, I'd like to be able to combine (sum or subtract) a subset of the page dimensions, to obtain a length to work with, without specifying absolute values.  For example: I'd like to set the width of a figure equal to \textwidth + \marginparsep + \marginparwidth  I don't have a MWE yet, because I'm trying to figure out if this is possible somehow.   is related, but applicable only to KOMA

In LaTeX2e,how can I sum two values and assign them to other variable?  I want to compute something like:   var=\textwidth - 1cm    And if both were constants:   var=1+1


I have a set of database on full recovery model, my backup schedule looks like this:   1 Weekly Full Backup 1 Daily Log Backup   Full backups are about 10GB, log backups are about 500mb per day.  What happens is that right now, I'm having a DataFile of 10GB but a log file of 30GB...  Could be an option to shrink the log file? Is this a good practice? I have read that is not recommended but I don't know the exact reason.  Thanks!

This one seems to be a common question in most forums and all over the web, it is asked here in many formats that typically sound like this:  In SQL Server -  What are some reasons the transaction log grows so large? Why is my log file so big? What are some ways to prevent this problem from occurring? What do I do when I get myself on track with the underlying cause and want to put my transaction log file to a healthy size?


Question: Provide the binary mask and bit-wise operations to complete the following tasks:   Turn on bits 7,3,1 of an 8-bit binary number (1 is on, 0 is off). Toggle bits 6,5,4 of an 8 bit binary number   So far I know it is an OR operation because 1 is on, but I don't know how to provide a mask. Do I have to turn 7,3,1 to binary then provide mask?

How do you set, clear, and toggle a bit?


I was asked to prove the fact that $$\int_{0}^a f(x)dx=\int_{0}^af(a-x)dx$$  The first part was quite easy to sort out by using the substitution $u=a-x$, but the second part of the question was to use the first part with $a=\frac{\pi}{2}$ to show that $$\int_0^\frac{\pi}{2}\frac{dx}{\sin x+\cos x}=\frac{\pi}{4}\int_0^\frac{\pi}{2}\frac{dx}{\sin x+\cos x}=\frac{\pi}{4}\sqrt{2}\ln(1+\sqrt{2})$$  Any help on this question is appreciated.

I cant seem to work this out, can someone pls. help,  $$\int_{0}^{\frac{\pi }{2}}\frac{x dx}{\sin x +\cos x}$$  You are meant to use the property of integral that:   $$\int_{0}^{a}f(x)dx = \int_{0}^{a}f(a-x)dx$$


We have two positive series: $\displaystyle\sum_{n=1}^\infty a_n$, $\displaystyle\sum_{n=1}^\infty b_n$ and we know that: $\frac {a_{n+1}}{a_n} \le \frac {b_{n+1}}{b_n}$ (from a certain index). Show that if $\displaystyle\sum_{n=1}^\infty b_n$ converges then $\displaystyle\sum_{n=1}^\infty a_n$ converges as well.   I think I know how to do it with contrapositive (suppose $a_n$ diverges, show it's bounded by $b_n$ thus it can't diverge) but I don't know how to show that $\frac {a_{n+1}}{a_n} \le \frac {b_{n+1}}{b_n} \Rightarrow a_n \le b_n \ \forall n$.

How do I prove that if $|a_{n+1}|/|a_n| \leq |b_{n+1}|/|{b_n}|$ and $\sum |b_n|$ is convergent, then $\sum |a_n|$ is convergent? I know that if I can get $|b_{n+1}/{b_n}| < 1$ then I can use the ratio test to say $\sum a_n$ is convergent, but I don't know if this the proper way to approach the problem.


logged on today and my activity tracker suddenly changed to this:     but....    still about 40 away from even getting awarded the grammar badge.  Don't know what the tracker is thinking.

Note: I don't seem to have actually been awarded the badge.    I just got this message:    however, I'm still quite a bit away from the reputation requirement:    I didn't get a notification that I earned the badge, nor is it in my badge list. But I cannot select it for tracking anymore:    Not sure if this is related to     I did not get the badge awarded, but maybe it's just not that time of the day yet (does the tracking earning notice and the actual awarding occur on different schedules)?


I wish to trim the list  [0,0,0,0,0,0,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3, ... , 145,145,145]  into  [0,1,2,3,4,...,145]   I know the "C-Programming-style" way of doing it in Python.  I am here to ask for an intelligent and smart way of doing this.

Is there a built-in that removes duplicates from list in Python, whilst preserving order? I know that I can use a set to remove duplicates, but that destroys the original order. I also know that I can roll my own like this:  def uniq(input):   output = []   for x in input:     if x not in output:       output.append(x)   return output   (Thanks to  for that .)  But I'd like to avail myself of a built-in or a more Pythonic idiom if possible.  Related question:


We're having a discussion at work, because of my tendency to name functions based on what they do.  For instance:  function notifyUserOfSomeThingThatHappened(){     // notification code }   My coworker believes (and I kind of agree) that this function should be named based on why it's being called, rather than what it does, since what it does could change.  Something like this:  function someThingHappened(){     // notification code     // possible new code in the future }   I agree with this, but with a catch: I think we should name functions that will only ever do one thing by their actual contents, but other functions by their reason for being called, like this:  function someThingHappened(){     notifyUserThatSomeThingHappened();     // possible new code in the future }  function notifyUserThatSomeThingHappened(){     // original code }   What are the best practices for naming functions? Why are these practices used? What are the advantages of one over the other?

So I'm working on this class that's supposed to request help documentation from a vendor through a web service. I try to name it DocumentRetriever, VendorDocRequester, DocGetter, but they just don't sound right. I ended up browsing through  for half an hour trying to come up with an adequate word.   Start programming with bad names is like having a very bad hair day in the morning, the rest of the day goes downhill from there. Feel me?


The question is pretty straightforward, but here is some context for clarification.  In the present document I'm writing, I find myself using a particular math symbol, which I wrote in TikZ, with tremendous regularity, so I encased the TikZ code in a macro call in the preamble.  FYI, the code overlays a clipped \ell and a clipped italics n to create a cursive-like h, and the macro labels this \ehh.  As of this writing, the \ehh  call is in use over 130 times, and processing all those TikZ environments is significantly adding to the compile time.  It should be noted the macro output is precisely the same in each instantiation; there is no change to the output given the local environment of a given \ehh call. As a test, I replaced the TikZ computation in the definition with just the letter h, and the compilation was back up to speed.  It really is the \ehh processing slowing things down. The questions: When a macro is defined using a computationally complicated structure, but where the output is the same for each call to the macro, is there a way to allow the processing of that portion of code one time, and just have the macro point to (or call, or whatever the correct vernacular is) the output, instead of processing the defining codeset repeatedly? If the answer to the general question is "no," then with a more specific TikZ focus, is there a way to process TikZ code written in the preamble and have calls to the macro (or maybe, subsequent calls after the first) not process the full TikZ code set, but rather just reference the already processed output?

Throughout my thesis, I have accent several mathematical symbols with "hats" and "checks". My advisor noted that the standard \hat{}, \check{} accents were difficult to read due to their size, so I made my own in Tikz. However, now LaTeX takes several (around three) minutes to compile the entire document. Below is the code used to define these symbols. I do use the accents package. Is there a more efficient way to define custom accents for mathematical symbols? I imagine Tikz is running every time the compiler comes across my command which is what's slowing it down, but I'm not sure how to avoid this. I am using TexMaker with the latest MikTex distribution for Windows. % Some symbols   \newcommand{\myhat}{% \mathbin{\begin{tikzpicture}[line width = 0.15pt, smooth] \draw[smooth, fill] (0,0.1ex) -- ({0.5ex - 0.3pt},0.45ex) -- ({0.5ex + 0.3pt},0.45ex) -- (1ex, 0.1ex) -- (0.5ex ,0.4ex) -- (0,0.1ex); \draw[white](0,0ex) -- (0, 0.1); \end{tikzpicture}  }}  \newcommand \what [1]{ \accentset{\myhat}{#1} }  \newcommand{\mycheck}{% \mathbin{\begin{tikzpicture}[line width = 0.15pt, smooth] \draw[smooth, fill, rotate = 180] (0,0.1ex) -- ({0.5ex - 0.3pt},0.45ex) -- ({0.5ex + 0.3pt},0.45ex) -- (1ex, 0.1ex) -- (0.5ex ,0.4ex) -- (0,0.1ex); \draw[white](0,-0.5ex) -- (0, 0); \end{tikzpicture} }}  \newcommand \wcheck [1]{ \accentset{\mycheck}{#1} }


The problem statement is:  Show that there exists numbers $a$ and $b$ such that   $$det (A + sxy^*)= a+bs$$  here $A$ is an $nxn$ matrix with real entries, and $x,y\in R^n$.  I've been using brute force and using multi-linearity of the determinant several times, and the computations are getting longer, but I see no pattern yet.    Any ideas are welcome.  Thanks,

Suppose that $A \in \mathbb{R}^{n\times n }$, and $x,y\in \mathbb{R}^n$.    Show that there exist numbers $a,b$ so that $\det{(A + sxy^*)}=a+bs$   Show that if $\det{(A)}\neq 0$ then $a = \det{(A)}$ and $b = \det{(A)} \cdot y^*A^{-1}x$.   Is it true that if $\det{(A)}=0$ then $a=0$?    My answer so far: The third question seems trivial and silly, and I don't understand why it's on there. I have solved the first one as follows: take $\beta$ to be any basis whose first element is $x$. Then with respect to basis $\beta$, $A+ sxy^*$ has the form   $$\left(  \begin{matrix} \alpha_{11} + sy_1 & \alpha_{12} + sy_2  & \dotsb & \alpha_{1n}+sy_n \\ \alpha_{21}&\dotsb&&\alpha_{2n} \\ \vdots & \ddots &&\vdots\\ \alpha_{n1} & \dotsb &&\alpha_{nn} \end{matrix} \right),$$  from which it's clear that the determinant is a polynomial in $s$ of degree $\leq 1$.    I am less clear on the second question.   For a limited case, note that if $A$ is diagonalizable and $x$ is an eigenvector of $A$ with eigenvalue $\lambda_x \neq 0$, then adding $sxy^*$ to $A$ has the effect of preserving all the eigenvectors, bumping up $\lambda_x$ to $\lambda_x + sy^*x$, and since the determinant is the product of all the eigenvalues, the product of $\lambda_1 \lambda_2  \dotsb (\lambda_x + sy^*x)\dotsb \lambda_n $ is   $$\det{(A)} + \det{(A)}\frac{sy^*x}{\lambda_x}=\det{(A)}\cdot sy^*(\frac{x}{\lambda_x}) = \det{(A)}\cdot s y^*(A^{-1}x).$$  Note that $y^*A^{-1}x$ is $\alpha_1 y_1 + \dotsb + \alpha_n y_n$, for $\alpha_i$ such that $x = \alpha_1 A_1 + \dotsb + \alpha_n A_n$, where $A_i$ are the columns of $A$.  But this is all I've got. Can someone give me a hint? I'm not looking for you to feed me the answer. Thanks as always


Consider the large calculation given below  echo  999999*999999999;   This returns 9.99998999E+14  Is there any way to get the the whole number 999998999000001 instead of the Exponent form?  Please help . Thanks in advance.

I'm trying to do an echo of a variable containing 1400000.  so there is written: echo round(1400000); this gives 1,4E+6 instead of the full number. Anybody an idea on how to display it fully?


I want to set style attribute value dynamically while looping in template.  But LWC is warning me of this error message.     LWC1060: Template expression doesn't allow CallExpression   Below is my template.    <template for:each={colors} for:item="color">
                <--! warning here -->           {color}
   </template>   How can I achieve my purpose?

How can expression functions similar to Visualforce and Lightning Aura Components be achieved within lightning web components?   For example, <template if:true={index % 5 == 0}>
</template> expression index % 5 == 0 is not compyling at all.  accountList.html  <template>     <template if:true={accounts.data}>         <template for:each={accounts.data} for:item='item' for:index='index'>                                       {item}         </template>     </template> </template>   accountList.js  import {LightningElement, wire} from 'lwc'; import getAccounts from '@salesforce/apex/TestController.getAccounts';  export default class AccountList extends LightningElement {      @wire(getAccounts) accounts;  }   Since LWC doesn't support Expression Functions, I'd like to know how to implement them.


Evaluate the following:    $$ \lim_{x\to \infty}  x \left({{\left(\frac{x}{x+1}\right)}^{x}-\frac{1}{e}}\right)$$   I tried to first solve the interior portion as $1^\infty$ indeterminate form but ended up getting a different indeterminate form of $\infty\cdot 0$.

I'm having some trouble solving finding the limit of:     $$\lim_{x \to \infty} x \left[ \frac{1}{e} - \left( \frac{x}{x+1} \right)^x \right]$$   I can see that $\left( \frac{x}{x+1} \right)^x = \left( 1 + \frac{-1}{x+1} \right)^x \rightarrow \frac{1}{e}$. That's why I thought the limit is 0. However, according to  it's $-\frac{1}{2e}$.  I tried to write $\frac{1}{e} - \left( \frac{x}{x+1} \right)^x$ as a series but I didn't find a way to...   What's the right approach to find this limit?


I have tried to prove this through mathematical induction but I can't seem to prove that the proposition works for $k+1$.

I'm trying to prove the following statement: $P(n) = 3^{2n-1} + 2^{n+1}$ is always a multiple of $7$  $\forall n\geq1$. I want to use induction, so the base case is $P(1) = 7$ so that's okay.  Now I need to prove that if $P(n)$ is true then $P(n+1)$ is true. So there exists a $d \in \mathbb{N}$ such that  $$ 3^{2n-1} + 2^{n+1} = 7d $$ From this I need to say that there exists a $k \in \mathbb{N}$ such that: $$ 3^{2n+1} + 2^{n+2} = 7k $$ With a little algebraic manipulation, I have managed to say: $$ 2 \cdot 3^{2n+1} + 9 \cdot 2^{n+2} = 7\cdot(18d) $$ But now I am stuck. How should I keep going?


I am using OSX Mavericks 10.9.2 and I have 4 desktops that I use in my daily workflow. From time to time Desktop 2 and Desktop 3 switch places and I cannot figure why. Probably when moving from desktop to desktop (sometimes I use 3 finger swap and sometimes Control^#) I activate some shortcut.   Does anybody what is shortcut for swapping desktops or some other explanation for this? And how to disable it :)  Thanks

Is there any way in Mountain Lion to preserve the order of spaces in Mission Control?  I use four different spaces for four fullscreen apps, and I like to keep them in a certain order so that I know where they all are in relation to each other.  The problem is that once these apps are quit, their spacial arrangement is lost, so I find that I'm always manually reordering them into the arrangement I like (since by default a new fullscreen app is tacked onto the end of the list of spaces).  In Snow Leopard and earlier (before Mission Control), it was possible to "bind" specific apps to specific spaces, so you could do things like always have Safari open in Space 2. With Mission Control, I don't see any way to do something equivalent.


I have two tables as below  Table A    Key    Field1  Created_date   1234    a      Jan-18   1234    b      Feb-18   1234    c      Mar-18   4567    d      Mar-18   6789    e      Apr-18     Table B  Key Posted_date 1234    Mar-18 4567    Apr-18   I want to join table A with B on the field Key and select records with max(A.created_date) where A.created_date < B.posted_date. The table B has around 300 million records. Could you please help me out.  Result    Key Field1  Created_date   1234    b   Feb-18   4567    d   Mar-18

Table:   UserId, Value, Date.   I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle)  Update: Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date.


By Euler's theorem, if $\gcd(e,n) = 1$, then $e^{\varphi(n)} \equiv 1 \pmod n$. But why does RSA need to make sure that $\gcd(e,\varphi(n)) = 1$?

When choosing the public exponent e, it is stressed that $e$ must be coprime to $\phi(n)$, i.e. $\gcd(\phi(n), e) = 1$.   I know that a common choice is to have $e = 3$ (which requires a good padding scheme) or $e=65537$, which is slower but safer.  I also know that for two primes $p,q$, we have $\phi(pq) = (p - 1) (q - 1)$  Now, let me give a (simple) example:  Say I choose $e = 3$, and two random primes $p = 5$ and $q = 13$.  I can now compute $\gcd(3, \phi(5 \cdot 13)) = 3$.  This reveals that $3$ and $\phi(n)$ are not coprime. I assume this could also happen for large values of $p$ and $q$, and likewise for another $e$. I therefore assume that the RSA algorithm must check that $\gcd(e, \phi(pq)) = 1$. But let's assume it doesn't.  How does RSA become vulnerable if $\gcd(e, \phi(pq)) \neq 1$?


As per the title. I had auto-login setup (and working) prior to upgrading. My user settings show auto-login set to "On", but I'm being prompted to login every time I reboot. Graphics is ATI Radeon HD 4200. Any ideas??

I have selected the setting 'Automatic Login' from within the default Gnome 3 Ubuntu 17.10 control panel app, but it keeps resetting to 'off' after every restart and does not allow me to automatically login.  Any ideas?


I am new in the world of Latex. I am trying to create a table as in the picture but I am not able to. Could someone please help me to create this table? Thanks in advance.

Im trying to create a multicolumn table in LaTex that would look like this:     Unfortunately I tried pretty much all the codes for multi row and multi column tables but it never looks even remotely similar. My main problem is to fit the Chronological periods on top of the 2 names.  The last code I tried was:  \documentclass[11pt]{article} \begin{document}  \begin{left} \begin{tabular}{|lc|ll|l|ll|}  \hline  {\bfseries Bronze Age} & {} & {\bfseries Iron Age} & {} &{\bfseries    Hellenistic}  & {\bfseries Roman}\\  \hline  \multirow {Kilise Tepe & Ephesos & Kilise Tepe  & Ephesos & Gordion &  Ephesos& Sagalassos}\\ \hline \end{tabular} \end{left}   \end{document}   Could someone please put me in the right direction?  Thank you in advance.


Suppose I have this code:  #include <netinet/in.h>  void bark(in_port_t port){     // etc. }  int main() {      const std::string var = "203";     in_port_t p = var;     bark(p);      return 0; }   How would I convert the std::string to an ?

I'm trying to iterate over the words of a string.  The string can be assumed to be composed of words separated by whitespace.  Note that I'm not interested in C string functions or that kind of character manipulation/access. Also, please give precedence to elegance over efficiency in your answer.  The best solution I have right now is:  #include <iostream> #include <sstream> #include <string>  using namespace std;  int main() {     string s = "Somewhere down the road";     istringstream iss(s);      do     {         string subs;         iss >> subs;         cout << "Substring: " << subs << endl;     } while (iss); }   Is there a more elegant way to do this?


I have email saved in the database like this: {     "_id" : 1,     "first_name" : "aman",     "last_name" : "kaur",     "company_name" : "",     "email_id" : "amaniron+1234@gmail.com", }   when I try to fetch it using following queries: db.getCollection('users').find({email_id: {$regex: "^amaniron+1234@gmail.com$"}}) db.getCollection('users').find({email_id: {$regex: "\^amaniron+1234@gmail.com$"}}) db.getCollection('users').find({email_id: {$regex: "\^amaniron+1234@gmail.com\$"}}) It gives me nothing. Please tell me what am I doing wrong here ?

I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?


I have a problem with my Java code:  public static void GetEquation () {     equation = Main.userInput.replaceAll(" ", "");      num1 = Double.parseDouble(equation.substring(0, 1));     operator = equation.substring(1, 2);     num2 = Double.parseDouble(equation.substring(2, 3));      if (operator == "+") {         result = num1 + num2;     }     else if (operator == "-") {         result = num1 - num2;     }     else if (operator == "/") {         result = num1 / num2;     }     else if (operator == "*") {         result = num1 * num2;     }      System.out.println(result); }   I found that it gets rid of the whitespace fine and it assigns the variables fine but when it comes to doing the math and displaying the result it fails. Whatever I typed in, I would get a result of 0. I can't see what is wrong.

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


Let $X=\mathbb{R}$ be given with the collection $\tau$ where  $$ \tau = \{U\subset X: |X\setminus U|<\aleph_0\}\cup \{\emptyset\} $$ I was sitting at my computer, when I suddenly asked myself: "How is $\tau$ actually a topology on $\mathbb{R}$?". It is supposed to satisfy the arbitrary union condition, but it doesn't. Indeed $$ \bigcup_{i\in \mathbb{N}} \mathbb{R}\setminus \{i\} \notin \tau $$ but each of $\mathbb{R}\setminus \{i\} \in \tau$. Can someone explain to me how $\tau$ is a topology?  edit as Thomas Andrews points out, I was confusing unions with intersections and, in general, just being an idiot.

My attempt to prove the following is below:     Let X be an infinite set. Show that $\mathscr{T}_1=\{U \subseteq X : U = \emptyset $ or $ X\setminus U $ is finite $ \}$   My book calls this set the ""  I just want to know if this proof is correct. (I intuitively understand why its a topology, but I'm not sure if I'm showing it properly)  Using the definition of topology:     $\mathscr{T}$ is a topology on X if and only if the following are true:   (i) X and Ø are elements of $\mathscr{T}$.   (ii) $\mathscr{T}$ is closed under finite intersections.   (iii) $\mathscr{T}$ is closed under arbitrary unions.   Let:$V_k \subseteq X$ be any finite set. (ie: $V_1, V_2...$ are all finite sets)  So Then, $U_k = X \setminus V_k$, would be the subsets of $\mathscr{T}$.   Now to verify the definition.     (i) X and Ø are elements of $\mathscr{T}$.   Ø is given in the definition of $\mathscr{T}_1$. Also, the empty set is considered finite, with cardinality zero. Thus $X$ is in $\mathscr{T}_1$ because its complement is finite.      (ii) $\mathscr{T}$ is closed under finite intersections.   $U_k \cap U_j = X \setminus (V_k \cup V_j) $, due to De Morgan's law. Since the Union of two finite sets is also finite, this set is still in $\mathscr{T}_1$. Or Symbolically (using bars || for cardinality): If $|V_k \cup V_j| < |\mathbb{N}|  $, then $(U_k \cap U_j) \in \mathscr{T}_1$. This reasoning can be extended to any finite amount of intersections.       (iii) $\mathscr{T}$ is closed under arbitrary unions.   $U_k \cup U_j = X \setminus (V_k \cap V_j) $, due to De Morgan's law.Since the Intersection of two finite sets is also finite, this set is still in $\mathscr{T}$. Or Symbolically: If $|V_k \cap V_j| < |\mathbb{N}|  $, then $(U_k \cup U_j) \in \mathscr{T}_1$. This reasoning can be extended to any finite amount of Unions.  Now let's consider the infinite case: $V_k \cap ... \cap V_j$ will only contain points that are in EVERY set being intersected. So if $V_k \cap ... $ was infinite, that would imply the every $V_k$ being intersected is also infinite, but $V_k$ is specifically defined as being finite. Thus even with infinite Unions, $\mathscr{T}_1$ is still closed.


Thank you for supporting Python learners, who got stuck! I'd like to create an array of objects and encountered some weird behaviour of Python. Here's the code: class Box:     def __init__(self, row, col):         self.row = row         self.col = col     def __str__(self):         return f"this is box[{self.row}][{self.col}]"  # instancing the boxes boxes = 3*[3*[None]]  for i in range(2):     for j in range(2):         boxes[i][j] = Box(i, j)         print(boxes[i][j]) print() print(boxes[0][0])  And this is the output: this is box[0][0] this is box[0][1] this is box[1][0] this is box[1][1]  this is box[1][0]  The last print statement shows the problem: When you call boxes[0][0], you get boxes[1][0]. Python seem to stick with the last instanced row index. This problem does not occur with list of objects, only with arrays. I suspect a limitation in Python (I'm using 3.8.5). I searched the web, but found nothing. What do you think is the problem here? How would you create this array of objects? Thank you very much for your help!

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


Question: There are 6n flowers of one type and 3 flowers of another type, total no of garlands possible?  My approach-: I have considered 3 cases Case 1. Garland contains only 6n  flowers No of possible ways $= \frac{(6n-1)!}{2}$  Case 2. Garland contains only type containing 3 flowers No of permutations$= \frac{2!}{2}$  Case 3. Garland has both types of flowers No of permutations $= \frac{(6n+2)!}{2*6n!*3!}$  Total permutations$= (6n+2)!/(2*6n!*3!) + 1 + (6n-1)!/2$  Is this approach correct or have I missed/considered some cases? What approach should be used for such questions?

This is my first question here.   I'm given $3$ white flowers and $6m$ red flowers, for some $m \in \mathbb{N}$. I want to make a circular garland using all of the flowers. Two garlands are considered the same if they can be rotated to be the same. My question is: how many different garlands can I make?  I tried an approach in which I divided the question into three parts:   No. of ways in which the white flowers are all together No. of ways in which two white flowers are together No. of ways in which no two white flowers are together   Can you please help?  The answer is $3m^2+3m+1$ in the book that I saw  Thanks


There have been multiple times that moderators have near instantly closed valid questions.   This authoritarian action is completely undemocratic.   I've found more than multiple times that questions have been reopened.   See      @KilianFoth is right. Nevertheless downvotes should be for bad   questions, not for questions we don't like. Furthermore, there are   already three votes to close the question because it would be "opinion   based", despite the question being totally neutral and non   controversial (either there are such operators in some exotic language   or there are't).   And:      4 "primarily opinion based" close votes for a question that is   definitely not opinion based? WTF? That is one of those cases were I   really wish there were a "keep open" close vote option. – Heinzi Feb 7   '18 at 7:51   Moderators are granted moderation power  that comes from asking or answering questions not on any moderation experience or merit. Meaning they could be great moderators or terrible moderators. Either way they are given that power without training, guidance or experience.   The users and typically new users have reported despair at topics closed or moved to other communities. Since late last year Stack Exchange has claimed it wanted to prevent that.   I suggest that part of that effort users should be able to vote or grade the quality of moderators, moderators who again, could be good, great or terrible at moderation. We don't know!  If users with moderation power (moderators) can close questions, users without moderation powers should be able to grade them.   Not a duplicate of provided questions (see comments).    Since you down voted my issues every year I post on them I'll give you some replies you can use to save time.   CANNED REPLY 1: Your idea is stupid and you're stupid. Your question is a duplicate. We've heard it many times before. Instead of taking that as a sign for improvement we'll defend the existing system the way it is and dismiss your concerns. Our system isn't oppressive, you're just a liar. Even if it is we have plenty of users. Your issue is not important us.   CANNED REPLY 2: Thank you for your suggestion. If you took the time out of your day to mention it it must be important to you. If it's important to you then it's important to us and it's not our desire to cause trauma to our users. While we get a lot of feature requests we can't address them all. We'll take your suggestion into consideration as we make improvements to our sites.

Since high rep users gain some pretty powerful privileges I wonder what checks and balances are in place to prevent them from abusing their privileges.  I am not near these privileges on any SE site, but a particular user that I think might abuse them is. , demonstrates one way that misuse can be highlighted.  Is that the only thing that prevents bad behavior for high rep users? You have to 'report' them on meta? What if you try to stop them but they 'punish' you, and you can't do anything about it because you are low rep? It would be nice if all their actions were public record; maybe some where on their profile page.  Things that might be done that abuses privileges in my opinion:   Someone may edit questions so they favor his own answer, or disfavor yours because your he does not like your answer. Delete votes on questions (I don't even know what this means) for subjective reasons. Dismiss flags that are valid.   Also, I am a bit confused between a moderator and a trusted user. I know that mods have more power but I would like to see a side-by-side comparison.


Let $H \leq S_{10}$ such that $H$ has at least one 9-cycle, one   2-cycle, and acts transitively on $\{1,2,...,10\}$. Find the minimum   size of $H$.   So, I am really stuck on this problem. I think the 9-cycle can be rearranged by an operation on itself, so that we get all the 9-cycles containing those 9 elements. I don't know how to go from there.

Suppose $G$ is a transitive subgroup of $S_n$ such that it there exist $\sigma, \tau \in G$ such that $\sigma$ is an $(n-1)$-cycle and $\tau$ is a transposition. Prove that $G = S_n$.   I just don't understand how to mathematically use the transitive nature of the subgroup.


I have some software that only works with Google chrome 35 and 37.  I want set one of my users up with this software - but I don't know where to find the download for 35 or 37.  Any ideas on a good resource for old browser's?

I have a specific requirement (probably silly!) for testing a browser of Chrome. I realize this requirement isn't the most logical, but politics being what they may I'd like to know the technical workaround.  I need to test a site in version, let's say, 28 of Google Chrome. Obviously Google runs a silent updater which can be disabled, but at this point they don't (to my knowledge) release old archives of the MSI installers (which I can easily use to reinstall and force a no-update option for testing). If we can get this working on a single instance then there's a possibility that a virtual machine or some other workaround will give us an easy restore point to meet this test.  If anyone has a good idea of where to start here that would be amazing.  I've already floated the "why are we doing this question?" and the answer is that it is part of the requirements so we need to make a best effort.  UPDATE:   FileHippo appears to only archive the online installer (automatic update)  OldApps doesn't archive Chrome anymore  OldVersion doesn't appear to have any Chrome Archives   UPDATE 2:  - The accepted answer's server is the correct solution here at this point in time. Basically speaking you're looking for the full install (30 or so MB). If you have an 800K file it is the online installer which automatically updates.


I am trying to include a package to an ubuntu ISO. I have googled and found some solutions with kickstart. But, I dont want to automate the partitioning and all. I wish it to appear like a normal installation and it should list team viewer after OS is installed. Is it possible?   Update : I dont mean to edit a Live CD. I mean the installation disk. The package must  be installed along with the OS and not live CD

I would like to customize Ubuntu live CD by installing some additional packages. I have followed   but it doesn't seems to work. Can anyone provide clear instructions?   Note: I do not prefer Remastersys, manual way will be appreciated.  Customization  Packages that I want to install:   Thunderbird    Samba    SSH       Changes that I need:   Remove Games menu from the Application menu Firefox shortcut on Desktop Radiance as the default Theme Different default Ubuntu Wallpaper   Configuration file changes   I want the panel to be placed at the bottom I want to paste my Samba configuration file instead of default Samba configuration I have few Firefox shortcuts and folders I would like to show that in Desktop Also it will be nice if you say me how to change the icon sets   Recent Updates   I have customized Ubuntu 10.10 with Firefox shortcuts and few folders on desktops. Everything went smooth. But the installer gets crashes after choosing the timezone. How do i fix this issue? Also setting wallpaper affects the login screen. The wallpaper which i set is displayed on the login screen also. I just want the default one for the login screen.


I installed an HP printer from a local network. Now, for some reason, the internal address of the printer has changed from 10.0.0.3 to 10.0.0.2. I opened the printer setting, but cannot change the IP address from there:  Is there another way to change the printer's address?

I have a network printer with a static IP address. Recently I've changed my subnet and had to allocate it a new static IP address.  I've tried to update CUPS with the new IP address by going to Printers -> [Printer name] -> Administration -> Modify printer -> Current connection -> Continue. I'm presented with this screen but the connection string is not an editable box, so I can't change the IP address:    How can I modify the IP address?


Can you please help me write a test class for my code:  public class retrieveOpenSafetyObservations    {    private ApexPages.StandardSetController controller;    public List<Safety_Observation__c> getOutbaseSafetyObservation()                      {                                       return [SELECT Id, Name, Title__c, Priority__c,   Risk_Factor_Ranking__c,Contractor__c,Status__c    FROM Safety_Observation__c WHERE Status__c = 'Open' order by id desc limit 10];        } }   this is what I have so far:   @isTest     public class testRetrieveOpenSafetyObservation{         static testMethod void testOpenSafetyOb(){                   Safety_Observation__c SafObse = new Safety_Observation__c(                   Basic_Risk_Factors__c ='Design',                   Cause_Category__c = '1 Equipment and Material problems',                   Cause_Code_Sub_Category__c = '3E other Human Error not specified here',                   Contractor__c = 'a0fg0000000u09l',                   Contributing_Factors__c = 'qwert',                   Customer_Name__c = '001g0000007q9Z9',                   Description__c  = 'bla bla',                   Human_Factor_Domain__c = 'Staffing Issue (Workload etc.)',                   Human_Factors__c = 'Alarms',                   Performance_Improvment_Factors__c = 'Organisational Change',                   Priority__c =  'Low',                   Risk_Factor_Ranking__c = '2',                   SO_Number_Name__c = 'Test',                   Status__c = 'Open',                   Title__c = 'Test'                   );            insert SafObse ;                               }         }

Can you please help me to write a test class for the blow code:   public class retrieveOpenSafetyObservations    {          private ApexPages.StandardSetController controller;          public List<Safety_Observation__c> getOutbaseSafetyObservations()                      {                                      return [SELECT Id, Name, Title__c, Priority__c,   Risk_Factor_Ranking__c,Contractor__c,Status__c               FROM Safety_Observation__c WHERE Status__c = 'Open' order by id desc limit 10];        }}   here is what I have so far:    @isTest         public class testRetrieveOpenSafetyObservation{             static testMethod void testOpenSafetyOb(){                     retrieveOpenSafetyObservations oso = new retrieveOpenSafetyObservations(                       Safety_Observation__c SafObse = new Safety_Observation__c(                       Basic_Risk_Factors__c ='Design',                       Cause_Category__c = '1 Equipment and Material problems',                       Cause_Code_Sub_Category__c = '3E other Human Error not specified here',                       Contractor__c = 'a0fg0000000u09l',                       Contributing_Factors__c = 'qwert',                       Customer_Name__c = '001g0000007q9Z9',                       Description__c  = 'bla bla',                       Human_Factor_Domain__c = 'Staffing Issue (Workload etc.)',                       Human_Factors__c = 'Alarms',                       Performance_Improvment_Factors__c = 'Organisational Change',                       Priority__c =  'Low',                       Risk_Factor_Ranking__c = '2',                       SO_Number_Name__c = 'Test',                       Status__c = 'Open',                       Title__c = 'Test'                       );                insert SafObse ; );                                   }               }


I cannot get matplotlib to work under a virtualenv in Ubuntu 20.04.  (myenv) $ pip3 install matplotlib Requirement already satisfied: matplotlib in /usr/lib/python3/dist-packages (3.1.2) (myenv) $ pip3 list | grep matplotlib matplotlib              3.1.2          (myenv) $ python3 Python 3.8.2 (default, Mar 26 2020, 15:53:00)  [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. Reading /home/user1/.pythonrc readline is in /home/user1/apps/anaconda3/envs/myenv/lib/python3.8/lib-dynload/readline.cpython-38-x86_64-linux-gnu.so >>> import matplotlib Traceback (most recent call last):   File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'matplotlib' >>>      But it works under the base virtualenv  (base) $ python3 Python 3.7.6 (default, Jan  8 2020, 19:59:22)  [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. Reading /home/user1/.pythonrc readline is in /home/user1/apps/anaconda3/lib/python3.7/lib-dynload/readline.cpython-37m-x86_64-linux-gnu.so >>> import matplotlib >>>    Note the different python versions. I don't recall doing any upgrade, I simply create myenv with conda create -n myenv.  I find it puzzling. How can I fix this?

I'm trying to install kivy for python 3 using apt-get:      sudo apt-get install python3-kivy   And it is installed in      /usr/lib/python3/dist-packages   But, when I tried to load it in python, I get a ModuleNotFoundError      Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 13 2017, 12:02:49)      [GCC 7.2.0] on linux     Type "help", "copyright", "credits" or "license" for more information.     >>> import kivy     Traceback (most recent call last):       File "<stdin>", line 1, in <module>     ModuleNotFoundError: No module named 'kivy'   When I check the system path from python, I only get packages in Anaconda:      >>> import sys     >>> print('\n'.join(sys.path))      /home/santiago/anaconda3/lib/python36.zip     /home/santiago/anaconda3/lib/python3.6     /home/santiago/anaconda3/lib/python3.6/lib-dynload     /home/santiago/anaconda3/lib/python3.6/site-packages     /home/santiago/anaconda3/lib/python3.6/site-packages/torchvision-0.2.0-py3.6.egg   Is there any way to include the '/usr/lib/python3' path to Anaconda?  Thanks.


For example, what's the difference between:   I've had a wonderful time here and I've been having a wonderful time?  Does the present perfect simple indicate that the action is over?

Which sentence is correct:  "I have been having classes for three months."  or  "I have had classes for three months."


I'm trying to learn about async and await in C#, and have been reading MSDN.  I arrived at  which I've copied into a console app in the hope of using the debugger to see how exceptions are handled asynchronously.  Using the info , I adapted the MS code to run it in the app (perhaps wrongly as a learner).  The error message I get is on this line:  Task<string> theTask = DelayAsync();      CS0120    An object reference is required for the non-static field,   method, or property 'Program.DelayAsync()'   Is this something I've done wrong, or a bug in the MSDN code? Can anyone please explain how to run the DoSomethingAsync() method from a console app so that I can see in the debugger how the exception is returned please?  class Program {     static void Main()     {         DoSomethingAsync().Wait();     }      static async Task DoSomethingAsync()     {         Task<string> theTask = DelayAsync();         try         {             string result = await theTask;             Debug.WriteLine("Result: " + result);         }         catch (Exception ex)         {             Debug.WriteLine("Exception Message: " + ex.Message);         }         Debug.WriteLine("Task IsCanceled: " + theTask.IsCanceled);         Debug.WriteLine("Task IsFaulted:  " + theTask.IsFaulted);         if (theTask.Exception != null)         {             Debug.WriteLine("Task Exception Message: " + theTask.Exception.Message);             Debug.WriteLine("Task Inner Exception Message: " + theTask.Exception.InnerException.Message);         }     }      private async Task<string> DelayAsync()     {         await Task.Delay(100);         //throw new OperationCanceledException("canceled");         //throw new Exception("Something happened.");         return "Done";     } }

Consider:  namespace WindowsApplication1 {     public partial class Form1 : Form     {         public Form1()         {             InitializeComponent();         }          private void button1_Click(object sender, EventArgs e)         {             //int[] val = { 0, 0};             int val;             if (textBox1.Text == "")             {                 MessageBox.Show("Input any no");             }             else             {                 val = Convert.ToInt32(textBox1.Text);                 Thread ot1 = new Thread(new ParameterizedThreadStart(SumData));                 ot1.Start(val);             }         }          private static void ReadData(object state)         {             System.Windows.Forms.Application.Run();         }          void setTextboxText(int result)         {             if (this.InvokeRequired)             {                 this.Invoke(new IntDelegate(SetTextboxTextSafe), new object[] { result });             }             else             {                 SetTextboxTextSafe(result);             }         }          void SetTextboxTextSafe(int result)         {             label1.Text = result.ToString();         }          private static void SumData(object state)         {             int result;             //int[] icount = (int[])state;             int icount = (int)state;              for (int i = icount; i > 0; i--)             {                 result += i;                 System.Threading.Thread.Sleep(1000);             }             setTextboxText(result);         }          delegate void IntDelegate(int result);          private void button2_Click(object sender, EventArgs e)         {             Application.Exit();         }     } }   Why is this error occurring?     An object reference is required for the nonstatic field, method, or property 'WindowsApplication1.Form1.setTextboxText(int)


I have seen the equation of a wave written as  $y = A \sin (kx – \omega t)$. However sometimes I see it written as $y=A\sin(\omega t-kx).$ Please notify the correct one and provide sufficient reasons.

What is correct wave equation: $y=A \sin(\omega t-kx)$ or $y=A\sin(kx-\omega t)$?  How are these wave equations used in the positive $x$-direction and negative $x$-direction?


I wanted to create a generic array that could contain any type of data. The class looks like this GenericArray.h:  #pragma once #include "LinkedList.h"  template<class T> class GenericArray { public:     GenericArray();     void push(T to_push);  private:     LinkedList<T>* _first; };   And the implementation looks like this GenericArray.cpp:  #include "GenericArray.h"  template<class T> GenericArray<T>::GenericArray() { this->_first = NULL; }  template<class T> void GenericArray<T>::push(T to_push) {     LinkedList<T>* new_node = new LinkedList<T>(to_push);     new_node->_next = NULL;     if (this->_first == NULL)     {         this->_first = new_node;         return ;     }     else     {         LinkedList<T>* last_nude = this->_first;         while (current->_next != NULL)         {             current = current->_next;         }         last_nude->_next = new_node;     } }   But yet, when Im trying to build a file,  I get this ERROR:     Severity  Code    Description Project File    Line    Suppression State   Error LNK2019 unresolved external symbol "public: __thiscall   GenericArray::GenericArray(void)"   (??0?$GenericArray@H@@QAE@XZ) referenced in function   _main Homework5   c:\Users\SSS\documents\visual studio 2017\Projects\Homework5\Homework5\main.obj 1   And:     Severity  Code    Description Project File    Line    Suppression State   Error LNK2019 unresolved external symbol "public: void __thiscall   GenericArray::push(int)" (?push@?$GenericArray@H@@QAEXH@Z)   referenced in function _main  Homework5   c:\Users\VVV\documents\visual   studio 2017\Projects\Homework5\Homework5\main.obj 1   Obviously I did somthing wrong when using bad with templates. But I followed my code in order to find the problen, and I couldnt find anything suspicious.   If you can enlighten me, I will me gratful. Thanks.

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


Do we have any other evidence other than red shift? Is anyone trying to disapprove inflation? Also, can red shift occur because of large distance, not only because two objects are going farther from each other?

There's another question on physics.SE whose , if I have understood it correctly, explains that the farther the points are in space the faster they are moving away from each other.     Actually, the apparent speed with which two of the points on the   circle in a distance $D$ of each other would move relative to each   other will be $v = H_0 D$ where $H_0$ is the speed the balloon itself   is expanding.   This means that even the ruler sitting on my desk is expanding, just that the expansion is very very slow owing to the ruler's small size relative to the cosmic scales. However, if everything is scaling then everything should apparently be of the same size to an observer in such an expanding space. The  quote from the show "The Big Bang Theory" comes to mind.   To be able to counter that, there're some phenomena that we can observe which are scale invariant. Red-shift would be one such phenomenon. But is red-shift the only way we can tell that the space is expanding? Is there a logical flaw in my thinking? I know that red-shift is a result of the Doppler effect - there's bound to be a decrease in the frequency of a signal, as perceived by an observer, emitted by a source which is moving away relative to the observer.


I want to install Firefox browser on my Mac laptop. I go to the Firefox website from Google and click on download. It downloaded a Firefox 77.0.1.dmg file. How do I install Firefox using this file? This does not look like Firefox icon.

I've downloaded Firefox and it's now sitting on my desktop as Firefox.dmg. When I double click on Firefox.dmg it opens up a window with Firefox in it so I can use it - does this mean the application has been installed?    Community Wiki'd the question because I think it's a worthwhile question to have on the site for pointing people to, it's not exactly intuitive to do and not a question I think I deserve any rep from.


I recently bought an asset for my game, basically a tilesheet, with seperate pngs as well, but where as previously I've created tilemaps out of identically sized tiles these are all in varying sizes but scaled to fit in with say 128 x 128 tiles or 256 x 256 tiles.  so one of the main blocks might be 128 x 128 but some other elements of them may be slightly oddly sized such as  173 x 214, this obviously wont tile well as it is, so I was wondering how I should approach this? do i need a tile editor that can support layers with different dimensioned tiles? or do i need to find some way of chopping, padding and aligning these images into the same 128x128 tiles?  thanks

Here is what I want to do with my tile map that I am unsure of. As you can see the top walls are way larger then the bottom and side ones (this is also an issue with my corners which are odd shapes [more like an L then a square] as well as larger then the 40x40px that my current tiles are).    I have also attached the tile sheet I am using for the tiles to show you what the corners and tops look like compared to the rest of the tiles.  What I’m thinking is I might be able to just draw them using the same array I have if I use the tiles width and height instead of a set WxH? I dont know how well this will work, but were the blocks that will have different values will be blocks the player/NPCs can’t step on then it may not be an issue, again I’m not even sure if that is a viable solution.  My code in case you want to see how I'm currently handling it:  (pastebin) (edit:im not handling it, meant how I'm currently doing the map)  tl;dr - how can I take take my 2d looking tile map and change it to have different size tiles? or is there a better way to do what I am trying to do? Is there a name of a method that I should be looking for while googling?


Can we name class using alphanumeric values ?like class Tier1, Tier2 and so on.Is this come under good practice. What is the recommendation around naming class. I know this is very generic question and simple one however there were instance during code review I often came across class names which seems to be usual.

What characters are valid in a Java class name? What other rules govern Java class names (for instance, Java class names cannot begin with a number)?


For whatever reason when ever i insert an object into my scene, it bounces around. The markers I have placed, work perfectly, 0.183 solve error, but the object just bounces and moves when I render the video. The object it's self isn't moving, but for some reason the camera sees it that way or something like that. I don't really get it, I'm new to this whole motion tracking thing.

Whenever I do camera tracking in Blender the reconstruction is always zooming out or not on the axis. I have a great quality camera, but the end results of the camera tracking always has the model sliding. If you have a solution please tell me.


We have a derivative function $f$ with for every $c$ element of $\mathbb{R}: |f'(c)|<M$. I tried to prove that prove that $\displaystyle \left|\int_{0}^{1}f(x)\mathrm{d}x-\frac{1}n \sum_{k=0}^{n-1}f\left(\frac{x}n\right)\right|\leq\frac{M}{n}$. I really have no idea how to start. I'm trying to use integral , derivative, sums ... so my paper is full of definitions but i can't use one. Can someone give me a hint how to start with this question so that i can move on. I'm really sorry i can't give a proper prove that i have already found but i'm stuck at the beginnin already.

$f$ is differentiable in $[0,1]$ ,$\sup_{x\in[0,1]}|f'(x)| \le M\lt+\infty $ . Prove $$ \left|\sum_{i=0}^{n-1} \frac{f(i/n)}{n}-\int_{0}^{1}f(x)\,\mathrm{d}x\right|\le\frac{M}{2n} $$ I tried to write $\int_{0}^{1}f(x)\,\mathrm{d}x$ as Riemann sum by partition $[0,1]$ into equal $2n$ parts. And want to use Mean Value Theorem. But I can't get $\frac{1}{2n}$ out of the absolute value. Come to seek some help ... Thanks and regards!


In my media center directory all modified times of my folders are somehow not the desired date.  How can I change all modified times of the main folders to the modified time of the newest media-file inside each folder?  for example:  cd /tmp mkdir test cd test mkdir d1 mkdir d2 touch d1/text1.txt touch d1/movie1.mov touch d2/text2.txt touch d2/movie2.mov touch notthis.file   now I tried:  ls -td *| head -n 1   but that gives out:  notthis.file

I was wondering if anyone knows how to change the timestamps of folders recursively based on the latest timestamp found of the files in that folder.  So for example:   jon@UbuntuPanther:/media/media/MP3s/Foo Fighters/(1997-05-20) The Colour and The Shape$ ls -alF total 55220 drwxr-xr-x  2 jon jon    4096 2010-08-30 12:34 ./ drwxr-xr-x 11 jon jon    4096 2010-08-30 12:34 ../ -rw-r--r--  1 jon jon 1694044 2010-04-18 00:51 Foo Fighters - Doll.mp3 -rw-r--r--  1 jon jon 3151170 2010-04-18 00:51 Foo Fighters - Enough Space.mp3 -rw-r--r--  1 jon jon 5004289 2010-04-18 00:52 Foo Fighters - Everlong.mp3 -rw-r--r--  1 jon jon 5803125 2010-04-18 00:51 Foo Fighters - February Stars.mp3 -rw-r--r--  1 jon jon 4994903 2010-04-18 00:51 Foo Fighters - Hey, Johnny Park!.mp3 -rw-r--r--  1 jon jon 4649556 2010-04-18 00:52 Foo Fighters - Monkey Wrench.mp3 -rw-r--r--  1 jon jon 5216923 2010-04-18 00:51 Foo Fighters - My Hero.mp3 -rw-r--r--  1 jon jon 4294291 2010-04-18 00:52 Foo Fighters - My Poor Brain.mp3 -rw-r--r--  1 jon jon 6778011 2010-04-18 00:52 Foo Fighters - New Way Home.mp3 -rw-r--r--  1 jon jon 2956287 2010-04-18 00:51 Foo Fighters - See You.mp3 -rw-r--r--  1 jon jon 2730072 2010-04-18 00:51 Foo Fighters - Up in Arms.mp3 -rw-r--r--  1 jon jon 6086821 2010-04-18 00:51 Foo Fighters - Walking After You.mp3 -rw-r--r--  1 jon jon 3033660 2010-04-18 00:52 Foo Fighters - Wind Up.mp3   The folder "(1997-05-20) The Colour and The Shape" would have its timestamp set to 2010-04-18 00:52.


My child has transferred phones. I now have his old phone and want to repurpose it, sell it, donate it, give it to a co-worker, use it myself, etc.  The FRP protection prevents me from doing that. I understand the point of FRP but the logic behind it is somewhat flawed and doesn't cover a multitude of legitimate scenarios. I own this phone, not my child!  My child is not present to provide credentials to bypass this feature. How do I reset this essentially bricked device without having to use hacking software?    Note: this question does look a bit like a duplicate of , but none of the answers there are acceptable or work.

I won a Samsung Galaxy S6 Edge, signed into it with my Google account, played around with it, wiped it, and sold it.  Now the person can't get past setup because it's saying he must login with an account previously synced to the phone.   Is there anything I can do from my side to remove this lock?


I'm try to reproduce the same behavior of my work laptop with my personal computer. In my work laptop, I'm administrator. There are a few more accounts like ITadmin and similars but my account has admin privileges and I never need to "Run as Administrator" any of my software. On my personal computer I have a similar setup. Of course I'm admin but I still need to "Run as Administrator" all the programs that requires such permissions. Both computers have the UAC set to the minimum. What's the magic setting on my work laptop?

When I was running Windows 7 Ultimate 32-bit, I had UAC disabled and everything was working smoothly for me. Now I've updated to Windows 10 Pro 32-bit (and recently also the 2015-11 update), I'm having a few issues. Although I have UAC set to "Never notify" in Control Panel, I find that certain activities are still fettered by UAC. For example, Windows Explorer doesn't let me create a file in certain folders, such as C:.  I use the Command Prompt quite a lot. In Windows 7, with UAC turned to "Never notify", Command Prompt automatically started as Administrator; whereas under Windows 10 I have to explicitly right-click and choose "Run as Administrator". More annoyingly, when I connect to the Windows 10 machine from another PC, using NET USE with my username for the target machine, I don't have access to do anything in folders that need admin access. I haven't found a workaround for this.  Is there a way to completely turn off UAC in Windows 10, so that I can do all admin tasks easily?


In Javascript (in Chrome devtools console panel and Node.js v0.12.5), I'm getting an incorrect answer for the product of these two large numbers:  input: 41962049 * 1827116622  output: 76669557221078480  In C++ and C#, I get the correct answer of 76669557221078478 when casting the expression to a 64-bit int.  I'm assuming this is an integer overflow issue, but I certainly could be wrong.  Is there a way to get accurate arithmetic products for large numbers in Javascript without using an external library like BigInteger? This is for an online class that doesn't allow additional libraries.  Thanks for your help.  EDIT: Thanks for the explanation explaining how this isn't actually integer overflow, Patrick Roberts! Very useful.   EDIT 2: jfriend00, I think this question is different than the one you linked to because I am trying to figure out if there is a way to work around JS's limitations without relying on an external library. The answer you provided in the comments helped answer my question, so thank you!

Is this defined by the language? Is there a defined maximum? Is it different in different browsers?


Would someone be able to explain why a sphere when projected with the pinhole projection model has its projected 2D image be an ellipsis. IN particular when the sphere is not directly in front of the center of projections why is the image of the sphere skewed? Any diagrams explaining this or formula would be greatly appreciated.

My intuition has always been that when any sphere is projected into 2D space that the result will always mathematically be an ellipse (or a circle in degenerate cases).  In the past when I was actively doing my own graphics programming and brought this up with other people they were adamant that I was wrong. If I recall correctly they believed the result could be something vaguely "egg shaped".  Who was correct?    Since there is already one answer submitted, I don't wish to totally change my question but I realize I left out important details due to losing familiarity with the field over the years.  I intended to ask specifically about perspective projection where the projection is a linear application.  The other projections are of course interesting for many uses so I wouldn't want them removed at this point. But it would be great if answers could have perspective projection as their most prominent section.


Is the following sentence grammatically correct?      I bought a real heavy book.   I feel it should have been a really heavy, but I heard people use a real heavy all the time.

Is this correct?     That is a real cool answer.   I learned that that was incorrect, since "real" is an adjective which can describe a noun, e.g. "real answer" but it is not an adverb which can describe an adjective, "real cool". Instead you would have to say:     That is a really cool answer.   Since "really" is an adverb.


I am looking for a solution to separate the tag names by comma. The tag name i am using is without a link. Here goes the code:  <?php $my_tags = get_the_tags();?> <?php echo $my_tags[0]->name?><?php $count=1; foreach ($my_tags as $my_tag) { if ($count != 1) {?> <?php echo $my_tag->name?> <?php } $count++; } ?>   The above code i got it from this page --> . But, the outcome is without a comma(,) if there are more than 1 tag.  Any solutions? Thanks!

I'm trying to show terms of custom taxonomies. I have that. But, my problem is how to separate when I have multiple terms. My code:
     <?php $loop = new WP_Query( array( 'post_type' => 'member', 'posts_per_page' => -1 ) ); ?>     <?php while ( $loop->have_posts() ) : $loop->the_post(); $do_not_duplicate = $post->ID; ?>

<?php $terms = get_terms('department');                 foreach ( $terms as $term ) {                     echo $term->name.' and ';                 }             ?>
             <?php the_post_thumbnail('full'); ?>

<?php the_title(); ?>

<?php $terms = get_terms('position');                     foreach ( $terms as $term ) {                         echo $term->name.' and ';                     }                 ?>
                 <?php the_content(); ?>                 <a href="<?php the_permalink(); ?>">See Full Biography

     <?php endwhile; wp_reset_query(); wp_reset_postdata(); ?>
   With this I am able to display all terms used (good). But, I need it to say "and" only between terms. Right now, it says "and" after every term, even it's only one term. I know my problem lies within here:  <?php $terms = get_terms('department');     foreach ( $terms as $term ) {         echo $term->name.' and ';     } ?>   How do I only get the "and" to only show between terms and not after every term?


I want to block access to the Internet for all apps and process on my machine except for ones specifically allowed. I used to achieve this with Firewall when I was using Windows. I have a very tight data plan (3rd world country problems) so I have to watch which apps use the Internet. How can I achieve this in Ubuntu 16.04 LTS?   Edit: Most of the answers I found here are either about blocking certain sites or blocking a certain app rather than blocking the entire app list and allowing only a handful apps.

I would like to use a software to control which program may connect to the internet. I know that this behaviour is associated with the word "firewall", but some Linux users are very upset if somebody demands a Personal Firewall. I don't want to upset you by demand such a program. I don't want to "secure ports" or other stuff a Personal Firewall promises on Windows. I looked into iptables but it does not fit my requirements.  I saw an excellent answer here () but it's very uncomfortable to set this up.  Is there a software that asks for each program if it may access the internet?


I had some code I was profiling and was surprised at how much time was being spent on Math.min(float, float).  In my use case I needed to get the min of 3 float values, each value is guaranteed to not be NAN or another edge case float value.  My original method was:  private static float min2(float v1, float v2, float v3) {     return Math.min(Math.min(v1,v2),v3); }   But I found that this was about 5x faster:  private static float min1(float v1, float v2, float v3) {     if (v1 < v2 && v1 < v3) {         return v1;     }     else if (v2 < v3) {         return v2;     }     else {         return v3;     } }   For reference this is the code for Math.min:  public static float min(float f1, float f2) {     if (f1 > f2) {         return f2;     }     if (f1 < f2) {         return f1;     }     /* if either arg is NaN, return NaN */     if (f1 != f2) {         return Float.NaN;     }     /* min(+0.0,-0.0) == -0.0 */     /* 0x80000000 == Float.floatToRawIntBits(-0.0f) */     if (Float.floatToRawIntBits(f1) == 0x80000000) {         return -0.0f;     }     return f2; }   Note: My use case was symmetric and the above was all true for max instead of min.  EDIT1: It turns out ~5x was an overstatement, but I am still seeing a speed difference  inside my application. Although I suspect that may be due to not having a proper timing test.  After posting this question I wrote a proper micro optimization speed test in a separate project. Tested each method 1000 times on random floats and they both took the same amount of time. I don't think it would be useful to post that code as it's just confirming what we all already thought.  There must be something specific to the project I'm working on causing the speed difference.  I'm doing some graphic work in an Android app, and I was finding the min/max of the values from 3 touch events. Again, edge cases like -0.0f and the different infinities are not an issue here. Values range between 0.0f and say 3000f.  Originally I profiled my code using the Android Device Monitor's Method Profiling tool, which did show a ~5x difference. But, this isn't the best way to micro-profile code as I have now learned.  I added the below code inside my application to attempt to get better data:  long min1Times = 0L; long min2Times = 0L; ... // loop assigning touch values to v1, v2, v3         long start1 = System.nanoTime();         float min1 = min1(v1, v2, v3);         long end1 = System.nanoTime();         min1Times += end1 - start1;         long start2 = System.nanoTime();         float min2 = min2(v1, v2, v3);         long end2 = System.nanoTime();         min2Times += end2 - start2;         double ratio = (double) (min1Times) / (double) (min2Times);         Log.d("", "ratio: " + ratio);   This prints a running ratio with each new touch event. As I swirl my finger on the screen, the first ratios logged are either 0.0 or Infinity or NaN. Which makes me think this test isn't very accurately measuring the time. As more data is collected the ratio tends to vary between .85 and 1.15.

How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related:


In Windows 8.1, is it possible to set the permissions of the folder to prevent users from renaming, moving or deleting a folder but allowing changes to any of it's contents and if so how?

On my computer running Windows XP Pro SP3 I have a folder on my desktop that is very important. How can I lock it so that I can alter anything in it, but the folder itself cannot be removed without resetting a (lock/unlock?) switch?


I think the following problem is not difficult, but I cannot solve it.  Prove the following fact.     Let $A, B$ be square matrices.   If $A B = A + B$, then $A B = B A$.

I was doing the problem $$ A+B=AB\implies AB=BA. $$  $AB=BA$ means they're invertible, but I can't figure out how to show that $A+B=AB$ implies invertibility.


My first question is: How would one solve such problems (in general,squares+rectangles). What should be the general technique?How can this problem be reduced to a mathematical problem?    My second question is: When to be sure that we have counted all the squares in such problems?

This is one of those popular pictures on sites like Facebook. I always see a huge variation of answers such as $8, 9, 16, 17, 24, 28, 30, 40, 41, 52,$ etc., yet I've never seen a definitive answer on any website.    I counted $16$ whole squares ($4$ going down on left side, $4$ going down on right side, $8$ small squares in the centre). With this method the answer could also be $17$ if you want to count the entire shape as one big square.  I can also see the answer being $24$ if you count the smaller squares separately, as if they were floating above the main grid instead of intersecting with it.  Is there a right answer, or is it possible that there is no 'right' answer and it just depends on your counting method?


Try going to any file, right clicking on it, and clicking on the "Details" tab. Like this photo   I want to change this values. Also Can I add custom properties the file details. Especially I want to do this changes for tif,jpeg,png,pdf files. Can I see my custom properties in "Details" window?  I found this page but it can change only office files.

I would like to write a small program in C# which goes through my jpeg photos and, for example, sorts them into dated folders (using MY dating conventions, dammit...).   Does anyone know a relatively easy way to get at the EXIF data such as Date And Time or Exposure programatically? Thanks!


I'm writing (what I thought would be) a quick little bash function to identify the most recent photo imported into Apple's standard Photos.app from a DSLR.  So far it looks something like this:  find ~/Pictures/Photos\ Library.photoslibrary/Masters -type f  Pretty simple. As it is, it lists the entire library of imported photos. My first instinct was to simply | tail -n 1, but the files aren't listed in any discernible order.   I considered | sort -V, but it's not unusual for the filenames (i.e. IMG_0123.CR2) to become out of order.  FYI: This BSD version of find doesn't support the -printf option found in the GNU version.

Using the Mac OS X Terminal, how do I write a find command that orders results by modification date (most recent first)?  There are similar questions already, but they refer to GNU find and POSIX, but I do not know whether Mac OS X is GNU or POSIX or something else.


I know that this question has been asked before, but none of the solutions have solved my problem.   Ubuntu boots and runs properly with the USB I used to install it plugged in to the computer, but when I shut down, remove the USB, and reboot, Windows Boot Manager appears. I am very confused why my computer wants anything to do with Windows because I chose to wipe my drive when installing Ubunbu.   I have tried using Boot-Repair, but Windows Boot Manager still launched when I restarted without the USB.  is the log from Boot-Repair.

I had Ubuntu 12.04 Beta installed on my computer. When 12.04 was finally released, I made a bootable USB Flash Drive using Startup Disk Creator.  Then I decided to check if this drive works properly and to reinstall the system on my desktop. I must add, my desktop behaves a bit strange when it comes to bootable USB's, it recognizes them as HDD.  In BIOS I changed priority of boot so USB Flash Drive (recognized as HDD) was first. Successfully booted, I installed Ubuntu. Everything worked fine, but...  Now I cannot boot from my real HDD. Every time I want to boot, I put the USB Flash Drive into my computer, boot, safely remove it and everything works.  What do I need to do to repair boot?


Every time I do anything I do anything related to sudo (mostly installing repositories), it says command not found.  I type:  sudo add apt-repository ppa:ppsspp/stable   It then says  sudo:add-apt: command not found   Sometimes it tells me to manually run configure --a, which I do, and it still doesn't work. Anyone know how to fix???  I'm on Ubuntu 18.04 LTS

The server version of Ubuntu does not have the  command. How can I add a  (PPA) to the server without this command?


I keep getting a null pointer exception. any help on why this is would be great. I believe that the problem resides in my find(String name, Node root) method. Any help with how to fix this would be great. Thank you  public class FamilyTree{      private Node root;      private class Node     {         private String name;         private Node father;         private Node mother;         private Node(String name, Node father, Node mother)         {             this.name = name;             this.father = father;             this.mother = mother;         }     }      public FamilyTree(String ego)     {         this.root = new Node(ego, null, null);     }      private Node find(String name)     {         return find(name, root);     }      private Node find(String name, Node root)     {         if( name != null) {             if (root.name.equals(name)) {                 return root;             } else {                 find(name, root.father);                 find(name, root.mother);             }         }         return null;     }      public void addParents(String ego, String father, String mother)     {         if (find(ego) == null)         {             throw new IllegalArgumentException();         }         else         {             find(ego).father = new Node(father,null, null);             find(ego).mother = new Node(mother, null, null);         }     }      public boolean isDescendant(String ego, String ancestor)     {         if(find(ego) == null ||find(ancestor) == null )         {             return false;         }         else         {             return isDescendant(find(ego), find(ancestor));         }     }      public boolean isDescendant(Node root, Node ancestor)     {         if( ancestor != null)         {             if (root.equals(ancestor))             {                 return true;             }         }          return false;     }  }

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?


INMO '92 Question 9:  Find $n$ such that in a regular $n$-gon $A_1A_2 ...A_n$ we have $$\frac{1}{A_1A_2}=\frac{1}{A_1A_3}+\frac{1}{A_1A_4}$$  I tried the following Assume it is inscribed in a circle. Then length of chord is $2\sin(\theta)$ where $\theta$ is half the angle subtended at the center between consecutive points. So, $\theta=\frac{180^\circ}{n}$. Then we get $$\csc(\theta)=\csc(2\theta)+\csc(3\theta)$$ Not sure quite how to proceed from there- using double and triple angle formulae doesn't seem to work

If $A_1A_2A_3.....A_n$ be a regular polygon and $\frac{1}{A_1A_2}=\frac{1}{A_1A_3}+\frac{1}{A_1A_4}$.Then find the value of $n$(number of vertices in the regular polygon).  I know that sides of a regular polygon are equal but i could not relate$A_1A_3$ and $A_1A_4$ with the side length.Can someone assist me in solving this problem?


A good friend of mine, who was also active on StackExchange, passed away a couple of days ago.  Does SE have any sort of process in this scenario, or do SE profiles sort of live on forever?  Thanks

It is a bit of a morbid concept, but having recently had a friend die unexpectedly and having to deal with the online repercussions of this event has gotten me to thinking about what should happen to my accounts when I kick the bucket.  I haven't had any great insights yet, but here are some things I think are worth thinking about:   an entry in the FAQ telling the person's loved ones what to do with respect to the account would be extremely helpful, specifically who to contact, how to contact them, and what proof is necessary some form of optional date of death on the user account screen some way to mark the user as no longer being able to generate content and blocking any attempt to login as the user.   The danger I see in implementing such features is the possibility of someone faking another person's death and thereby locking a user out of his or her account or worrying his or her friends.


I have been working with C# ASP.NET MVC5 for a while and I was wondering something. Why are we utilizing the using() to instantiate a class sometimes?  For an example:  using (CyrptoStream cs = new CryptoStream(PARAMETERS) { //SOMETHING }    or  using (Aes encryptor = Aes.Create() {  }   How is that different to MyClass myClass = new MyClass()  Thank you.

User  answered the wonderful  question by mentioning the using keyword. Can you elaborate on that? What are the uses of using?


A few days ago, someone posted a question about updating dataset. After some questions/comments to his question, it didn't receive answers (and no up/down vote).  1 or 2 days later, the user posted the  (he just reformulated the question, posted less code and with bad formatting, the code doesn't compile due to missing ' for comments), so it would be harder to get answer for this question . The question received a +1.   I flagged this question as a duplicate of the previous and asked user to edit the previous instead of creating a new one, but he deleted the previous.  I do not blame the asker, I understand he wanted to keep it's 5 points rep  :) And it seems he solved his problem later.  But now the flag is marked with eventinvalidated because it is impossible now to accept or reject it?   Since my flag is no longer appropriate, I am just curious about what could happen to this flag?

I flagged a  yesterday as a duplicated question and now its status is set to eventinvalidated. I can see this in my Flagging History section.  I'm not sure I understand what it means since the post is still there and has not been deleted. It's the first time I have seen this status.  Could someone enlighten me about that?


I'm in the process of modelling a building similar to reference picture below. I'm struggling with the part I highlighted in red. I can easily model one of these objects, but I'm looking for a way to repeat them regularly with consistent spacing on different surfaces of my mesh. As you can see, the orientations of the different surfaces are different. I tried different options :  Particules/Geometry nodes : I can't find a way to make it not random and have consistent spacing. Having the orientation follow the base geometry also seem challenging but my experience with geometry nodes is very limited. Using instances on faces : I managed to get a somewhat decent result by copying only one strip of my building mesh, inserting loopcuts at each spot where I want to instanciate the child object and configuring an instancer on faces. It's tedious because I need to adjust the number of cuts on each face to have an even spacing and making the corners look good take a lot of fiddling.  Does someone has a smarter idea ? Thank you.

I have a chain object. And i have a curve it follows. I got it to work for following curve, but chain object is not circles but both parts are more like stretched circles (ovals). Object i made with 2 toruses one rotated 90 degrees and then joined them together. I tried single torus too. But same issue. on a curve it just looks stretched oval. What can be the issue?   Thanks


For what possible values of n is U(n) cyclic?Is there any general result regarding this?If yes please could anyone state it and possibly give me a hint about its proof.

When can we say a multiplicative group of integers modulo $n$, i.e., $U_n$ is  cyclic?   $$U_n=\{a \in\mathbb  Z_n \mid \gcd(a,n)=1 \}$$  I searched the internet but did not get a clear idea.


I have read online and I can only find the method where you hold shift just after powering on the system.  I have followed instructions and I have done them. Hut when it tells me to type in a NEW UNIX PASSWORD it doesn't let me type in anything.  Suggestions?

When I'm about to install a program in the terminal it wants the password:  [sudo] password for xxx:   But when I start to type my password nothing happens. What should I do?


I was using wifite command I know that WiFi state goes to down when we run wifite command. And, WiFi state goes to up after restarting laptop also. I was running that command few hours ago. When I restarted my laptop I noticed it(WiFi) was working properly. But, when I have start laptop again I am not getting any WiFi list even WiFi isn't showing after typing ifconfig  After running ifconfig -a  Sorry I am unable to format my question and copy and paste those texts from terminal. ~ cause, I am using Unix SE from android device I have tried answers from  when I tried sudo service network-manager restart I got error Failed to restart network-manager.service: Unit network-manager.service not found.

In new version of Kali 2.0 with updated "aircrack-ng" tool, there is a problem between Internet connection and using cracking tools.   I have my wireless card as wlan0. And the Internet connection is fine too. Then, what I do is:  airmon-ng start wlan0 airodump-ng wlan0mon   Now the airodump-ng doesn't work, saying "Device or resource busy".  In order to run this I have to kill some processes, using:  airmon-ng stop wlan0 airmon-ng check kill airmon-ng start wlan0 airodump-ng wlan0mon   Now the cracking process is up.   I can start cracking, but now I cannot connect to the Internet after the kill process.  On typing iwconfig in terminal, I get this:  root@kali:~#iwconfig wlan0mon IEEE 802.11bgn  ESSID:"myessid"         Mode:Managed  Frequency:2.412 GHz  Access Point: 00:00:00:00:00:00          Bit Rate=108 Mb/s   Tx-Power=20 dBm          Retry short limit:7   RTS thr:off   Fragment thr:off       Encryption key:off       Power Management:off       Link Quality=42/70  Signal level=-68 dBm         Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0       Tx excessive retries:2  Invalid misc:9   Missed beacon:0  eth0      no wireless extensions. lo        no wireless extensions.   And, on running ifconfig on terminal, I get this:  root@kali:~#ifconfig lo        Link encap:Local Loopback         inet addr:127.0.0.1  Mask:255.0.0.0       inet6 addr: ::1/128 Scope:Host       UP LOOPBACK RUNNING  MTU:65536  Metric:1       RX packets:5604 errors:0 dropped:0 overruns:0 frame:0       TX packets:5604 errors:0 dropped:0 overruns:0 carrier:0       collisions:0 txqueuelen:0        RX bytes:452904 (442.2 KiB)  TX bytes:452904 (442.2 KiB)   There is no wlan0 or wlan0mon. I also restarted the network manager by:      service network-manager restart   But nothing changed. Though it displays wlan0 when checked using ifconfig this time.


English uses two lexemes to denote that something is smaller in number or size/amount: "Less" and "fewer". "Less" is used for uncountable nouns ("I needed less time to mow the lawn today"), while "fewer" is used for countable ones ("I needed fewer attempts to get the lawnmower going today").  However, sometimes "less" is used with countable nouns (famously the "X items or less" register in supermarkets). When can countable nouns be used with "less"? Consider these examples:    I'll only need five minutes or less to mow the lawn. A lawnmower may only go 5 mph or less. You may only use my lawnmower if you weigh 75 kg or less.   These sentences sound correct to me, while the use of "fewer" in these contexts seems incorrect or at least odd to me (as a non-native speaker of English):    ? I'll only need five minutes or fewer to mow the lawn. ? A lawnmower may only go 5 mph or fewer. ? You may only use my lawnmower if you weigh 75 kg or fewer.   Which of these do native speakers prefer?  Could it be that "less" is acceptable, when the countable noun refers to an uncountable entity (such as time, speed or weight)? If so, is this restricted to units (minutes, mph, kg)? Also: Would this explain the use of "less" in "X items or less", as "items" as a countable noun refers to an abstract, uncountable entity (i.e. "shopping")?

I've just received a memo which says (effectively)      As more people leave, there will be less people available.   I want that word to be fewer. Are there guidelines for which word ought to be used when?


I have a Lenovo A806. The device was rooted and I downloaded a root uninstaller from the PlayStore to uninstall some apps that I couldn't otherwise.   In the process, among other apps, I deleted the only launcher I had on the phone (Lenovo Launcher) and I might have deleted the APK (not sure about the APK). The result was a black screen without any apps.   When turn on the phone I can see the home screen (same one you see before you unlock keyboard) and I also have some of the functionalities (eg messages, can make calls etc). However, if I open one of these functionalities and I click on the "back" button, the screen goes completely black and the phone goes unresponsive.  I tried to,   reset factory settings by holding the Volume Up + Down + On/Off button which opened the "Lenovo Recovery" screen and I choosing the "wipe user data (both fuse format and fuse wipe data).  install update package option and I rebooted the phone. Nothing of those worked.    Could anyone direct me towards the right way?

I was making some tests on my android phone and I accidentally deleted the launcher from the system partition and I forgot to copy the new one to the system partition again, and the phone doesn't show anything, just the status bar and I can't enter or run anything.   I tryed to send the launcher's apk using bluetooth, but neither other android phone nor windows 8.1 can't send any file to the phone, even if the phone is paired with both devices.  Is there any way to run the Play Store to install the launcher or to install the launcher from the SD card?  Thanks a lot.


I am trying to upload a Theme. But I am getting message Please select a file.  I placed below code in wp-config.php file. define( 'WP_DEBUG', true ); define( 'WP_DEBUG_DISPLAY', false ); define( 'WP_DEBUG_LOG', true );  My PHP Version is 7.4.18 My server settings are like below  My Server file & folder permission is like below  But I am not getting any Debug Log message.  I am trying to install  Theme.

I am facing Please select a file error while trying to upload a plugin. My php.ini settings are like below  upload_max_filesize = 20000 max_file_uploads = 200 max_execution_time = 300 max_input_time = 600 memory_limit = 12800 post_max_size = 8000  My WordPress Version 5.5.3