My system is Ubuntu 18.04 LTS, with GNOME 3.28.1. In the login screen, if I enter the wrong password, it shows me the the message "Sorry, it didn't work", and then I continue to enter the right one. Then the login screen fades away but continue to show me the purplish background but not the desktop environment. However, if I enter the right password on the first try, everything goes normal. Also if I press cancel button after the "Sorry, it didn't work" message was shown and reenter the login screen, everything works fine. Does anyone knows how to fix that?

If I enter my password correct first time, I login as normal.  If I enter my password wrong, it says invalid password. If I attempt to enter the correct password now then the screen freezes and doesn't go to dock as normal. I must restart using a physical button or shutdown to get out. Login works normally after restart, assuming I get it right first time.  EDIT:  After entering a wrong password, if I click cancel and then go back to my user to login, it works fine.


I'm primarily a web developer (Cold Fusion / HTML, JS, CSS etc).  I want to develop a part of my application that will be written in coldfusion. It's a scoring system and, much like this site (coincidentally), certain privileges are unlocked at certain thresholds.  The system will be written in cold fusion, but the cf community isn't very large, so I'd honestly welcome a bit more feedback on the method to do it. I can handle the code itself.  Would such a question perhaps belong in Programmers?  I'm not sure that it really counts as a 'best practice' question, since I'm not talking about things like properly naming variables, or thread-locking, or table schema.  I do have a few ideas in mind, but this isn't the site for going into question details. I know that the best questions show effort on the part of the asker and not just a "Do this for me!", so when I ask, wherever I ask, I'll list out the ways I see for doing it and the pros and cons that I see for each.  So, while I provided details for the question I want to ask, this question boils down to: Where should a person ask about the best method to achieve something?

Stuff like polls, recommendations based on subjective constraints, puzzles, webcomics etc. do not belong on the serious main SE sites, where professionals should be considered at work and having just a few spare minutes ("code's compiling") to answer questions, so they should not be distracted by such things. However, I'd also like to have a home for these things still using the SE engine. For the reason I mentioned before, this needs to be a separate place though. Let's call it four.[sitename-here].com.


I was just curious as to how you would calculate it without a calculator. I don't care if it's in radians or degrees, but I just would like it to be specified.

Does anyone know of a way to estimate the tangent of an angle in their head? Accuracy is not critically important, but within $5%$ percent would probably be good, 10% may be acceptable.  I can estimate sines and cosines quite well, but I consider division of/by arbitrary values to be too complex for this task. Multiplication of a few values is generally acceptable, and addition and subtraction are fine.  My angles are in degrees, and I prefer not have to mentally convert to radians, though I can if necessary. Also, all angles I'm concerned with are in the range of [0, 90 degrees].  I am also interested in estimating arc tangent under the same conditions, to within about 5-degrees would be good.  Backstory  I'm working on estimating the path of the sun across the sky. I can estimate the declination pretty easily, but now I want to estimate the amount of daylight on any given day and latitude. I've got it down to the arc cosine of the product of two tangents, but resolving the two tangents is now my sticking point. I also want to calculate the altitude of the sun for any time of day, day of the year, and latitude, which I have down to just an arc tangent.


