I recently installed Ubuntu 20.04 LTS and i also intalled third party softwares during the time of OS installation. Bluetooth drivers are downloaded and bluetooth option is showing and it is turning on too but bluetooth devices are not showing in the list. i tried doing everything. intalled blueman but it cant find my devices either.  here is the output of the commoand lspci -knn | grep Net -A3; lsusb `

Bluetooth is on but can't find or be found by any other devices.  Output of sudo service bluetooth status:  ● bluetooth.service - Bluetooth service    Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)    Active: active (running) since ხუთ 2015-06-04 22:33:18 GET; 13min ago  Main PID: 26678 (bluetoothd)    CGroup: /system.slice/bluetooth.service            └─26678 /usr/sbin/bluetoothd -n  ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPAG ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPHS ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSource ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSink ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPAG ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPHS ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSource ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSink ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Adapter /org/bluez/26678/hci0 has been enabled ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Adapter /org/bluez/26678/hci0 has been enabled   Output of lsusb:  Bus 003 Device 005: ID 0a5c:21d7 Broadcom Corp. BCM43142 Bluetooth 4.0   How can I fix it?


Is it possible to move dialog in the comments to chat when the system doesn't ask? (I want to move existing comments, not create a new empty room.)

Question: For an answer on a stack exchange site with say 8 comments, how can I / is it possible to import the comments into a chat room? Background: I was helping with a  and made several comments before I saw the link to auto-import comments into a chat room.  This was awesome by the way!! Note that the person who asked the question left a link to the chat room in a comment. I wanted to make a similar chat room  because I edited an answer which wasn't mine and added a paragraph.  I wanted to chat with the answer's author @JonHopkins to say, 'hey feel free to remove my edit -- just wanted to add my $0.02' -- especially as the stack exchange engines said not to add an additional answer.  HOWEVER, there was no link to auto-import the comments -- probably because I hadn't previously left one, but I'm not sure. So I ask here, Stack Exchange Gurus, could a static link be added to auto-import a series of comments into a chat session?


I tried to enable AT theme and now have a white page with the error:  Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /Applications/MAMP/htdocs/test/includes/theme.inc on line 98  I changed my php.ini memory_limit = 128M. No difference.  I am so crazy pressed for time, this is the worst thing to happen now. How can i fix this? Please somebody HELP!!!!!  The site is on a localhost.  PS- now i see a different error:   Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /Applications/MAMP/htdocs/test/sites/all/modules/ds/includes/ds.registry.inc on line 554   Drupal 7.2.4

I have a issue with my Drupal installation, for example:   when I enable or disable the modules, It redirects me to a blank page, when I create a new content type and save it, redirects me to a blank page, when I add a new view and save it, it redirects me to a blank page, when I try to clear the cache, it redirects me back to a blank page, or in similar cases.   Basically all the confirmation pages redirect me to a white screen. When I refresh it again, it shows me the page. I tried to increase the PHP memory value but it doesn't help.  Are there any other solutions for this?  The error which I'm having:      Fatal error: Allowed memory size of 100663296 bytes exhausted (tried to allocate 8192 bytes) in sites/all/modules/views/plugins/views_plugin_localization_none.inc on line 1


So I have to proof that for an element $A$ of $M_{m\times n}(K)$ r an  element of $N$, $rk(A)\leq r$ if there are two matrices $B$ element of  $M_{m\times r}(K)$ and $C$ element of  $M_{r\times n}(K)$ with $A=BC.$  I would be very happy if someone could help me.

I have a problem understanding the following:     Let $A$ be an $m \times n$ matrix and let t $\in \mathbb{N}$. Prove that   $\operatorname{rank}(A)\leq t$ if and only if there exists an $m \times t$ matrix $B$ and a $t \times n$ matrix $C$ so that $A = BC$.   I know what a rank is but I can't make a connection between the rank and the existence of two matrices such that $A = BC$.


I am doing my very first WebGIS application with ArcGIS server using ArcGIS Javascript API 3.17. I have to bring 100 layers in my webgis application as REST service from Oracle DB. To do that whether can we publish 100 layers as one map service or each layer as one service i.e 100 map service or group the layers as 10 datasets and publish as 10 map service. please suggest that which is the efficient way to publish those 100 layers in ArcGIS server.

I have a conundrum that I am getting mixed advice on how to go about.  Therefore id like to put it to GIS-SE for some justified answers.  Scenario:     Client has a web mapping application.  Does not want to split into multiple smaller applications.  Although this goes against what the modern day approach is for maps on the web,  (i.e. lots of focussed web-map apps over one main web-map) I strongly believe that for some users, trying to replicate a GIS application on the web is ok (). Client has cached as much of his basemap layers into separate services. Client still requires an additional 600-700 layers in a dynamic map service... The service will be published with all of these layers turned off. It is not anticipated that users will turn on more than 10-40 layers at a time.   I imagine your initial reaction to this is similar to mine (600+?! WTF?!)  However - the requirement is set in stone and why not?  Their prior ArcIMS application had similar functionality, so why can't this newer ArcGIS Server product do the same?  The users potentially need to be able to cross compare and perform analysis on the entire range of layers, even if the layers belong to other departments.  Before you jump to conclusions, the client is a clued up ArcGIS Server admin. They have administered the 600 layers by all of the best practice rules: e.g. scale ranges combined with definition queries; annotation over labelling; generalising complex layers at small scales; publish as MSDs; etc  Problem:  What is the better approach here?     Publish all 600 layers into one dynamic map service   Split the layers into logical groupings (hydrology, planning, ecology, utilities, etc)   If you go with #1, and you have a few complex layers turned on.  If you want to turn on a simple points layer, then ArcGIS Server will still have to render the entire layers being displayed all over again.  If you go with #2, each time your making a request, potentially, the web application could have to make several GET requests for ExportMaps from the individual map services (is this bad, or does it create additional load to ArcGIS Server over #1?)  And then this leads to configuration & tuning to ensure everything is as quick as possible. We can scale the back end of ArcGIS Server to multiple hosts and have some good hardware to sit it on.  If you go with #1, you can throw the maximum # of instances that you AGS can handle.  If you go with #2, I assume you evaluate the performance of the map services (load testing and look at wait times) and address the min/max instances accordingly to ensure there is not one service that is a 'weak link'.  Im currently leaning towards the #2 approach, as my head is still telling me that having 600 layers in one service is madness, but if they are all turned off by default, there really is no issue.  Would love to hear your thoughts.  Let me know if you need more info via the comments, but not looking for answers like 'use a desktop application' or 'educate them to do things differently'    From discussions in comments, I failed to mention another consideration.  The application that the service will be consumed within, has the ability for layer level security (at the application level).  Therefore the group of users (that is fairly large) are assigned to a particular role, and that role will have access to the full 600 layers.  Other roles will be limited.


How does a site like SO handle the codes we upload and display them without the codes causing any harm to the SO server?. I am sure that there would be a ton of malicious codes that are uploaded. So how can i go about designing a similar system that allows to safely handle codes and display them without compromising the safety of my site ?.

Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of HTML tags?


I am trying to decode article on   I was able to follow everything until the part with a change of basis x$^k=Q^T(w^k−w^⋆)$ to eigenspace... I conceptually understand what it means, however, I don't fully understand how we derived $x^k$ variable and what this variable represents, this part is quite confusing to me.  On one hand, we have symmetric Q matrix (why is it transposed?) and also $(w^k-w^*)$ which should represent how far is $w^k$ from optimal $w^*$. Unfortunately, I cannot put it together, and I am unable to derive this from anything mentioned before... Can you explain a little bit more about the problem? Is it just simple translation of some of the previous formulas to the Q basis (which I somehow missed) or something totally different?  Thank you in advance!

I'm reading , a post from the new distill journal. I'll paraphrase the main equations leading to the part which confuses me, the post describes the intuition in more detail.   The gradient descent algorithm is given by the following iterative process $$w^{k+1} = w^k-\alpha \nabla f(w^k)$$ where $w^k$ is the value of iteration $k$, the learning rate is $\alpha$ and $\nabla f(w)$ is  the gradient of the function $f$ evaluated at $w$. The function $f$ you wish to minimize.  Gradient descent with momentum is given by adding "memory" to the descent, this is described by the pair of equations:  \begin{align} z^{k+1} &= \beta z^k + \nabla f(w^k) \\ w^{k+1} &= w^k - \alpha z^{k+1}  \end{align}  In the next section "First Steps: Gradient Descent" the author considers a convex quadratic function  $$f(w) = \frac12w^TAw-b^Tw, \quad w \in \mathbb{R}^n, A \in \mathbb{R}^{n,n}$$ which has gradient $$\nabla f(w) = Aw-b$$ If we assume $A$ is symmetric and invertable then $f$ has optimal solution $w^\star = A^{-1}b$.   If we were to use gradient descent then we would iterate towards this optimal solution in the following way  \begin{align} w^{k+1} &= w^k - \alpha \nabla f(w) \\ &= w^k - \alpha (Aw^k -b) \end{align}  Then the article goes on to say "There is a very natural space to view gradient descent where all the dimensions act independently — the eigenvectors of $A$". I think this makes sense, although my intuition is kind of fuzzy.   Every symmetric matrix $A$ has an eigenvalue decomposition where $$A = Q\text{diag}(\lambda_1,\ldots,\lambda_n)Q^T.$$  Where $\lambda_1 > \ldots > \lambda_n$ and $Q$ is the vector with the corresponding eigenvectors as columns (right?).   This next part is where I don't understand what is going on:      If we perform a change of basis, $x^k = Q^T(w^k - w^\star)$, the   iterations break apart, becoming:       \begin{align} x_i^{k+1} &= x_i^k - \alpha \lambda_i x_i^k  \\ &=(1-\alpha\lambda_i)x_i^k &= (1- \alpha\lambda_i)^{k+1}x_i^0 \end{align}      Moving back to our original space $w$, we can see that      $$w^k - w^\star = Qx^k = \sum\limits_{i}^n = x_i^0(1-\alpha\lambda_i)^kq_i$$   What is going on here? Where is the motivation of taking $w^k - w^\star$ into the eigendomain? What is $x^k$? Why are we now looking at invidual elements of the vector? I tried to follow the caculations through, but $x^{k+1}$ depends on $w^{k+1}$ which depends on $z^k$, which I thought we were trying to eliminate. My question is can someone expand on these few steps with some intuition and calculations? Thanks.


I use Cefsharp.Winform (). I Try Form.Close() but it error: System.InvalidOperationException: 'Cross-thread operation not valid: Control 'Form2' accessed from a thread other than the thread it was created on.'  Form1.cs  using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;  namespace TEST_CEF {     public partial class Form1 : Form     {         public Form1()         {             InitializeComponent();         }          private void button1_Click(object sender, EventArgs e)         {             Form2 frm2 = new Form2();             frm2.Show();         }     } }   Form2.cs  using CefSharp; using CefSharp.WinForms; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;  namespace TEST_CEF {     public partial class Form2 : Form     {         public Form2()         {             InitializeComponent();             InitBrowser();          }          public ChromiumWebBrowser browser;         public void InitBrowser()         {             Cef.Initialize(new CefSettings());             browser = new ChromiumWebBrowser("www.google.com");             this.Controls.Add(browser);             browser.Dock = DockStyle.Fill;              browser.FrameLoadEnd += WebBrowserFrameLoadEnded;         }          private void WebBrowserFrameLoadEnded(object sender, FrameLoadEndEventArgs e)         {             if (e.Frame.IsMain)             {                 if (browser.Address.IndexOf("google") > -1)                 {                     timer1.Start();                 }             }         }          private void Form2_FormClosing(object sender, FormClosingEventArgs e)         {             browser.Dispose();             Cef.Shutdown();         }         int time = 0;         private void timer1_Tick(object sender, EventArgs e)         {             time++;             if (time==3)             {                 this.Close();             }         }     } }

I have a scenario. (Windows Forms, C#, .NET)   There is a main form which hosts some user control. The user control does some heavy data operation, such that if I directly call the UserControl_Load method the UI become nonresponsive for the duration for load method execution. To overcome this I load data on different thread (trying to change existing code as little as I can)   I used a background worker thread which will be loading the data and when done will notify the application that it has done its work.   Now came a real problem. All the UI (main form and its child usercontrols) was created on the primary main thread. In the LOAD method of the usercontrol I'm fetching data based on the values of some control (like textbox) on userControl.    The pseudocode would look like this:  CODE 1  UserContrl1_LoadDataMethod() {     if (textbox1.text == "MyName") // This gives exception     {         //Load data corresponding to "MyName".         //Populate a globale variable List<string> which will be binded to grid at some later stage.     } }   The Exception it gave was     Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on.   To know more about this I did some googling and a suggestion came up like using the following code  CODE 2  UserContrl1_LoadDataMethod() {     if (InvokeRequired) // Line #1     {         this.Invoke(new MethodInvoker(UserContrl1_LoadDataMethod));         return;     }      if (textbox1.text == "MyName") // Now it wont give an exception     {     //Load data correspondin to "MyName"         //Populate a globale variable List<string> which will be binded to grid at some later stage     } }   BUT BUT BUT... it seems I'm back to square one. The Application again  become nonresponsive. It seems to be due to the execution of line #1 if condition. The loading task is again done by the parent thread and not the third that I spawned.  I don't know whether I perceived this right or wrong. I'm new to threading.  How do I resolve this and also what is the effect of execution of Line#1 if block?  The situation is this: I want to load data into a global variable based on the value of a control. I don't want to change the value of a control from the child thread. I'm not going to do it ever from a child thread.   So only accessing the value so that the corresponding data can be fetched from the database.


After giving an answer to , the author edited the question. Now my answer doesn't apply and I received a comment from another user that it isn't consistent anymore. The author is most likely either not interested in the answer he was looking for, doesn't visit SO, or whatever. The problem is that my answer is left as accepted and I am obviously getting downvotes for it from other users (well the downvotes are justified since the answer isn't consistent anymore).  What would be the correct solution from my side since I cannot delete the answer?

I'm not sure if there's already an existing term for this, so I'm inventing my own. (tl;dr: I call them "chameleon questions" because they change every time you submit or edit an answer.  If you're already intimately familiar with the phenomenon, please skip past the first set of bullet points to where I ask for recommendations.)  I think many of us have experienced this on occasion:  You open up a narrow-looking question, usually dealing with some specific error message.  The question probably contains a snippet of sloppy but not quite awful code; code indicating that the author, typically a new/low-rep user, possibly a , doesn't really know what they're doing.  I'm not trying to be condescending here, they're probably very intelligent and hardworking, but in this specific case, they're clearly in way over their head.  However, as a question, it's not really too bad.  The goal and problem are both clearly stated.  The code is formatted (sort of).  Mort was polite and checked their spelling.  The question looks answerable, although from a rep perspective* it's an obvious dead-end, it's had maybe 3 views in the past 30 minutes.  So you decide, you know what, this person took the time to write up the question properly, they deserve an answer, put on your good citizen hat and throw them a bone.  You slog through the ugly code, find the offending line, direct their attention to it and explain why it's wrong and how it needs to be fixed.  Later, they leave a comment saying that yes, that was indeed the problem and your answer helped them fix it (great!).  Oh, but, now there's another problem (uh-oh...). Something else is broken.  After letting out a long sigh, you read the comment and/or edited question, roll up your sleeves, and write up Take 2, hoping that's the end of it.  And of course it's not the end.  Now maybe the error is gone, but it's not doing what it's supposed to.  If you're anything like me, your patience is now starting to wear thin. It's lousy code and you didn't volunteer to help them rewrite their whole app.  And of course, the question still only has 12 views, and nobody has upvoted either the question or your answer, including the person you're helping, so this is turning out to be a genuinely thankless task in all respects.  Welcome to "Family Tech Support", Web 2.0 Edition.   * Which is of course just an arbitrary number that none of us care about. Not really, anyway. Not very much, at least.  So, here's where I get to my question.  At this point, do you:  Leave a comment, stating as politely as possible that you've done your best to help them answer the original question they asked, and if they have a new problem then they should start a new question?  (I did this once, and actually ended up with an accept, but I felt kind of guilty afterwards, I don't think anybody answered their 2nd question).  Bite the bullet and edit your answer a 3rd, 4th, 5th time, however many times it takes to resolve their issue, knowing full well that they may not even remember to accept the answer once you're done? (I may work for free on SO, but that doesn't mean my time is worthless.)  Just abandon the question, hoping that it will force Mort to start thinking for himself?  Something else?   I've tried all three of the above and none of them ever quite feel right. I do want to help, but at the same time there are a lot more "lucrative" questions I could be answering. And I don't mind spending a lot of time on an answer either, if the question is interesting or important to me, but debugging is dull work. I'd prefer not to reference specific questions here; I'm pretty sure that this is a shared experience, and my objective isn't to point fingers at "misbehaving" members.  I'm more looking for some practical advice on how to dig myself out of these pits of despair. Anybody have any other ideas?


I research a lot in google for a script that tell me if apache2 is configurated well and it's capabilites/calibration are set correctly.  I use mpm_prefork_module and I would to know if params are set correctly for my machine.  This is my actual params:  <IfModule mpm_prefork_module>     StartServers          5     MinSpareServers       5     MaxSpareServers       25     MaxClients            50     MaxRequestsPerChild   500     ServerLimit           50 </IfModule>   The question is very simple, anyone know a script (bash prefered) that check apache2 calibration?

This is a  about capacity planning for web sites. Related:      What are some recommended tools and methods of capacity planning for web sites and web-applications? Please feel free to describe different tools and techniques for different web-servers, frameworks, etc., as well as best-practices that apply to web servers in general.


I've already read some of your answers concerning the "rather than vs instead of" issue, but I still don't understand why in my example rather than is the correct answer.     Our manager is concerned with efficiency.............expansion.      a. Rather than      b. Instead of      c. Although      d. Even if   The correct answer is a.  Could someone explain why? I think that both a and b are correct.

I never really gave a deep thought at this but recently a teacher of talked about language and there was an implicit question in it. something like  there is a difference between "rather than" and "instead of" in usage. do you know it??  please help and explain with a few examples.


Why is the Linux load average over the past 1, 5 and 15 minutes reported as the exponential moving average, instead of just simple (unweighted mean) moving average?  It seems to me that the simple moving average value would be easier to understand.  And having the three different load average values already communicates what the load looks like nearer in time, so it is not apparent what added value the exponential weighting brings.  For background, see the  man page and the Wikipedia entry on .

Until recently I thought the load average (as shown for example in top) was a moving average on the n last values of the number of process in state "runnable" or "running". And n would have been defined by the "length" of the moving average: since the algorithm to compute load average seems to trigger every 5 sec, n would have been 12 for the 1min load average, 12x5 for the 5 min load average and 12x15 for the 15 min load average.  But then I read this article: . The article is quite old but the same algorithm is implemented today in the Linux kernel. The load average is not a moving average but an algorithm for which I don't know a name. Anyway I made a comparison between the Linux kernel algorithm and a moving average for an imaginary periodic load:   .  There is a huge difference.  Finally my questions are:   Why this implementation have been choosen compared to a true moving average, that has a real meaning to anyone ? Why everybody speaks about "1min load average" since much more than the last minute is taken into account by the algorithm. (mathematically, all the measure since the boot; in practice, taking into account the round-off error -- still a lot of measures)


How do I find out information about logs that are in a file on my desktop called "logs," such as what application from which they were created, the sizes of the exports logged, what the most common error is amongst the logs, and other information, as well. I'm fairly new to the command line and Linux and this whole side of web development and design and I am in desperate need of assistance! I thank you so much for taking the time to help me!   LindsayLambo

So, if there is some problem with my computer, be it hardware or software, what are the major log files and where are they located?  Also, is there a generic location where log files of the other packages might be located?


There are a few fields that uses public upload destination. I changed it globally right now, as far as I know it uses private upload destination from now. But how can I change previously uploaded files' upload destination (programmatically)?

Let's say I have a node type "Article" which has a field "File" which is set to handle public files. A lot of articles and files get added.  Now the specs suddenly change and the "Article" will move behind a login and therefore also the attached files must be changed to be not publicly accessible anymore.  I already found out  pretty easily by reimporting the manually updated field.storage.node.field_file.yml config. But: this only affects new files that will be added after the switch. It doesn't work for existing files. They still are accessible publicly. Many thousand existing files would need to be manually reuploaded to also make them private.  Does anybody of you have solved that in D8 before? If so, then how?  As all I can think of right now is to programmatically query all "Article" nodes, then foreach through all nodes, get the files, temporarily store them somewhere else, empty the field out, then try to reupload the files programmatically (probably my next question) and then resave each node.  Does that sound reasonable? Or can you think of any other approach that might work here (in D8)?


I am currently trying to translate a Python image detection algorithm in C++ (in order to use it in a smartphone app) using OpenCV.  I have similar results to a certain point, where the two algorithms seem to diverge due to the accumulation of small differences in the images: I am applying some transformations to the image, but the number of decimal digits in Python is much larger than in C++ (where I use CV_64FC1 matrices), so I get more and more different results after some iterations...  Do you have any idea on how to overcome this issue?  Thanks in advance :)  EDIT: here is a code that gives a different result in Python and C++  void conv2(const Mat &img, const Mat& kernel, Mat& dest) {   Mat source = img;   Point anchor(kernel.cols - kernel.cols/2 - 1, kernel.rows - kernel.rows/2 - 1);   flip(kernel, kernel, 0);   filter2D(source, dest, -1, kernel, anchor); }  void myFunc() {   Mat im = imread("3.png", IMREAD_GRAYSCALE);   im.convertTo(im, CV_64F);    int rows = im.rows;   int cols = im.cols;   int sze = 7;    Mat gauss = getGaussianKernel(sze, 1);   Mat f = gauss * gauss.t();   Mat fx, fy;   Sobel(f, fx, -1, 1, 0);   Sobel(f, fy, -1, 0, 1);   Mat Gx, Gy, Gxx, Gyy, Gxy;   filter2D(im, Gx, -1, fx);   filter2D(im, Gy, -1, fy);   pow(Gx, 2, Gxx);   pow(Gy, 2, Gyy);   Gxy = Gx.mul(Gy);    gauss = getGaussianKernel(sze, 38);   f = gauss * gauss.t();   conv2(Gxx, f, Gxx);   conv2(Gyy, f, Gyy);   conv2(Gxy, f, Gxy);   Gxy *= 2;    Mat Gxx_minus_Gyy = Gxx - Gyy;   Mat Gxy_squared, Gxx_minus_Gyy_squared;   pow(Gxy, 2, Gxy_squared);   pow(Gxx_minus_Gyy, 2, Gxx_minus_Gyy_squared);    Mat denom;   sqrt(Gxy_squared + Gxx_minus_Gyy_squared, denom);   // denom += numeric_limits<double>::epsilon();   Mat sin2theta = Gxy / denom;   cout.precision(dbl::max_digits10);   cout << fixed << sum(sin2theta) << endl;   exit(1); }   And Python:  def conv2(img, kernel):     source = img     kernel = cv2.flip(kernel, 0)     rows, cols = kernel.shape     anchor = (int(cols - cols/2 - 1), int(rows - rows/2 - 1))     return cv2.filter2D(source, -1, kernel, anchor=anchor)   def myFunc():     im = cv2.imread('3.png', cv2.IMREAD_GRAYSCALE)     im = np.float64(im)      rows, cols = im.shape;     sze = 7      gauss = cv2.getGaussianKernel(sze, 1);     f = gauss * gauss.T;     fx = cv2.Sobel(f, -1, 1, 0)     fy = cv2.Sobel(f, -1, 0, 1)     Gx = cv2.filter2D(im, -1, fx)     Gy = cv2.filter2D(im, -1, fy)     Gxx = cv2.pow(Gx,2);     Gyy = cv2.pow(Gy,2);     Gxy = cv2.multiply(Gx, Gy);      gauss = cv2.getGaussianKernel(sze, 38);     f = gauss * gauss.T;     Gxx = conv2(Gxx, f)     Gyy = conv2(Gyy, f)     Gxy = 2*conv2(Gxy, f)     Gxx_minus_Gyy = Gxx - Gyy     Gxy_squared = cv2.pow(Gxy, 2)     Gxx_minus_Gyy_squared = cv2.pow(Gxx_minus_Gyy, 2)     denom = cv2.sqrt(Gxy_squared + Gxx_minus_Gyy_squared)     # denom += np.finfo(float).eps;     sin2theta = Gxy/denom     print(cv2.sumElems(sin2theta))     exit()   The call to myFunc() prints the sum of the elements in the "sin2theta" matrix: Python gives 86587.44928456949, and C++ gives 86825.05505451805947814, which starts to make a pretty important difference.

In my  I was printing a double using cout that got rounded when I wasn't expecting it.  How can I make cout print a double using full precision?


#include<stdio.h>  #define KOREA "대한민국"  char* My_strcpy(char* dest, const char* src);   What is the difference between "char* p" and "char *p"?

I've recently decided that I just have to finally learn C/C++, and there is one thing I do not really understand about pointers or more precisely, their definition.  How about these examples:   int* test; int *test; int * test; int* test,test2; int *test,test2; int * test,test2;   Now, to my understanding, the first three cases are all doing the same: Test is not an int, but a pointer to one.  The second set of examples is a bit more tricky. In case 4, both test and test2 will be pointers to an int, whereas in case 5, only test is a pointer, whereas test2 is a "real" int. What about case 6? Same as case 5?


How can I import a .bib (Latex Bibliography) file into a .tex (Latex)? There must be separate files but there must be a bibliography into the .tex file.

After a lot of struggle, I was successful with using a .bib file for the references in my .tex file using the following 2 lines of code:  \bibliographystyle{abbrv} \bibliography{parallel-stochastic-hmm}    Unfortunately, I just found out that I need to produce a single .tex file instead of using separate files.  How do I insert the citations of my .bib file into my .tex file?  Is there a special command for that?


I have a mesh and I need to chunk it into 256 equal pieces. How can I do it?

I have terrain (ANT Landscape plugin) that I would like to cut up into chunks (don't need to be equal size) for a game engine so that I can do occlusion culling /  or load and unload chunks around the player.  I am trying the knife project feature that I saw in the answer  but it doesn't work for my terrain mesh (using the terrain plugin).  I also tried some answers here that contain some Python scripts, but couldn't get them to work.  Any ideas of how I can cut the mesh up quickly in to chunks.  I've been doing it manually so far, but it takes forever to do as some terrains can be rather big. I don't mind having to do a little clean up of the mesh after.  Picture below shows the knife project method (following instructions from linked answer).      Thanks  Edit:  Example of mesh (terrain is usually much large than this) that I am trying to break into chunks.    How I am manually doing it.    Blend file that contains terrain and grid for the knife projecting method.


I'm trying to  install GIMP for Ubuntu 12.10 from Ubuntu SW center but any times I try I get  the replay that I' cannot reach the repository and I've to check my Internet connection. That is properly working with Firefox and Thunderbird. In addition appears the info that not safe program cannot be installed because of lack of authentication. May anybody give a some explanation?

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


So I'm playing around with logistic regression in R, using the mtcars dataset, and I decide to create a logistic regression model on the 'am' parameter (that is manual or automatic transmission for those of you familiar with the mtcars-dataset).  Call: glm(formula = am ~ mpg + qsec + wt, family = binomial, data = mtcars)  Deviance Residuals:         Min          1Q      Median          3Q         Max   -4.484e-05  -2.100e-08  -2.100e-08   2.100e-08   5.163e-05    Coefficients:              Estimate Std. Error z value Pr(>|z|) (Intercept)    924.89  883764.07   0.001    0.999 mpg             20.65   18004.32   0.001    0.999 qsec           -55.75   32172.52  -0.002    0.999 wt            -111.33  103183.48  -0.001    0.999  (Dispersion parameter for binomial family taken to be 1)      Null deviance: 4.3230e+01  on 31  degrees of freedom Residual deviance: 6.2903e-09  on 28  degrees of freedom AIC: 8  Number of Fisher Scoring iterations: 25   Now, at first sight this looks like a terrible regression, right? The standard errors are HUGE, the z-values are all close to zero and the corresponding probabilities are all close to one. HOWEVER, the residual deviance is extremely small!   I decide to check how well the model does as a classification model by running:  pred <- predict(logit_fit, data.frame(qsec = mtcars$qsec, wt = mtcars$wt, mpg = mtcars$mpg), type = "response") # Make a prediction of the probabilities on our data mtcars$pred_r <- round(pred, 0) # Round probabilities to closest 0 or 1 table(mtcars$am, mtcars$pred_r) # Check if results of classification is any good.   Indeed, the model perfectly predicts the data:       0  1   0 19  0   1  0 13   Have I completely misunderstood how to interpret model data? Am I overfitting massively or what's going on here? What's going on?

I'm using R to run some logistic regression. My variables were continuous, but I used cut to bucket the data. Some particular buckets for these variables always result in dependent variable being equal to 1. As expcted, the coefficient estimate for this bucket is very high, but the p-value is also high. There are about ~90 observations in either these buckets, and around 800 total observations, so I don't think it's a problem of sample size. Also, this variable should not be related to other variables, which would naturally reduce their p-values.  Are there any other plausible explanations for the high p-value?  Example:  myData <- read.csv("application.csv", header = TRUE) myData$FICO <- cut(myData$FICO, c(0, 660, 680, 700, 720, 740, 780, Inf), right = FALSE) myData$CLTV <- cut(myData$CLTV, c(0, 70, 80, 90, 95, 100, 125, Inf), right = FALSE) fit <- glm(Denied ~ CLTV + FICO, data = myData, family=binomial())   Results are something like this:  Deviance Residuals:       Min        1Q    Median        3Q       Max   -1.53831  -0.77944  -0.62487   0.00027   2.09771    Coefficients:                 Estimate Std. Error z value Pr(>|z|)     (Intercept)     -1.33630    0.23250  -5.747 9.06e-09 *** CLTV(70,80]     -0.54961    0.34864  -1.576 0.114930     CLTV(80,90]     -0.51413    0.31230  -1.646 0.099715 .   CLTV(90,95]     -0.74648    0.37221  -2.006 0.044904 *   CLTV(95,100]     0.38370    0.37709   1.018 0.308906     CLTV(100,125]   -0.01554    0.25187  -0.062 0.950792     CLTV(125,Inf]   18.49557  443.55550   0.042 0.966739     FICO[0,660)     19.64884 3956.18034   0.005 0.996037     FICO[660,680)    1.77008    0.47653   3.715 0.000204 *** FICO[680,700)    0.98575    0.30859   3.194 0.001402 **  FICO[700,720)    1.31767    0.27166   4.850 1.23e-06 *** FICO[720,740)    0.62720    0.29819   2.103 0.035434 *   FICO[740,780)    0.31605    0.23369   1.352 0.176236     --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  (Dispersion parameter for binomial family taken to be 1)      Null deviance: 1037.43  on 810  degrees of freedom Residual deviance:  803.88  on 798  degrees of freedom AIC: 829.88  Number of Fisher Scoring iterations: 16   FICO in the range [0, 660) and CLTV in the range (125, Inf] indeed always results in Denial = 1, so their coefficients are very large, but why are they also "insignificant"?


This is for a self test for a college job application so I am not necessarily looking for the exact statement I need, instead I am trying to get a hint as to what direction to look, I DO NOT have access to the actual database to view it:  This problem tasks us with using JOIN to select data about users from one table based on if they have a hold on their account on another table, the problem also ONLY wants students in the College that is given by the $college argument.  I am pretty new to PHP so I've been using w3schools as a guide and I have used their INNER JOIN example exactly, yet it keeps giving me a 'unknown column E(or any other letter given by $college) in 'where clause'', or if I change the "" to '' it changes to 'unknown column $college in 'where clause''  Here is my code:  <?php  function hasHold($college) {     $query = "SELECT interview_student.Student_ID,      interview_student.Last_Name,      interview_student.First_Name,      interview_student.College,      interview_account_hold.Amount_Due         FROM interview_student INNER JOIN interview_account_hold         ON interview_student.Student_ID = interview_account_hold.Student_ID         WHERE interview_student.College = $college";      return $query; } ?>   Assuming access to the interview_student table from the previous question...  +------------------------------------------------------+ | interview_student                                    | +------------+-----------+------------+---------+------+ | Student_ID | Last_Name | First_Name | College | GPA  | +------------+-----------+------------+---------+------+ | 463127376  | Willemsen | Lucas      | A       | 2.37 | +------------+-----------+------------+---------+------+   The accounting office has provided us a list of students who currently have holds on their accounts because of unpaid tuition. They are only listed by ID and amount due; and they are only listed if they have an amount due. Students who have no amount due are not listed.  +-------------------------+ | interview_account_hold  | +-------------------------+ | Student_ID | Amount_Due | +------------+------------+ | 416996983  | 3,403.20   | | 287856417  | 2,318.13   | | 537713123  | 3,678.06   | | 187296716  | 2,202.83   | | 145768187  | 2,379.32   | +------------+------------+   Write a function called hasHold that takes one argument ($college) and returns a string (a SELECT statement).  The argument passed to the function will be a college code (such as 'A' for Agriculture).  The string returned should be a SELECT statement that will return all the students who are in the given college that have an account hold in place. The resulting query should return the following fields in the following order: Student ID, Last Name, First Name, College, Amount Due.  Once again, the function should return the SELECT statement as a string. You do not need to handle the actual connection, submitting the query, parsing the results, etc. Just return a string.

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


Let $A$ be a commutative ring, and $A[x]$ be the ring of polynomials in an indeterminate x, with coefficients in A. I found several proofs online that in this case the Jacobson radical equals to the nilradical, and to prove the non-trivial direction (Jacobson radical included in the nilradical), they all used the fact that if $f=a_0+a_1x+...+a_nx^n$ is an element of the Jacobson radical, then $1+fx$ is a unit, but I couldn't see why. Can anyone please clarify that for me?  I'm not looking for a proof, I'm just looking for an explanation about why $1+fx$ is a unit.

Let $R$ be a non-zero commutative ring with identity. Let $\textrm{nilrad}(R)$ be the nilradical of $R$, which can be characterised either as the intersection of all prime ideals of $R$, or as the ideal of nilpotent elements. Let $J(R)$ be the Jacobson radical of $R$, which can be characterised either as the intersection of all maximal ideals of $R$ or as the ideal of elements $x\in R$ with the property that $1-xy$ is a unit for all $y\in R.$   In general, the nilradical of R is contained in the Jacobson radical. I want to show that the reverse inclusion holds in the polynomial ring $R[X].$ Can someone please give me a hint for this problem? Thank you.


After recently updating from 14.04 to 16.04, I tried to update to 18.04. However, when I try to do this, it keeps on failing presumably because of no disk space. When I click "Properties" on the "Computer" tab in "Files", it says that I have absolutely no free disk space, which I found strange because I transferred 40GB to a hard disk just before trying to update to 18.04 for the first time. I only just realized that memory could be a problem, but till now, I have tried to update to 18.04 multiple times.   When I do dpkg -l linux-headers-\* linux-image-\* | grep ^ii, I get the following, probably because I tried to update to 18.04 a lot of times:  ii  linux-headers-4.4.0-141             4.4.0-141.167        all          Header files related to Linux kernel version 4.4.0 ii  linux-headers-4.4.0-141-generic     4.4.0-141.167        amd64        Linux kernel headers for version 4.4.0 on 64 bit x86 SMP ii  linux-headers-4.4.0-142             4.4.0-142.168        all          Header files related to Linux kernel version 4.4.0 ii  linux-headers-4.4.0-142-generic     4.4.0-142.168        amd64        Linux kernel headers for version 4.4.0 on 64 bit x86 SMP ii  linux-headers-generic               4.4.0.142.148        amd64        Generic Linux kernel headers ii  linux-image-3.16.0-43-generic       3.16.0-43.58~14.04.1 amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP ii  linux-image-4.4.0-141-generic       4.4.0-141.167        amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP ii  linux-image-4.4.0-142-generic       4.4.0-142.168        amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP ii  linux-image-extra-3.16.0-43-generic 3.16.0-43.58~14.04.1 amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP ii  linux-image-extra-4.4.0-141-generic 4.4.0-141.167        amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP ii  linux-image-extra-4.4.0-142-generic 4.4.0-142.168        amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP ii  linux-image-generic                 4.4.0.142.148        amd64        Generic Linux kernel image   Is the existence of so many images and headers causing the memory full issue? If yes, how do I delete the proper ones?  The cause for the memory full issue is that my /var/log/cups/error_log is 86GB! Can I just delete this or is there a better and safer solution?

I have Lubuntu 16.10 installed on my disk mounted as /.  The problem is that the CUPS log file( /var/log/cups/error.log)  grows all the time until I no have free space left on the disk...   So when I delete that file, the space on disk freed up again  I already tried:    fsck disk usage analyzer every apt-cleaning/autocleaning, and dependencies fixing.    How should I proceed?  du -sxh:  9,0G    .  Model: ATA ST3160815AS (scsi) Disk /dev/sda: 160GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags:   Number  Start   End     Size    Type      File system     Flags  1      32,3kB  50,3GB  50,3GB  primary   ext4            boot  2      50,3GB  160GB   110GB   extended  5      50,3GB  158GB   108GB   logical   ext4  6      158GB   160GB   2136MB  logical   linux-swap(v1)   parted --list && sudo df -h:  Model: ATA ST3160815AS (scsi) Disk /dev/sda: 160GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags:   Number  Start   End     Size    Type     File system  Flags  1      32,3kB  50,3GB  50,3GB  primary  ext4         boot  2      50,3GB  160GB   110GB   primary  ext4   Filesystem      Size  Used Avail Use% Mounted on udev            985M     0  985M   0% /dev tmpfs           201M  6,3M  195M   4% /run /dev/sda1        46G   43G  709M  99% / tmpfs          1003M  188K 1003M   1% /dev/shm tmpfs           5,0M  4,0K  5,0M   1% /run/lock tmpfs          1003M     0 1003M   0% /sys/fs/cgroup tmpfs           201M   36K  201M   1% /run/user/1000 /dev/sda2       101G   60M   96G   1% /media/aram/


I have a complex object I am trying to texture with a real locations textures. I have the faces I want selected in edit mode and I UV unwrap them by projecting from bounds and it looks fine, like only the faces I selected are being unwrapped, but when I go to apply a new material, the material selects ALL of the faces, the ones I want, and the ones I don't want. What's the best way to get by this?

How do you add more than one material to a mesh?   I have tried adding two materials to the object, and then assigning one of the materials to a vertex-group, but I could not find a place to assign it.  I am making a striped bouncy ball that I want to deform, so adding a different material by separating the mesh into different objects would not be ideal.


X company offers the best coverage plans. They also offer great benefits. X company offers the best coverage plans. It also offers great benefits. Or X is a known company in the world of tech. They make the best products. X is a known company in the world of tech. It makes the best products. Is using they to refer to a company a grammatically sound choice?

Here is from an article from the  magazine:     One drug he talks about is an antidepressant called reboxetine (branded as Edronax by   its makers, Pfizer) that he used to prescribe to his patients.   Pfizer is a drug company. It is a singular noun. Why is it described as its makers, which is plural?


Say $\mathbf{X} \in \mathbb{R}^{n \times p}$ and $\boldsymbol{\Sigma} = \frac{1}{n}\mathbf{X}'\mathbf{X}$. The eigenvector decomposition of $\boldsymbol{\Sigma}$ gives $\boldsymbol{\Sigma} = \mathbf{P}\boldsymbol{\Lambda}\mathbf{P}'$ where $\mathbf{P}$ are the eigenvectors and $\boldsymbol{\Lambda}$ is a diagonal matrix with eigenvalues on the diagonal. The singular value decomposition of $\mathbf{X}$ gives $\mathbf{X}=\mathbf{U}\mathbf{S}\mathbf{V}'$, where $\mathbf{U}$ contains the left eigenvectors of $\mathbf{X}$, $\mathbf{V}$ contains the right eigenvectors of $\mathbf{X}$, and $\mathbf{S}$ is a diagonal matrix with singular values on the diagonal. The eigenvalues of $\boldsymbol{\Sigma}$ will equal the squares of the singular values of $\mathbf{X}$ only if $\mathbf{X}$ was centered (the mean of $\mathbf{X}$ was removed). If I plot the cumulative variance explained by the principal components, the plot will (obviously) be different depending on whether $\mathbf{X}$ was centered first.  I'm trying to understand what the eigenvectors mean if I don't center $\mathbf{X}$ prior to doing the decomposition. I'm working on an naive algorithm that involves performingPCA online. I need to recompute eigenvectors after observing each new data point, and my results are much worse if I recenter the data set as I observe new data points. However, if I pretend to have seen all the data at first, center the data, and compute the eigenvectors of the entire centered data set, my (offline) performance is much better than if I had not centered my data.  Could someone please provide some intuition as to what centering the data set does and how this might be affecting my algorithm performance? Also, what is the difference in the singular values computed before and after centering the data?

I keep reading about instances where we center the data (e.g., with regularization or PCA) in order to remove the intercept (as mentioned in ). I know it's simple, but I'm having a hard time intuitively understanding this. Could someone provide the intuition or a reference I can read?


Infernal Legacy grants tieflings ability to cast Hellish Rebuke as a reaction at 3rd level, as if it was cast using a 2nd level spell slot. Hellish Rebuke as spell has Verbal and Somatic components.  How can a tiefling using a sword and a shield (or wielding two weapons, separate item in both hands anyway), cast it in a battle, as a reaction? Is there something which allows practical use in regular battle, or is this class feature nearly useless for most front line fighting tieflings? Am I missing something obvious here?  The spell description does say "point a finger", which could be plausibly done with weapon in hand, but I don't think requirements of somatic component allow such exceptions strictly RaW?  I mean, it can still be used in bar fights, but 3d10 fire damage seems rather excessive retribution for some peasant hitting you with a beer mug... And I guess there's the odd ambush where damage is done when the PC does not have weapon in hand yet. And a principled good-aligned warrior might walk into a battle with an empty hand, and only envelope the baddie in hellfire after receiving a damaging hit, and then draw a weapon, but that is getting a bit ridiculous...    Alternatively, are there other options for making that high-AC front-line tiefling warrior, who can use its racial abilities in battle well?

Suppose a Fighter/Wizard without the War Caster feat is wielding a sword and shield.  If she is hit and wants to cast the Shield spell as a reaction (it has a somatic component), can she drop her sword and cast the spell all as part of the same reaction?  The rules don't seem to specify anything about object interactions other than as part of your main turn's move or action.    As a DM, I think I would rule that she could, since opening her hand seems like a reasonable start to whatever gestures she might need to make to cast the spell.  But I wanted to check, is this just a DM discretion thing, or are there explicit rules/examples somewhere that help clarify how this should be ruled?


I'm trying to write a mathematical set class. My idea was to make an base class which is called Set. Then i wrote two child classes of the Set class. Namely the FiniteSet class and the CountableSet class (which can deal with infinite Sets). My problem is now that those child classes depend on each other and I cannot solve this. I will also appreciate completely different solutions to this problem.   //-------------------------------------------------------- //Set class //-------------------------------------------------------- class Set { public:     //some virtual functions  protected:     //some attributes  };  //-------------------------------------------------------- //FiniteSet class //-------------------------------------------------------- class FiniteSet : public Set { public:     //implements all virtual functions       //function which needs to know CountableSet:     Set unionWith(Set* otherSet)     {         if(typeid(CountableSet) != typeid(*otherSet))         {             //the other set is finite. We can simply add all                                      //elements from otherSet to this set.         }         else         {             //create a CountableSet and return it         }     }  private:     //some attributes }  //-------------------------------------------------------- //CountableSet class //-------------------------------------------------------- class CountableSet : public Set { public:     //implements all virtual functions       //function which needs to know FiniteSets     Set intersectWith(Set* otherSet)     {         if(typeid(FiniteSet) == typeid(*otherSet))         {             //do something and return FiniteSet         }         else         {             //do something and return occasionally CountableSet         }     }  private:     //some attributes }

I often find myself in a situation where I am facing multiple compilation/linker errors in a C++ project due to some bad design decisions (made by someone else :) ) which lead to circular dependencies between C++ classes in different header files (can happen also in the same file). But fortunately(?) this doesn't happen often enough for me to remember the solution to this problem for the next time it happens again.  So for the purposes of easy recall in the future I am going to post a representative problem and a solution along with it. Better solutions are of-course welcome.     A.h  class B; class A {     int _val;     B *_b; public:      A(int val)         :_val(val)     {     }      void SetB(B *b)     {         _b = b;         _b->Print(); // COMPILER ERROR: C2027: use of undefined type 'B'     }      void Print()     {         cout<<"Type:A val="<<_val<<endl;     } };       B.h  #include "A.h" class B {     double _val;     A* _a; public:      B(double val)         :_val(val)     {     }      void SetA(A *a)     {         _a = a;         _a->Print();     }      void Print()     {         cout<<"Type:B val="<<_val<<endl;     } };       main.cpp  #include "B.h" #include <iostream>  int main(int argc, char* argv[]) {     A a(10);     B b(3.14);     a.Print();     a.SetB(&b);     b.Print();     b.SetA(&a);     return 0; }


I have some questions regarding to my news portal, where I have some issues with high traffic.   The issues is: I have daily about 50 k UU, and sometimes I have shots about 20 k UU in one time from socials links. In this case my server is going down due to RAM overload due to number of request to database, and some process in apache is hanging.   I'm looking for some advice what to do, to handle it. My ideas:  1) Simply buy more powerfull server(I will do it) 2) Using proper caching. I'm not sure how to use it in proper way, because I have news portal, so it's always very important how fast users will see new post. Could you give me any adivce ?   Specs of my server:  I'm using wiredtree with SSD 2000: 2,5 GB RAM, storage: 50GB Pure SSD RAID-10, CPU PRIORITY x2, Bandwith 6TB.   EDIT:  More about cache - I don't fully get how should I do it, because it's very important to me, to display new news to users very quickly. And the issue is when I have shot of 20 k UU in one time, and all will start reading it directly from DB, it will overload RAM due to too many request to DB.

This is a  about  Related:      I have a question regarding capacity planning. Can the Server Fault community please help with the following:   What kind of server do I need to handle some number of users? How many users can a server with some specifications handle? Will some server configuration be fast enough for my use case? I'm building a social networking site: what kind of hardware do I need? How much bandwidth do I need for some project? How much bandwidth will some number of users use in some application?


I have this problem that when I'm trying to restore my iPhone 6 on iTunes it keeps me prompting me that restore and update when I'm just choose the restore option only, cause I don't want it to update its own iOS to the newer one. Is there a way to avoid updating when I choose the restore option only? I already search all the solution online yet no answer help my concern.

I'm trying to downgrade my iPhone from the current iOS to an older one, as per .  But every time I try, I always receive this error:     The iPhone could not be restored. This device isn't eligible for the requested build.     I have tried many times with and without DFU mode. Any ideas regarding this?


I'm trying to iterate through every table in my database.  I've found this answer from 9 years ago:    With the answer apparently being:  Dir[Rails.root.join('app/models/*.rb').to_s].each do |filename|   klass = File.basename(filename, '.rb').camelize.constantize   next unless klass.ancestors.include?(ActiveRecord::Base)   next if klass.abstract_class?   # do something with klass end   The answer above is 9 years old but I can't find anything more recent. Is there an easier way for me to access this list? My end result is I want a list of every table in my database. I also have namespaced models so would need to make the above even uglier for it to work for me.  EDIT: As multiple users have pointed out models do not exist in my DB. My bad. As I said in my original post:     My end result is I want a list of every table in my database.

How do I get a list of all the tables defined for the database when using active record?


Let $f(x)$ continuous and integrable, $G(k) = \displaystyle\int_{0}^{k} \dfrac{f(x)}{f(x)+f(k-x)}dx$. Show that $G(k)=\dfrac{k}{2}.$    (Hint: Let $u=k-x)$  Here is what I did:  $G(k) = -\displaystyle\int_{k}^{0} \dfrac{f(k-u)}{f(k-u)+f(u)}du=\displaystyle\int_{0}^{k} \dfrac{f(k-u)}{f(k-u)+f(u)}du$    Then:  $\displaystyle\int_{0}^{k} \dfrac{f(x)}{f(x)+f(k-x)}dx - \int_{0}^{k} \dfrac{f(k-u)}{f(k-u)+f(u)}du = 0$  But now I don't know how to proceed.

I found this problem on an old FB post and have just been humbled by it.  Let $f(x)$ be continuous on $[0,n]$ such that $n > 0$ and $f(x) + f(n - x)$ does not vanish on $[0,n]$ then evaluate  $$ \int_0^n \frac{f(x)}{f(x) + f(n-x)}dx $$  Any clues/hints would be appreciated.


I have an Ubuntu server running Netatalk and flex media server. I was just thinking that if I need to access the Ubuntu terminal from a machine like Windows is there a way I can simply enter my server's ip address and see my server's terminal. Both the machines are on the same network. ssh is one way. But can I see my server's terminal on a web browser or is it is impossible?

I'm at a library, and all of the computers are Windows based.  I'm sshing into my Ubuntu box somewhere else. The terms of service says "You may not make any changes to system files." However, when I ssh into my Ubuntu box, it might "look" like I'm hacking, since I've had a few people (including I presume the library supervisor) look at my computer funny when I opened a website where the text was a monospaced font and the website background was black. Running Command Prompt will certainly be considered to be hacking if looking at a website was.  If I'm sshing into my box it appears as though I'm "hacking" into the computer. I'd like to somehow do it in a web browser with nice happy looking text, so that it actually represents what I'm doing; I'm not going to hack into the computer, I'm only using a computer somewhere else.


let's say we wan to say 6879 out loud Would it be  six thousand eight hundred seventy-nine six thousand and eight hundred seventy-nine six thousand and eight hundred and seventy-nine  What about larger numbers?

I want to write a program which will translate a number into text, but I am not sure how to read those numbers and about the rule.  999,999 =?   Nine hundred ninety nine thousand and nine hundred ninety nine? Nine hundred and ninety nine thousand and nine hundred ninety nine?     123,909,909 =?   one hundred twenty three million nine hundred nine thousand and nine hundred nine? one hundred and twenty three million nine hundred nine thousand and nine hundred nine?   1,000,000,000,000,000 =?   one million billion?   What is the rule to read them?


Fill in the right word. Bread is usually made ______ wheat. 1) of 2) from 3) with 4) by

(1) Wine is an alcoholic beverage made from fermented grapes or other fruits. (Wikipedia) (2) Tables were made of marble or wood and metal (typically bronze or silver alloys), sometimes with richly ornate legs. (Wikipedia)  Why is 'from' used in (1), whereas 'of' is used  in (2)? Is it a stylistic choice whether to use 'of' or 'from'? Or, in case of chemical changing, differently from changing in shape only, 'from' is preferable?


When writing a formal letter addressed to someone whose gender is unknown, how important is it to use "Dear Sir or Madam", instead of "Dear Sir"?  I was taught that "Dear Sir" is an acceptable gender-neutral salutation but times may have changed, is this right or wrong?

When is it appropriate to use the terms Dear Sir or Madam and To whom it may concern?  The rules I was taught state that Dear Sir or Madam should be used when you're writing a letter to a person about something that person has direct involvement in (e.g. returning a defective product to a customer service department).  By the same rules, To whom it may concern would be used for situations in which the recipient is a third party to the topic of the letter (e.g. regarding a letter of reference or recommendation).  Was I taught correctly?  Is the rule actually something else?  Or is this one of those situations where many people have an opinion but there is no real rule?


In quantum mechanics, I know that there is an uncertainty in the speed of the non-relativistic particles (i.e. Heisenberg's uncertainty principle). Is there also an uncertainty in speed of light in quantum physics?

While I was hobby-reading about quantum mechanics I came across Heisenberg's theory. But while I was trying to understand it I thought of this: if the speed of light (as well as the momentum of a photon) is well-defined, then if in an experiment the position of the photon was found, the researchers would know the exact position of the photon, but also its momentum which is constant. Is this an exception from the rule, or am I just ignorant?  PS, 12 grade physics education, please try to explain in simple words


Following a book, I see a statement that reads      we find that (18.7.11) is euqivalent to $$ l^k\left|u_{ij}^W-\frac{b_ib_j}{l} \right|=0 $$ which can be written as $$ l^{k-1}\left|u_{ij}^W\right|\cdot\left[l - \sum_{i,j=1}^k u_W^{ij}b_ib_j\right]=0 $$   To translate, the book says that given that $0\neq l\in\mathbb{R},\;{\bf b}\in \mathbb{R}^k$ and $0<{\bf U} \in M_k(\mathbb{R})$, then $$ \det\left({\bf U} - \frac{{\bf b} {\bf b}^\top}{l} \right) = \det\left({\bf U}\right)\left[1 - \frac{{\bf b}^\top{\bf U}^{-1}{\bf b} }{l} \right]$$ Can anyone help me understand why that's true?

I read something that suggests that if $I$ is the $n$-by-$n$ identity matrix, $v$ is an $n$-dimensional real column vector with $\|v\| = 1$ (standard Euclidean norm), and $t > 0$, then $$\det(I + t v v^T) = 1 + t$$ Can anyone prove this or provide a reference? More generally, is there also an (easy) formula for calculating $\det(A + wv^T)$ for $v,w \in \mathbb{K}^{d \times 1}$ and some (invertible) matrix $A \in \Bbb{K}^{d \times d}$?


I want to show that $X=S^1=\{x^2+y^2=1|x,y\in \mathbb{R}\}$ and $Y=\mathbb{R}^2-\{0\}$ are homotopy equivalent. For this I have to find a function $f:X\rightarrow Y$ and a function $g:Y\rightarrow X$ such that $f\circ g$ is homotopic to the $id_Y$ and  $g\circ f$ is homotopic to the $id_X$.  The construction of $g$ is easy: $g(x,y)=\frac{1}{\sqrt{x^2+y^2}}\begin{pmatrix}x\\y\end{pmatrix}$.  But how do I construct $f$? There is a certain ambiguity 'how much I stretch the unit circle'?  Many thanks in advance

I know that the fundamental group of $X = \mathbb R^2 \setminus \{(0,0)\}$ is the same as the fundamental group of the circle $Y = S^1$, namely $\mathbb Z$.  However, $X$ and $Y$ are not homotopic, i.e. we can't find continuous maps $f:X\to Y, g : Y \to X$ such that $f \circ g$ is homotopic to $id_Y$ and $g \circ f$ is homotopic to $id_X$.  I would like to prove it, but I don't really know how to do it. If such $f$ and $g$ existed, then it would be something like $f : x \mapsto x/\|x\|$, and $g(Y)$ has to be compact... I don't know how to continue.  Any hint would be appreciated. I apologize if this has already been asked.


I asked how to get the administration rights but I can't use Sudo. What do I type in the terminal?

Inspired by this ....  I am the sole person using my system with 12.04. Every time I issue a sudo command; the system asks for the user password (which is good in its own way).  However I was thinking; without activating the root account; how can I execute the sudo commands which will not ask for user password to authenticate.  NOTE: I want to execute sudo command without authenticating via password; only when they are executed via terminal. I don't want to remove this extra layer of security from other functions such a while using 'Ubuntu software center' or executing a bash script by drag-drop something.sh file to the terminal.


I am running Ubuntu 11.10 and do not want nautilus to start running at all.  There used to be a way to kill it via gconf-editor.  Does anyone have the secret recipe?  Thanks

Since 11.10 nautilus shows my Desktop in Unity. As I remember correctly, tthis wasn't in 11.04. How can I disable that?


I'm trying to figure out why my function isn't working as it should. The code is fairly basic and self explanatory. Here is the function:  public static void Greet(){     System.out.println("Hello, what is your name? ");     name = scan.nextLine();     do{         System.out.println("Would you like to order some coffee, " + name + "? (y/n) ");         input = scan.nextLine();         if(input == "y"){             System.out.println("Great! Let's get started.");             break;         }         else if(input == "n"){             System.out.println("Come back next time, " + name + ".");             System.exit(0);         }         else{             System.out.println("Invalid response. Try again.");         }     }     while(true); }   Basically, regardless of what I enter as "input" on line 5, the function will treat it as if I hadn't entered a 'y' or 'n', it just constantly loops the while(true) and printing "Invalid response. Try again." I have no idea why my if/else statements aren't working correctly. Any help would be appreciated, thanks!

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?


Does$$\lim_{h\to 0} \frac1h\int_0^h \sin(1/t)\,dt\tag1$$   exist?    Let $F(h)=\int_0^h \sin(1/t)\,dt$. There is no closed form expression for $F$. If the limit in $(1)$ existed, then $F(h)$ would be an example of a differentiable function whose derivative is discontinuous, which is why I am interested. Solutions which are comprehensible by an exceptionally bright high school calculus student would be preferred, if possible.   My thoughts:   It is tempting to apply l'Hopital's rule to $\lim_{h\to 0}\frac{F(h)}{h}$, but $\lim_{h\to 0}\frac{F'(h)}{1}=\lim_{h\to 0}\sin(1/h)$ does not exist.  An equivalent expression, obtained from substituting $1/u$ for $x$, is $$ \lim_{h\to 0}\frac1h\int_{1/h}^{\infty}\frac{-\sin u}{u^2}\,du=\lim_{a\to\infty}a\cdot\int_a^\infty  \frac{-\sin u}{u^2}\,du.\tag2$$ It is tempting to bound $\left|\int_a^{\infty}-\sin u/u^2\,du\right|$ by $\int_a^{\infty}1/u^2\,du=1/a$, but this bound is too coarse. I strongly suspect the limit exists and is equal to zero. In $(2)$, I think the alternating sign of $\sin u$ causes $\int_a^\infty  \frac{-\sin u}{u^2}\,du$ to go to zero faster than $a$. However, I am getting tongue-tied in making this argument formal, especially using the tools available to a high-school calculus student (l'Hopital's, MVT, integration techniques, etc).   Thank you in advance for any help.

Let $$f(x) = \begin{cases}\begin{align*}&\cos{\dfrac{1}{x}}, &x \neq0 \\ &0, &x=0. \end{align*}\end{cases}$$ Is the function $F(x) = \displaystyle \int_{0}^x f dx$ differentiable at $0$?  We can see that the function $f(x)$ is continuous everywhere except $x=0$. In order to show differentiability we will need to show the derivatives from the left and right are equal. So we need to show that $$\lim_{h \to 0^+} \dfrac{F(x+h)-F(x)}{h} = \lim_{h \to 0^-} \dfrac{F(x+h)-F(x)}{h}.$$ The derivative from the right is $$\lim_{h \to 0^+} \dfrac{F(x+h)-F(x)}{h} = \lim_{h \to 0^+} \dfrac{\displaystyle \int_{0}^x\cos{\dfrac{1}{x+h}}-\int_{0}^x\cos{\dfrac{1}{x}}}{h}$$ and the derivative from the left is $$\lim_{h \to 0^-} \dfrac{F(x+h)-F(x)}{h} = \lim_{h \to 0^-} \dfrac{\displaystyle \int_{0}^x\cos{\dfrac{1}{x+h}}-\int_{0}^x\cos{\dfrac{1}{x}}}{h}.$$ I am not sure how to proceed.


Am using Maven, I want to import the methods which are in test class to the main class,please let me know how to do this. Actually I have done importing the class of test to main function and created an object using the class of test, but the am getting an error like can not resolve methods.  Actually am doing unit testing , I want to import the test class(1) to the other test class(2) and in test class (2) I have to write main() and inside main() am  creating the object to test class(1) and calling the required methods from test class(1) using the object created. Do I have to add any dependencies in pom.xml file of test class(2)(am using maven) or any other suggestions to do this.  Test class1.java  public class testclass1{  public void a(){   statements  } public void a(){    statements  } }   Testclass2.java  import testclass1; public static void main (String args[]){  testclass1 ET =new testclass1();  ET.a();  ET.b();     }

How can you depend on test code from another module in Maven?    Example, I have 2 modules:   Base Main   I would like a test case in Main to extend a base test class in Base.  Is this possible?  Update: Found an , which involves creating a test jar.


I've got a table that contains multiple data series - and they aren't uniformly distributed either.  Example below.  As you can see there are multiple series here: Income, Short-Term Capital Gain, and Long-Term Capital Gain.  They don't have the same number of entries (i.e., rows) and the dates at which they occur aren't at uniform intervals in the table.  I'd like to get, for this table, an Excel chart with 3 data series lines, where X axis is a timeline and Y axis is the $/share column.  There are three things I don't know how to do:   Display, given a single time series with non-uniform time intervals, a graph over a uniform timeline.  (E.g., if I have a series with monthly dates but some months are missing I don't know how to chart that with "gaps" for the missing months.) Display multiple series from a table like this where the series are distinguished by a value in a column. Whether Excel is the right tool for the job or if there's something else I should be using.   .  Type                      $/share   Payable date ------------------------- --------- -------------- Income                        0.5   9/24/2018 Income                        0.5   6/18/2018        Short-Term Capital Gain      0.06   12/19/2017    Long-Term Capital Gain       0.69   12/19/2017      Income                       0.48   9/22/2017       Short-Term Capital Gain      0.02   12/27/2016      Long-Term Capital Gain       0.63   12/27/2016     Income                       0.44   9/19/2016      Income                       0.47   6/17/2016      Income                        0.4   3/17/2016     Income                       0.55   12/17/2015      Short-Term Capital Gain      0.04   12/17/2015     Long-Term Capital Gain       1.44   12/17/2015     Income                       0.47   9/21/2015     ...

Say I have a table as follows:   Label |  X  |  Y  |   A   |  1  |  1  |   B   |  2  |  2  |   B   |  3  |  2  |   A   |  4  |  3  |   C   |  5  |  4  |   A   |  4  |  3  |   C   |  2  |  1  |   How can I make this into an Excel scatter plot with 3 series (A,B,C) without manually selecting the correct rows manually for each series (). This table would be this chart:    Sorting won't help, as I want to do this relatively dynamically with new data.


I am building a c# project for a DLL that will be used x64 environment. Originally I was using 'Any CPU" as the platform target. However, when I test it I found it failed during library loading and I found it load some 32 bit libraries. I changed it to 'x64' and everything works as expected. My question is, in what case I should use 'x64' and in what case I should use 'Any CPU'.  I used to think 'Any CPU' is safer and it will automatically determine whether 32-bit or 64-bit library is required.

I have some confusion related to the .NET platform build options in Visual Studio 2008.  What is the "Any CPU" compilation target, and what sort of files does it generate? I examined the output executable of this "Any CPU" build and found that they are the x86 executables (who would not see that coming!). So, is there any difference between targeting executable to x86 vs. "Any CPU"?  Another thing that I noticed, is that managed C++ projects do not have this platform as an option. Why is that? Does that mean that my suspicion about "Any CPU" executables being plain 32-bit ones is right?


First, here's a material that made me keep thinking about this issue in the first place.        He seems as if he hasn't slept for days   because of a tough project he has been working on, he stayed at the office for days. So, he hasn't slept for days.      He seems as if he hadn't slept for days.    He has slept quite well, but he looks tired like a person who hasn't slept for days.   I'm trying to figure out how to use 'as if' more concisely. If you could help me, it would mean the world to me.   Thanks in advance

First, here's a material that made me keep thinking about this issue in the first place.        He looks as if he knew the answer.    He is pretending as if he knew the answer. He is not as smart as he can solve the problem.      He looks as if he knows the answer.    He is a smart enough to know. Many people expect him to know the answer  Am I right to think this way? I'm trying to figure out how to use 'as if' more precisely.   Thanks in advance


I have a notebook with 32GB SSD with Windows 8.1 installed and am thinking of installing Ubuntu 14.04 on dualboot, I have done a search online, but I'm still in doubt about which is the best way to install and configure the system so that both work without problems. I saw that some people had problems and as my knowledge is more User level I would like some advice and tips to prevent it.   Incidentally, it is possible to maintain the SSD just for Windows and create a partition on the HD to Ubuntu?   I thank the attention.   PS: My notebook is in this link below:

I have 2 1tb hard drives on my computer with Windows 8 on the first hard drive and nothing on the other.  I want to install Ubuntu 14 on the second hard drive. I've looked up some guides and they all say to install Ubuntu on the sdb partition when booting off a usb stick. I have also seen some say to unplug the Windows HDD and then install Ubuntu onto the second HDD, and Ubuntu will automatically detect Windows and ask what you want to boot into upon boot.   I am really concerned about this - Will it ask me to choose what OS I want to boot into? Is there something like rEFInd(Mac) for Windows? Can anyone please give me a guide on how to do it without ruining my computer?  Thanks


I am trying to understand how terminals work. I am looking at the implementation of Netbeans Terminal plugin. I realize it may not be the ideal candidate but my CPP skills are quite limited. So I figured I'd begin with something I know.   Netbeans Terminal seems assume that a character is one block wide, or atleast that a characters width is in multiples of a block width. (A block here is a just a rectangle with a fixed width & height). If I am not completely wrong Gnome Terminal & Konsole work on similar lines. Needless to say this screws with some fonts, specifically Indic fonts, the fonts of my interest. While, the reason Netbeans was implemented this way could be implementation specific, the real question I am after is why are Terminals implemented in this way in general.  I don't know where to begin, so any reading resources you could suggest would help me a great deal. I did read through TTY demystified, but that doesn't delve in character rendering details.

Why did visual terminal  need a fixed-width font? There were visual limits: 24 x 80 characters. But still why not use variable-width characters?  For instance, in  in paragraph 4.8.2 it is said that variable-width font characters are redrawn so that they fit one fixed-width font character.


In order to run an executable file, I need to run all the commands in the below bash file first, so I just put those commands in the bash file and run the bash file first, but running the bash file doesn't work, I have to run the 4 commands one by one in the terminal and then run my executable file in the same terminal, why do I have to do this, why running the bash file doesn't acheive the same as running the commands one by one:  #!/bin/bash export LD_LIBRARY_PATH=/repo/$USER/ncmain/out/rcpi/ITC_CXA11466/x86/lib export ITC_RUNDIR_PATH=/local/scratch/$USER/itc/ export ITC_INSTANCE_NAME=itc_$USER /local/scratch/ehhozzo/RCS_ROOT/software/itcworld

I have multiple Amazon EC2 accounts and want to quickly be able to switch variables, such as $EC2_HOME, using a script.  I have have a shell script set up like this:  #!/bin/sh export EC2_HOME=/home/me/.ec2 echo $EC2_HOME   When I run the script I know that EC2_HOME is set, but I thought that using export would make the variable stick around after the script completed. It does not, as running echo $EC_HOME does not show anything.  I know this must be very rudimentary Linux scripting knowledge, but I don't know it. I tried looking for related questions without luck - so my apologies if this is a duplicate.


I am designing a table in which I need images to get stored for every row. Should I upload the images to a folder on google-drive and then store the shareable link or should I store the images locally in a folder ? If stored locally , what address should I store in the Table ?

So I'm using an app that stores images heavily in the DB. What's your outlook on this? I'm more of a type to store the location in the filesystem, than store it directly in the DB.  What do you think are the pros/cons?


In bash, if I type a command beginning with a '#', bash ignores it as a comment.  Ie, the following is ignored at the bash prompt:  > # Hi there!   Whereas in zsh:  > # Hi there ! zsh: bad pattern: #   How can I ask zsh to do the same?  This is incredibly useful to "store" commands that you want to run later, or to chat when using a shared tmux/screen session.  I am using ''

It might be useful to allow comments in zsh commands written on the command line, as in bash, but  % echo test # test zsh: bad pattern: #   Any way to get the same behaviour as in the bash shell?


I am learning how to code HTML from websites and other people. This one site mentioned the <div> and <span> element but didn't really give a good definition of them. Can someone tell me exactly what they are for and how to use them?

I would like to ask for some simple examples showing the uses of <div> and <span>.   I've seen them both used to mark a section of a page with an id or class, but I'm interested in knowing if there are times when one is preferred over the other.


I'm trying to calculate the probability of drawing specific cards in a deck.  I know that I can use multivariate hypergeometric distribution to calculate for a defined success.  I'm wondering how I can do the same for a range of acceptable successes.  For example (if k is the number of successes):   Drawing less than k cards Drawing up to k cards Drawing between k and l cards (also inclusive of k and/or l) Drawing k or more cards Drawing more than k cards   I'd just like to know if there's a formula for this already, or what the process would be to find these values.  Edits after receiving further questions  Let's say we're using a standard 52 card deck of playing cards and they're shuffled.  You're drawing cards off the top of the deck.  Some questions that might be asked are:   What's the chance of drawing 2 or 3 queens in 5 cards? What's the chance of drawing $\le$ 3 queens AND $\ge$ 2 kings in 7 cards?   Because the number of cards is known, the last example translates to 0-3 queens and 2-4 kings.

I understand how to calculate multivariate hypergeometric distributions.  For example, if you have an urn with 2 red marbles, 4 white marbles, 8 blue marbles, and 12 orange marbles, the probability of drawing 5 marbles and getting 1 red marble and 2 white marbles is as follows:  $P = \frac{{2 \choose 1}{4 \choose 2}{20 \choose 2}}{26 \choose 5}$  What I'm wondering is if I wanted to calculate 1 or more red marbles and 2 or more white marbles, if that could be calculated this way:  $P = \frac{{2 \choose 1}{4 \choose 2}{24 \choose 2}}{26 \choose 5}$  where I'm adding in the extra red and white marbles to the last combination. If this doesn't work (which I don't think it does because the numerator and denominator no longer match) why not, and is there a nice solution to this problem that doesn't involve summing all of the separate probabilities?


Is Baron and Kenny method for mediation now outdated? This is because I got a comment from reviewer saying asking me to refer to Rucker, D.D., Preacher, K.J., Tormala, Z.L. & Petty, R.E. (2011). Mediation analysis in social psychology: Current practices and new recommendations.

I'm about to open the door to a very thorny issue in the social sciences.  How does one correctly model and test hypotheses about mediating variables using observational data?  I'm familiar with the Baron-Kenny approach to mediation , and also with structural equation modeling.  However, I've heard both approaches disparaged by more quantitative-minded social scientists than myself -- especially when one is using observational rather than experimental data.  So, let's say that I'm trying to resolve the following:   Y is a behavioral outcome. Both X and Z are observed characteristics of subjects that cannot be manipulated by an experiment. X is an attitude (something that can be changed over the long term) and Z is an unchangeable characteristic such as age, race, etc.   I hypothesize that X is a mediating variable, thus Z affects Y through the pathway of X.  While it's reasonable to suggest that Z is in some way correlated with X, my theory argues that it has no impact on Y (other than through **X).  How would one best test these hypotheses using best practices in current research?


I need to find the period of $\frac{\cos 3x}{1+\cos2x}$. I know that $\cos3x$ has the period $\frac{2\pi}{3}$ and $\cos2x$ has the period $\pi$, but how do I find the period of that function?

Suppose that period of $f(x)=T$ and period of  $g(x)=S$, I am interested  what is  a period of $f(x) g(x)$? period of $f(x)+g(x)$? What I have tried is to search in internet, and found following  for this.  Also I know that period of $\sin(x)$ is  $2\pi$, but what about $\sin^2(x)$? Does it have period again $\pi n$, or? example is following function $y=\frac{\sin^2(x)}{\cos(x)}$ i can do following thing, namely  we know  that  $\sin(x)/\cos(x)=\tan(x)$ and period of tangent function is $\pi$, so I can represent $y=\sin^2(x)/\cos(x)$ as $y=\tan(x)\times\sin(x)$,but how can calculate period of this?   Please help me.


I'm working through an algorithm text, trying to implement everything in C++ for practice. But I can't seem to figure out templating.I have three files:  algPlayground.h  #include <stdlib.h> #include <vector>  using namespace std;  template <class T> void insertionSort(vector<T>& toSort);    algPlayground.cpp  #include <stdlib.h> #include <vector> #include "algPlayground.h"  using namespace std;  template <class T> void insertionSort(vector<T>& toSort) {     for (int j=1; j < toSort.size(); ++j) {         T key = toSort[j];         int i = j-1;          while (i > -1  && toSort[i] > key) {             toSort[i+1] = toSort[i];             i -= 1;         } // end while      toSort[i+1] = key;      } // end for  } // end insertionSort   and algTest.cpp  #include <stdlib.h> #include <vector> #include <iostream> #include "algPlayground.h"  using namespace std;  int main() {      vector<int> vectorPrime(5);      vectorPrime[0]=5;     vectorPrime[1]=3;     vectorPrime[2]=17;     vectorPrime[3]=8;     vectorPrime[4]=-3;      insertionSort(vectorPrime);     for (int i=0; i<vectorPrime.size(); ++i) {         cout << vectorPrime[i] << " ";     }// end for }   I get the following error:   algTest.cpp:(.text+0xb1): undefined reference to `void insertionSort<int>(std::vector<int, std::allocator<int> >&)' collect2: error: ld returned 1 exit status   I saw  where, someone suggested that the proper way to do this was   template<typename T, typename A> void some_func( std::vector<T,A> const& vec ) { }   but when I make that correction, I'm still getting a similar error:  algTest.cpp:(.text+0xb1): undefined reference to `void insertionSort<int, std::allocator<int> >(std::vector<int, std::allocator<int> >&)' collect2: error: ld returned 1 exit status   I have no idea where I'm going wrong here. Help?

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


I want to GET ID or class of the clicked element. Can someone give me idea how to do this? I tried to get the ID of the clicked element but it's not working.   Here's my jquery.  $('.sems').click(function() {      var id = $(this).attr('id');     alert(id); });   Here's the full code where link is located.  if(isset($_POST['loadsem'])) {     $stud = $_POST['stud'];     $output = '';       $sql = "SELECT DISTINCT sch_year,semester FROM grades WHERE stud_no ='$stud'";     $result = mysqli_query($con,$sql);     $output .= '

                         Semesters Attended
';       while($row = mysqli_fetch_array($result))       {         $sem = $row['semester'];         $year = $row['sch_year'];         $output .= '
                       '; <--- Here's the link                     if($sem == "1"){                       $output .= $row['semester']. "st Semester S.Y " .$row['sch_year'];                     } else {                       $output .= $row['semester']. "nd Semester S.Y " .$row['sch_year'];                     }                     $output .='
';       }           $output .= '

';    echo $output;     }

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.


Evaluate $$\sum_{k=0}^{\infty} \frac{1}{F_{2^n}} \;.$$  I'm thinking of using a relation from a term to another.

Evaluate the sum:  $$\sum_{n=0}^{\infty} \frac{1}{F_{(2^n)}}$$  where $F_{m}$ is the $m$-th term of the Fibonacci sequence. I need some support here. Thanks.


I have Windows 10. I can't seem to find any of my screenshots.   I've looked over on YouTube and Safari but I can't find any tutorials on how to open screenshots on Windows 10.

I pressed F2 to take a few Minecraft screenshots. Later I couldn't find them. Where are they stored on my computer?


I have a php page with a form for a login.   <form role="form" id="contactForm">     <input type="text" id="inputName" required>     <input type="password" id="inputPassword" required>     <button type="submit">ACCEDI</button>  </form>

   On the bottom of the page I load a .js to execute this form in jQuery and the page, on success return a new form on div #risposta but this form cannot be executed like the first. When I click on the submit button of the 2nd form it reload the page and do nothing. 1st form works as needed.   js code:  $("#contactForm").on("submit", function (event) {     event.preventDefault();     submitForm(); }); $("#conferma").on("submit", function (event) {     console.log( 'Conferma Dati' );     event.preventDefault();     submitConfermaDati(); });   hmtl of 2nd form generated by first:  <form role="form" id="conferma" class="form-signin">     <input type="hidden" id="utf_id" value="1">     <input type="text" id="rag_sociale" class="form-control"  value="">     <input type="text" id="utf_nome" class="form-control" value="" required="">     ----- more input -----           <button type="submit">CONFERMA</button> </form>


I'd really appreciate some help in regards to this situation:   "I was lucky enough to see the One Direction in concert".   As native English speakers we know that the "the" is superfluous in this sentence, but I'd really appreciate the rules around the omission of it in some contexts.   For example, It's perfectly fine to say: "I was lucky enough to see the Red Hot Chili Peppers in concert" +the. However: "I was lucky enough to see Take That in concert" -the.  I would love for someone to give me the general rule here. I'm sure the answer is staring me  right in the face!

Is there a rule beyond the common "no the with proper nouns and names" for the following problem?     I saw the Empire State Building.      We went to the White House.      We saw the Golden Gate Bridge.   but     I went to Death Valley National Park.      I crossed Brooklyn Bridge.


I have an app/site and need to perform a search for all users located within a user specified distance of their zip code. I have two tables, one with user data and a second with zip code information. I'm having difficulties figure out the query to find users that are within the distance.  I don't understand geospatial query needed to make it work.  User Table Structure  username        zip  =====================    tester55        60608    Tester1         00544    iosuser1        73120    Tester3         01002   Zipcodes Table Structure  zip     latitude     longitude ------------------------------ 00501   40.8154      -73.0451 00544   40.8154      -73.0451 01001   42.0702      -72.6227 01002   42.3671      -72.4646   I want to use the zip code of a user to find other users within a certain radius.  Here are the queries I have so far, I'm trying to figure out how to make it one query.  First Query      Select users.zip, users.username, zipcodes.zip as user zip,  zipcodes.longitude as userlong, zipcodes.latitude as userlat from users, zipcodes where users.zip = zipcodes.zip AND username = 'tester55   Second Query  SELECT zipcodes.zip, zipcodes.city, zipcodes.state, zipcodes.longitude, zipcodes.latitude, ( 3959 * acos( cos( radians(userlat) ) * cos( radians( zipcodes.latitude ) )      * cos( radians( zipcodes.longitude ) - radians(userlong) ) + sin( radians(userlat) ) * sin(radians(zipcodes.latitude)) ) ) AS distance  FROM zipcodes HAVING distance < 50 ORDER BY distance   Any help is greatly appreciated.

I have 2 tables. One (domains) has domain ids, and domain names (dom_id, dom_url).  the other contains actual data, 2 of which columns require a TO and FROM domain names. So I have 2 columns rev_dom_from and rev_dom_for, both of which store the domain name id, from the domains table.  Simple.  Now I need to actually display both domain names on the webpage. I know how to display one or the other, via the LEFT JOIN domains ON reviews.rev_dom_for = domains.dom_url query, and then you echo out the dom_url, which would echo out the domain name in the rev_dom_for column.  But how would I make it echo out the 2nd domain name, in the dom_rev_from column?


I'm working on application that causes me many problems when working   file1 = "src\\sga\\facturation\\data.ser"; FileInputStream fis = new FileInputrStream(file1);//this works fine on NetBeans   I tried  file1 = "data.ser"; InputStream fis = ClassLoader.getSystemClassLoader().getResourceAsStream(file1);   But nothing; I tried also to change the repertory's path, it told me file not found, I tried even to force the repertory in C:\Folder; where I put my files but nothing works. I tried to delete those lines to see if FileOutputStream works, but it's not the case :( Here's which works on NetBeans   ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file2));   This is my repertory    Thanks for helping  RELATED POSTS NEVER TOLD ME A SOLUTION WHICH WORK, SO IF YOUR ATTENTION WAS TO PUT A -1 ON BEGINING, DO IT AND LEAVE !

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


How to install Dreamboxedit, Clonezilla and Skype in Ubuntu 14.04.3 LTS?

How can I install applications like Google Chrome on Ubuntu?  Are there any commands to install an application?    Index of answers:


I'm thinking about  $ax \equiv 0 \mod m$ $\Leftrightarrow$ $m \mid (ax - 0) \Leftrightarrow m\mid ax$  Since $\gcd(a,m) \not= 1$, we have  $m \mid a \Rightarrow m\mid ax$  But I'm not tottaly sure about this. Any hints?

Let us consider the ring $\mathbb{Z}_n$ where $\bar{m}\in\mathbb{Z}_n$  Could anyone help me prove that $\bar{m}$ is a zero divisor in $\mathbb{Z}_n$ if and only if $m,n$ are not coprime  So far I have:  Assume $\exists \bar{a}: \bar{m} \bar{n}=n \mathbb{Z} \Rightarrow$ for some $b\in\mathbb{Z}:am=bn$  I then assumed $n,m$ were coprime and attempted to use $\exists a',b'\in \mathbb{Z}:a'm+b'n=1$ to come to a contradiction, however haven't found one, the most promising thing I have found so far is that  $a=n(a'b+ab')$ and $b=m(a'b+ab')$ $\Rightarrow n|a$ and $m|b$


I know how to create a shortcut on Keyboard>Shortcuts. But if I want to create a new window and activate this one, I would like to know.  It shoudl be: nautilus;wmctrl -a nautilus;  but keyboard>shortcut doesn't accept that.

What is the shortcut for opening a new window (opening folders). for that I have to go to folder options and right click and then need to click on open new window.  or I have to make focus on the folder icon or open a folder then press  Ctrl+N  for opening a new window is there any direct command spcific to open a new window in ubuntu.


I created this grid for use in a game. Users will use the grid as a guide to add road.   I created the mesh by drawing a rectangular plane and performing several arrays. Then I applied the "wireframe" modifier to create lines.   I now want to merge all the lines/planes together to create single mesh. How is this possible?   Ideally, I'm trying to reduce file size as I just need the lines visible.

Is there any addon that will allow me to merge multiple different meshes into one solid mesh?  I've spent a great deal of time constructing a fancy window frame, but I made it out of multiple individual meshes.


The composition was defined as follow:  $(a,b)$ $\in$ $(R;S)$ $\Leftrightarrow$ $\exists c |  (a,c) \in  R \\  $&$ (c,b)  \in S$ .  Also the composition was defined as the binary product of two matrix .  $SoR$ (relation of composition)$  = R * S $ (product of matrices) where the sum is the disjunction and the product is the conjunction.  If our two relations R and S are two convex polygon  Is there a geometric interpretation of the composition of two convex polygon ? for example :     The Green polygon was the searched result .

the composition was  defined as follow:  (a,b) \in (R;S) <=> there is c | (a,c) \in R  and (c,b) \in S .   If our two relations R and S are two convex polygon   Is there a geometric interpretation of the composition of two convex polygon ? for example :   the green polygon was the result of composition. How can i describe geometrically the result !!!


Let's say  enters the battlefield under my control. The card states that when it comes into play I must sacrifice a land. Can I in response to its ETB ability sacrifice a land using say ? When Glacial Chasm entered, a land was sacrificed. Is this allowed, and more to the point: is Glacial Chasm's ETB requirement met in this scenario?

Say I have a Zombie token, , and  on the battlefield. Can I sacrifice the Zombie token to activate both the Altar's and Seer's abilities?  Similarly, if I have one card in hand, and  and  on the battlefield can I discard the one card to both of their abilities?  If I have a  with 3 charge counters can I activate both of its abilities by tapping it to add a counter, and tapping it to remove 3 counters and destroy a permanent without untapping it in between?