Why there is no output? Why doesn’t an ambiguity error occur?   #include <iostream> using namespace std; class A{ public:     A(){         cout << "Class A";     }     A(int a = 0){         cout << "A";     } };  int main() {     A a();     return 0; }   So when we create an object “a” of type “A”  A a();, compiler calls a constructor without parameters, doesn’t he?     In C++, We can have more than one constructor in a class with same name, as long as each has a different list of arguments. A constructor is called depending upon the number and type of arguments passed.   While creating the object, arguments must be passed to let compiler know, which constructor needs to be called.


I use Ubuntu on a netbook and am looking for a way to run reasonably basic android apps. The only ways to do that I've seen are to either run the emulator from the SDK or a VM, but those aren't really great options for people like me on underpowered computers.  What I was wondering is if anyone here knew of an alternative to this setup. All I really need is something capable of interpreting android apps in desktop linux and spoofing any information like location or accelerometer data (so no playing games or even 3D work). It could be in development (just so long as I can follow along), I'm just hoping it exists.


Editing PostGIS database using ArcGIS for Desktop Add-In/Extension without ArcSDE?

I need to improve an existing solution to be able to do multiuser editing within a PostGIS database from ArcMap. Available for the solution is ArcGIS for Desktop 10.3 [Basic]. (No non-free Extensions or ArcGIS for Server)  There is already an existing solution implemented as an ArcMap-AddIn. It uses an editable exchange Format (Shapefile) which is read out to the database and updated from the database if there is a change in the Shapefile or PostGIS database. This solution is prone to errors and needs to be improved.  I know it is possible to read from PostGIS databases in the new ArcGIS for Desktop versions using a query layer. But then the layer can't be edited. The solution needs to be implemented as an Add-In or an Extension. Whatever is required.  As the “” is capable of such a connection. That's why I thought it might be possible to write a ArcMap Extension. Any Advice?  I know similar questions have been asked. But the questions and the answers I found, did relate to old versions of ArcGIS. There has been a lot of change relating PostGIS databases in the resent ArcGIS versions.     I found a clue to a good solution in  answer to a different question. It links to a coustom implementation of a "Plug-in Data Source" (). It is a good example I could use as a template for my PostGIS implementation. But this solution didn't implement write support. The same answer claims, write support for "Plug-in Data Sources" was introdused with version 10.1 SP1. My search didn't find any documentation for this. I can only find the old "read-only"  for "Plug-in Data Sources". In the lower part of the comments to the answer, Ragi Yaser Burhum and Petr Krebs try to implement write support. Sadly they didn't resolve there issues (at least publicly). I think  is a branch of their work. Maybe anybody of you could point me to documentation (or a solution) for write support in a "Plug-in Data Source".


Evaluate sum of the series $\sum { 1\over n!(n^4+n^2+1)}$

Evaluate  sum of the series:  $\displaystyle \sum_{n=0}^\infty {1\over n!(n^4+n^2+1)}$  Comparison test $\left(\text {with } \sum {1\over n^2}\right)$ confirms the convergence of the series. But what's the sum of the series. Using comparison tests I managed to show that ${19\over 14}\le$ sum $\le{e+121\over 91}$. The series seems to converge to $\frac e2$. But how to show that ?


preg_match_all not matching contents on a different line

I was writing a regex match pattern, when I suddenly found out that preg_match_all isn't matching contents on a different line. What's up with that, and how do I fix it?   test1.php   $content = file_get_contents("test2.php"); preg_match_all("~startMatch(.+?)endMatch~", $content, $matches);  print_r($matches);    test2.php   startMatch text  endMatch    Results:   Array ( [0] => Array ( ) [1] => Array ( ) )    Expected Results:   Array ( [0] => Array ( [0] => startMatch text endMatch ) [1] => Array ( [0] => text ) )   However, we get the expected result, if startMatch text endMatch is on the same line. What's up with that? Don't periods in regex match all characters? How do I fix it?


i am getting a null-pointer at resource.length() and i am not able to figure it out why? even though the the file has data

class WordCount {     String resource;     void read () throws IOException     {          File file = new File("C:\\Users\\Desktop\\read.txt");            BufferedReader br = new BufferedReader(new FileReader(file));           while ((resource = br.readLine()) != null)          {                  resource.trim();          }          System.out.println(resource.length());          br.close();     } }


I have recently installed ubuntu 14.04 alongside windows 8.1 but after installation ubuntu does not detect WiFi while windows does. I am using Lenovo Z51-70 laptop. Please mention whatever data you require in comments.Wireless Info Script is Attached herewith.


I came across a post, which was basically gibberish like "hsuheuduehuhfuheufhufe".  Originally I marked it as spam, but it was not accepted.  Why?  It should have been marked at rude and abusive.  Perhaps a new feature could be to separate the 2, so that such a post, which is definitely abusive, but not rude?  Thanks.


How Can I Tell If I Bought a Pirated Pokemon Game?

I bought a copy of Pokemon Fire Red off Amazon. Shortly after I bought it, I read several reviews stating the person bought a pirated copy. I was wondering... how can I tell if I purchased a pirated game?


Responsive design squashing user image on profile page

When a user includes a large image in their "About me" section it appears to squash the user image on the left of the page. Reproduce here:     Reproduced in:   Windows 10, Chrome v69 Windows 10, Opera 55.0     Same user on this stack, same bug:


Lightning Community Pre-Built template nav text colors

hoping for some help!  I'm really struggling to change the text color of my navigation items on a pre-built template. It's the Jepson one.  The inspector tool reveals the css classes I need to change, and changing the font size works, but nothing I do seems to change the actual text color. I've included images. Someone please help me modify the CSS to actually make the color change. It's driving me absolutely nuts and I am sure it is a simple solution. Just want to change it to any color except black.


Why isn't there a potential difference across a disconnected diode?

I know this question sounds silly, as if there was a potential difference a current would be created when the terminals are connected together and this would mean energy has come from somewhere.  The reason I ask this though is that from my understanding of the depletion region and built in potential of a diode it seems like if you connected a voltmeter across the whole diode it would show the value of the built in potential.  This is explained in the image below:    At first, electrons flow from the n type to the p type because there are a higher concentration in the n type, and holes do vise versa. This is called the diffusion current. The first electrons and holes to cross the pn boundary are the ones which are closest to it; these carriers recombine when they meet each other and are then no longer a carrier. This means there is a depletion region of no carriers near the pn boundary. because electrons have left the n type material, and holes have left the p type material, there is a surplus of positive and negative charge on the n and p side of the pn boundary respectively. This causes an electric field that opposes the diffusion current, and so no more electrons or holes cross the boundary and combine. In short, only the electrons and holes near the boundary combine, because after they have done that an electric field is formed that prevents any more carriers from crossing. The current due to this electric field is called drift current, and when in equilibrium this will equal the diffusion current. Because there is an electric field at the boundary (pointing from the positive charge to the negative charge) there is an associated voltage. This is called the built in potential.  If you sample the electric field at each point along the diode from left to right, you would start with 0 in the p region because there are an equal number of protons and electrons. As you approach the depletion region you would see a small electric field pointing back towards the p region, caused by acceptor impurities which now have an extra electron (due to recombination) and therefore now have a net negative charge. This electric field would increase in strength as you get closer to the boundary, and then die away as you get further away.  This electric field means there is a voltage, as shown in graph (d). The p side is at an arbitrary potential, and the n side is at a potential higher than this because there is an electric field between them. This means there is a potential difference across the depletion region; this is known as the built-in potential.  But why when I connect a volt-meter across the whole diode will I not see this built in potential?


Does the kind of singularity of a meromorphic function $f$ determines the kind of singularity of $e^f$?

In , I recently asked on if the isolated singularities of a meromorphic function $f$ are the same ones as the of the function $e^f$. I quickly realized that this isn't the case, so I hereby wanted to rephrase the question more generally:  Given a meromorphic function $f: U \to \mathbb{C}, U \subseteq \mathbb{C}$ open, and an isolated singularity $a \in U$ of $f$, does the kind of singularity (removable, pole or essential) that $a$ is for $f$ already determine the kind of singularity that $a$ is for the function $g(z) := e^{f(z)}$? (Notice that, unlike in the other question, I'm not demanding that they are the same kind of singularity – just if we already know which kind of singularity $a$ is for $e^f$ if we know the kind regarding $f$.)  I unfortunately don't have much more to offer as an approach as I did in the other question. I know that if $a$ is a removable singularity for $f$, then it's a removable singularity for $e^f$ aswell. And for many functions with a pole, $e^f$ has an essential singularity, with one of the most basic examples being $f(z) = \frac{1}{z}$ (as it was also given as an answer in the linked question).  So I'm basically searching for any functions $f$ with a pole $a$, so that $e^f$ actually also has a pole at $a$ (since I don't expect a pole to become a removable singularity). Or if there is a function $f$ with an essential singularity $a$, so that $e^f$ has a pole. (Since I believe that most essential singularities are sent to essential singularities, if we consider for example $f(z) = e^{\frac{1}{z}}$. I would then expect $e^{e^{\frac{1}{z}}}$ to have an essential singularity aswell.)  If I'm wrong though and the kind of singularity of $f$ does indeed determine the kind of singularity of $e^f$... then I would appreciate any hints or approaches on how to actually proof that; because so far, I've been out of ideas.


How disk space is used on Android device?

I have critical low storage level and can't understand what takes much of it and how that's possible that the installed applications can use 7 GB? I only use a few social media clients without any games or soft like Photoshop. Also on the second screenshot it indicates that the apps are using just 1.13 GB and so I can't understand the situation. Also what is the "Other"?


how can i prove that every subring of $\mathbb{Q}$ is PID?

How can I prove that every subring of $\mathbb{Q}$ is PID?


While hammering a nail (before it is in the wall) it is pretty evident that the tip of the nail is going to be applying a force directed along th axis of the nail, then why is it said that pressure is always non directional ?


I'm only just getting started with homebrewing however I have a longer term goal of going all-grain and brewing a porter with a distinctly smokey flavour to it.  Something similar to the flavours found in Bombardier Satanic Mills.  What factors go in to achieving this flavour?