Hi I want to implement a while loop where users can input some strings and finish it by entering an empty String. When I am entering for example "Hello", "World", "" the loop does continue infinitely, but it should stop after the empty string - I don`t know why. Can you help?   Maybe the check if the string is unequal an empty string does`t work?  This is my code:  public static void main(String[] args) {     write("Enter some words and end your input by an empty string.");     String input = readString("Input a word:");     while(input != "") {         input = readString("word:");     }   Thank you.

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


I have a database of northings and eastings of boundary markers of land parcels that are in a form that I cannot pin on any format. I would like to perform some conversions on them so that they can be used on Google Earth, Maps, Waze etc. Example land parcel boundary markers:  23463.817 E, -54819.146 N  23449.900 E, -54808.635 N  23445.504 E, -54841.976 N  23435.597 E, -54834.499 N  23434.750 E, -54828.132 N   One of the marker is pointing "close" to 3.184487, 101.718079 on Google Earth.   I'm having trouble determining what format are these because it seems the values are way out of range for many known formats. I have no access to the people providing this information at the moment. Can anyone help me figure this out?   The area of concern is in Kuala Lumpur, West Malaysia.

I have a Shapefile but its coordinate system is Unknown, and there is no *.prj file.   How can I identify it now?


I have a C++ program as below  #include <iostram>  using namespace std;  class abc {     public:         abc()         {             cout << "in Constructor\n";         }; };  int main() {     abc a(); }   I compiled and I saw that "in Constructor" is not getting printed which means constructor is not getting called. I was wondering that both abc a and abc a() are same and both will create object a. But that seems to be wrong. Can any one please let me know what abc a() means because I didn't get the compilation error also.

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


Ltf(c+h) = f(c)(h goes to 0) if and only if Ltf(x) = f(c)(x goes to c).  I am able to prove this fact using sequential criterion of continuity. But sequential criterion is dependent on Axiom of countable choice.   Is above result also dependent on axiom of countable choice. I think no because different books use both definition equivalently.

In my introductory Analysis course, we learned two definitions of continuity. $(1)$ A function $f:E \to \mathbb{C}$ is continuous at $a$ if every sequence $(z_n) \in E$ such that $z_n \to a$ satisfies $f(z_n) \to f(a)$. $(2)$ A function $f:E \to \mathbb{C}$ is continuous at $a$ if $\forall \varepsilon>0, \exists \delta >0:\forall z \in E, |z-a|<\delta \implies |f(z)-f(a)|<\varepsilon$. The implication $(2)\implies(1)$ is trivial (though I will happily post a proof if there is sufficient interest).  The proof of the implication $(1)\implies(2)$ is worth remarking on, though. Proof that $(1)\implies(2)$: Suppose on the contrary that $\exists \varepsilon>0:\forall \delta>0, \exists z \in E:\left (|z-a|<\delta \; \mathrm{and} \; |f(z)-f(a)|\ge \varepsilon\right )$.  Let $A_n$ be the set $\{z\in E:|z-a|<\frac{1}{n} \; \mathrm{ and }\; |f(z)-f(a)|\ge\varepsilon\}$.  Now use the Axiom of Choice to construct a sequence $(z_n)$ with $z_n \in A_n \; \forall n \in \mathbb{N}$.  But now $a-\frac{1}{n}<z_n<a+\frac{1}{n}\; \forall n \in \mathbb{N}$ so $z_n \to a$.  So $f(z_n) \to f(a)$.  But $|f(z_n)-f(a)|\ge\varepsilon\; \forall n \in \mathbb{N}$, which is a contradiction. You will have noticed that the above proof uses the Axiom of Choice (the lecturer didn't explicitly spell out the dependence, but it's definitely there).  My question is: is it possible to prove that $(1) \implies (2)$ without using the Axiom of Choice.  I strongly suspect that it isn't.  In that case, can anyone prove that we have to use the Axiom of Choice?  I can think of three ways to do this: (A) Show that $\left( (1) \implies (2)\right)\implies \mathrm{AC}$.  I suspect that this statement is untrue. This is definitely untrue, as Arthur points out, because I only used the axiom of countable choice, which is strictly weaker than AC. (B) Show that $(1)\implies (2)$ is equivalent to some other statement known to require the Axiom of Choice (the obvious example being the well-ordering of the real numbers). (C) Construct or show the existence of a model of ZF in which there exist sequences which satisfy $(1)$ but not $(2)$. Of course, if anyone can think of another way, I would be very interested to hear about it. One final note - I am aware that very many theorems in Analysis use the Axiom of Choice in one way or another, and that this is just one example of such a theorem.  If there exists a model of ZF like the one described in (C), is the study of Analysis in that model interesting?


I have edited my sources.list because I couldn't do update because it throws a series of error code 404. I followed some steps on the internet so it would lead to id.old-releases.ubuntu.com, but it's still failed (I was trying to download samba for my school's project and I got panicked because of it). I haven't backup my sources.list file, and I'm confused what to do now.  This is what the code that I use to change the sources.list:  $ sudo sed -i.bak -r 's/(archive|security).ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list   Most of the errors that I got were similar like this.  Err http://id.old-releases.ubuntu.com vivid-backports Release.gpg               Could not resolve 'id.old-releases.ubuntu.com'   Could anybody help? I don't really understand how Ubuntu works.

Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found:  $ sudo apt-get install vlc Reading package lists... Done                Building dependency tree        Reading state information... Done     E: Couldn't find package vlc


When I am tried to install Ubuntu along with Windows I can't do it. It is showing that "Erase disk and install Ubuntu". What I do to get the option to install Ubuntu along with Windows 10?

Whenever I startup from the LinuxLive USB, and try to install Ubuntu 12.04, it only gives me two options instead of the usual 3 or 4. My options are "Replace Windows 7 with Ubuntu" and "Something Else". Whenever I go into "Something else", it looks extremely confusing. How do I install it side-by-side while using the "Something else" section? These are my partitions.   /dev/sda /dev/sda1 ntfs (104Mb, System Required Partition) /dev/sda2 ntfs (1000097Mb, Windows 7 Partition)   Or should I try reinstalling my installer on a CD rather than USB and maybe then it will have the "Install alongside" function?


This fact is rather obvious (when viewed informally) but OK... How can we prove most easily and without using too much theory that the series     $$\sum_{n=1}^{\infty} \sin(n)$$  is divergent?   I tried to prove it but to do so, I have to use quite a few properties of the $sin$ and $arcsin$ functions. So I am looking for something simpler, more elegant.

I received a task to find out whether the following series converges:  $$\sum_{x=1}^\infty\sin(x)$$  On first look it seems simple, but as I keep thinking about it, there's not a single lemma or criterion that I can use to tackle the problem.  D'alembert ? Doesn't work: The following is meaningless IMHO: $\lim\limits_{x \to \infty}{}\frac{\sin(x+1)}{\sin(x)}$  That series isn't monotonic... you can't understand the rules for when will a member of the series be negative or positive.  All I know is that $\sin(x)$ is blocked between (-1) and 1. Though it's easy to see that $ \sum\limits_{x=1}^\infty\lvert\sin(x) \rvert$ diverges.    May I use  for $\pi$ in order to construct  2 subseries:   One that shows that $\sin(x)$ converges to the limit 1 Another one that shows that $\sin(x)$ converges to the limit 0   And we know that a series can't converge to 2 different numbers, hence it diverges?


My great-great grandfather, Wolf Finkelstein, was born in 1832 before Romania came into existence so, I don't know how to find out anything about him such as who his parents were.  I think he was born in a town called Jassy which I have also seen spelled Iasi.  Any help to point me in the right direction will be greatly appreciated.  Please note, I am new to using this site so, I may not always ask a question the best way.

Wolf Finkelstein was my great-great grandfather.  He was born in Romania in 1832 which was before that country came into existence.  I don't know how to find out anything about him such as who his parents were.? How could I determine a more precise location and date for his birth?  I think he was born in a town called Jassy which I have also seen spelled Iasi.


$(function() {   $(".reqdeb").click(function() {     console.log("Working");     var req_id = $(this).attr("id");     var info = 'id=' + req_id;     if (confirm("Are you sure you want to delete this request?")) {       $.ajax({         cache : false,         type : "POST",         url : "del_req.php",         data : info,         success : function() {         }       });       $(this).parents("tr").animate("fast").animate({         opacity : "hide"       }, "slow");     }     return false;   }); });   This is the code that stops working after a few tries of pressing the button and the code that causes it to stop working is this:  function autoRefresh_div(){     $("#refresh").load("reqs.php");     $("#nrref").load("numreq.php") } setInterval('autoRefresh_div()', 5000);

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


While going through the terminal just changing the directory with / and // it shown the same contents of root directory then what's the difference in both of them

I mistakenly typed cd // instead of cd /. To my surprise, current directory showed up as //.   What is that directory? Why does it exist?  apple@snipped $ pwd /home/apple apple@snipped $ cd / apple@snipped $ pwd / apple@snipped $ cd // apple@snipped $ pwd // apple@snipped $ cd /// apple@snipped $ pwd /


I want to reset 170 SQL sequences to 0. I have heard that this is not easy, but there are "hacks" possible like:  select SEQ_P_1.CURRVAL from dual;   remember this value, say 111 and then  alter sequence SEQ_P_1 increment by -111 minvalue 0; select SEQ_P_1.NEXTVAL from dual; alter sequence SEQ_P_1 increment by 1;   As a result, the sequence SEQ_P_1 is set to 0. That works for me! Now comes my questions about the other 169 sequences. I don't want to type all that... Now  select 'alter sequence '||sequence_name||' minvalue 0 increment by '||     select sequence_name.CURRVAL     from dual||';' from dba_sequences where sequence_name like '%SEQ_P_%';   does not work. Something must be wrong with the inner select..? Please help :) I want to get a result of 170 lines that I copy paste into SQL developer so that it does all those 4 steps i did manually above for each line.  SOLVED:  I compile the procedure given in  and then execute all statements that I get using     select 'exec reset_seq('''||sequence_name||''');'    from dba_sequences    where sequence_name like '%SEQ_P_%';

In , I can do something like this:  ALTER SEQUENCE serial RESTART WITH 0;   Is there an Oracle equivalent?


Is it possible to configure LaTeX to simultaneously output a standard .pdf for a presentation and also a handout version?  Platform: Texmaker Compiler: XeLaTeX

I'm currently generating some presentations with beamer for students of my course. Some like to print the material, so I created a handout. Some students prefer to have 2,3,4,6 etc. pages per sheet of A4 paper. How can I go about to automatize the following code, so that it outputs 4 different files in 1x2,1x3,2x2,2x3 format?  I'd like to avoid having to compile it again everytime for the different formats.  \documentclass[a4paper]{article} \usepackage{pdfpages}  \begin{document} \includepdf[pages=1-last,nup=1x2,landscape=false,frame=true,             noautoscale=false,scale=1,delta=0mm 5mm]{Pres7Chap13-Handout.pdf} \end{document}


I am inserting into two tables at the same time, tss_client and tss_details. First, I insert into tss_details, then using Details_ID from there, I insert into tss_client.   How to I get the most recent ID, from tss_details? I'm trying LAST_INSERT_ID() but it doest work   addDetailsQry.prepare("INSERT INTO tss_details(Username, Password, Email, Description, etc..) "                       "VALUES (:Username, :Password, :Email, :Description, etc..");   addClientQry.prepare("INSERT INTO tss_client(Client_Name, Website, Contact_Details_ID)"                      "VALUES (:Client_Name, :Website, :LAST_INSERT_ID()");  addDetailsQry.bindValue(":Username", username); addDetailsQry.bindValue(":Password", password); addDetailsQry.bindValue(":Email", email); addDetailsQry.bindValue(":Description", description);  addClientQry.bindValue(":Client_Name", clientName); addClientQry.bindValue(":VAT_Number", VATNumber); addClientQry.bindValue(":Website", website); addClientQry.bindValue(":Contact_Details_ID", /*what would i put here*/ );  if(addDetailsQry.exec()) {     qDebug() << "Client Details added!";      if(addClientQry.exec())     {         qDebug() << "Client added!";     } }   The ID column in tss_details is an identity.   I'm using ODBC and SQL Server version:     'Microsoft SQL Server 2016 (RTM) - 13.0.1601.5 (X64)   Apr 29 2016 23:23:58   Copyright (c) Microsoft Corporation  Express Edition (64-bit) on Windows 10 Pro 6.3  (Build 14393: )   and  I get:     [Microsoft][ODBC SQL Server Driver][SQL Server]'LAST_INSERT_ID' is not a recognized built-in function name.

Which one is the best option to get the identity value I just generated via an insert? What is the impact of these statements in terms of performance?   SCOPE_IDENTITY()  Aggregate function MAX() SELECT TOP 1 IdentityColumn FROM TableName ORDER BY IdentityColumn DESC


I'm new to python and I'm developing a raspberry pi program that will check a sever ever 2 min. i have the server check part working But, I'm not sure how to accomplish the repeat. For example in arduino there is void loop() function there I could wait to see if 2min have pass then call the sever check function without a problem. How would I accomplish this in python?

I want to repeatedly execute a function in Python every 60 seconds forever (just like an  in Objective C). This code will run as a daemon and is effectively like calling the python script every minute using a cron, but without requiring that to be set up by the user.  In , the solution appears to effectively just  for x seconds. I don't need such advanced functionality so perhaps something like this would work  while True:     # Code executed here     time.sleep(60)   Are there any foreseeable problems with this code?


Do you know about any good photo / 3D references sites?  I want to create a 3D human models but I need good references for it. Do you know about any free or paid site that you trust? Thanks

Since asking for tutorials, videos, resources, links to other content or downloads is considered off topic here, this is a specifically created Community Wiki which gathers resources for Blender and it has been approved by the .  Just write in the appropriate answer/section. If you have concerns, questions, post a  question, so we don't clutter the comments, but you can link your meta question from the comments.  Questions regarding such resources are not allowed anymore, except for very specific and on topic requests (ask on  if you're unsure about your question). Follow the instructions made in the question about how to post, what can be posted, etc.  Learning             Assets    (also see: )   Reference Images/Blueprints (also see: )    Tools    (also see: )      Other   Special Interest ()     Also see the .


I need to divide two values in LaTex,  \newcommand{\x}{30} \newcommand{\y}{10}   Is there a simple way to do this? i.e   x / y = 3   Preferably not using external packages, or a long winded \newcommand function. It needs to be as simple as possible. Also I may need to divide floats by integer values.

I have to deal with a lot of numbers in my latex documents. So far, I have been using a rudimentary \newcommand{\VarOne}{1000} to define \VarOne and then use it as it is using \VarOne{} in the document.  Can I use LaTeX to perform basic operations like add/ subtract/ multiply/ divide numbers --- integers/ non-integers?  Also, is there a way to print non-integers with comma separated values? So, \newcommand{\VarOne}{1000.97} produces 1,000.97 when used in the document? I can do this only for integers using \newcommand\mynum[1]{\num[group-separator={,},group-minimum-digits=4]{\the\numexpr(#1)\relax}} macro.


I have my working system in a remote location and the os is in unix and i need to get the files from that remote unix system to my local machine using bash commands. I tried  scp ls .txt*  D:\BACKUP   this command by connecting using putty to my remote system.  i tried but its not working.

In my terminal shell, I ssh'ed into a remote server, and I cd to the directory I want.   Now in this directory, there is a file called table that I want to copy to my local machine /home/me/Desktop.   How can I do this?  I tried scp table /home/me/Desktop but it gave an error about no such file or directory.   Does anyone know how to do this?


I'm wondering if there is any way to make crypto based on time, where the concept of time is linear in one-direction. Even a theoretical brainstorm.  Example 1:  A message which can only be opened/read after a certain time. Could be good for distributing things before a release date.  Example 2:  A message which cannot be opened be opened/read after a certain time. Could be good for HTTPS, or exchanging short messages between spies.

Does there exist any cryptographic algorithm which encrypts data in such a way that it can only be decrypted after a certain period of time?  The only idea that I can think of, is something like this: Seed a PRNG with a public value. Run the PRNG for a week and use the final value it produces to encrypt the message. Now anyone who runs that PRNG for a week starting from the seed value you made public can decrypt the message. Obviously this breaks down since they could use more computational power than you; if the time span was years then Moore's Law would apply, etc.  Is there anything like this other than physically burying a private key on a USB stick in a literal time capsule?


I have a table that has a centered head, but the body is on the left. Since i use p{x cm}, i can't use c to make it to the center. Here's my MWE: \documentclass[12pt,a4paper]{article} \usepackage{bm,longtable,array,caption,booktabs,setspace} \begin{document}     \begin{spacing}{1.2}         \renewcommand{\arraystretch}{1.5}         \setlength{\tabcolsep}{12pt}         \begin{longtable}{p{1cm}p{2.5cm}p{4cm}p{2.5cm}}             \caption{\label{what}This is what?}\\             \toprule             \multicolumn{1}{c}{\centering \bm{$xjxj^2$}}             &\multicolumn{1}{c}{\centering \bm{$xis2-1$}}             & \multicolumn{1}{c}{\centering \textbf{www}}             & \multicolumn{1}{c}{\centering \textbf{xxx}}\\             \hline \hline             \endfirsthead             \hline             \multicolumn{1}{c}{\centering \bm{$xjxj^2$}}             &\multicolumn{1}{c}{\centering \bm{$xis2-1$}}             & \multicolumn{1}{c}{\centering \textbf{www}}             & \multicolumn{1}{c}{\centering \textbf{xxx}}\\             \hline \hline             \endhead             123 & 123456789 & 123456789 & 987654331\\             \hline             123 & 123456789 & 123456789 & 987654331\\             \hline             123 & 0 & 123456789 & 987654331\\             \hline             123 & 123456789 & 123456789 & 987654331\\             \hline             123 & 0 & 123456789 & 987654331\\             \hline             123 & 123456789 & 123456789 & 987654331\\             \hline             123 & 0 & 123456789 & 987654331\\             \bottomrule         \end{longtable}     \end{spacing} \end{document}  Hope you want to help me. Thanks in advance

How can I center the column values in this code?  \documentclass[conference]{IEEEtran} \begin{document} \begin{table}   \centering   \begin{tabular}{|p{2.5cm}|p{2.5cm}|p{2.5cm}|}     \hline     Reconstruction strategy & aa          & bb( \%) \\ \hline     Classic                 & 3342 voxels & 68 \%   \\ \hline     VC                      & 4296 voxels & 87 \%   \\ \hline     V m=7                   & 4745 voxels & 96 \%   \\ \hline   \end{tabular}   \newline\newline    \caption{title}\label{tab1} \end{table} \end{document}


I had a single account on my Windows 10 laptop which I changed from an administrator to a standard account not knowing the consequences.  I tried booting Ubuntu (16.04) from a flash drive. But when I'm renaming sethc.exe file I get a popup showing "Error renaming file operation not supported". Please help me out of it and become the administrator user of the system.

I accidentally disabled my admin account.  After I login to another account I found I can not get admin rights, because all admin accounts on my computer are disabled.  I clicked on 'run as administrator' but only see a smart card choice (all the admin accounts are disabled so no choice provided)    I don't want to re-install my OS, help!    Details:  I have account A on my computer.    I got a new computer so I want to give the old one to my mother.    Creating a new user account B for her and disable account A.    Logout and restart.    Successfully login B, now I found I could not get admin rights because no account choice is provided.    More informations about my machine:  OS is Windows 10 and my admin account is a Microsoft Account.  I have an arch-linux installed on my computer and dual-boot it using GRUB, so maybe I can not use safe mode.


To my understading what a 1x1 convolution does is gives an embedding of the (i,j)th entry of the feature map along its depth. Besides here some dimensionality reduction is also done. How will the scenario change when we have 5x5 or 3x3 convolution done followed by a 1x1 convolution. I know that the number of computations will blow up. But is their some other point that I am missing?

I am currently doing the Udacity Deep Learning Tutorial. In Lesson 3, they talk about a 1x1 convolution. This 1x1 convolution is used in Google Inception Module. I'm having trouble understanding what is a 1x1 convolution.  I have also seen  by Yann Lecun.  Could someone kindly explain this to me?


For example, suppose I'm building a first-person shooter and the player pulls the trigger. I want to convert the screen coordinate (x, y) into a world coordinate (x, y, z) to know what they've hit.  I've seen some people mentioning a lookup using glReadPixels, but I've heard it's slow and those references were years old, so I'm not sure if this is the best way.  I'm working with core OpenGL 3.3, not ES. gluUnProject is not part of the API I'm asking about.  These types of answers would be most helpful:   An explanation of how to retrive a pixel's (x, y, z) value using glReadPixels and how to transform that into world coordinates. I know how to multiply by inverse matrices; I don't know exactly what steps OpenGL takes to arrive at its depth buffer value. Or, an explantion of how to do something similar, perhaps more efficiently, with a pixel buffer object. Or some method that I don't even know about that's better than either of the above.   For some context: I have many months' worth of code into a game I'm developing in OpenGL using the core 3.3 profile. I'm using minimal libraries and not the old fixed-function GL pipeline, which is why it does not make sense for me to use gluUnProject. I mention this to highlight why this question is not the duplicate of a currently-linked older question.  Note: I previously mentioned a shader idea that did not add much to the question, so I removed it. I also edited the question to clarify the context and the type of answer I am looking for.

I've spent more time than I should trying to get my ray picking program working. I'm pretty convinced my math is solid with respect to line plane intersection, but I believe the problem lies with the changing of the mouse screen touch into 3D world space.  Heres my code:      public void passTouchEvents(MotionEvent e){           int[] viewport = {0,0,viewportWidth,viewportHeight};         float x = e.getX(), y = viewportHeight - e.getY();          float[] pos1 = new float[4];         float[] pos2 = new float[4];         GLU.gluUnProject(   x, y, 0.0f,                             mViewMatrix, 0,                             mProjectionMatrix, 0,                             viewport, 0,                             pos1, 0);           GLU.gluUnProject(   x, y, 1.0f,                             mViewMatrix, 0,                             mProjectionMatrix, 0,                             viewport, 0,                             pos2, 0);     }   Just as a reference I've tried transforming the coordinates 0,0,0 and got an offset.  It would be appreciated if you would answer using OpenGL ES 2.0 code.


we have that the probability of winning a game is b and if you win you keep playing until you loose. And it says that the average number of consecutives wins is $1/(1-b)$, suppose infinite periods.   Well what the way i was trying to solve this is using a geometric sum, because the answer looks a little bit like a geometric sum, but i need some help.  As allways thank you very much.

In consecutive throws of an ordinary die, which of the following two possibilities is more likely to happen first:   a) Two successive occurrences of 5 or  b) Three successive appearances of numbers divisible by 3?  I thought that "time to event" random variable follows a geometric distribution. In the first case the probability of the event would be $p_1=1/36$ so the waiting time would be $E(X_1)=\frac{1-p_1}{p_1}=35$, plus 2 (for the successive occurrences of 5) = 37.  Accordingly the probability of the second event would be $p_2=\frac{2^3}{6^3}$ and the waiting time for the second event would be $E(X_2)=\frac{1-p_2}{p_2}=26$, plus 3 = 29.  As I was not sure about the validity of the above considerations, I decided to try some monte carlo simulations (the code can be found here: ). According to the results, the second event will happen first, indeed. But the expected values are larger than the ones calculated before (About 42 and 39, accordingly)   What is the right way to calculate the waiting time?


I have taken many looks, but I have not been able to find a working snippet which I would understand at my current learning level. What I'm aiming to do is again:   Take input:string input = "Eggs and Spam"; Tokenize it, and then put the tokens (together) into a list:   Which I see as this: inputlist = ["Eggs", "and", "Spam"];   First, I may like to know how to (hopefully briefly) declare a list, and do the above by appending the list.  In terms of C++, I'm also curious how I could do so when using only the default libraries, as I am having trouble handling library files at the moment.

Java has a convenient split method:  String str = "The quick brown fox"; String[] results = str.split(" ");   Is there an easy way to do this in C++?


I'm a noob Wordpress Developer and I just created my first Custom Template Page using Advanced Custom Fields and managed to loop.     <?php              $args = array(                 'post_type' => 'art',                 'orderby' => 'title',                 'order' => 'ASC'             );             $the_query = new WP_Query( $args );                  ?>         <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>           <?php get_template_part( 'content', 'art' ); ?>          <?php endwhile; endif; ?>   But I will like to use it not only inside a template page, but anywhere I want. Therefore I need to create a shortcode.  Example:  function foobar_func( $atts ){     return "foo and bar"; } add_shortcode( 'foobar', 'foobar_func' );   My question would be: How can i put the loop inside my shortcode?

I manage a wordpress site and have created a template part that I usually paste below the content.

Featured store products
          <?php $catquery = new WP_Query( 'post_type=product&posts_per_page=4&orderby=rand' );         while($catquery->have_posts()) : $catquery->the_post();         ?>         <a href="<?php echo get_post_meta($post->ID,'PRODUCT-url', true);?>">

                         <?php the_post_thumbnail('small-thumbnail'); ?>

<?php the_title(); ?>

                   <?php endwhile; ?>
   Now I'm trying to put this IN BETWEEN the content, so I thought of using a shortcode  function get_products($atts) { get_template_part('block-products-inline'); } add_shortcode('products', 'get_products');   Now every time I post [products], I expect the products to go there. However when I try the code above, the products template_part goes all the way to the top of the page, right underneath the title and right before the actual content.  But when I edit the shortcode to simply return some text, then the text DOES appear in the middle of the content.  Does anyone understand what's going on? Because I don't..


Why are most of deleterious mutations recessive in nature? I understood that if it's recessive then one reason may be that the mutant gene doesn't code for a functional protein and so there is no  phenotype to express.  But why is it recessive in the first place?

Can someone tell me where can I find detailed text about mechanisms of evolution of dominance? Or, if it is possible, I would be grateful if someone will tell me about them here.


So the n key on my macbook is broken. There isn't an issue with the key cap or the scissor clip underneath the issue seems to be coming from the little sensor thingy underneath. I was fixing an issue with a different key and made the mistake of taking apart the n key to see how to put the other one back together. Well, now I am left with a broken n key. Is this something I could fix myself, a hardware issue or a software one? I have tried all the other suggestions online about slow keys and enabling mouse keys but nothing is working. After noticing the issue the n key would respond really slowly after being pressed and then the letter n would appear randomly when I typed, but now it isn't functioning at all. Currently typing by using cmd+v to paste the n. Any help would be appreciated, thanks in advance!

This is an attempt to write a canonical QA for this issue, as per the Meta post:   I expect it to be periodically edited with the goal of becoming a comprehensive information resource.  I have a MacBook Pro that has a key(Shift, Return,   Command, P, etc.) that doesn’t respond when pressed or is stuck in the down position.    It's possible that my favorite beverage was spilled (or some other liquid damage).  It's also possible that I have no idea what happened.  It was working yesterday and suddenly today it's no longer working.  Is there any way to bypass or remap the key?  Can I  have the system ignore it completely?  (This question can also apply to external USB keyboards or the Bluetooth keyboards)


I'm trying to wrap multiple field items in an HTML container.  So let's say I have "Blog" content type. I have field1, field2, field3, field4 and field5 for this content type.   I want to output field2, field3 and field4 wrapped together in a DIV.  I've been Googling and tinkering for the past 3 hours and I haven't gotten anywhere.  Any help out there?  Drupal 7, Zen subtheme.   I read this and didn't have any luck here either:

I have a content type that uses many cck fields, and I would like to theme the content type by grouping certain fields in "blocks" (not Drupal blocks but div blocks), preferably div tags, so that the fields aren't just displayed one after the other. I can edit the css of individual fields, but if I want a field to be in a div on the top right hand corner of my node types page, and then another group of fields to be along side it, and then another group of fields to fall underneath all of the other fields, that css could get messy and interfere with my themes main css. I'm not sure what to put in my template file, since all the fields just fall under "content."   I'm using Drupal 6, and a little new with php, but can do basic "print" and "if" conditions. Any help would be greatly appreciated! Thanks in advance!


I'm studying on the derivation of $\left\langle \frac{1}{r^2} \right\rangle$ by using the book . The derivation in the book is as follow:  I can understand the rest of the derivation but I'm stuck at equation (6.223) as I don't understand how the integrals is equal to zero, I tried to evaluate the partial derivative of the equation but the problem becomes more complex. Is there any way to prove the integral is equal to zero? Edit: I know there is  to evaluate the value of $\left\langle \frac{1}{r^2} \right\rangle$ without involving complex integral. I just don't understand the calculation part of this method.

I have a problem understanding the solution provided for the problem here:    It's from the book "Quantum Mechanics - Concepts and Applications", 2nd ed., by N. Zettili (Wiley, 2009).   My issue is that I don't understand the second equality of eq. (6.223). Why do these two integrals cancel each other out?


I just created a resume in Overleaf using LaTeX and saved it as a PDF. The tex file was somehow deleted from my Overleaf account and now I want to make some edits. Is there a way I can make changes in LaTeX to my pdf file?

I know that hardly any information is passed to the PDF when a .tex file is compiled.  But is there a tool that can convert a PDF document back to (La)TeX?


If  $\forall i \in \Bbb{N}: a_{i} \in \Bbb{R}^+$ , is it true that $\forall n \in \Bbb{N} : \big(\sum_{i=1}^{n}a_{i}\big) \big(\sum_{i=1}^{n}  \frac{1}{a_{i}}\big) \ge n^2$ ?   I have been able to prove that this holds for $n=1$ , $n=2$, and $n=3$ using the following lemma:     Lemma 1:  Let $a,b \in \Bbb{R}^+$. If $ab =1$ then $a+b \ge 2$   For example, the case for $n=3$ can be proven like this:  Let $a,b,c \in \Bbb{R}^+$. Then we have:  $(a+b+c)\big(\frac{1}{a} + \frac{1}{b} + \frac{1}{c}\big) = 1 + \frac{a}{b} + \frac{a}{c} + \frac{b}{a} + 1 + \frac{b}{c} + \frac{c}{a} + \frac{c}{b}  + 1 $  $= 3 + \big(\frac{a}{b}  + \frac{b}{a}\big) + \big(\frac{a}{c} + \frac{c}{a}\big) + \big(\frac{b}{c} + \frac{c}{b}\big) $  By lemma 1, $\big(\frac{a}{b}  + \frac{b}{a}\big) \ge 2$,  $ \big(\frac{a}{c} + \frac{c}{a}\big) \ge 2$ and  $\big(\frac{b}{c} + \frac{c}{b}\big) \ge 2$ , therefore:  $3 + \big(\frac{a}{b}  + \frac{b}{a}\big) + \big(\frac{a}{c} + \frac{c}{a}\big) + \big(\frac{b}{c} + \frac{c}{b}\big) \ge 3 + 2 + 2 +2 = 9 = 3^2 \ \blacksquare $  However I'm not sure the generalized version for all natural $n$ is true. I can't come up with a counterexample and when I try to prove it by induction I get stuck.  Here is my attempt:  Let $P(n)::\big(\sum_{i=1}^{n}a_{i}\big) \big(\sum_{i=1}^{n} \frac{1}{a_{i}}\big) \ge n^2$  Base case: $\big(\sum_{i=1}^{1}a_{i}\big) \big(\sum_{i=1}^{1} \frac{1}{a_{i}}\big) = a_{1} \frac{1}{a_{1}} = 1 = 1^2$ , so $P(1)$ is true.  Inductive hypothesis:  I assume $P(n)$ is true.  Inductive step:  $$\left(\sum_{i=1}^{n+1}a_{i}\right) \left(\sum_{i=1}^{n+1} \frac{1}{a_{i}}\right) = \left[\left(\sum_{i=1}^{n}a_{i}\right) + a_{n+1}\right] \left[\left(\sum_{i=1}^{n} \frac{1}{a_{i}}\right) + \frac{1}{a_{n+1}}\right]$$  $$=\left(\sum_{i=1}^{n}a_{i}\right) \left[\left(\sum_{i=1}^{n} \frac{1}{a_{i}}\right) + \frac{1}{a_{n+1}}\right] + a_{n+1} \left[\left(\sum_{i=1}^{n} \frac{1}{a_{i}}\right) + \frac{1}{a_{n+1}}\right]$$  $$=\left(\sum_{i=1}^{n}a_{i}\right)\left(\sum_{i=1}^{n} \frac{1}{a_{i}}\right) +\left(\sum_{i=1}^{n}a_{i}\right) \frac{1}{a_{n+1}} + a_{n+1} \left(\sum_{i=1}^{n} \frac{1}{a_{i}}\right) +a_{n+1} \frac{1}{a_{n+1}}$$  $$=\left(\sum_{i=1}^{n}a_{i}\right)\left(\sum_{i=1}^{n} \frac{1}{a_{i}}\right) +\left(\sum_{i=1}^{n}a_{i}\right) \frac{1}{a_{n+1}} + a_{n+1} \left(\sum_{i=1}^{n} \frac{1}{a_{i}}\right) +1 $$  $$\underbrace{\ge}_{IH} n^2 + \left(\sum_{i=1}^{n}a_{i}\right) \frac{1}{a_{n+1}} + a_{n+1} \left(\sum_{i=1}^{n} \frac{1}{a_{i}}\right) + 1$$  And here I don't know what to do with the $\big( \sum_{i=1}^{n}a_{i} \big) \frac{1}{a_{n+1}} + a_{n+1} \big(\sum_{i=1}^{n} \frac{1}{a_{i}}\big)$ term.  Is this inequality true? If it is, how can I prove it? If it isn't, can anyone show me a counterexample?

If $x_1,...,x_n$ are positive real numbers and if $y_k=1/x_k$, prove that $$\left(\sum^n_{k=1}x_k\right)\left(\sum^n_{k=1}y_k\right)\geq n^2.$$   I've been learning induction, and I've come across this problem that I really can't even break down and begin to think about. I've been told it has something to do with Cauchy-Schwarz, but I cannot figure out how to apply it. I would appreciate help figuring out how to go about and formulate this proof. Thanks!


I was refused a business visit visa to the UK recently because my sponsor's deposits did not match his salary. They also objected that I did not show my bank statements hence 'not shown proof of my financial circumstances in Pakistan'. What I wanted to know is when I reapply, do I really need to attach my statement, since it is only sufficient to support my daily expenses and my credit is equal to my debit? I am afraid they might object to it since I have known people who have gotten their visas rejected on the basis of insufficient funds in their bank account even when they were NOT their own sponsor.

The UK Visas and Immigration Directorate publishes  that provides helpful tips that can result in successful visa applications. Section 2 of this guidance opens is entitled "other documents you may want to provide" (emphasis mine).  Section 2: other documents you may want to provide – all visitors This section provides guidance on the types of documents that you may want to provide to help us consider your application against the Immigration Rules. Previous travel documents/passports, which show previous travel. Financial documents showing that you have sufficient funds available.  These must clearly show that you have access to the funds, such as:  bank statements building society book proof of earnings such as a letter from employer confirming employment details (start date of employment, salary, role, company contact details) where a third party (who is either in the UK or will be legally in the UK at the time of your visit) is providing financial support to you e.g. a business, a friend or a relative, documents to show that they have sufficient resources to support you in addition to themselves and any dependant family should be provided   The first item is "bank statements" and this ties in with the , which says...  evidence that you can support yourself during your trip, eg bank statements or payslips from the last 6 months  (Note 'eg' is a Latin abbreviation meaning "for example"; this appears to be optional rather than a fixed requirement.) Question: How should someone interpret this such that the chances of success are maximized? How many statements should I submit? What are they looking for and what do my bank statements tell about me?


Is there an english word, which can be used for both update and create?  I'm programming a function which creates something if it doesn't exist already, otherwise it updates the stuff.  A word which came me in mind is process.  Does anyone know a better matching word for this purpose?

I'd like to know if someone has a better word than , for both creating and updating something.  Context: I'm a software developer and I'm trying to think of a clever way to name the function that will initially create an object, and if it's already created, update it.


Hi, there. please check this image.  I had a suspicious IP address and I ran the last command. Anyone please tell what that lsof is? Did somebody run the lsof command on my server? but I've never run that command

This is a  about Server Security - Responding to Breach Events (Hacking)   See Also:                  Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism:   What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning?   Original Version       2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a    attack on our provider. The servers access to the Internet   has been shut down which means over 5-600 of our clients sites are now   down. Now this could be an FTP hack, or some weakness in code   somewhere. I'm not sure till I get there.      How can I track this down quickly? We're in for a whole lot of   litigation if I don't get the server back up ASAP. Any help is   appreciated. We are running Open SUSE 11.0.            2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed   to resolve this problem, although it may not apply to many others in a   different situation. I'll detail what we did.      We unplugged the server from the net. It was performing (attempting to   perform) a Denial Of Service attack on another server in Indonesia,   and the guilty party was also based there.      We firstly tried to identify where on the server this was coming from,   considering we have over 500 sites on the server, we expected to be   moonlighting for some time. However, with SSH access still, we ran a   command to find all files edited or created in the time the attacks   started. Luckily, the offending file was created over the winter   holidays which meant that not many other files were created on the   server at that time.      We were then able to identify the offending file which was inside the   uploaded images folder within a  website.      After a short cigarette break we concluded that, due to the files   location, it must have been uploaded via a file upload facility that   was inadequetly secured. After some googling, we found that there was   a security vulnerability that allowed files to be uploaded, within the   ZenCart admin panel, for a picture for a record company. (The section   that it never really even used), posting this form just uploaded any   file, it did not check the extension of the file, and didn't even   check to see if the user was logged in.      This meant that any files could be uploaded, including a PHP file for   the attack. We secured the vulnerability with ZenCart on the infected   site, and removed the offending files.      The job was done, and I was home for 2 a.m.            The Moral   - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole   world is made aware of the vulnerability.   - Always do backups, and backup your backups.   - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server   Fault.


I want to draw a rectified signal with (blue) and without a capacitor  (black). This is what I'm getting     This is what I want     Code:  \begin{figure}[H]  \begin{tikzpicture}     \draw (0,0) -- (12,0);     \draw (0.2,1.5)node[left,font=\tiny] {$y=12$} -- (11.8,1.5);     \draw (0.2,-1.5)node[left,font=\tiny] {$y=-12$} -- (11.8,-1.5);      \foreach \x in {0,0.5,...,12}{     \draw (\x,-0.2)node [below,font=\tiny,] {\x} -- (\x,0.2) ;     }     \draw[ thick, black] (0,0) sin (1,1);    %% the real business in this line     \draw[ thick, black] (1,1) cos (2,0);    %% the real business in this line         \draw[ thick, line join=round , blue] (1,1) to (4.1,0.35);     \draw[ thick, black] (2,0) to  (3,0);    %% the real business in this line     \draw[ thick, black] (3,0) to (4,0);    %% the real business in this line         \draw[ thick, black] (4,0) sin (5,1);    %% the real business in this line     \draw[ thick, black] (5,1) cos (6,0);    %% the real business in this line     \draw[ thick, black] (6,0) to (7,0);    %% the real business in this line     \draw[ thick, black] (7,0) to  (8,0);    %% the real business in this line     \draw[ thick, black] (8,0)  sin (9,1);    %% the real business in this line     \draw[ thick, black] (9,1) cos (10,0);    %% the real business in this line     \draw[ thick, black] (10,0) to (11,0);    %% the real business in this line      \end{tikzpicture} \caption{nach  gleischrichtung}     \label{halb_welle_schaltung}     \end{figure}

Would it be possible to achieve this in PGF plots? I can manage to get a sine wave and draw the sawtooth looking wave but cant get it all together


Suppose I say:     It is foolish to lick a metal pole.   Is this in the passive voice?  Would this sentence be better as:     To lick a metal pole is foolish.   How about:     Licking a metal pole is foolish.

How can I reliably and accurately identify the passive voice in writing or speech? I'm not interested in advice about whether or not to use it yet... I just want to know for sure what it is, so that I don't look as stupid as .


Is there a limit to how big you should make K for k-fold cross validation? I understand as K gets bigger performing the CV will take longer, but aside from that, is there any reason not to make K = n? is there a point where your validation sets are so small that even if you average them, the result is garbage?

How do  methods compare in terms of model variance and bias?   My question is partly motivated by this thread: . The answer there suggests that models learned with leave-one-out cross-validation have higher variance than those learned with regular $K$-fold cross-validation, making leave-one-out CV a worse choice.  However, my intuition tells me that in leave-one-out CV one should see relatively lower variance between models than in the $K$-fold CV, since we are only shifting one data point across folds and therefore the training sets between folds overlap substantially.  Or going in the other direction, if $K$ is low in the $K$-fold CV, the training sets would be quite different across folds, and the resulting models are more likely to be different (hence higher variance).  If the above argument is right, why would models learned with leave-one-out CV have higher variance?


Is there anyway to prevent this dialog box from popping up every time a file has been changed?     This file has been modified by another program, do you want to reload it?

How can I stop the warning that appears in Notepad++ if the file is modified from an external program or application?


I'm trying to generate a string between capital A-Z in java using Secure Random. Currently I'm able to generate an alphanumeric string with special characters but I want a string with only upper case alphabets.    public String createRandomCode(int codeLength, String id){         char[] chars = id.toCharArray();         StringBuilder sb = new StringBuilder();         Random random = new SecureRandom();         for (int i = 0; i < codeLength; i++) {             char c = chars[random.nextInt(chars.length)];             sb.append(c);         }         String output = sb.toString();         System.out.println(output);         return output ;     }    The input parameters are length of the output string & id whhich is alphanumeric string.Can't understand what modifications to make to the above code to generate only upper case alphabet string. Please help..

I've been looking for a simple Java algorithm to generate a pseudo-random alpha-numeric string.  In my situation it would be used as a unique session/key identifier that would "likely" be unique over 500K+ generation (my needs don't really require anything much more sophisticated).    Ideally, I would be able to specify a length depending on my uniqueness needs. For example, a generated string of length 12 might look something like "AEYGF7K0DM1X".


Machine Learning is sometimes associated with cryptography. Many of such cross field studies have been majorly done in use of machine learning for cryptanalysis/decryption. I am interested in knowing that can machine learning be used in anyway for encryption. Googling it did not give any relevant results. Are there any references or resources on this domain? Or is this idea impractical without much future scope?

I am about to go study for my masters in machine learning, data mining and high performance computing, but have recently become very interested in cryptography after taking Dan Boneh's Cryptography course on coursera.com.   I was wondering if there are any practical applications for machine learning in cryptography? A quick google search didn't seem to reveal much for me so i was wondering if someone here knows something.  My first impression would be that machine learning techniques could be used to learn the inverse function for some cipher and passphrase given enough plaintext/ciphertext pairs, but i am not sure how capable things like neural networks are at learning functions which are not linearly separable.


I have the following code in Python 3:  def matrix(n:int) -> list:     matrix = list([[None]*n]*n)      count = 1     for i in range(n):         for j in range(n):             print(i, j, count)             matrix[i][j] = count             count += 1      return matrix  number = 3 print(matrix(number))   Below is the print result:      0 0 1     0 1 2     0 2 3     1 0 4     1 1 5     1 2 6     2 0 7     2 1 8     2 2 9     [[7, 8, 9], [7, 8, 9], [7, 8, 9]]   As you see, indexes are correct, but it does not return the expected value of [[1, 2, 3], [4, 5, 6], [7, 8, 9]]. There has to be a fundamental reason for this behavior, and of course, by using other methods, such as append(), the result is correct.

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


I am new to java... If I am missing something, please advise me.  I try to access the private method like below:  public class PublicClassPrivateMethodAndVariableAccess {     private int a=23;      private void show()     {         System.out.println("a = "+a);     }      public static void main(String... arg)     {         PublicClassPrivateMethodAndVariableAccess pr = new PublicClassPrivateMethodAndVariableAccess();         System.out.println("using method showing  pr.show() ");         pr.show();         System.out.println("pr.a = "+pr.a);     } }   This will show output as:  using method showing  pr.show()  a = 23  pr.a = 23   But when I’m using a similar code with a different way to access the private method...:   class Testclass {     private int a=23;      private void show()     {         System.out.println("a = "+a);     }    }  public class NoModifierClassPrivateMethodAndVariableAccess {     public static void main(String... arg)     {         Testclass pr = new Testclass();         System.out.println("using method showing  pr.show() ");         pr.show();         System.out.println("pr.a = "+pr.a);     } }   ... it shows error as below:  NoModifierClassPrivateMethodAndVariableAccess.java:19: error: show() has private  access in Testclass                 pr.show();                   ^ NoModifierClassPrivateMethodAndVariableAccess.java:20: error: a has private access in Testclass                 System.out.println("pr.a = "+pr.a);                                                ^ 2 errors   I am asking why this second code is failing to access the private method?

In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), public, protected and private, while making class and interface and dealing with inheritance?


I'm using float to display decimal numbers, but sometimes it doesn't display correct result.  For example, for 6.2/1000 the result is 0.0061999997.  I know why is this happening, but I wonder is there a way to display correct result, in this case, 0.0062?  EDIT:  does not answer to my question, so why did you marked my question as already been answered in other place?  Numbers I wrote are only example. In the app user can enter any number and divide / multiply number with any other number, so the result maybe won't have any decimal points, maybe it will have 4 decimals, maybe it will have 7 decimals,...

What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next number. This is the standard method of rounding most people expect in most situations.  I also would like only significant digits to be displayed - i.e. there should not be any trailing zeroes.  I know one method of doing this is to use the String.format method:  String.format("%.5g%n", 0.912385);   returns:  0.91239   which is great, however it always displays numbers with 5 decimal places even if they are not significant:   String.format("%.5g%n", 0.912300);   returns:  0.91230   Another method is to use the DecimalFormatter:  DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385);   returns:  0.91238   However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this:  0.912385 -> 0.91239 0.912300 -> 0.9123   What is the best way to achieve this in Java?


Basically, my question is about where anchor tag links should be located.  In the specific sentence Click here to go to this site, what makes the most sense?  Click  to go to this site.  Click here to go to .  Click  to go to .      Which provides the best user experience?