If $\gcd(a,b)= 1$ and $a$ divides $bc$ then $a$ divides $c\ $ [Euclid's Lemma]

Well I thought this is obvious. since $\gcd(a,b)=1$,  then we have that $a\not\mid b$ AND $a\mid bc$. This implies that $a$ divides $c$. But apparently this is wrong. Help explain why this way is wrong please.   The question tells you give me two relatively prime numbers $a$ and $b$ such that $a$ divides the product $bc$, prove that $a$ divides $c$. how is this not obvious? Explain to me how my "proof" is not correct.


Gravitational waves: novel or confirmatory?

If the rumors are true and gravitational waves have been detected, would we learn any new fundamental physics from them? Or is this simply an important confirmation of a prediction of general relativity that doesn't give us new insight into current unsolved problems?


(Why) do overfitted models tend to have large coefficients?

I imagine that the larger a coefficient on a variable is, the more ability the model has to "swing" in that dimension, providing an increased opportunity to fit noise. Although I think I've got a reasonable sense of the relationship between the variance in the model and large coefficients, I don't have as good a sense as to why they occur in overfit models. Is it incorrect to say that they are a symptom of overfitting and coefficient shrinkage is more a technique for reducing the variance in the model? Regularization via coefficient shrinkage seems to operate on the principle that large coefficients are the result of an overfitted model, but perhaps I'm misinterpreting the motivation behind the technique.  My intuition that large coefficients are generally a symptom of overfitting comes from the following example:  Let's say we wanted to fit $n$ points that all sit on the x-axis. We can easily construct a polynomial whose solutions are these points: $f(x) = (x-x_1)(x-x_2)....(x-x_{n-1})(x-x_n)$. Let's say our points are at $x=1,2,3,4$. This technique gives all coefficients >= 10 (except for one coefficient). As we add more points (and thereby increase the degree of the polynomial) the magnitude of these coefficients will increase quickly.  This example is how I'm currently connecting the size of the model coefficients with the "complexity" of the generated models, but I'm concerned that this case is to sterile to really be indicative of real-world behavior. I deliberately built an overfitted model (a 10th degree polynomial OLS fit on data generated from a quadratic sampling model) and was surprised to see mostly small coefficients in my model:  set.seed(123) xv = seq(-5,15,length.out=1e4) x=sample(xv,20) gen=function(v){v^2 + 7*rnorm(length(v))} y=gen(x) df = data.frame(x,y)  model = lm(y~poly(x,10,raw=T), data=df) summary(abs(model$coefficients)) #     Min.  1st Qu.   Median     Mean  3rd Qu.     Max.  # 0.000001 0.003666 0.172400 1.469000 1.776000 5.957000   data.frame(sort(abs(model$coefficients))) #                                   model.coefficients # poly(x, 10, raw = T)10                  7.118668e-07 # poly(x, 10, raw = T)9                   3.816941e-05 # poly(x, 10, raw = T)8                   7.675023e-04 # poly(x, 10, raw = T)7                   6.565424e-03 # poly(x, 10, raw = T)6                   1.070573e-02 # poly(x, 10, raw = T)5                   1.723969e-01 # poly(x, 10, raw = T)3                   6.341401e-01 # poly(x, 10, raw = T)4                   8.007111e-01 # poly(x, 10, raw = T)1                   2.751109e+00 # poly(x, 10, raw = T)2                   5.830923e+00 # (Intercept)                             5.956870e+00   Maybe the take-away from this example is that two thirds of the coefficients are less than 1, and relative to the other coefficients, there are three coefficients that are unusually large (and the variables associated with these coefficients also happen to be those most closely related to the true sampling model).  Is (L2) regularization just a mechanism to diminish the variance in a model and thereby "smooth" the curve to better fit future data, or is it taking advantage of a heuristic derived from the observation that overfiited models tend to exhibit large coefficients? Is it an accurate statement that overfitted models tend to exhibit large coefficients? If so, can anyone perhaps explain the mechanism behind the phenomenon a little and/or direct me to some literature?


Using some matlab (I know it's cheating) I found that: $$k=0 => Result=1$$ $$k=1 => Result=1$$ $$k=2 => Result=2$$ $$k=3 => Result=5$$ $$k=4 => Result=15$$ $$k=5 => Result=52$$ $$k=6 => Result=203$$  This sequence is puzzling...


So this might be wierd question but is there anyway to get the synomposis of a command in the terminal? what I mean by this is that if I write for example find I would like the terminal to write out the Synopsis part of the man page for find. I ofcourse don't want it to simply type everything in, but rather have a "grayed out" suggestion for what to write.  I think this would be extremely helpful for when you forget a specific command and don't want to simple go to the man page.   The redis-cli seems to do something like this... The main part here is that I want it to be inline, i. e. like redis-cli:


How to remove author name default capitalization?

According to biblatex doc (p.80-81) :     \Parencite is similar to \parencite but capitalizes the name prefix of   the first name in the citation if the useprefix option is enabled,   provided that there is a name prefix and the citation style prints any   name at all.      \Textcite is similar to \textcite but capitalizes the name prefix of   the first name in the citation if the useprefix option is enabled,   provided that there is a name prefix.   My problem is that \parencite and \textcite capitalize the author name by default. Therefore, there is no difference between these commands (\textcite has the same behavior than \Textcite). I am using authoryear-comp style.  It it a big problem for me because I cannot cite using \textcite. Indeed it will produces something like "according to NAME (2008), there is ...". The capitalized author name is ugly.  MWE :   \RequirePackage{filecontents}  \begin{filecontents}{\jobname.bib} @Book{author00:_title,   author =   {Author},   title =    {Title},   publisher =    {Publisher},   year =     2000} \end{filecontents}  \documentclass[12pt,twoside,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english,french]{babel}  \usepackage{lmodern} \usepackage{xspace}  \usepackage[autostyle=true]{csquotes} \usepackage[style=authoryear-comp,      hyperref,      backend=biber,      isbn=false,      doi=false,      url=false,      ]{biblatex} \AtEveryBibitem{\clearlist{language}} \renewcommand*{\newunitpunct}{\addcomma\space} \addbibresource{\jobname.bib} \usepackage[colorlinks]{hyperref}  \begin{document}  \noindent \verb+\parencite{author00:_title}+ :  \parencite{author00:_title}\\ \verb+\Parencite{author00:_title}+ : \Parencite{author00:_title}\\ \verb+\textcite{author00:_title}+ : \textcite{author00:_title}\\ \verb+\Textcite{author00:_title}+ : \Textcite{author00:_title}  %\printbibliography \end{document}


This  asks why isn't the Force used to snap a neck instead of choking. It is harder to snap a neck than to hold someone, so it kinda makes sense that it's not used often.  However, snapping a neck is a very ineffective way of killing if we have a ranged attack that can't be covered. Why not use the Force to pop a vein inside the person's brain? Just scramble a part of the brain and the person is gone. Not much strength is needed, the kill is instant (so you can't really prepare for it).  Why not just cause a stroke to an enemy?


alias for killing all processes of a grep hit

I am trying to make a superkill alias that kills all process that hit a grep match.  I'd like to do:  superkill ruby   And have it kill all processes that match 'ruby'  In my .bashrc, I've added this  alias superkill="ps ax | grep $1 | cut -f1 -d' ' | xargs kill"   However, when I run it, I get  superkill something usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]     [-e pattern] [-f file] [--binary-files=value] [--color=when] ...   Can someone point me in the right direction?  Thanks, Kevin    This is different than the duplicate. I am asking a specific question. The duplicate is a high level question that speaks in generalities. I am unable to come up with a solution after reading the duplicate.   pkill -f does not work.  if you do  ps -A|grep ruby   and then  pkill -f ruby   and then  ps -A|grep ruby   You will see that a ruby processes still exist.  BUT if you do   kill -9 xxx   where xxx is the PID, this does work. What I'm looking for is something that aliases kill -9 to the matches to grep.  UPDATE - this reminds me of my frustration with SO, where everyone is too quick to downvote or flag (i contend that flagging has very little value). Here's yet another example where all of the suggested answers do not work:  kevin@kpi-2:~/Documents/code/kpi-veh$ sudo killall -r ruby kevin@kpi-2:~/Documents/code/kpi-veh$ ps -A|grep ruby 27175 pts/9    00:22:03 ruby kevin@kpi-2:~/Documents/code/kpi-veh$ sudo killall -r ruby kevin@kpi-2:~/Documents/code/kpi-veh$ ps -A|grep ruby 27175 pts/9    00:22:06 ruby kevin@kpi-2:~/Documents/code/kpi-veh$ sudo killall -r ruby kevin@kpi-2:~/Documents/code/kpi-veh$ ps -A|grep ruby 27175 pts/9    00:22:08 ruby kevin@kpi-2:~/Documents/code/kpi-veh$ kill -9 27175 kevin@kpi-2:~/Documents/code/kpi-veh$   what i am looking for (cannot believe i still have to argue with the hall monitors that this is a dupe) is a way to alias kill.  In this case (this happens often with Ruby), I HAVE to resort to killing the process by ID, killall in any variant does not work, as best I can tell.


Are people allowed to post their email address in an answer, asking for code or possible solutions on any of the Stack Exchange sites?  I  the following:


Quantum entanglement, how do we know there was no spin?

Im not a scientist, so go easy on the explanation!  As I understand it we can create two entangled particles. The entangled particles have a spin property which is opposing. When we measure one of the particles for spin we get a result and we can deduce the spin direction of the unmeasured particle. All makes sense, but...  How do we know that the entangled particles didnt already have spin before being measured?


Word to describe someone who goes to all the events in town!

I'm looking for a short word that could describe people who are always going to every event in town. It doesn't need to be an existing word, feel free to create one of your own. It can also be made of words related to events and parties. (ex: club, event, guest list, etc.)  Edit  The word will serve as a new term to describ these people in a favorable way. It will probably be used for an app name so it need to be catchy and fun. ( Preferably )


I've reading about about the Cinnamon Desktop through this Q&A:  Also I've been reading these theming questions:     I'm trying to understand downloading & installing themes.  I see that I can download GTK2 & GTK3 but I'm unsure I understand the differences. I see there are themes such as Unity Themes, Gnome-Shell themes from websites such as  How do I apply these themes to Cinnamon?  I'm new to Cinnamon so a beginners guide would be very useful.


What is the idea called when something has happened to you but you just don't know?

There is a word/idea that something has happened to you, but you just don't know that it already has occured. Question Have you ever been phished before?  Answer 1. Yes. 2. No, I have never been phished before. 3. I don't know.  In this case, say for number 2 (and for intents and purposes that the phishing is silent), you HAVE been phished, you just wouldn't have known it has happened to you. For you, you feel this is true but it may not be because you wouldn't know. What is this idea called? Naive, Ignorance? I'm looking for an ideology word if one exists, like Occam's razor or even an expression.


What is the difference between    $ \lim_{n \to \infty} \ \mathrm{E}_{\theta}(T_n(X)) = \theta$    and    $ T_n(X) \xrightarrow{p} \theta \ $  for  $\ n \xrightarrow{} \infty$ ?  (unbiasdness vs. Consisteny)    Ups... there seems to be this question already :-(     Shall I delete this question?


I want the limits of the sum sign to be placed where I placed the red lines in the photo. This is the line of script I used:  $Result = p + \sum_{i=0}^{n} f(x)$    This is what I get and the red lines is what I want.


What is the quotient space $S^{2}\times S^{2}\times S^{2}/\sim$ topologically, geometrically, and algebraically, where $S^{2}\subset\mathbb{R}^{3}$ is the unit sphere of $\mathbb{R}^{3}$ and the equivalence relation is defined as $$\left(p_{1},p_{2},p_{3}\right)\sim\left(p'_{1},p'_{2},p'_{3}\right)$$ iff there exists $T\in O(3)$ such that $$T\left(p_{1},p_{2},p_{3}\right)=\left(p'_{1},p'_{2},p'_{3}\right)?$$ Thanks.


What does matrix transposition represent?

If the visual manifestation of a matrix is a linear transformation, what is that of its transpose?


The default .bashrc in the standard distribution of Ubuntu 16.04 that comes with AWS has these lines:  # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth   However, it doesn't seem to work. I have been running pm2 restart myApp and pm2 list repeatedly using the Up Arrow key, and the command buffer now contains nearly a hundred lines of these.  What could be wrong?


what is the cardinal of $\prod_{n}^{}2^n$?  I tried to create an injective function from this formula to the natural numbers and stuck.  Thanks.


Zip the contents of a directory without the directory itself

I want to create a ZIP archive of a directory without going into the directory itself, and not include that directory    - This post guides to changed the current directory and then create the archive. But, as stated earlier, i do not want to change the current directory.  This is the structure of the directory that I want to archive  parentdir/ parentdir/dir1/ parentdir/dir1/file1.txt parentdir/dir1/file2.txt parentdir/dir2/ parentdir/dir2/file1.txt parentdir/dir2/file2.txt   And the desired archive would contain  dir1/ dir1/file1.txt dir1/file2.txt dir2/ dir2/file1.txt dir2/file2.txt   If I use the command  zip -r output.zip parentdir/   this includes the parentdir as well in the archive.  Is there any flag that allows us to create an archive without the parentdir ? I do not want to change the current directory to the parentdir. I cannot also use the -j flag,since I do not want to junk the rest of the paths. Can i accomplish this from any directory?


How can a photon oscillate when it experiences no time?

How can light experience change if it is motionless in time?


Finding sum of $\lim_{n\rightarrow \infty}\sum^{n}_{k=0}\binom{n}{k}^{-1}$

Finding sum of $\displaystyle \lim_{n\rightarrow \infty}\sum^{n}_{k=0}\binom{n}{k}^{-1}$   Try: $$\lim_{n\rightarrow\infty}\sum^{n}_{k=0}\frac{k!\cdot (n-k)!}{n!}$$  $$\lim_{n\rightarrow}(n+1)\sum^{n}_{k=0}\int^{1}_{0}x^{n-k}(1-x)^kdx$$  $$\lim_{n\rightarrow\infty}\int^{1}_{0}x^{n}\sum^{n}_{k=0}\left(\frac{1-x}{x}\right)^{k}dx$$  $$\lim_{n\rightarrow\infty}\int^{1}_{k=0}x^{k}\sum^{n}_{k=0}\frac{x^{k+1}-(1-x)^{k+1}}{(2x-1)(1-x)^k}dx$$  Could some help me to solve it, Thanks


This is my code,i want to check against empid if cli and callduration both are same and evaluated before it..then show this cli and call duration is already evaluated..if cli is same but duration is different then show start evaluation and also if cli and duration both are different then also show start evaluation.  The problem which i am facing is that my code is only check one statement like empid=1,cli=123,calldurations is 1min &01:01 then its check only 1 min duration and on 01:01 duration print the statement start evaluation..the code should show call is already evaluated..  <?php $con = mysqli_connect("localhost","root","","usman"); $check = "SELECT COUNT(*) FROM eval WHERE empid = '$_POST[empid]' &&  cli =  '$_POST[cli]'  && callduration = '$_POST[callduration]' "; $result = mysqli_query($con,$check); $count = mysqli_fetch_array($result); if(current($count) > 0) {   echo "
This call is already evaluated against

 Emp-ID " . $_POST["empid"] . "

CLI - " . $_POST["cli"] . "

Call Duration - " . $_POST["callduration"] . "
"; } else {   echo " Click Here To Start Evaluation
";  } ?>


Replace Paid Shipping Method With Free Shipping Method WooCommerce

If I have a store that offers flat rate shipping of $10 and free shipping for orders over $100 and a customer orders over $100 it doesn't make much sense for them to have to see both free shipping and flat rate shipping on the checkout page. Why would a user even choose flat rate shipping?  How can I use a filter to detect if free shipping is available, filter the flat rate shipping label so it says something like flat rate shipping (free), and then disable the free shipping method.  The end result is that if a user orders less than $100 they see flat rate shipping $10 and if they order over $100 they see flat rate shipping (free!).


How can I install Sun/Oracle's proprietary Java JDK 6/7/8 or JRE?

I want to install Oracle's JRE and to update to the latest version with the Software Updater when they released. Is there a Ubuntu package that is provided by Canonical or Oracle?  Before release Java 7, I followed  to install Java 6.  But it doesn't work for Java 7. There is no package sun-java7-xxx. How can you install Java 7?


Explain this bash script: echo "${1##*.}"

Consider the following bash script:  #!/bin/bash echo "${1##*.}"    This script prints the extension of a file if the file name is supplied as the first command line argument, something like following:  $ ./script.sh ./file.pdf   In the above case pdf is printed.  Please explain how the expression ${1##*.} is able to extract the extension of the file.  (I understand what $0, $1, $2, $# do in bash and also understand about regular expressions to some extent)


Accidentally made a folder called '.. and now windows says it can't find it to delete it

I accidentally changed a folder name to be '.., and now whenever I try to delete it, windows is saying it can't find the file or folder specified.  I need to delete it though because it's messing up the git repo


By considering the sequence of partial sums calculate the limit of $\sum^{\infty}_{n=0} p^n$ , where $0<p<1.$

I have no idea how to solve this problem. I know that the definition states that a series $$\sum^\infty_{k=1}=a_1+a_2+a_3+a_4+........$$ is convergent if the sequence of partial sums $$S_n=a_1+a_2+a_3+......+a_n = \sum_{k=1}^n a_k$$ converges to a limit, so $$\lim_{n\to\infty}S_n$$ And the limit is called the sum of the series denoted by $$\sum_{k=1}^{\infty}a_k=S$$ However, i do not then know how to implement this into other promblems like the one below, $$\sum^{\infty}_{n=0}p^n$$ Thank you.


NoSuchMethodError though method is there in icu4j jar

Edit: This Question was marked duplicate of  but its not duplicate one, here i am asking about does this problem happening because of icu4j jar and WebSphere.    I am running application on WebSphere 7 and i am using STS for development at one point i am calling UCharacter.offsetByCodePoints from icu4j 58.2 jar that i have added my application's web-inf/lib folder. when i click on method STS is able find this method but at run time i am getting below error.        java.lang.NoSuchMethodError: com/ibm/icu/lang/UCharacter.offsetByCodePoints(Ljava/lang/CharSequence;II)I   I have added this jar at every required place like in WEB-INF/lib folder.  Is it due to WebSphere is getting confused between sun.text.normalizer.UCharcter and com.ibm.icu.lang.UCharacter or does webSphere has older version of icu4j or what ?  What could be possible solution for it.


Restore original permissions for system files

I have a machine which all its system drive files e.g /etc/* /lib/* /home/* where moved to a storage system by mistake. Now I moved them back to their original places but I don't know how to set the permissions to the original one?


Can i set up an Ubuntu virtual machine on Windows (Oracle VirtualBox)?

I am new to the Ubuntu OS. I was wondering if I could use this operating system through an Oracle VirtualBox virtual machine on Windows as I do not want to switch my computer's OS. It is a Hewlett-Packard PC running Windows 8.1.  If this is already in an FAQ somewhere, I'm sorry as I have not looked because I'm lazy.  I have heard great things about this OS and I want to try it for myself. It does not mean that I'm going to be switching for good, I just want to try it on a virtual machine. Thank you in advance. P.S. this is for personal use and I'm using the free version.


This is the theorem If $G$ is a graph, there are at least $2$ vertices(points ) always have the same degree.  e.g:  I have graph $G$, $(U,V)$ ,$4$ vertices $(e1,e2,e3,e4)$ ,and $4$ edges. So the degree we have $(2,2,2,2)$,  and if i put one vertice ,and obtain new graph or new vertice, and so on the graph always have a same degree ,at least  $2$ ..  How i can proof it with pigeon hole principle or others? Can you give me a clu?


Recursive C++ code goes into infinite loop

Why does the following code go into an infinite loop:  #include<iostream> using namespace std;  void printarray(int arr[], int n, int i);  int main(){     int arr[] = {1,2,3,4,5};     int n = sizeof(arr)/sizeof(arr[0]);     printarray(arr,n,0);     return 0; }  void printarray(int arr[], int n, int i){     if(i >=n)         return;     cout<<arr[i]<<"\t";     return printarray(arr,n,i++);    //Replacing i++ by i+1 works fine }   However, if I use i+1 instead of i++, the code works fine.As per my understanding i++ is effectively the same as i+1. Then what is the problem here?


Like the title says: I don't think "to can" is right :)  I mean "can" as in to be able to. I'm aware of other meanings.  I can't find the answer here. (There's  which sidesteps this precise case). Online dictionaries draw a blank (, e.g.).  I'm looking for some official indication that the infinitive doesn't exist for this irregular verb.  It would be nice if someone could share any information on how this has evolved to be the case.


In the mwe below, I try to have different name inside a pgfplotsinvokeforeach loop. I don't understand why the name is the same with the last value  \documentclass{article} \usepackage{lmodern} \usepackage{tikz} \usepackage{pgfplots}   \begin{document}  \begin{tikzpicture}[scale=1] \begin{axis}[height=8cm,width=12cm,              axis y line=middle,             axis x line=middle,             x label style={anchor=west},             y label style={anchor=south},                        xlabel=$t$,ylabel=$e(t)$,             xmin=0,xmax=6,ymin=-1,ymax=6,             xtick={1,2,3,4,5},             xticklabels = {$\tau$,$2\tau$,$3\tau$,$4\tau$,$5\tau$},             ytick={5},             yticklabels = {$E$},             clip mode=individual         ] \addplot[domain=0:6, samples=30,red]{5};     \addplot[domain=0:6, samples=100,blue]{5*(1-e^(-x))};     \pgfplotsinvokeforeach{1,2,...,5}{     \pgfmathtruncatemacro\Adv{(1-e^(-#1))*100}%     \draw [<->] (axis cs:#1,0) -- (axis cs:#1,{5*(1-e^(-#1))})node [midway, right] {$\Adv\%$}; } \end{axis} \end{tikzpicture}     \end{document}   .


I'm struck with PHP SharePoint integration. Is there any simple PHP method to read list from SharePoint?


Trying to install (Or just try) Ubuntu, but i just get black screen immidiately after selecting "Install Ubuntu" in the first boot menu

I am trying to boot from a USB drive prepaired with "UNetbootin" but after selecting "Install Ubuntu" the USB keeps flashing (Indikator LED) for a few seconds and then it stops. And then nothing. I have tried with Linux Mint 16 Cinnamon and i get the exact same problem there.. I have tried following this guide () but with no luck. When the black screen comes I can take no action other than killing it on the power bottom (No "crtl-alt-del", "esc", "random smashing on the keyboard" is doing anything)


Site hopping, non-related subjects, wasting time on the internet

What is the term for embarking on an internet search that leads from one website to another, to another, to a totally different site of non-related subject, based on information found in each subsequent search? Say, start looking at recipes initially and end up on Mediaeval monks, via early explorers, or whatever...hopping around all over the place and finding that a day has passed without your realising it.


Do you know what his name is?      Do you know what is his name?   I saw this in grammar text book. The first is the correct one because "Subject + Verb". The second is wrong.  We do usually say "What is your name?", "What is his name?", why the sentence is wrong when the front of the question is "Do you know..."


Environment definitions with arguments in \enddef

I was hoping to create a custom proof environment where along with the qed symbol it also mentions what was the claim that was proved. I thought the following would work:  \newenvironment{myproof}[1]% {\vspace{1ex}\noindent{\em Pf.}\hspace{0.5em}}% {\hfill{\tiny \qed (#1)}\vspace{1ex}}   I thought \begin{myproof}{Claim 42} ..\end{myproof} would work but it doesn't. After some googling I figured that it was because the argument is not passed on to \endmyproof.  Is there any fix to this? Or is this just bad TeX?  PS: FWIW, I was writing down a proof and had a small claim inside. The QED on the claim was a bit misleading that the proof of the Theorem was done. So this seemed like a natural(?) thing to do.


I have been trying to solve this problem for the last two days and I can't find a way to solve it I tried to look for similar problems but all the problems I find include the length of the ladders Any help would be appreciated.  The ladders intersect in the middle and they are in the middle of each building  1.How long is the alley's width?   2.The height of the buildings?   3.The lengths of the ladders?  h = 1.80m  building 1 4 floors in height  building 2 6 floors in height  I was not given more information and thanks for your time


Is it possible to complete "Pieces of the Past" after killing everyone in Dawnstar?

I am playing through Skyrim on the Xbox 360 and have 49/50 achievements competed. Earlier in the game, to gather a 1000 gold bounty in every city, I went into Dawnstar and slaughtered the first few guards I saw. Without realizing it, my companion killed the leader of the museum.   My last achievement, "Oblivion Walker", was to complete 15 Daedric quests. I completed 14/15, and then saw that I still had "Pieces of the Past". I went to try and start the quest, but was unable to. I searched through Dawnstar, but could not visit the measure any longer.  Do I need to restart my game from a previous save before my companion slaughtered the museum leader? If so, do I need to have all 15 done at the same time, or will I get the achievement upon completion of that quest?


How can I run a game starting with Commoners?

My gaming group tends to prefer low power level campaigns. Rather than tales of epic heroes saving the world, we prefer tales of dirt-farming peasants sometimes succeeding at things. We tend to be much more invested in out characters when we feel they are defying the odds.  My question is: Using 5e as base, how can I incorporate starting a campaign with the party as a Commoner or other NPC class (effectively Lvl 0) and have them eventually progress into real classes after the first few seasons?  How can I adjust starting characteristics and gear to represent this?  I welcome all suggestions, comments, and advice.  Thank you!


Adding a date and the time portion of a datetime2 together

I have a date field [load_date] and a datetime2 field [load_time] that I want to combine into a datetime2.  I want to combine load_date with the time portion of load_time and create a datetime2.  It's in an existing table, and I want to SET the load_time to this new value.  Below is a SELECT that appears to work, so I can turn this into an UPDATE statement.  However, I wanted to know if there is a more elegant or less verbose way.  SELECT     [load_date]     , [load_time]     , DATEADD(DAY, DATEDIFF(DAY, CAST(CAST([load_time] AS TIME) AS DATETIME2), CAST([load_date] AS DATETIME2)), CAST(CAST([load_time] AS TIME) AS DATETIME2))


how do photons move with respect to EM (I'd like to picture wave magnitudes frame by frame)

(I'm aware treating photon as particle and talking about its position is not exactly, conceptually right but I think it makes sense, at least in the point of view of a beginner. Please just assume photons carry fields and they exist like particles for the moment,or call them anything else if you think it fits better.)  When I study maxwells electrodynamics, I always end up seeing the following image. However I do not really understand what meaning should I make of it. I would really appreciate if you can briefly mention any experiments measuring this electric and magnetic field property, in case its relevant to your answer.    (here is the image I encounter)  1- Does it mean a single photon moves and carries fields of varying magnitude? Therefore we experience different electrical and magnetic field depending on at which position we encounter the photon? So by chance, if a point object is just at the place where E=B=0, photon may just pass through without doing anything? I tried to draw it as follows, in case I cannot make myself clear by words.   (picture 1)  2- Or does it mean, photons travel in groups and their sequence forms a sinusoidal shape. And the whole group goes with c, as in the following clumsy drawing (of course it is drawn discrete but I mean if this image was continuous):  (picture 2)  I think that all notes I encounter mean the 'picture 1' I have drawn. But it just do not feel right to me with my current knowledge, since varying fields of single photon means effect of a photon to a point charge depends on which phase photon meets the charge although photons were supposed to have a constant energy to give off. And also, if we look at the field distribution with a ray of photons, that would make the field move even faster than c, since photons carry their wave with c but the wave they carry also seems like propagating as it changes with time. Would you explain this mechanism to me, what proof do we have to say this actually happen instead of picture 2 I have drawn? Why do we rule out possibility of picture 2?  (the question is not duplicate specifically because this part, and that it tries to relate photons propagation with it)  I know I should be violating some basic concepts but I am trying to learn by questioning and I have already read the existing lecture notes so please bear with me. I am really dying to make a sense out of this electrodynamics but I just cannot do it since no one even attempts to talk about what would a particle correspondence of wave theory would be. I would really appreciate any insights, explanations, corrections or experimental information. Thanks in advance.


Based on numerous internet resources, speaker wire acts like an antenna which picks up the transmitted signal of nearby cellphones and causes the speakers to buzz. But I'm not really buying that...  A 3.5 mm speaker cable is designed to carry 1 V. I've seen old setups where PC speakers are powered directly from the 3.5 mm jack (and I've tested playing unamplified sound directly from a PC through the jack, although the volume in my setup was not very high at all). How can the tiny bit of EM emitted by a cellphone radio cause a speaker system, designed to operate off of a fluctuating 1 v signal, produce such a loud buzzing noise? I couldn't imagine the EM generating more than a few micro-volts in a receiving antenna. Am I wrong?  Thanks.  Updated - corrected voltage of line out to 1 V (see comments)  Update I looked it up, and yes it seems GSM transmits at 2 W. I'd like to do a sanity check with that figure to verify some of the answers which state that the transmitted power is significant. My physics is quite rusty, but I'll try...  We know that the intensity of EM radiation around a source is:  $$I = \frac{P}{4\pi r^2}$$  So let's say we have a wire 2 m long and 0.2 mm wide (I hope this is a valid approximation for the wire) that is approximately 2 m away from a transmitting GSM module.  Then for \$P = 2 W, I = 39 \frac{mW}{m^{2}}\$  Multiply that by the surface area of the wire (0.2 mm * 2 m)  The total EM power along the wire is then 16 \$\mu W\$.  Like I said I'm quite rusty, but is this not correct? Is this really significant enough to produce that sound without being amplified somehow? Perhaps the signal resonates? Or interferes directly with sound cards?


Logistic Regression Cost Function proof by using maximizing likelihood function

In  or .he cost function for logistic regression is defined as:  $$   J({\theta}) =\frac{1}{m}  \sum_{i=1}^m Cost(h_{\theta}(x^{(i)},y^{(i)}) $$   $$ \begin{equation}   Cost(h_{\theta}(x),y)=\begin{cases}     -\log(h_{\theta}(x)), & \text{if $y=1$}.\\     -\log(1-h_{\theta}(x)), & \text{if $y=0$}.   \end{cases} \end{equation}  $$ Then It is said that this simplifies to:  $$ J(\theta) = - \frac{1}{m} \displaystyle \sum_{i=1}^m \left[y^{(i)}\log \big(h_\theta (x^{(i)})\big) + (1 - y^{(i)})\log \big(1 - h_\theta(x^{(i)})\big)\right] \\[6pt] $$  In this  under why this cost function? she had given the Maximum Likelihood Explanation which I did not understand. even , the accepted answer has the last line as Two loss functions can be derived by maximizing likelihood function.  Can anyone give me proper mathematical(Maximum Likelihood Explanation) proof of how we arrive  at the following cost function?  $$ \begin{equation}   Cost(h_{\theta}(x),y)=\begin{cases}     -\log(h_{\theta}(x)), & \text{if $y=1$}.\\     -\log(1-h_{\theta}(x)), & \text{if $y=0$}.   \end{cases} \end{equation}  $$


How to put this particular constraint on this link table in MySQL?

I have the following three tables in MySQL: Store, Groups, StoreGroup. A store can belong to several groups. StoreGroup is the link table that records the groups a store belongs to. The Groups table has the following fields:  +------------+----------------------------------+------+-----+---------+----------------+ | Field      | Type                             | Null | Key | Default | Extra          | +------------+----------------------------------+------+-----+---------+----------------+ | id         | int(11)                          | NO   | PRI | NULL    | auto_increment | | name       | varchar(255)                     | YES  | UNI | NULL    |                | | category   | enum('Area','Level','Temp')      | YES  |     | NULL    |                | | expireDate | datetime                         | YES  |     | NULL    |                | +------------+----------------------------------+------+-----+---------+----------------+   The link table StoreGroup that records each store's groups has the following fields:  +---------+-------------+------+-----+---------+-------+ | Field   | Type        | Null | Key | Default | Extra | +---------+-------------+------+-----+---------+-------+ | storeID | varchar(16) | NO   | PRI | NULL    |       | | groupID | int(11)     | NO   | PRI | 0       |       | +---------+-------------+------+-----+---------+-------+   However, even though a store can belong to several groups, it has a constraint that it can belong to only one group in one group category. For example, a store with storeID ABC can belong to both groups with groupID 1001 and 1002 since 1001 is from 'Area' category and 1002 is from 'Level' category. But it cannot be assigned to groupID 1003 because both group 1001 and 1003 are from the same group category 'Area' as shown below:  SELECT * FROM Groups;  +------+--------------+----------+---------------------+ | id   | name         | category | expireDate          | +------+--------------+----------+---------------------+ | 1001 | City A       | Area     | NULL                | | 1002 | Branch       | Level    | NULL                | | 1003 | City B       | Area     | NULL                | +------+--------------+----------+---------------------+   So when one wants to insert the record into StoreGroup table, the following is OK:  INSERT INTO StoreGroup VALUES('ABC', 1001); INSERT INTO StoreGroup VALUES('ABC', 1002);   But the following should fail because storeID 'ABC' cannot belong to both groups 1001 and 1003 since 1001 and 1003 both are from category 'Area':  INSERT INTO StoreGroup VALUES('ABC', 1003);    --This should fail.   So how to modify the table of StoreGroup or Groups to add this constraint so that assigning store to groups with same category will fail?


I had Schengen visa four years ago and it's revoked due to limitation on my visa

I had Schengen visa four years ago through Latvia, and it was revoked due to limitation on my visa, pls can I apply with my new passport as new applicant through another Schengen country.   I would like to know if my previous information won't have any effect on my new application. With another Schengen.


Does an op amp needs an Input Bias Current to operate?

I'm confused about the source of Input Bias Current, is it generated by op amp, where the current "leak" from the op amp. or it's a must to operate the op amp? for example if I have in a data sheet a 1pA input bias current, should I provide a 1pA to the inputs of op amp? I know that the bipolar op amp needs a current to operate, but what about FET and CMOS op amp?   In short question: Should I build circuit to "provide" this current, or it's just given by the op amp itself?  Also, what is the difference between input bias current and the leakage current?  Note: if the type of op amp make a difference, I'm interested in LTC6078/LTC6079


How does Fermat's principle of least time come from this statement?

In Wikipedia Fermat's Principle is stated as:     A ray of light prefers the path such that there are other paths, arbitrarily nearby on either side, along which the ray would take almost exactly the same time to traverse.    So how does the principle for shortest time come from this statement? Is there any mathematical derivation or any assumption to make?


I'm looking for a keyboard shortcut or a CLI instruction to change the display scale on the fly. Seems there's nothing in compiz-config manager to handle this?


I am new in ML so excuse me if this is a bit basic. I noticed many times that the requirement for some methods in ML is that the instances are IID(e.g. Stochastic Gradient Descent). I don't exactly understand this. Does this means that all features must have the same distribution and must be independent? Or does this mean that chosen instances must be independent and have the same distribution (I don't know how better to write this, not sure it is clear). And to assure IID random selection of instances from training set is enough (Because every feature has some distribution and with random selection you provide independent instance)?


Does the synchronizedMap method in Collections synchronize both read and write operations

When i do a Collections.synchronizedMap(someHashMap), are all access to the map synchronized? Or only write operations (put) synchronized? How about if two threads are reading from the Map? Will it be synchronized? DOesnt seem necessary How abotu if one thread is doing put() and another is doing get()?


How to go to the first blank cell directly in a column of Google Sheets?

I use column A mainly. A1 is the name of data type, and A2, A3, A4, ... are data. When I open this file, It shows the screen containing the first cell, A1. If I fill data from A2 to A250, then I should scroll down to the cell A251 to fill the next data.   It takes some time, and I want to know the way (if exists) to go to the first blank cell of column A when I open this file.


I know this is easy to lots of you but I am just struggling to find the solution.  How can I prove the sum of the highlighted angles in the following 3 times 3 square grid is equal to $\pi$?


Symbolic links error while creating Ubuntu UEFI bootable USB

I have tried to create UEFI bootable USB drive within Ubuntu 14.10 (Startup disk creator didn't help nor I am interested in using it.). I have formated USB with FAT32 and GPT. So the only thing left to do would be just to copy all files from ISO to USB. That method worked when it comes to Linux Mint 17.1 and Clonezilla live CD, but when I tried to create bootable USB for Ubuntu 14.04 or Kubuntu 15.04 beta 1 there was an error copying files. Actually, on several occasions (4 or 5) pop-up window appeared.   After ignoring this errors, both Ubuntu and Kubuntu USB boot-up just fine, with no apparent problems in Live mode.   Can someone please elaborate what this symbolic links presents? Will this cause some problem when OS is installed?


Reset root password for Ubuntu 16.04 - recovery mode asks for root password

We've lost the root password from our file server from supermicro server.  I tried to follow the common instructions to reboot with left shift and drop to root shell as it is described .  When I choose root in this menu:    Ubuntu still asks for root password or propose to press Ctrl+D to return to Recovery menu.  Are there any other ways to reset root password?


Is it OK to ask questions in other languages?

The title is indeed a bit too general. I have seen that all stack exchange sites always use English as the language of their posts, save maybe in a few comments and in , which I translated from Chinese into English. There is, however, a notable exception: Italian SX. If you go there, and look at the , you almost see more questions in Italian than in English. To make a few examples, , , ,  and , and I know of at least one more. Interestingly, all but one (#3) of the above examples are by user . Indeed, if you look at the questions on his user page, 1 out of the first 30 is in English, and the remaining 29 are all in Italian. Now, I know of the , which I anyway can't seem to find the result of (if there was one), and would anyway be a separate site specifically requiring Arabic posts, which Italian SX on the contrary doesn't. So I was wondering: is it appropriate to post in Italian on Italian SX? And more generally, is it appropriate to post in language X on X language SX? FOr example, in Chinese on Chinese SX? What should be done to users consistently posting in Italian on Italian SX?


Assume that you have any two real numbers $a$ and $b$, and $1\leq k <\infty$, $k \in \mathbb{R}$.  How would you prove the inequality $|a+b|^k \leq 2^{k-1} (|a|^k+|b|^k)$?


Dual space of a finite dimensional normed space

My lecturer gave us this result today in class, but he didn't give a proof, he said we can prove it ourselves, only I'm really struggling to see how to do it.  Let $E$ be a normed space with dual $E'$. Then $E$ is finite dimensional if and only if $E'$ is finite dimensional, and in fact $\dim{E} =\dim{E'}$.  Would appreciate any input!


Showing that the number of ways to select an even number of elements is equal to the number of ways to select an odd number of elements.

Show that if n is an odd integer, then the number of ways to select an even number of elements from a set of n elements is equal to the number of ways to select an odd number of elements. Can anybody help me?, i'm actually lost with this, i don't know how to proceed.


Ubuntu 16.04 Bluetooth headphones not recognised as headset

I am trying to connect my Sony WH-CH700N bluetooth headphones to my ubuntu 16.04. The device is recognised, although as unknown type instead of as headset.   I've tried installing blueman bluetooth manager, but still doesn't work.   It doesn't appear as a headset.  Does anyone know how to fix this?  Thanks.


Why web apps do not consider high resolution screens in their designs?

Have a look at the image below, this is how Youtube will look when someone opens on high resolution screen.There are empty space on both sides and I have checked this with many popular web apps, same behaviour everywhere.  So my question is why don't they use full screen for these high resolution screens?  One reason cab be that they don't want to make everything bloated(extra large) for big screens but not all high resolution screens are big screens.Nowadays there are ultra hd monitors available.


Using \ref to refer to a section included in a document using \addcontentsline

I realize that this question appears to be similar to the following but it is different:  I was unable to use the link above to solve my problem. I am writing a document using the book class. There is a preamble which has notation and the preamble should not have a chapter number in the table of contents. Code for notation in preamble: \addcontentsline{toc}{chapter}{Notation} \phantomsection \label{chnotation}  % table of notation goes here  In the main body I am using hyper ref to try and get links to pages. \documentclass[12pt,letterpaper,openany,oneside]{book}  \usepackage[bookmarks,hypertexnames=false,debug,linktocpage=true]{hyperref} \hypersetup{colorlinks,linkcolor={blue!90},citecolor={blue!90},urlcolor={blue!80}}   \begin{document}  \chapter*{Acknowledgements} \include*{Preamble/acknowledgements}  \clearpage \listoftables  \addcontentsline{toc}{chapter}{List of Tables}  \clearpage \listoffigures \addcontentsline{toc}{chapter}{List of Figures}  \clearpage \chapter*{Notation} \include*{Preamble/notation}  \setcounter{tocdepth}{3} \clearpage \tableofcontents   \include{"Sections/Chapter 1/chapter1"}  \include{"Sections/Chapter 2/chapter2"} \end{document}   The result of the table of contents page is given below  this is correct since the sections in the preamble should not have a chapter number associated with them. I would like to use use \ref to refer to the notation section, however using \ref{chnotation} (where chnotation is the label of the notation section) does not work. I get the following error message Package hyperref Warning: Suppressing empty link on input line 16.  Is there away I can use \ref to refer to a section in the preamble that has been set up this way? I can not use \chapter because this will cause a chapter number to appear (along with the text "Chapter XX Notation) and this should not happen since this is part of the preamble. Desired outcome I would like to write a something like the following in the body: The reader may wish to refer to the \ref{chnotation} in the preamble.  and after compiling, the \ref{chnotation} will be replaced by the name of the section in the preamble and the sentence will appear as The reader may wish to refer to the Notation in the preamble. where clicking on the word "Notation" will take the reader to the page where the \label{chnotation} was placed. I tried looking at  for help however I couldn't solve my problem.


Java compile and run from command line with external jars in the same folder

I have a few java classes that do a simple data base test. I have all of the java files in a folder called "MorphiaTest". I also have all of the jars they depend on in that exact same folder. I want to compile this little application so I can move it around and run it. I'm running ubuntu and trying to do this all from the command line so I can SCP my compiled app onto a server. In this one folder is QueryTest.java and Record.java as well as the requisite Mongo-java-driver.jar and morphia-1.3.2.jar. All I want to do is compile these and run "java QueryTest" from the command line and have my program run. This is how I'm compiling javac -cp ":mongo-java-driver-3.8.2.jar:morphia-1.3.2.jar" QueryTest.java Record.java   All fine and dandy this compiles fine. But when I go to run "java QueryTest" I get this: Error: Unable to initialize main class QueryTest Caused by: java.lang.NoClassDefFoundError: org/mongodb/morphia/Datastore  What am I doing wrong?


Windows 10 thinks it's up to date, but it's not

Windows 10 downloaded a big update not long ago and went through a lengthy upgrade process. Partway through the system locked up. The little progress spinner stopped spinning and it sat there for hours.  So I powered down, the system appeared to go through a recovery process, and then I checked for updates again. It says that "Your device is up to date", but the current version is 1511, build 10586.633. That version isn't current; version 1607 was released in August.  But whenever I check for updates, it says that the system is up to date.  Windows Update troubleshooter reports no problems.  How do I persuade Windows to install 1607?


What's a command line way to find large files/directories to remove and free up space?

Looking for a series of commands that will show me the largest files on a drive.


Does anyone know how shared access (multiple Initiators) to a single iSCSI target is supposed to work.  I have got it semi-working with Linux (CentOS-7) target and Win 2012 server / Win Hyper-V 2012 R2 Initiators.  Problem is each instance seems to get it's own version of the NTFS partition.  The reason for doing this is so that I can have my virtual machine files hosted on the remote iSCSI target and migrate the actual running virtual machines between servers.  Without sharing the iSCSI target I cannot see any way of doing this.


Where to find compile/build configuration - Problem with Tor from source

Since I need to patch tor that does not yet support binding on a link-local ipv6 address, I compiled it from source.  The compile is successful (with minor warnings on the ar command) but the resulting executable has a strange behavior: it changes identity every 5 minutes.  Here is a detailed post on tor trac of this phenomenon:   To be sure the observation is not due to my patch, the above post is when compiling the unmodified source that is within the Ubuntu source repository. Same behavior is observed with the latest tor (0.3.1.8 as of this post).  I suspect what I have observed comes from a configuration paramater of one of the libraries (libevent, libssl) that has somewhere a default timeout of 5 minutes.  For tor, but more generally for any package I might want to compile, I would like to know where to find all the "parameters" to set so that the executable has the same behavior as those from the Ubuntu repositories.  For instance, I can see that the path where tor searches its configurations are different (first below is the tor binary from Ubuntu repo):  $ strings -d tor | grep -e '/.*torrc' /etc/tor/torrc-defaults /etc/tor/torrc ~/.torrc $ strings -d tor_0.3.1.8 | grep -e '/.*torrc' /usr/local/etc/tor/torrc ~/.torrc /usr/local/etc/tor/torrc-defaults   Then I guess, when you build/compile something on Debian/Ubuntu you have a set of parameters for: path, timeouts, various options, etc...  I can live with the different default paths (the systemd service forces the path of the configuration file) but the "5 minutes bug" is very annoying. Moreover, as tor is about anonymity, there could be more serious "silent bug" like this one... and I'll be glad if I could avoid them!  In summary, I would like set up a build environment to be able to compile executable with the exact same defaults parameters as those from the Ubuntu official repository. First instance of that would be to compile tor with the same "parameters" as in the Ubuntu repo.


Where are Upstart log messages on Ubuntu 13.X?

On Ubuntu 12.04, I can find Upstart log messages in /var/log/syslog.  Commands:  # initctl log-priority info # initctl emit hello   Log:  Apr  1 01:56:56 precise64 kernel: [ 8365.820425] init: Connection from private client Apr  1 01:56:56 precise64 kernel: [ 8365.821130] init: Handling hello event   On Ubuntu 13.10, the messages do not appear in syslog or anywhere else under the /var/log directory, although commands like logger hello work as expected. Should I be looking for them somewhere else? Is there a configuration setting I need to change somewhere?  There’s a  from somebody who seems to be having the same problem on Ubuntu 13.04, and more  and  that may also be describing the same problem. Unfortunately, these questions offer no leads for the problem.


How can I determine which hash function I should use?

I am studying Compilers recently, and I want to implement a lexer.   When I was designing the Symbol Table of lexer, I was thinking of to make the hash value of the identifier to the Symbol Table index.  However, I was confused about which hash function I should use, can anyone give me some advice?  I want to implement the lexer with C++, and say the identifier is made of letter, number and underscore, and it only starts with letter or underscore.  Thank you in advance!


So, I've been trying to round a number but it always gives me a result which I know is wrong, for example:  355 / 60   While this should be presenting me with a float around 5.9 etc. , the output on my machine is just 5, and if I specify float (355 / 60) the output is 5.0  I noticed this was very wrong, so I tried the same thing in trinket.io and the output was correct.   What is wrong with my IDLE, I suspect it's an issue which has to do with me using python 2.7 and trinket.io using 3, but my output shouldn't be so wrongly rounded, right?


I am about to start learning about light, having some knowledge of electromagnetic waves. I know an accelerated charge produces changing electric field which produces a changing magnetic field and vice versa thus EM waves propagate in space. Now I have doubt when we start speaking of light as a wave we draw the common sine wave to represent the same.But what does that waving thing actually represent in physical sense? What is actually oscillating that we represent in light wave?![edit:Have a look at image.In the image you can see light waves represented as something like sine curve.I wanted to ask if light is an electromagnetic wave it should have two field oscillating-one electric and other magnetic, but as shown in image which is commonly found in books explaining interference etc. why we have only a single curve and what is that]?()


What is the lastest level of ubuntu for a Dell Optiplex 620 computer

I have several dual processor 3ghz Pentium D Dell 620 systems with at least 2gb of memory.  I want to move them off XP and do not want to go to  Win7.  Am I limited to 13.04 or can I go to a later release.


Floating point error in MATLAB - linearly spaced vectors

OS: Win 7 64bit. Matlab: 2014a, 2015a  When I create a vector as follows:  a = 0.2:0.2:1   I get:   a = 0.2000    0.4000    0.6000    0.8000    1.0000   which is expected. Now when I want to see whether 0.6 exists in my vector I type:  a == 0.6   and I get: 0 0 0 0 0  find(a == 0.6) also return an Empty matrix: 1-by-0  These are unexpected. It is able to find all the other values, but for 0.6 there is a problem. I think although 0.6 is created it is actually 0.600000000000000001 or something similar, which is a problem. You can see that this is the case by a > 0.6 and will get  0 0 1 1 1.  1-First of all why is this happening?  2-Second are we able to see the whole value of a number in Matlab, if so what is the function or setting for that?  I created the same vector using linspace, but that also did not help. I have found a solution to this by typing :  a = roundn(a, -10). However, I think that such a solution should not even be needed at the first place.   3-Is there a better way to order Matlab to yield exact values?  Thank you all for your help.


How does the OS adjusts itself to the available RAM?

In my PC, there is 8GB RAM and runs Windows 10 64-bit OS. In the task manager, I can see that the OS is utilising 50%, that is, approximately 4GB of RAM and the remaining 4GB is free. But, in my friends' computers, which have 4GB RAM, there also I saw that the OS is utilising 50% of RAM. In many computers, there are just 2GB RAM, but it runs fine and there also only 50% memory usage.  So, I am wondering, how does the OS adjusts itself to the available RAM space?


At what levels do heroes in Hearthstone earn gold cards?

As you level up a hero in Hearthstone you earn gold versions of that hero's basic cards. For example the Druid earns a gold copy of Healing Touch at levels 15 and 20.      What gold cards do heroes earn at which levels?


I tried setting my birthday to an old age to see if it would work, but I was stopped by a message that said "Birthday must be after 1920/01/01". According to  1.9 million people in the U.S. lived to 90. This number has nearly tripled since 1980.  Shouldn't we have a more realistic age cap (hence even more), like 107?


Thank you ahead of time.   Problem: I have x different class objects that contains y amount of different properties  (y properties will rarely be the same among the x objects and nearly all properties will be strings). I need to be able to create a copy of the object that contains the same data (minus one property that will be changed later in the code) but the two object do not reference the same memory location.  Question:I am looking for a way to create a generic method that is able to copy the information from one object into another (or better yet return the copied object. I figure this may be possible with the use of reflections but I do not have any idea how to do this successfully. Is this possible?


Who is the best loser at a knock out tournament between a 2:2 and a 0:0

It was a top 6. First match a team lost 3:2 on penalties after 0:0 score at regulation time. The other one lost 4:3 and the other one lost 4:3 on penalties after 2:2 draw on regulation time Who is the best loser?


Do cheap routers overload easily when there are many devices connected to it, and how do I fix it?

Here in the UK, everytime you sign up to an ISP they will provide you with a router to connect at home. These are usually cheap netgear home routers (the one I'm using is a DGN-1000SP) with a basic GUI firmware. With 3 people in the flat, we usually have around 6 devices (3 PC's and 3 mobile devices) but sometimes up to 10 as more devices/guests come into play.  However, I've noticed that the network slows down massively when the number of devices get to 8 or so. Logging into my router's GUI I notice that the list of attached devices keep changing; sometimes there are as little as 3 devices connected and sometimes all 6 are shown.  Is this because the router cannot handle all the simultaneous requests (hardware fault) or because the internet connection is too slow? The connection is ADSL with 5Mbps down and 1Mbps up.  What are some ways I could fix this? Will establishing another access point with my spare router, wired to the original access point but broadcasting a different wireless channel and throwing traffic to this router help if the problem is to do with hardware?


What's a task-manager lighter than Activity-Monitor?

Apple Activity Monitor is nice and simple enough, but I tend to keep it open all the time in order:   to have a CPU monitor always visible in the Dock without any click/gesture (and without wasting space on the Menu Bar) to have quick access to details (PID, CPU/Memory/Network usage) and to killing apps   It is good enough but I was wondering:  does any other software exist, providing more or less the same functionalities, but with less use of CPU and (mainly) less energy impact?  Open-source is highly preferred. Freeware is a nice to have. If priced: not unreasonably 😁


Where do I connect my C wire from my thermostat when there are two transformers?

I have a Laars gas boiler that has 3 heating zones. I want to replace the old mercury honeywell tstat on the 1st floor (heat only) with a newer honeywell RTH9580 wifi model. I've taken pictures of my entire system, labeled the wires in the pics to indicate the associated connections, and included the Laars wiring diagram.  There is a transformer mounted on the wall near the boiler that is wired in-line to the system (power from the panel --> into the emergency boiler switch --> into the wall transformer --> then to the boiler (low water cut off and boiler circuitry).  There is also a transformer within the boiler circuitry itself.  Can someone tell me the best method (proper preferred, not necessarily easiest) to connect the C wire?


Why isn't the table adjusting the text to make line breaks when necessary? Can I make them manually? What could be done to fix these margins? Edit: MWE below: \documentclass[a4paper,12pt,spanish]{article} \usepackage{multirow} \usepackage[utf8]{inputenc} \usepackage{geometry} \usepackage[spanish]{babel} \usepackage{graphicx} \begin{document} \begin{center} \begin{tabular}{|r|ccccc|} \hline    & Descripción & Narración & Diálogo & Exposición & Argumentación \\ \hline   Técnico-científico &  &  &  & Habitual & \\   Jurídico-administrativo &  &  &  &  & \\   Humanístico &  &  &  & Estudio & Ensayo\\   Periodístico &  &  &  & Noticia & Art. opinión\\   Literario & Descripción & Novela & Teatro & \multicolumn{2}{c|}{Lengua literaria}\\ \hline \end{tabular} \end{center} \end{document}  Edit 2: Problem remains when changing tabular with tabu. Aditionally, it gives me a non fatal error when compiling: Overfull \hbox (57.79063 too wide) (page 2), lines 112-123. Since this table appears in the page 2 and the code lines match too, it probably wants to tell me something, but I don't know what it means.


Summation involving totient function: $\sum_{d\mid n} \varphi(d)=n$

Prove that:$$\sum_{d\mid n} \varphi(d)=n$$  Where $\varphi(n)$ denotes the number of positive integers $m$ less than or equal to $n$ such that $\gcd(m,n)=1$  I am lost here, any help would be appreciated.


Answers I want to describe a sad situation that I encountered here recently. I joined a subcommunity "Russian language" cause I am interested in linguistics and had some experience of working in a Russian language magazine as an editor.  So I posted some replies and got a comment that they are bad and too broad and pretty harsh commands in a style "do this, don't do that" from some of the old-timers here. Anyway I disagreed and said I was probably right and had some experience (maybe that was wrong to say). After that this guy started insulting me implying that I lie about my previous work and telling that his 4-year exp. here matters much more! Then we had a bit of unpleasant talk and later he deleted ALL his comments in it.  That was all a bit rude, but no problem, maybe my answer was a bit broad, I admit that. Bad things started later. He started putting minuses to all my answers (moreover 2 minuses at a time) and told me that he would do it further cause I "don't understand in a good way".  But I really wanted to take part in this community. I wrote to moderator using a standard form, but got no reply. (maybe he is a moderator himself?)  What should I do? I don't want to have all my answers minused (with 2 minuses at the same time - dunno why) Here he threatens me to "control" all my answers -  (sorry it's in Russian) Here he "controls" them -   Sorry about that question, I don't want to have quarrels or drama, just want to have friendlier attitude and not being minused cause someone dislike me personally. Whom should I contact about it if moderator option doesn't work?


How to make tail to automatically reconnect to a log file that was deleted and recreated together with its parent directory

I am using tail with option --follow=name to watch my log files in my servicemix instance (path = ${smx_home}/data/log/servicemix.log).  ServiceMix have a 'nice' feature to restart clean with servicemix clean that start fresh without cache and it seems it removes also the whole directory ${smx_home}/data.  When the folder and the log file are deleted, the message comes:  tail: data/log/servicemix.log: No such file or directory   and I have to press ctrl-C and restart my tail command like   tail --follow=name data/log/servicemix.log   The issue comes because the 'clean start' of ServiceMix remove the whole directory and not only the file and the initial inode is invalid.  Is there any way to make tail to reconnect to the deleted log?   If tail does not work, is there any other alternative (like e.g. with more or less)?  UPDATE:  I also tested multiple combination with -F --follow and --retry   tail --follow=name --retry data/log/servicemix.log   and this is not working too.  My tail version is   tail (GNU coreutils) 8.4


How do you calculate the displacement of an object moving with a changing acceleration?

Take an object a vertical distance $r$ above the surface of the earth of radius $R$.  The acceleration due to gravity at any $r$ is therefore: $a=\frac{GM}{(R+r)^2}$   Lets say the object falls from rest for $t$ seconds, how far does it fall in this time?  I assume calculus is necessary but get lost in the calculations.  $$a=\frac{dv}{dt}$$ so... $$dv=\frac{GM}{(R+r)^2}dt$$  Where do I go from here or am I even on the right track?  I guess I want an integral where: $$ds=\int_0^t something . dt$$  but I don't know how to get there.


Applying a keras model working with greyscale images to RGB images

I followed this  using the Fashion MNIST dataset. The training set contains 60,000 28x28 pixels greyscale images, split into 10 classes (trouser, pullover, shoe, etc...). The tutorial uses a simple model:  model = keras.Sequential([     keras.layers.Flatten(input_shape=(28, 28)),     keras.layers.Dense(128, activation='relu'),     keras.layers.Dense(10) ])   This model reaches 91% accuracy after 10 epochs.  I am now practicing with another dataset called CIFAR-10, which consists of 50,000 32*32 pixels RGB images, also split into 10 classes (frog, horse, boat, etc...).   Considering that both the Fashion MNIST and CIFAR-10 datasets are pretty similar in terms of number of images and image size and that they have the same number of classes, I naively tried training a similar model, simply adjusting the input shape:    model = keras.Sequential([      keras.layers.Flatten(input_shape=(32, 32, 3)),      keras.layers.Dense(128, activation='relu'),      keras.layers.Dense(10)   ])   Alas, after 10 epochs, the model reaches an accuracy of 45%. What am I doing wrong?  I am aware that I have thrice as many samples in an RGB image than in a grayscale image, so I tried increasing the number of epochs as well as the size of the intermediate dense layer, but to no avail.    Below is my full code:  import tensorflow as tf import IPython.display as display from PIL import Image from tensorflow import keras import numpy as np import matplotlib.pyplot as plt import pdb import pathlib import os from tensorflow.keras import layers #Needed to make the model from tensorflow.keras import datasets, layers, models  (train_images, train_labels), (test_images, test_labels) = datasets.cifar10.load_data()  IMG_HEIGHT = 32 IMG_WIDTH = 32  class_names = ['airplane', 'automobile', 'bird', 'cat', 'deer',                'dog', 'frog', 'horse', 'ship', 'truck']   train_images = train_images / 255.0 test_images = test_images / 255.0  def make_model():       model = keras.Sequential([          keras.layers.Flatten(input_shape=(IMG_HEIGHT, IMG_WIDTH, 3)),          keras.layers.Dense(512, activation='relu'),          keras.layers.Dense(10)       ])       model.compile(optimizer='adam',                    loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),                    metrics=['accuracy'])       return model  model=make_model() history = model.fit(train_images, train_labels, epochs=10)


How to create the illusion of depth with repeating patterns?

How do I create perspective with repeating patterns? I am very much a beginner level, as noted by my first attempt to create a illustration in illustrator. However, my attempt has provided me with various questions and obstacles on how to achieve the  Hand-drawn illustration.  For instance, in the picture below – there is repeating previously design pattern. What technique could be used to create depth?     The end result should yield a perspective similar to this live trace.  This may be off topic so please let me know how far or nebulous this question appears.


Is there a license / royalty free DRM available for protecting and distributing content?

Is there a license / royalty free DRM available for protecting and distributing video content?


Measuring distribution/concentration across categories

i'm trying to represent concentration/distribution across a set of categories.  Specifically these are job types, e.g. tourism, manufacturing, transport, education.  Let's say there are 10 job types and 3 cities:   City 1: 100k jobs.  All are in tourism.   [highly concentrated]  City 2: 75k jobs, 91% in tourism, 1% in each of 9 other industries.   [highly concentrated]  City 3: 30k jobs, 10% in each of 10 industries.  [highly distributed]  I'm not a stats guy but this feels like it should be something obvious and i'm struggling to find it.  i can't see how i could use stand dev as there is no mean.


Computing the Limits $ (1) \lim_{n \rightarrow \infty} \frac{10^n}{n!} ~~ (2) \lim_{n \rightarrow \infty} \frac{n^n}{n!} $

I have a question about the limit of the factorial function. How can I evaluate  $$ (1) \lim_{n \rightarrow \infty} \frac{10^n}{n!} $$  $$ (2) \lim_{n \rightarrow \infty} \frac{n^n}{n!} $$  Is there any alternative expression for the factorials to solve this problem?


Why Godel's theorem influences Hilbert's programme?

I have trouble understanding why it is being said that Godel's incompleteness theorem shows that Hilbert's programme is essentially impossible.  So, if I understand Godel's second incompleteness theorem, it says that sufficiently strong theorems such as Peano Arithmetic cannot prove its consistency within itself.  But isn't Hilbert's programme that we prove consistency using finitary means in metatheory? It seems to me that Godel's theorem implies that we cannot prove the consistency of the theory within the formal theory. But what about proving the consistency of the theory using metatheory (which is outside of the formal theory)?  I would appreciate your help and comments!


Problem with logic of determining equality of two strings while ignoring case

making a function that determines if two strings are equal but ignores their case. So far I have  bool isEqual(string str1, string str2) {     bool result = true;     for(int i = 0; I < str1.length(); i++) {         if(str1[i]==str2[i]||str1[i]==toupper(str2[i])||str1[i]==tolower(str2[i])){             //keep result==true         }         else {             result = false;         }     } return result; }   But this seems like a really inefficient way to do the logic of this problem, does anybody have any suggestions? Thanks


How do I programmatically determine operating system in Java?

I would like to determine the operating system of the host that my Java program is running programmatically (for example: I would like to be able to load different properties based on whether I am on a Windows or Unix platform). What is the safest way to do this with 100% reliability?


Does $\sum_{n=1}^{\infty} \frac{1}{n+1}$ converge?

Sorry for the oversimplified question, but does the series $\sum_{n=1}^{\infty} \frac{1}{n+1}$ converge? The ratio test of it gives the result of "1". Thanks a lot.


Let f be continuous on $\left [ a,b \right ]$ , and a$<$x$<$b. Prove that:$$\lim_{h\rightarrow 0}\frac{1}{h}\int_{a}^{x}\left ( f\left ( t+h \right )-f\left ( t \right ) \right )dt=f\left(x \right )-f\left(a\right)$$  I have tried Mean Value Theorm to solve it, but it didn't work. And I've been stuck on this for a while without any idea. Is it possible for someone to help me? Or give a hint. Thanks!


${}$Can the gravitational constant $G$ be calculated theoretically?

In an answer to a previous post of the same question, it was stated that the gravitational constant can not be determined theoretically yet!  From my perspective, the reason this is not yet possible is because of a flaw in the assignment of units in the SI system.   It is possible to derive the gravitational constant multiple ways using known physical constants but because of the flaw in the SI system the dimensions will not work out.  Thus the proof would be defined as a numerical coincidence and would be rejected.  If one was to show the proof using a new system of units it would still be rejected because the new system would suggest a flaw in theory of something which has been established for over one hundred years.  So the argument of a numerical coincidence based on unjustifiable units is used to defend a faulty set of units which is the source of the problem in the first place.  So my question is, "How does one defeat this problem?"


I try to get rounded corners on a UIImage, what I read so far, the easiest way is to use a mask images. For this I used code from TheElements iPhone Example and some image resize code I found. My problem is that resizedImage is always nil and I don't find the error...  - (UIImage *)imageByScalingProportionallyToSize:(CGSize)targetSize {     CGSize imageSize = [self size];     float width = imageSize.width;     float height = imageSize.height;      // scaleFactor will be the fraction that we'll     // use to adjust the size. For example, if we shrink     // an image by half, scaleFactor will be 0.5. the     // scaledWidth and scaledHeight will be the original,     // multiplied by the scaleFactor.     //     // IMPORTANT: the "targetHeight" is the size of the space     // we're drawing into. The "scaledHeight" is the height that     // the image actually is drawn at, once we take into     // account the ideal of maintaining proportions      float scaleFactor = 0.0;      float scaledWidth = targetSize.width;     float scaledHeight = targetSize.height;      CGPoint thumbnailPoint = CGPointMake(0,0);      // since not all images are square, we want to scale     // proportionately. To do this, we find the longest     // edge and use that as a guide.      if ( CGSizeEqualToSize(imageSize, targetSize) == NO )     {          // use the longeset edge as a guide. if the         // image is wider than tall, we'll figure out         // the scale factor by dividing it by the         // intended width. Otherwise, we'll use the         // height.          float widthFactor = targetSize.width / width;         float heightFactor = targetSize.height / height;          if ( widthFactor < heightFactor )             scaleFactor = widthFactor;         else             scaleFactor = heightFactor;          // ex: 500 * 0.5 = 250 (newWidth)          scaledWidth = width * scaleFactor;         scaledHeight = height * scaleFactor;          // center the thumbnail in the frame. if         // wider than tall, we need to adjust the         // vertical drawing point (y axis)          if ( widthFactor < heightFactor )             thumbnailPoint.y = (targetSize.height - scaledHeight) * 0.5;          else if ( widthFactor > heightFactor )             thumbnailPoint.x = (targetSize.width - scaledWidth) * 0.5;     }       CGContextRef mainViewContentContext;     CGColorSpaceRef colorSpace;      colorSpace = CGColorSpaceCreateDeviceRGB();      // create a bitmap graphics context the size of the image     mainViewContentContext = CGBitmapContextCreate (NULL, targetSize.width, targetSize.height, 8, 0, colorSpace, kCGImageAlphaPremultipliedLast);      // free the rgb colorspace     CGColorSpaceRelease(colorSpace);          if (mainViewContentContext==NULL)         return NULL;      //CGContextSetFillColorWithColor(mainViewContentContext, [[UIColor whiteColor] CGColor]);     //CGContextFillRect(mainViewContentContext, CGRectMake(0, 0, targetSize.width, targetSize.height));      CGContextDrawImage(mainViewContentContext, CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledWidth, scaledHeight), self.CGImage);      // Create CGImageRef of the main view bitmap content, and then     // release that bitmap context     CGImageRef mainViewContentBitmapContext = CGBitmapContextCreateImage(mainViewContentContext);     CGContextRelease(mainViewContentContext);      CGImageRef maskImage = [[UIImage imageNamed:@"Mask.png"] CGImage];      CGImageRef resizedImage = CGImageCreateWithMask(mainViewContentBitmapContext, maskImage);     CGImageRelease(mainViewContentBitmapContext);      // convert the finished resized image to a UIImage      UIImage *theImage = [UIImage imageWithCGImage:resizedImage];      // image is retained by the property setting above, so we can      // release the original     CGImageRelease(resizedImage);      // return the image     return theImage; }


Write mathematical operators in typewriter font

I want to typeset unicode symbols like ≥ (U+2265) and ∧ (U+2227) in the typewriter / tt / monospaced / non-proportional font of my document. I don't care how I have to enter these symbols in my .tex files. Entering ≥ or using a commando like \ge is both fine as long as I can do so inside \texttt and \begin{verbatim}.  I know that I can enter unicode signs directly using \DeclareUnicodeCharacter{2265}{\ge}. However, the command \ge can only be used in math mode which changes the font. Therefore \texttt{$\ge$} is not a solution. Also, I have to use pdflatex so XeTeX or LuaLaTeX are not an option for me.  Is there a way to output a ≥ in the current non-math font?


Uninstall ubuntu linux/ Install windows 7

I want to uninstall my ubuntu linux from the computer because it's very hard to use and install windows 7. What can i do in this case?(I have an original windows 7 on CD/DVD)


UK visa application: what visa type to select for a conference?

I am a student in the USA on an F1 visa. I need to attend a conference in England and wanted to know the procedure to apply for the visa.  Since I am in the US, when I start using the visa portal on gov.uk, it redirects me to the 'visa4uk' website. I made an account there, and when it is time to select the visa type, I cannot find 'Standard visitor' visa. It is just a list of 'Visit, Study, Work...', upon selecting Visit, a list of 'Tourism, Child, Family, Business...'. So I selected Business. Is this correct?


SQL: getting the max value of one column and the corresponding other columns

ID|  tag  |  version -----+-----+----- 1|  A  |  10 2|  A  |  20 3|  B  |  99 3|  C  |  30 3|  F  |  40   desired output:  1 A 10 2 A 20 3 B 99   How can I get the max version of every ID and the corresponding tag for that version? Speed is important (I have around 28m rows) so a nested Select won't do it. Also a simple Group by ID with a max(version) doesn't work because I also need the corresponding Tag where the version is max.


I need help choosing a suitable distrbution for my PC.  I am using an HP d530 CMT with:    ⠀• CPU Type: Intel Pentium 4, 3000 MHz (15 x 200) ⠀• Motherboard Chipset: Intel Springdale-G i865G ⠀• System Memory: 1015 MB  (PC3200 DDR SDRAM) ⠀• Video Adapter: Intel(R) 82865G Graphics Controller (96 MB) ⠀• 3D Accelerator: Intel Extreme Graphics 2 ⠀• Audio Adapter: Analog Devices AD1981B(L) @ Intel 82801EB ICH5 - AC'97 Audio Controller ⠀• Network Adapter: Broadcom NetXtreme Gigabit Ethernet    I have tried to install Ubuntu 13.10 and 12.04 LTS. Everything is OK on Ubuntu 12.04 except, that the video card was not recognized and the media player, YouTube,etc. did not work properly.


Why does gravity becomes negative when finding the negative derivative of potential? (I know $F=-dU/dx$) Why is $F$ itself negative?

By definition of the gravitational energy:  $$ -\frac{dU}{dx}=-\frac{GMm}{x^2}=F $$  Then by integrating we get:  $$ U(x)=\int\frac{GMm}{x^2}=-\frac{GMm}{x} $$  (I am not confused why force is negative derivative of the potential function)  I am confused about the negative sign in front of the force here in the first equation.I know that in force vector there should be a negative sign to indicate the opposite direction to unit vector. But isn't the whole equation just in scalar form?  (See both function $U$ and variable $x$ are scalars)  So why do we put minus sign here? Even if it is in vector form,how do we define the direction $dx$ and how does it relate to the unit vector in $F$ (which makes a minus sign in F's vector equation).  I know that physically work done equals to negative change in potential function, and it makes sense in this equation. But I wish to get a mathematical explanation.  And, I have an another question, when using line integral to find work done by the field:  $$ w=\int_c \mathbf{F}\cdot\mathrm{d}\mathbf{r} $$  Where $\mathrm{d}\mathbf{r}$ here is the element for position vector, if we goes from a larger radius to a smaller radius, the force vector should have same direction to change in position vector, therefore the work done:  $$ w=\int_c \mathbf{F}\cdot\mathrm{d}\mathbf{r}=\int_{R_2}^{R_1}\frac{GMm}{R^2}\mathrm{d}R=\frac{GMm}{R_2}-\frac{GMm}{R_1} $$  When I goes from smaller radius to a lager radius, the formula becomes:  $$ w=\int_c \mathbf{F}\cdot\mathrm{d}\mathbf{r}=\int_{R_1}^{R_2}-\frac{GMm}{R^2}\mathrm{d}R=\frac{GMm}{R_2}-\frac{GMm}{R_1} $$  Where $\mathrm{d}\mathbf{r}$ is positional vector, $\mathrm{d}R$ is the radius element and $R_2>R_1$. The position vector should be reversible to each other because of the direction we choose. See the work done here becomes same, but we know that gravity is conservative, so the two outcomes here should just be reversible to each other.  What goes wrong with my deductions here? Hope that you can solve my problem, and please forgive my ignorance as I am just a high school student.


I have a range of ipv6 addresses available (native) and want to use them. I 've setup the kernel to support ipv6 and installed the necessary tools (iproute2 etc).  I am having a problem understanding how to actually add the range for the server to use it. Do I have to configure each one separately or is it possible to add the whole range?  Also, after I recompile the programs to support ipv6 (Gentoo), is there an expected strategy on which ip they 'll be using for outgoing connections (assuming the other end is ipv6 enabled)? Is it random, is it the first one, is it something entirely different?


I'm a bit confused about all the memory types and various bus frequencies of modern consumer PCs. Requesting expert help on the subject.  So far I'm confident that:   I have an Asus X51L laptop with an unknown set of configuration options. The CPU in there supports PAE, so I still have a chance to extend the memory beyond 3GiB; and the upper limit of the system is 8GiB. (?) The laptop has two SODIMM slots, one of which is occupied by a 2GiB bank, and the other one is empty. dmidecode and lshw tools consistently state 533 Mhz frequency of the bank.   The last one confuses me the most. I failed to find out characteristics of the northbridge in this laptop, and still can't figure out what DDR2 to seek for. Is it DDR2-1066? Or, rather, PC2-8500/PC2-8600? Wouldn't a DDR2-800 bank harm the system's performance?  Which kind of modules should I look up in stores?    Update: I have bought a 2 GiB DDR2-800 SODIMM, and it seams that the system can't handle 4 GiB of memory. When installed by itself in either slot, both new and old bank (which btw happens to be marked GDDR2-677) work just perfectly; i.e. any configuration resulting in 2 GiB works. When both banks are installed though (totalling in 4 GiB), the memcheck86 tool produces horrible artifacts and crashes, and system reboots; an Ubuntu system can be started and even logged into a Unity session, but the system reboots too in this case from even a minor RAM load.  So it's pretty obvious to me now that this laptop doesn't support 4 GiB of RAM or more.


The negation of a limit condition, Spivak style.

I got stuck on this bit from Spivak's Calculus:  When proving that $f$ does not approach $l$ at $a$, be sure to negate the definition correctly: If it is not true that   for every $\varepsilon>0$ there is some $\delta>0$ such that, for all $x$, if $0<|x-a|<\delta$, then $|f(x)-l|<\varepsilon,$   then   there is some $\varepsilon>0$ such that for every $\delta>0$ there is some $x$ which satisfies $0<|x-a|<\delta$ but not $|f(x)-l|<\varepsilon.$    I don't understand why the negation of the top sentence is given by the bottom sentence. Thank you so much! EDIT My problem is not why "continuous functions are those that let you interchange limits". It's more just a question about how you can negate sentences in general.


Badge progress like 29/5 (e.g. for curious badge) is misleading

Summary: My question is not about why I have not got the badge, but rather the misleading progress display.  There are quite some posts about this topic. Most of them are marked either duplicate or closed. This topic is slightly different here is why,  To get curious badge a user must Ask a well-received question on 5 separate days, and maintain a positive question record. Agreed!  The formula to calculate if I am eligible for this badge is total questions - negative questions - closed - deleted)/total questions >= 0.5. Totally fine!   The best example what I can give why I think the count is shown wrong is I can't have 7 apples out of 5! How can I have 29/5 on the badge? I think the way the numbers are displaying is misleading.  Here are the few questions which talk about this issue but they are answered with you don't have +ve track. This answer doesn't really help. Again, how can I have 29 apples out of 5?


Symbology transfer from QGIS to ArcGIS Desktop

I am working with QGIS and ArcGIS Desktop 10.7.1 simultaneously.   Is there any way to transfer my symbologies and styles from QGIS to ArcGIS Desktop?   I could not find a way to do it so far.


Find all limit points of the set $S = \{\frac{p}{2^k} : p \in \mathbb{Z}, k \in \mathbb{N}\}$.  I could prove that all elements of $S$ are limit points of $S$. However, answer is all real numbers. Any help?


Scoring when two triple word squares are covered in one play

The word QUAGMIRE is on the board vertically, with the Q on the top row, second column. The next player creates SQUEEZED horizontally, landing the S on the triple word square in the top row, first column, and remaining UEEZED landing to the right of the existing Q, ending with the D on the triple word square in the eighth column. Since two triple word squares are covered in this one placement, how would it be scored?  Letters:   S: 1 Q: 10 U: 1 E: 1 x 2 (double letter) E: 1 Z: 10 E: 1 D: 1   27 Total for letters. Do you then multiply by 3 for the first triple word square, and then multiply that result by 3?  27 X 3 = 81, 81 X 3 = 243  Bonus for all 7 tiles placed:  243 + 50 = 293