Over the years of surfing on the web I have found numerous examples of people saying that you shouldn't use the word "here" in a textlink etc. Personally I like the idea of using the word, because it is so straightforward for your visitors to know where to click.  The only reason that I can truly think of is for SEO purposes. The word here doesn't have much value as a keyword as such.  I would like to know some other opinions on why we should/shouldn't use word like "this" and "here" in a textlink.


I am not allow to use the fact if a sequence is convergent then its Cauchy which is the only way I can solve this problem.

I am trying to understand better Cauchy sequence in the book that I am reading he is trying to provide counter argument that in general metric spaces we can find sequence that are Cauchy but aren't convergent for example $\frac{1}{n}$ is Cauchy but doesn't converge in the space T = (0,1].  I am trying to prove that the sequence is Cauchy to begin with if we consider $n \geq m > 0$ Consider $|a_n - a_m| = \frac{m - n}{mn} < \frac{m}{mn} = 1/n < \epsilon$. So if we choose N = $\frac{1}{\epsilon}$ that should work since for $n, m > N = \frac{1}{\epsilon}$   we have the following:  $|a_n - a_m| = \frac{m - n}{mn} < \frac{m}{mn} = \frac{1}{n} < \epsilon$.  what do you guys think any the proof is good or is there anything to make it better ? It is always good to learn from the extra bit of details as it makes my brain understand the subject more !


I was wondering how to make a function alter two variables (the return and another one) and I stumbled upon calling the function with an '&' before the parameter (which I understand to mean the address of the parameter) then throughout your function, referencing it with the '*' sign (which I guess is a "dereference" and means it alters the object at the address).  Anyways, this was all going fine, then a friend said you can just call the function with the variable directly, refer to the variable with an & before it in the header, and treat it normally throughout the function. This seems way easier, so why isn't there more about it on the web? Is one style more correct than the other?  void foo(int &junk)  //The way the friend said {     junk++; }  void oof(int *junk) //what I found, and what the internet seems full of {     (*junk)++; }  int main () {     int junk=1;     std::cout << junk << "\n";     foo(junk);     std::cout << junk << "\n";     oof(&junk);     std::cout << junk; }   This outputs:  1 2 3   So everything works fine, I'd assume.

I know references are syntactic sugar, so code is easier to read and write. But what is the difference between a pointer variable and a reference variable?


Show that $n^{13} - n$ is divisible by $2, 3, 5, 7$ and $13$   I know this has been asked before, but the other approaches seem different than mine.   Here is my approach:  Look at $ n^{13} -n \equiv 0 \bmod k $ where $k$ is some positive integer. Then we can write $ n^{13} \equiv n \bmod k $ which has the form $ n^{\phi(k) + 1} \equiv n \bmod k $. So we can solve for $k$ that satisfies the equation $\phi(k) + 1 = 13$. The first few $k$ that satisfy this are $13, 21,$ and $26$. Since $21 = 3 * 7$ and $ 26 = 2 *13$, this shows that $ n^{13} -n $ is divisible by $ 2,3,7,13 $.  My trouble is proving this for $5$. I have checked the Euler totient function up to $k= 100,000,000$ with Mathematica. There is not an integer on this list that is divisible by $5$. The list seems to have stopped growing after $42$: $\{ 13, 21, 26, 28, 36, 42 \}$. Why does this method not seem to work for $5$?

Show that $2730\mid n^{13}-n,\;\;\forall n\in\mathbb{N}$   I tried, $2730=13\cdot5\cdot7\cdot3\cdot2$  We have $13\mid n^{13}-n$, by Fermat's Little Theorem.  We have $2\mid n^{13}-n$, by if $n$ even then $n^{13}-n$ too is even; if $n$ is odd $n^{13}-n$ is odd.  And the numbers $5$ and $7$, how to proceed?


I'm looking for a derogatory term for people from liberal metropolitain areas who think they are better educated and more enlightened than those from rural, conservative areas.   Carthage, TX is to redneck as San Francisco, CA is to ______________.  EDIT:  In response to comments below, I feel I must add that I do not believe the people of SF "think they are better educated and more enlightened than those from rural, conservative areas."   If I did believe that, I wouldn't be asking this question now would I? BECAUSE I WOULD KNOW ALL THE DERAGATORY TERMS.

I'm looking for something people from rural area would use, especially when they refer to that person's inability to adapt to the country life.


I'm proving that on a normed space $(X, \Vert.\Vert)$, the function $\mathbb{R} \times X  \to X: (\lambda, x ) \mapsto \lambda x$ is continuous on its domain, where the domain is equiped with the maximum norm $d_M((a,x),(b,y)) = \max\{|a-b|,\Vert y - x \Vert\}$  I fixed a point $(\lambda_0,x_0)$. I have to prove that:  $$\forall \epsilon > 0: \exists \delta > 0: \forall (\lambda, x) \in \mathbb{R}\times X: \max\{|\lambda- \lambda_0|, \Vert x - x_0\Vert \} < \delta \implies \Vert\lambda x - \lambda_0 x_0\Vert < \epsilon$$  I did the following:  $$\Vert \lambda x - \lambda_0 x_0\Vert \leq (|\lambda - \lambda_0| + |\lambda_0|)\Vert x - x_0\Vert + \Vert x_0\Vert |\lambda - \lambda_0| < (\delta+ |\lambda_0|)\delta + \Vert x_0 \Vert \delta$$  Can I choose $$\delta := \min\left\{\sqrt{\frac{\epsilon}{2}}, \frac{\epsilon}{2(|\lambda_0| + \Vert x_0 \Vert + 1)}\right\}$$   to make the expression smaller than $\epsilon$?

The topology induced by the norm of a normed vector space is such that the space is a topological vector space.  Can you tell me if my proof is correct? Of course we have to show that addition and scalar multiplication are continuous with respect to the product topology (induced by the norm).  (1) To show that $(x,y) \mapsto x + y$ is continuous let $\varepsilon > 0$. I can show that the norm $\|\cdot\|_{V \times V}: V \times V \to \mathbb R$ defined as $\|(x,y) - (x_0, y_0) \| = \|x-x_0\| + \|y_0 - y\|$ induces the same topology as the product topology on $V \times V$. Hence we can choose $\delta = \varepsilon$ to get $$ \| (x+y) - (x_0+y_0)\| \leq \|x-x_0\| + \|y-y_0\| < \delta = \varepsilon$$  (2) To show that $V \times K \to V$, $(v, \alpha) \mapsto \alpha v$ is continuous at $(v,\alpha)$, observe that $$\| \alpha v - \beta w\| = \|  \alpha v - \beta w + \alpha w - \alpha w\| = \|\alpha(v-w) + (\alpha - \beta) w\| \leq |\alpha| \|v-w\| + |\alpha - \beta| \|w\|$$  Hence $\| \alpha v - \beta w\| < \varepsilon$ if $\|v-w\| < \frac{\varepsilon}{2 |\alpha|}$ and $|\alpha - \beta| < \frac{\varepsilon}{2 \|w\|}$. Unfortunately, the second inequality depends on $w$. How do I make it independent of $w$? Thanks.


I want to install win 7 over ubuntu but the windows installation has stopped when appear the "Starting Windows" screen (for the first time). I convert my hard disk to mbr, from gpt and I deleted all partition, but the same problem. The screen is just froze.  Now I don't have an operating sistem on my hp envy laptop, just an ubuntu live usb.  What can I do ?

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


It is known that many sectors/industries within the stock market are correlated with each other. For example, using VIF as a measure of correlation, I have the following result:  Sector  ENERGY   CONSUMER STAPLES   CONSUMER DISCR   MATERIALS   INFORMATION TECH   INDUSTIRALS   HEALTH CARE   FINANCIALS   UTILITIES   TELECOM SVC  VIF    2.937214     4.268179      10.755497        6.150606     5.023864           14.064349       2.795279      6.054236     2.985639     3.360512   As you can see, VIF for most industries are greater than 5. I was just wondering if  1) there exists data for the uncorrelated sectors  or  2) there eixsts a way to extract the "pure" part of a given return stream which is uncorrelated with other parts. I am not even sure if it's possible.

I am trying to perform a multi linear regression model:  $$y_i = β_0 + β_1x_{i1} + β_2x_{i2} +... + β_px_{ip} + ε_i$$  where $$x_{i1}, x_{i2}, ..., x_{ip}$$ are highly correlated with each other (VIFs can be as low as 5 and high as 30).  I am just wondering if there exists a procedure with the following properties:  1) extracts the pure part of each independent variable, where pure is defined as a part of the variable which is uncorrelated with other variables.  2) the pure part and the original variable should be similar to each other, whether similar is defined as moments such as mean and variance and correlation coefficient (ideally >0.90)


I am generating html table on ajax callback like  ... success: function (data) {     if (data != undefined) {         var table = $("
").addClass("table table-striped table-bordered table-condensed");         var header = $("
").html("
a	b	c	d	e	f	g	");         table.append(header);         for (var i = 0; i < data.length; i++) {             var row = $("
");             row.append($("").html(data[i].Id));             row.append($("").html(data[i].Name));             row.append($("").html(data[i].Color));             row.append($("").html(data[i].Doors));             row.append($("").html(data[i].Fuel));             row.append($("").html(data[i].Injection));             row.append($("").html(data[i].Desc));             table.append(row);         };         $("#carsTable").html(table);     } }, ...   On same page using javascript I want to recognize click event on table row of this carTable generated snippet.    $('#carTable tr').on('click', function (e) {       console.log('click!');   });   Is this because of generated html in the callback and if it is how to solve this?

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


As stated in the title, when I open Settings and click on Privacy then Screen Lock all of the options are grayed out.    The Blank Screen setting in Power is set to 15 mins. Super+L is set in the Keyboard setting to lock screen, but never works. The only thing that seems to work is the Switch User in the upper right menu.  GNOME shell extensions:   User Themes System-monitor   $ xset q Screen Saver:   prefer blanking:  yes    allow exposures:  yes   timeout:  0    cycle:  0 DPMS (Energy Star):   Standby: 0    Suspend: 0    Off: 0   DPMS is Enabled   Monitor is On

Recently upgraded to Ubuntu 18.10, having two problems.  Easiest to explain: when I open "settings", go to "privacy", select "screen lock", I get the popup window with the screen lock settings, but everything is grayed out:   Second issue: If I step away from the machine for long enough (seems to be 5 minutes), the screen blanks. Hitting a key or moving the mouse wakes it up. But when it wakes up, the only things on the screen are the icon bar at the left and the top bar with status icons on the right end. The rest of the screen is blue, not my normal lock screen image. The screen isn't locked, it doesn't prompt for a password, it's just...blue.  I can move the mouse pointer around the screen, the icons react if I click on one, I can bring up the popup with volume/brightness controls on the top bar. But if the pointer is on the blue background, neither left nor right button clicks do anything.  Now, if I press ctrl-alt-F1 from there, I get a lock screen where I can enter my password. Then I get the blue screen back, but if I press ctrl-alt-F2 I get my normal screen (with running applications) back.  ctrl-alt-F2 without going through the lock screen first does nothing.  I'm not finding anything while searching that matches either of these sets of symptoms. Suggestions?


I have a question. For everyone to understand this and an eventual answer I'll just show you. I have one table that's looking like this:  model   | price  model1  |  10 model2  |  15 model3  |  20 model4  |  25 model5  |  30   And I want my new table to look like this:                  models                  | total model1, model2, model3, model4, model5  |  100   How can I do that? I heard there is a group_concat() function but I also heard that is not indicated to do that. Can someone explain?

Using MySQL, I can do something like:  SELECT hobbies FROM peoples_hobbies WHERE person_id = 5;   My Output:  shopping fishing coding   but instead I just want 1 row, 1 col:  Expected Output:  shopping, fishing, coding   The reason is that I'm selecting multiple values from multiple tables, and after all the joins I've got a lot more rows than I'd like.  I've looked for a function on  and it doesn't look like the CONCAT or CONCAT_WS functions accept result sets.  So does anyone here know how to do this?


I get this whenever I try to install a package  $ sudo apt-get install metacity Reading package lists... Done Building dependency tree        Reading state information... Done Suggested packages:   gnome-control-center The following NEW packages will be installed:   metacity 0 upgraded, 1 newly installed, 0 to remove and 157 not upgraded. 1 not fully installed or removed. Need to get 0 B/243 kB of archives. After this operation, 744 kB of additional disk space will be used. $    I tried the basic fixes, didn't work.  sudo apt-get clean && sudo apt-get autoremove sudo apt-get -f install sudo dpkg --configure -a   This is what I get when I do an apt download  $ sudo apt download metacity Get:1 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 metacity amd64 1:3.18.3-1ubuntu3 [243 kB] Fetched 243 kB in 2s (90.4 kB/s) W: Can't drop privileges for downloading as file '/home/jaison/metacity_1%3a3.18.3-1ubuntu3_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

I get it after updating in Synaptic Manager  I recently did a clean install of Ubuntu 17.04 from 16.10.  error message:-  W: Download is performed unsandboxed as root as file '/var/cache/apt/archives/partial/samba-libs_2%3a4.5.8+dfsg-0ubuntu0.17.04.1_i386.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)


show that $$I=\int_0^1 (\sqrt[3]{1-x^7}-\sqrt[7]{1-x^3}) \, dx=0$$  I find this is Nice equalition!  My try: let $$\sqrt[3]{1-x^7}=t\Longrightarrow x=\sqrt[7]{1-t^3}$$ so $$dx=-\dfrac{3}{7}t^2(1-t^3)^{-\dfrac{6}{7}} \, dt$$ so $$I=\frac{3}{7}\int_0^1 \frac{t^3}{\sqrt[7]{(1-t^3)^6}} \, dt-\int_0^1 \sqrt[7]{1-x^3} \, dx$$  By parts,we have $$\int_0^1 \sqrt[7]{1-x^3} dx=\dfrac{3}{7}\int_0^1 \frac{x^3}{\sqrt[7]{(1-x^3)^6}} \, dt$$ so $$I=0$$  this problem maybe have more other nice methods!Thank you

Evaluate the integral: $$ \int_0^1 \left(\sqrt[3]{1-x^7} - \sqrt[7]{1-x^3}\right)\;dx$$   The answer is $0,$ but I am unable to get it. There is some symmetry I can not see.


I'm trying to play a LAN server with my sibling, but every few minutes, I lag then get disconnected.  It tells me that the connection was forcibly closed by a remote host.  We have the same wifi, and also I have let Java through firewall on both computers.  We run 1.10.2 and Windows 10.

Upon entering any given minecraft server, after a minute or two I am forced out of the server, and I'm given the following error:  java.io.IOException: An existing connection was forcibly closed by the remote host.  What does this mean, and how can I prevent it from happening again?


I have a laptop with Windows 8.1 and every time I restart the computer it's like Google Chrome reinstalls itself from scratch. My browsing history, download history, extensions, themes, etc... all disappear.  I have reinstalled Chrome more than 5 times attempting to solve this problem, with no effect. I avoided restarting Windows for several weeks to avoid the issue, but now I'm tired of this. I don't know what to do. I like Chrome and don't want to switch to another browser, but it seems I don't have a choice. Can anyone help?  Other details: I tried signing into a Google account using Chrome. I scanned the system with Malwarebytes and Avast more than 10 times. I formatted and reinstalled my operating system 3 times.  I do have malware in my system, but they are not going away. The one malware annoys me most is "bettersearch.tk".

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


Fermat's Little Theorem states that, if $p$ does not divide $a$, then:  $$a^{p - 1} \equiv 1 \pmod{p}$$  From this, can we derive the following:  $$a^{\frac{p - 1}{2}} \equiv \, ?\pmod{p}$$  If not, is there an answer to what $?$ should be in the above congruence?

When $p$ is a prime, we know that Legendre symbol of $a$ is $$\left(\frac{a}{p}\right) = a^{({p-1})/{2}}$$  Suppose $a$ is a square, then $a = x^2$ for some $x$. Therefore, $a^{\frac{p-1}{2}} = x^{p-1} = 1$ by Fermat's little theorem. But if $a$ is not a square, then how to prove that $a^{\frac{p-1}{2}} = -1$?


While calculating electric potential due to a spherical shell at a point outside the shell, why do we say that the entire charge is present at the centre of shell? Is this true even if the charge on the shell is distributed non-uniformly?

When discussing gravitation between two bodies of finite size, for instance Earth around the Sun, we suppose the mass of Earth and the Sun to be perfectly localized at the center of each body. Is this a "useful" "good" "approximation" or the "absolute truth"?


I can calculate this easily using L'Hopital Rule. Can anyone give me some pointers on how to do this without using L'Hopital?  $$\lim_{x \to a} \frac{\log(x-a)}{\log(e^x-e^a)}$$  I tried substitution by $n = x+a$ and then $\lim_{n \to 0}$ but that didn't work.

I have been working on this question for a while now:  $$ \lim_{x\to a^+} \frac{\cos(x)\ln(x-a)}{\ln(e^x-e^a)} $$  I know the answer is $\cos a$, that's what the solutions say. But I don't understand how it became to that. I've tried solving it using L'Hopital rule but I've gone nowhere because the expressions just keep getting messier and messier. What's a sensible way to go about doing this? Thank you in advance for your answer.


Special relativity predicts that for me and my friend who's running at a uniform speed of $v$ away from me, the same things don't happen at the same time. For instance, if my friend runs at a light bulb who's set to light up in a few seconds, the light bulb is going to light up 'earlier' for my friend. Is it possible to test this experimentally?

I know that thought experiment about trains when a flash of light in the middle reaches the both end simultaneously for a passenger but different times for the bystander.  So were there (non-thought) experiments that directly checked this?


Let $$S_r(n)=\sum_{m=0}^n(-1)^m m^r\binom{n}{m}$$ Evaluate $S_n(n)$  For this question, the first part I did is to prove that for integer r, $0<r<n$, $S_r(n)=0$  I did this by induction, given the binomial coefficient $$(1+z)^n=\sum_{m=0}^nz^m \binom{n}{m}$$ and differentiate it $r$ times. The result can be obtained for $S_1(n)=S_2(n)=\dots=S_k(n)=0 \implies S_{k+1}=0, $ given $0<k<n$  I want to show that $S_{n}(n)$ is a linear combination of all $S_k(n)$ for $0<k<n$, but is seems not the case.  How should I proceed?

I'm going to university in October and thought I'd have a go at a few questions from one of their past papers. I have completed the majority of this question but I'm stuck on the very last part. In honesty I've been working on this paper a while now and I'm a bit tired so I'm probably giving up earlier than I usually would.  I won't write out the full question, only the last part:     Let $$S_r(n) = \sum_{m=0}^n\ (-1)^m m^r {n \choose m}$$ where r is a   non-negative integer . Show that $S_r(n)=0$ for $r<n$. Evaluate   $S_n(n)$.   I have shown that $S_r(n)=0$ for $r<n$ by taking $(1+z)^n= \sum_{m=0}^n\ z^m {n \choose m}$, letting $D_r(f(z))=z\frac d{dz}(z\frac d{dz}...(\frac d{dz}(f(z)))...)$ where $z\frac d{dz}$ is applied $r$ times and applied it to both sides.  The left hand side gives a polynomial, degree n which has factor $(1+z)$ for all $r<n$ and the right hand side gives $\sum_{m=0}^n\ z^m (m)^r {n \choose m}$. Setting $z=-1$ yields the required result.   There is some build up to this, so I'm fairly certain that this was the intended method.  I'm stuck however on the very last part. I have tried finding a form for $D_r((1+z)^n)$, but I'm fairly sure that this isn't the correct approach, as the wording of the question implies that $S_n(n)$ needs to be considered separately.  I'm surprised that I didn't find that this question had already been asked, so apologies if it has been.  Thank you.


So I'm trying to check a box by value that's equal to the variable but I can't get to work.  Here's a fiddle:   It checks all the boxes if I set it to .val(checkboxValue).prop("checked", "checked");  I tried .val() == checkboxValue.prop("checked", "checked"); but that doesn't work

I'd like to do something like this to tick a checkbox using jQuery:  $(".myCheckBox").checked(true);   or  $(".myCheckBox").selected(true);   Does such a thing exist?


I am looking for a hint for the following exercise:             Assuming $f(z)$ as an entire function, prove that      $$\left(\frac{∂^2}{∂x^2}+\frac{∂^2}{∂y^2}\right)\cdot|f(z)|^2=4\cdot|f'(z)|^2$$   I suppose that solution involves using Cauchy–Riemann equations, but I´m not sure  about how to do it

Given $f$ entire show that $$ \left( \frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2} \right) \lvert f(z) \rvert^2 = 4 \lvert f'(z) \rvert^2 $$ I've come close to getting the exact answer by writing $f(z)$ as $u(x,y)+iv(x,y)$ and realizing the Laplacian of f is equal to zero. This leads to a lot of cancellations but I'm still making mistakes in my computations and I can't figure out where. Any help is appreciated.


Having hard time to understand the difference in benefits of using notify over notifyall and vice versa. Lets say that we have an object L that we want to lock and four threads: A, B, C and D. Now A enters run method and obtains a lock on object L while B, C and D are waiting to be notified. So what is the difference between notifying these waiting threads individually with notify and notifying all of them at once with notifyall since in both cases we have no control over which thread after A obtains a lock on object L.

If one Googles for "difference between notify() and notifyAll()" then a lot of explanations will pop up (leaving apart the javadoc paragraphs). It all boils down to the number of waiting threads being waken up: one in notify() and all in notifyAll().  However (if I do understand the difference between these methods right), only one thread is always selected for further monitor acquisition; in the first case the one selected by the VM, in the second case the one selected by the system thread scheduler. The exact selection procedures for both of them (in the general case) are not known to the programmer.  What's the useful difference between  and  then? Am I missing something?


For some reason, my finger memory has converted mv to rm. Until I manage to retrain those fingers, how might I have rm prompt when provided multiple locations (one of which likely does not exist)?  I know that the -I option will prompt on more than three files, and the -i will prompt on every file, but I need something similar that will prompt on more than one file.

I want to create a script that whenever there are more than three files being removed, it invokes rm -i by default. I know it will go in initialization files but can't seem to get it working.  So far:  if [$file -ge 3]; then   rm -i    exit 0  else   rm exit 1


I am trying to output very large (bussproofs) prooftrees, say with hundreds of nodes. An attempt I am trying is by the package preview. By trial and error, I may find a large value to set PreviewBorder (PreviewBbAdjust), and so it seems I succeed to display a large prooftree, see/try my MWE below.   Question is: is there a way to ask latex to calculate the needed value(s), for each given tree?  \documentclass[14pt]{article} \usepackage{bussproofs} \usepackage{amssymb} \usepackage{latexsym} \usepackage[active,tightpage]{preview} \PreviewEnvironment{prooftree} %\setlength\PreviewBorder{990pt}% \renewcommand\PreviewBbAdjust{-100pt -100pt 990pt 100pt} % This is the "centered" symbol \def\fCenter{{\mbox{\Large$\rightarrow$}}} \begin{document} \begin{prooftree} \Axiom$\Delta\fCenter\Pi$ \Axiom$\Gamma^\prime\fCenter\Delta,A$ \dottedLine \singleLine \UnaryInf$\lnot A,\Gamma^\prime \fCenter \Delta$ \UnaryInf$\lnot A,\lnot A,\Gamma^\prime \fCenter \Delta$ \singleLine \UnaryInf$\Gamma \fCenter \Delta$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta,B$ \Axiom$\Delta\fCenter\Pi$ \Axiom$\Gamma^\prime\fCenter\Delta,A$ \dottedLine \singleLine \UnaryInf$\lnot A,\Gamma^\prime \fCenter \Delta$ \UnaryInf$\lnot A,\lnot A,\Gamma^\prime \fCenter \Delta$ \singleLine \UnaryInf$\Gamma \fCenter \Delta$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta,B$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta B, 001$ \Axiom$\Delta\fCenter\Pi$ \Axiom$\Gamma^\prime\fCenter\Delta,A$ \dottedLine \singleLine \UnaryInf$\lnot A,\Gamma^\prime \fCenter \Delta$ \UnaryInf$\lnot A,\lnot A,\Gamma^\prime \fCenter \Delta$ \singleLine \UnaryInf$\Gamma \fCenter \Delta$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta,B$ \Axiom$\Delta\fCenter\Pi$ \Axiom$\Gamma^\prime\fCenter\Delta,A$ \dottedLine \singleLine \UnaryInf$\lnot A,\Gamma^\prime \fCenter \Delta$ \UnaryInf$\lnot A,\lnot A,\Gamma^\prime \fCenter \Delta$ \singleLine \UnaryInf$\Gamma \fCenter \Delta$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta,B$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta B, 001$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta B, 002$ \Axiom$\Delta\fCenter\Pi$ \Axiom$\Gamma^\prime\fCenter\Delta,A$ \dottedLine \singleLine \UnaryInf$\lnot A,\Gamma^\prime \fCenter \Delta$ \UnaryInf$\lnot A,\lnot A,\Gamma^\prime \fCenter \Delta$ \singleLine \UnaryInf$\Gamma \fCenter \Delta$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta,B$ \Axiom$\Delta\fCenter\Pi$ \Axiom$\Gamma^\prime\fCenter\Delta,A$ \dottedLine \singleLine \UnaryInf$\lnot A,\Gamma^\prime \fCenter \Delta$ \UnaryInf$\lnot A,\lnot A,\Gamma^\prime \fCenter \Delta$ \singleLine \UnaryInf$\Gamma \fCenter \Delta$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta,B$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta B, 001$ \Axiom$\Delta\fCenter\Pi$ \Axiom$\Gamma^\prime\fCenter\Delta,A$ \dottedLine \singleLine \UnaryInf$\lnot A,\Gamma^\prime \fCenter \Delta$ \UnaryInf$\lnot A,\lnot A,\Gamma^\prime \fCenter \Delta$ \singleLine \UnaryInf$\Gamma \fCenter \Delta$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta,B$ \Axiom$\Delta\fCenter\Pi$ \Axiom$\Gamma^\prime\fCenter\Delta,A$ \dottedLine \singleLine \UnaryInf$\lnot A,\Gamma^\prime \fCenter \Delta$ \UnaryInf$\lnot A,\lnot A,\Gamma^\prime \fCenter \Delta$ \singleLine \UnaryInf$\Gamma \fCenter \Delta$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta,B$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta B, 001$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta B, 002$ \BinaryInf$\Gamma,\Pi,A \fCenter \Delta, \Delta B, 003$ \end{prooftree} \end{document}

I am looking at different options to typeset proof trees, and be helped by   A question I don't see any hint therein is about whether there are tools to display very large proof trees (hundreds of nodes).  I am speculating/dreaming  about a tool to navigate a proof tree up and down (kind of what we do with google maps). Is there anything you may think of which could be suitable for doing that? How would you go to get something workable?  -------- second update  Thanks to cfr, I learnt about varwidth (without which it seems we get error messages: Something's wrong--perhaps a missing \item. \begin{prooftree}, why so?). Still, for a large number of proof steps, I get a cropped proof tree. I understand I may adjust the border's value, by trial and error. Question is: is there a way to ask latex to calculate the best value, for each given proof tree? Or at least, is there a way to know such value somehow in advance? (for the example below, border=125pt is good enough)  \documentclass[border=10pt,varwidth]{standalone} \usepackage{bussproofs} \begin{document} \begin{prooftree} \AxiomC{A} \UnaryInfC{B} \AxiomC{C} \BinaryInfC{D} \AxiomC{E} \AxiomC{F} \BinaryInfC{G} \UnaryInfC{H} \BinaryInfC{J} \AxiomC{A} \UnaryInfC{B} \AxiomC{C} \BinaryInfC{D} \AxiomC{E} \AxiomC{F} \BinaryInfC{G} \UnaryInfC{H} \BinaryInfC{J} \BinaryInfC{JJ} \AxiomC{A} \UnaryInfC{B} \AxiomC{C} \BinaryInfC{D} \AxiomC{E} \AxiomC{F} \BinaryInfC{G} \UnaryInfC{H} \BinaryInfC{J} \AxiomC{A} \UnaryInfC{B} \AxiomC{C} \BinaryInfC{D} \AxiomC{E} \AxiomC{F} \BinaryInfC{G} \UnaryInfC{H} \BinaryInfC{J} \BinaryInfC{JJ} \BinaryInfC{JJJ} \end{prooftree} \end{document}


I have two drupal 7.x sites, and I am uplaoding user picture programtically using the bleow code. In one site it is working fine and another one is getting fatal error as shown below. what could be the problem here..  Fatal error: Call to undefined function file_save() in /...   Code to upload user picture programatically.  $tmp_photo_realpath = "images/".$userimgname;         $tmp_photo = "images/".$userimgname;           $file = new stdClass();           $file->uid      = $uid;           $file->status   = 0; // mark the file as temporary           $file->filename = basename($tmp_photo_realpath);           $file->uri      = $tmp_photo;          // $file->filemime = image_type_to_mime_type(exif_imagetype($tmp_photo_realpath));           $file->filesize = filesize($tmp_photo_realpath);          $infofile = explode("/",$tmp_photo);            $infoext = explode(".",end($infofile));         $imgext = end($infoext);        // The file should be an image       $errors = array();       $errors += file_validate_is_image($file);       $errors += file_validate_image_resolution($file, variable_get('user_picture_dimensions', '100x100'));       $errors += file_validate_size($file, variable_get('user_picture_file_size', '30') * 1024);        // Make sure file extension is a valid image       if (!in_array(strtolower($imgext), array('jpg', 'png', 'gif'))) {         $errors[] = ' invalid image file extension.';       }        if (count($errors)) {         drupal_set_message(t('Profile Image Import:') . ' ' . $errors[0], 'warning');         // Clean up (set fid to avoid error messages)         $file->fid = 0; file_delete($file);       }       else {         // We'll need a valid file id on the file object; file_save() will give us one         $file = file_save($file);         // Update user account (fid is not empty, status is temporary -- image         // will be moved to proper directory and assigned to the user)         $fields['picture'] = $file;         $account = user_save($account, $fields);     }

This is what I have right now:  <?php     define('DRUPAL_ROOT', '/var/www/clients/client1/web15/web');     include_once(DRUPAL_ROOT . '/includes/bootstrap.inc');     drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); //  drupal_flush_all_caches();        $users = views_get_view_result('userlist', 'uid_list');     $i = 0;     foreach ($users as $user) {         $filename = 'sites/default/files/generated_pdfs/individual_pdf_report_' . $user->uid . '.pdf';         generate_employee_pdf($user->uid, $filename);         error_log('Generated ' . $filepath);         $i++;     }     // create object     $zip = new ZipArchive();     // open archive     if ($zip->open("sites/default/files/generated_zips/individual-reports.zip", ZIPARCHIVE::CREATE) !== TRUE) {         die ("Could not open archive");     }     // initialize an iterator     // pass it the directory to be processed     $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator("sites/default/files/generated_pdfs/"));     // iterate over the directory     // add each file found to the archive     foreach ($iterator as $key=>$value) {         $zip->addFile(realpath($key), $value->getFilename()) or die ("ERROR: Could not add file: $key");     }     // close and save archive     $zip->close(); ?>   I'm getting a bunch of errors from the above when run standalone. Works fine in my module. Some of the errors are:  Warning: Invalid argument supplied for foreach() in drupal_depth_first_search() (line 56 of /var/www/clients/client1/web15/web/includes/graph.inc). Warning: Invalid argument supplied for foreach() in _module_build_dependencies() (line 229 of /var/www/clients/client1/web15/web/includes/module.inc). Warning: include_once(sites/all/modules/views_bulk_operations/actions/archive.action.inc): failed to open stream: No such file or directory in views_bulk_operations_load_action_includes() (line 56 of /var/www/clients/client1/web15/web/sites/all/modules/views_bulk_operations/views_bulk_operations.module).


I have a query which I cannot resolve by finding enough arguments. A perfectly round wheel that also doesn't have any contractions due to gravity is placed in a perfect vacuum, so no drag is present. Will it stop due to friction force or will it roll forever?

I have already read        and many others   But I still have the following problem:   On one hand I've been told that if pure rotation takes place then the object goes on forever. This must imply no frictional force in any form acting on the body. On the second hand I've been told that during pure rotation(no external forces like wind) on a plane surface friction acts opposite to velocity of center of mass (accompanied by change of normal) and slows it down.     Both seem logical enough: The point of contact doesn't slip therefore no friction is required; So no retarding force and it must go on. Things don't go on forever; Friction must be present to slow it down.    So, which hand is correct? Or is there a third hand altogether?


I want to export materials from my object so that for example in unity I can open it, add lighting and that it actually changes according to the lighting. So basically i want to export my materials with the bumps, reflections and transparancy. I made it in cycles.

I used node textures in a mesh I exported to .FBX.  I then imported it into Unreal Engine 4 and it didn't import any textures; I clicked the Upload Textures option in Unreal Engine.  Is there something I'm doing wrong or is it Blender?


I prepared a document in XeLaTeX in Linux, fonts embedded, then I went to a printing guy on windows + lots of Adobe tools, and pdf looks the other way on his machine: some fonts get scaled which results in a slightly deformed layout.  How do You get a portable pdf?  My first thought is to convert pdf to ps with a virtual printer (CUPS in case of linux).  One other possible solution is to embed fonts in the ps resulted:  ps2pdf14 -dPDFSETTINGS=/prepress document.ps   Edit:  MWE:  \documentclass{article}  \usepackage{fontspec}  % fonts: \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} \setmainfont{DejaVu Sans} \setsansfont{DejaVu Sans} \setmonofont{DejaVu Sans Mono}  \usepackage{fontawesome}  \begin{document}  \faBullhorn test.  \end{document}   In okular:    In Adobe Reader:    You see in Adobe the glyph is larger. How do I process pdf so that it is displayed in the same way in any major pdf viewer?  Edit 2:  The problem with scaled font is solved if I open the pdf and export it to pdf with  -- but its free version warns me about the watermark (which I actually can't find).  Export to pdf in  doesn't help.  Printing to pdf in virtual CUPS printer doesn't help. Moreover after piping pdf through CUPS adobe reader doesn't see the glyph at all.

The following example must be compiled with XeLaTeX to reproduce the issue.  % arara: xelatex \documentclass{article} \usepackage{fontawesome} \begin{document} Text Text \faMobilePhone\ Text Text \end{document}   Normally I am using TeXworks to compile and view the output. With the internal viewer I am getting the desired result. The following image demonstrates it:    However if I open the pdf with Preview (viewer of Mac) the scaling of the icon fails.     If I open the pdf file with Adobe Acrobat Reader the icon is still scaled correctly. If I print the page my printer is also not able to scale the icons correctly.   If I use LuaLaTeX everything seems to work correctly.   Can you reproduce the issue and do you know a solution?


I am trying to learn about optics and I am having a hard time understanding the meaning of "real" vs "virtual" image.  My understanding is that for a concave mirror, the image focuses on the same side as the object so it is a real image.  For a convex mirror, the image focuses on the opposite side of the object from the mirror so it is a virtual image.  However, we can both see either real or virtual images, so how are we seeing something that focuses on the other side of the mirror in the convex case ?  I am very confused.

I'm doing magnification and lens in class currently, and I really don't get why virtual and real images are called what they are.  A virtual image occurs the object is less than the focal length of the lens from the lens, and a real image occurs when an object is further than focal length.  By why virtual and real? What's the difference? You can't touch an image no matter what it's called, because it's just light.


On HTTPS pages if I click Stack Exchange -> chat it drops me off here () with "all" filtering selected. On HTTP pages Stack Exchange -> chat drops me off with "site" filtering, listing the rooms specific to the site I am on.   HTTPS should mirror the behaviour that HTTP pages have. Can this be fixed please? It makes it almost impossible to find chat rooms of a specific site if I don't know their name.

Since the redesign of the top bar, it appears the chat room link next to a site no longer goes to that site's chats.  For instance, this link:  should go to something like , but it just goes to  instead.