I'd like to prove that the function: $$ f(x)=\frac{1}{(\sin x)^2}-\frac{1}{x^2} $$ is increasing on $[0,\pi/2]$, with $f(0)$ understood in the limiting sense. Computing the derivative reduces the problem to showing that $$ (\sin x)^3-x^3 \cos x \ge 0, \qquad x\in [0,\pi/2], $$ but I don't know how to handle it. Any hints will be highly appreciated!

show that     $$x^3<\sin^2{x}\tan{x},x\in\left(0,\dfrac{\pi}{2}\right)$$ have nice methods? Thank you    my try: $$\Longleftrightarrow \cos{x}\cdot x^3<(\sin{x})^3$$  let $$f(x)=\cos{x}\cdot x^3-(\sin{x})^3$$ $$\Longrightarrow f'(x)=-\sin{x}\cdot x^3+3\cos{x}\cdot x^2-3(\sin{x})^2\cos{x}$$


Over on stack-overflow, I have 2 or 3 questions that have over 1000 page views and its hard for me to believe that they only have 1 up-vote each. I am not saying my questions deserve it, but I have seen some really stupid questions that have way more, with less views. No examples at the moment, but I am sure you have all seen them...  This is either due to my questions not being useful at all except for myself, or there are a lot of lurkers out there that find them in search but never take the time to sign and up-vote if they were helpful.  SO should implement a sign in after X amount of web site visits or something similar. That feature is really annoying but if cache isn't cleared then the login will persist... I don't think questions are getting represented accurately enough both positively and negatively. Who knows, maybe all my questions suck and I would be getting 100 down votes.

Wouldn't requiring everyone to register weed out a lot of flaky people?  What is the "benefit" of allowing people to ask questions without registering first?


Why exactly does the latter case in Python doesn't yield the result 3.3?  >>> 1.0 + 2.3 3.3 >>> 1.1 + 2.2 3.3000000000000003   It doesn't seem to make any sense to me what is going on here. What are the limitations here for the representation of the same result that you are getting through 1.0 + 2.3 but not through 1.1 + 2.2?

I want a to be rounded to 13.95.  >>> a 13.949999999999999 >>> round(a, 2) 13.949999999999999   The  function does not work the way I expected.


Will Ubuntu 14.04 support WUBI? Or will another alternate Windows Installer be available? I work on a lab network with PC Devices which ETH and USB hardware has been removed, and we use a different bus technology. Wubi was the only way to install Ubuntu, so we are waiting for Wubi to be updated for the next LTS release.  We appreciate your advice and thank you for your help. -Bran

Is it possible to use Wubi for Ubuntu 13.04? I read that it will not be supported in the official release due to some problems. Is this going to change in the future, and can we expect to see a future release with support for 13.04?


The LaTeX in my system cannot support Sweave compilation to pdflatex, it warns for missing .sty files. I want to clean my system and reinstall a more complete LaTeX. What is the better way for doing so?

When I installed TeXLive2012 on Linux some time ago, I had to follow .  For the new release, as of yesterday, will I need to mimic the procedure from 2012 or can it be done in an easier fashion this time?  Or does it have to be installed in an entirely different way?  Edit 2:  After uninstalling:  Setting up tex-common (3.15) ... Directory /etc/texmf/ not writeable. Exiting. dpkg: error processing tex-common (--configure):  subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing:  tex-common E: Sub-process /usr/bin/dpkg returned an error code (1)   Edit 3:  Now, whenever I run commands in the terminal, I receive this:  Need to get 0 B of archives. After unpacking 0 B will be used. Setting up tex-common (3.15) ... Directory /etc/texmf/ not writeable. Exiting. dpkg: error processing tex-common (--configure):  subprocess installed post-installation script returned error exit status 1 No apport report written because MaxReports is reached already                                                               Errors were encountered while processing:  tex-common  E: Sub-process /usr/bin/dpkg returned an error code (1) A package failed to install.  Trying to recover: Setting up tex-common (3.15) ... Directory /etc/texmf/ not writeable. Exiting. dpkg: error processing tex-common (--configure):  subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing:  tex-common   This occurred when I ran sudo aptitude update and then running upgrade.  I followed everything from cmhughes link on removing TeXLive.


i'm trying to understand wether my model has good performance or not. I have binary classifier for summarization sentences: important or not (extractive approach) on specific corpus.  Dataset is imbalanced: class 1 - 8K samples, 0 -  32K  As i understand accuracy is not valid metric, and AUC ROC too because of imbalance. So i use average precision, F1, F2 metrics. As baseline i've used SVM, it shows AUC ROC 78% but AP - 20%.  I use CNN with words embeddings and have such values:  Accuracy: 27% AUC ROC - 70% Average precision - 40% Precison class 1 - 27%, class 0 - 95% Recall class 1 - 85%, class 0 - 55% F2 - 59% F1 - 41%  In my task it's better that classifier can find positive class. But i'm worrying about false positives.  I wonder when can i say, that model is good enough? I've read some articles where authors says different : F1 should be > 50%, others - it could be 40-50%.  so my question is model have good performance or i should tune it?   if you have questions, don't hesitate)

This is a general question that was asked indirectly multiple times in here, but it lacks a single authoritative answer. It would be great to have a detailed answer to this for the reference.  , the proportion of correct classifications among all classifications, is very simple and very "intuitive" measure, yet it may be a . Why does our intuition misguide us here and are there any other problems with this measure?


A population has a density function given by f(x)=(k+1)x^k 0<x<1 0 otherwise For n observations,x1,x2,x3...xn made from this population, find the maximum likelihood of k. Here's my attempt: I have got k=-1-n/(product of log xi fron i=1 to i=n). Im not sure if it's correct. Can somebody help?

Let $X_1, \cdots, X_n$ be a random sample from the PDF: $f(x;\theta) = (\theta + 1) x^{\theta}$ with $0<x<1$ and $\theta > -1$.  The likelihood function is: \begin{align} L(\theta) &= f(x_1, \cdots, x_n; \theta) \mathbb{1}\{0<x<1\} \mathbb{1}\{\theta >-1\}\\ &= \prod_{i=1}^{n}{f(x_i ; \theta)}\mathbb{1}\{0<x<1\} \mathbb{1}\{\theta >-1\}\\ &= \prod_{i=1}^{n}{(\theta+1)x_i^{\theta}}\mathbb{1}\{0<x<1\} \mathbb{1}\{\theta >-1\} \\ &=(\theta+1)^n \left( \prod_{i=1}^n{x_i}\right)^\theta \end{align}  We look at the log likelihood $l(\theta)$ and take the derivative of this since it is easier to deal with and it is allowed because the log is monotonic:  \begin{align} l(\theta) = n\log(\theta+1) + \theta \left( \sum_{i=1}^n{\log(x_i)} \right) \end{align}  $\implies \frac{d}{d\theta} = \frac{n}{\theta+1} + \sum_{i=1}^n{\log(x_i)} = 0$  $\implies \hat{\theta}_{MLE} = -\frac{n}{\sum_{i=1}^n{\log(x_i)}} - 1$  However, this doesn't look right.


Can I use dd command to clone my entire Ubuntu install along with grub into external hard drive and use it for portability?

I have done half an hour reading around to prepare to clone my hard drive.  It has multiple partitions, including a Windows partition.  I am going to buy a very large external hard drive for the backup.  I would like to be able to use this clone to restore the whole drive in case something goes wrong (I'm about to do some OS re-shuffling).  I want do learn how to do this using dd, as I like low-level tools that don't require installing anything.  I found the following useful code from the  (entered from a root shell using a live CD):  dd if=/dev/hda of=/dev/hdb & pid=$! while kill -USR1 $pid; do sleep 1; done   (I know that I will have to edit the input and output locations.)  However I have two questions.  The first one is very noobie: this command is split across two lines.  Surely when I press enter after the exclamation mark it will start the process?  Two, on other sites it recommended entering block size.  Like this:  # dd if=/dev/hda conv=sync,noerror bs=64K of=/mnt/sda1/hda.img   I don't know anything about block sizes.  Is 64K right?  It looks like my block size is 512 bytes from the following, the output of sudo fdisk -ul:  Disk /dev/sda: 750.2 GB, 750156374016 bytes 255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0xc3ffc3ff     Device Boot      Start         End      Blocks   Id  System /dev/sda1   *          63   143364059    71681998+   7  HPFS/NTFS/exFAT Partition 1 does not start on physical sector boundary. /dev/sda2       976867328  1465147391   244140032    7  HPFS/NTFS/exFAT /dev/sda3       143364094   976867327   416751617    5  Extended Partition 3 does not start on physical sector boundary. /dev/sda5       143364096   162895871     9765888   82  Linux swap / Solaris /dev/sda6       162897920   205864959    21483520   83  Linux /dev/sda7       205867008   976867327   385500160   83  Linux  Partition table entries are not in disk order  Disk /dev/mapper/cryptswap1: 10.0 GB, 10000269312 bytes 255 heads, 63 sectors/track, 1215 cylinders, total 19531776 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x433bb3a7  Disk /dev/mapper/cryptswap1 doesn't contain a valid partition table   Thank you.


i have errors withing sudo apt-get update  W: GPG error: http://archive.ubuntu.com trusty Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>   i try this commands:  sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5   and this   cd /var/lib/apt sudo mv lists lists.old sudo mkdir -p lists/partial sudo apt-get update   but i still have the same problem

I frequently cross this issue, and always have to google for an answer. Does anyone have a permanent fix for BADSIG errors from apt-get?     W: GPG error:    lucid   Release: The following signatures were   invalid: BADSIG 54422A4B98AB5139   Oracle Corporation (VirtualBox archive   signing key)


I'm about to switch from windows to ubuntu but I'm pondering if I should do a whole format when installing ubuntu or keep windows on the side. I'm saving some files that I care about on an external hard drive but I'm anxious I might miss some of those. I don't save everything because it's too large (and larger than my hdd).  My question is whether I should do a full format or install ubuntu in another partition :   Since I might miss some files and I'm planning to install ubuntu and let the windows install intact (until I'm sure there is no file I forgot to save). I'm planning to remove the windows files in the upcoming months. I'm wondering if making an install "next to" windows is not as clean as doing a full formatting ? In other words, ubuntu will be installed in another partition (I guess) then the windows partition will be deleted, will ubuntu then take the whole hard drive for itself ? Will there be any residual garbage from windows ?   If it's indeed cleaner to remove everything and install ubuntu I'll take the risk of missing some files.

Is it really safe to choose the "Install Ubuntu alongside Windows" option from the Ubuntu installation program?  I never used that option, instead I used other tools such as partition magic or windows 7's disk tool to resize my partitions.  Since I'm going to install Ubuntu across a lot windows (XP, Vista and 7) machines. It would not be nice to damage those Windows partitions.  What is your experience? Can I use this feature without concerns?


I would like to remove a java process in the system tray called LRAT.  When I right-click on the icon there is no context menu and no exit option.  When I double-click on it, nothing seems to happen.  I noticed it first after I updated the Adobe Flash player plugin, but I doubt it had anything to do with it.  Nothing in the Process Explorer is called LRAT, and a search on the net produce nothing except links to RAT Trojan horse.  Any help is greatly appreciated.

Is there any way to find out what process created a given icon in the system tray? A new icon has appeared that I don't recognize and I would like to find out what process spawned it.


All of a sudden my Toolbox in ArcGIS 10.1 for Desktop has stopped working.  Last week i was using clip tool but the toolbox window was blank, i tried other tools but it shows the same blank window.

I recently installed ArcGIS 10.3.1 and now all the toolbox functions (that I have tried) open, but they have no parameter fields. For example, the "Add Field" tool comes up with the standard toolox dialog with the title bar, buttons at the bottom, and a functional help panel, but the rest of the dialog is entirely empty.  I've run a repair on the installation.  Has anyone else seen this? Any fixes?  Same thing after uninstalling all ArcGIS applications and reinstalling. Other details: Windows 7, 64 bit, SP1, Intel CPU


When importing dxfs, you get a window asking you to select vector layers to add. With all the dxfs I've imported so far, that has had two layers called entities, one of which is points and one of which is linestrings. I select all, click OK, and then the file imports. This has to be done for each dxf. Today I had to import approximately 200 dxfs (which I eventually combined using the data management tools.) Having to click on select all and then on OK, to select the vector layers for each and every one of those dxfs was very tedious! Is it possible to set QGIS to select all automatically as it imports dxfs, without my having to sit there for half an hour repeating those clicks? The dxfs were created from NTF tiles, using the LL2DXF converter. Unfortunately, many of them will not open in Autocad due to an invalid block name so I can't combine them in CAD if there are lots. I do have a script that can strip out the blocks, but it is a little slow and has to be used one file at a time. That's OK for a small number, but today I had a very large area of map to convert and there are other towns to do over the coming weeks.

Can somebody help me with loading a dxf file as a vector layer with PyQGIS?  Is QgsDataSourceURI an option? I've tried it with this code, but it didn't work.  fitxer="/tmp/prova.dxf" uri = QgsDataSourceURI() uri.setDatabase(fitxer) uri.setDataSource('', 'entities', 'OGR_GEOMETRY', "OGR_GEOMETRY='POINT'", 'fid')  layer = QgsVectorLayer(uri.uri(), 'prova', 'ogr')  print 'isValid:', layer.isValid()


I have below Python code:  class Shape(object):      def draw(self):         raise NotImplementedError   class Triangle(Shape):      def draw(self):         print("draw triangle")  class Square(Shape):      def draw(self):         print("draw square")  t = Triangle()   I want to get the instance t's class's name(string).   How can I get it?

How do I find out a name of class that created an instance of an object in Python if the function I am doing this from is the base class of which the class of the instance has been derived?  Was thinking maybe  might have helped me out here, but it doesn't seem to give me what I want. And short of parsing the __class__ member, I'm not sure how to get at this information.


I have some data on a drug where doctors are trying to find out based on collected data how many patients get heart disease because of a drug.  The output is the following:  95%CI 1.72(1.28-2.30) for the patients are taking this drug   95%CI 1.30(1.21-1.40) for the patients which are not taking the drug  Therefore we conclude that there is a 42% absolute increase for getting the heart disease compared to the no users. I think I’m right here?  Back to the CI-95%,, does this mean that if the study was repeated with another sample and the parameters being the same (age, sex, other diseases, other medications taken) that 95% out of the sample (let’s say a sample of 100 people which would then be 95 patients) would show the same amount of people getting the heart disease? Is this what the CI is all about? Because if we take a random sample but not with the same parameters values (age, sex, other diseases, other medications) we wouldn't get even close to the 95% we would have a 20% match or so..  In essence would the other sample yield the result of 95% of the patients being in the 1.28-2.30 interval and the other 5 % being outside of the interval?

I know roughly and informally what a confidence interval is.  However, I can't seem to wrap my head around one rather important detail:  According to Wikipedia:     A confidence interval does not predict that the true value of the parameter has a particular probability of being in the confidence interval given the data actually obtained.     I've also seen similar points made in several places on this site.  A more correct definition, also from Wikipedia, is:     if confidence intervals are constructed across many separate data analyses of repeated (and possibly different) experiments, the proportion of such intervals that contain the true value of the parameter will approximately match the confidence level   Again, I've seen similar points made in several places on this site.  I don't get it.  If, under repeated experiments, the fraction of computed confidence intervals that contain the true parameter $\theta$ is $(1 - \alpha)$, then how can the probability that $\theta$ is in the confidence interval computed for the actual experiment be anything other than $(1 - \alpha)$?  I'm looking for the following in an answer:   Clarification of the distinction between the incorrect and correct definitions above. A formal, precise definition of a confidence interval that clearly shows why the first definition is wrong. A concrete example of a case where the first definition is spectacularly wrong, even if the underlying model is correct.


Let $p_n$ the $n^\text{th}$ prime number.  I mean $p_1=2,p_2=3,p_3=5,...$ now consider this series $\displaystyle \sum_{n=1}^{\infty}\frac{1}{p_n}=\frac12+\frac13+\frac15+\frac17+... $  I know $\displaystyle \sum_{n=1}^{\infty}\frac{1}{n} \to \infty$ (harmonic series)  now I am looking for a simple proof to  show $$\sum_{n=1}^{\infty}\frac{1}{p_n}=\frac12+\frac13+\frac15+\frac17+... \to \infty$$ thanks in advance.

Is this series known to converge, and if so, what does it converge to (if known)?  Where $p_n$ is prime number $n$, and $p_1 = 2$,  $$\sum\limits_{n=1}^\infty \frac{1}{p_n}$$


I want to create reports with jasper in java by using eclipse, but I get awalys this exection:        Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/ReferenceMap      at net.sf.jasperreports.engine.util.JRSingletonCache.<init>(JRSingletonCache.java:53)      at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.<clinit>(JRXmlDigesterFactory.java:181)      at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:205)      at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:170)      at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:154)      at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:146)      at at.campus02.bp2.knapp.main.testReport.main(testReport.java:27)     Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.ReferenceMap      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)      ... 7 more     This is my code:    import java.util.HashMap; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JasperCompileManager; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.view.JasperViewer;  public class testReport {   public static void main(String[] args) {   // TODO Auto-generated method stub    try {    String stringPath = System.getProperty("user.dir") +"\\init\\Blank_A4.jrxml";    //System.out.println(stringPath);      HashMap<String, String> param = new HashMap<String, String>();        JasperReport jr = JasperCompileManager.compileReport(stringPath);    JasperPrint jp = JasperFillManager.fillReport(jr, param);    JasperExportManager.exportReportToPdf(jp); //   JasperViewer.viewReport(jp);       }    catch (JRException e) {    // TODO Auto-generated catch block    e.printStackTrace();   }  } }     These are the JARs and class folders in the project:   commons-beanutils-1.9.2.jar commons-collections-3.2.1.jar commons-digester-1.8.jar commons-logging-1.2.jar groovy-all_2.0.1.jar jasper-compiler-jdt-5.5.9.jar jasperreports-4.0.0.jar   I hope someone can help me with the problem. Thanks!

I am getting a NoClassDefFoundError when I run my Java application.  What is typically the cause of this?


Whenever I connect my bluetooth earbuds to my Mac, there is a noticeable audio lag when watching videos. How do I solve this. I use my earbuds with my Android phone and they work perfectly.

I have a bit of an odd situation, and wanted to ask for ideas.   Recently started connecting a JBL Charge 2+ to my MBA 11 inch, mid-2013, via Bluetooth. I noticed that there's clear delay between sound event and sound being audible via the JBL.   The problems persists across applications (so for example, playing video via VLC means the sound isn't synced, same for youtube videos in different browsers, same for mp3s that start playing with a small delay, etc.)  The delay is minor, but noticeable, in the range of 0.5s I'd say.  At first I thought it might be a Bluetooth driver issues, but now I found out the following: just connected another JBL device, a Flip 3 to the same MBA, and the sound plays without noticeable delay. I'm not sure if they use the exact same drivers, but now I'm wondering:   Is there a chance that it's a hardware problem? Didn't really consider this a possibility, but now I'm not sure anymore. How to test, and, ideally, fix this issue? How can I isolate the reason for the audio lag with the Charge 2+?   Any help would be appreciated!


I'm beginner on python,  I'm developing a Python 3 application on my own computer (LINUX) and  I have to give a final standalone version on Windows 64 to my teacher.  My question is how to compile a python program on Windows, what's tools are generally used to programming python on windows and how to handle dependencies module (Sklearn, OpenCV  ...etc).  Thanks in advance !

I thought I heard that  was able to do this, but I never figured it out.  Has anyone successfully done this?  Can I see your setup.py file, and what command line options you used?  Basically I'm thinking of it giving me a single executable file that does something like unzips itself to maybe /temp and runs.


here is my problem...  i use ajax and jquery to fill up a form...  the user chooses something in a select, and, as he has chosen this or that, ajax returns data, and this data is placed into the form...  sometimes, new elements are created with the ajax data return, example :   ajax returns "blahblah", then i put it in my form, like this :  $("#myDiv").empty(); $("#myDiv").html(ajaxReturn);   IT WORKS FINE! BUT :   the new elements i put into my form are not observed anymore by my jquery...! i have a function like this :  $("#xxxx").on("change",function(){     alert("something"); });   this function works great for the element i have in my form at PAGE LOAD, once this element is replaced by another coming from my ajax call, EVEN IF it has the same ID as the previous one, the actions on it are no more spotted by JQuery...  how can i solve that?  (i really need to replace my select with my ajax return, because sometimes it's no more a select but an input text i need...)  thanks for advices :)

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.


Recently I started learning Apex programming.  I was trying to get some examples, but I could not find enough to practice my code.  Please provide me links or exercises so that I could practice concepts like class, objects, soql, dml etc.

I am new to salesforce. I dont have coding background. Please let me know bst way to learn apex coding?


The sun is shining and a spherical snowball of volume 340  ft$^3$  is melting at a rate of 10 cubic feet per hour. As it melts, it remains spherical. At what rate is the radius changing after 2.5 hours?  Please help I'm really confused 340-10*2.5 = 315 so (-10) = 4pi/3 * ?

The sun is shining and a spherical snowball of volume 340 ft$^3$ is melting at a rate of $10$ cubic feet per hour. As it melts, it remains spherical. At what rate is the radius changing after $2.5$ hours?   And this answer is wrong? please help $10\times 2.5 =25$ $340 - 25 = 315$ so $r^3 = \dfrac{315\times 3 }{ 4\pi}$ $r= 4.2$ ft


Cloudflare  Cloudflare has the options Universal/Flexible SSL, which basically allow websites to serve their website over HTTPS by using a certificate from Cloudflare.  Besides the fact that Cloudflare always acts as a man-in-the-middle, here the connections from Cloudflare to the origin server  (with Universal/Flexible SSL), or Full SSL only use a self-signed certificate which is also quite unsecure.  , but at least they have two options which may be considered quite secure (Keyless SSL and Full SSL (Strict)) as there the real Stack Exchange certificate is used.  AFAIK, unless Stack Exchange uses Keyless SSL, you do not know what mode they use, because in all other modes you only see a certificate issued for ssl*.cloudflare.com with an Subject Alternative Name for the real domain. .  meta.*.stackexchange.com  But it's getting worse: You have no HTTPS at all on these sites. E.g. look at one of the most ironic domains:  or  , and I know you cannot solve it, because you cannot use a wildcard TLS certificate there. There was also a  about this issue (BTW: Site uses Cloudflare SSL too).  But this blog post is from 2013. Come on: We have 2016 now and you neither have other subdomains nor HTTPS on these domains. Nowadays we even have automated  (Let's Encrypt) so there is really no problem to get certificates for all these domains. And we have HTTP headers [which can make the migrating from HTTP to HTTPS very easy (see scotthelme.co.uk/migrating-from-http-to-https-ease-the-pain-with-csp-and-hsts/).  Some of the arguments in the blog post are already outdated (e.g. the Google rank argument [today Google even ranks sites with HTTPS heigher] and the third-parties [AFAIK all of the listed ones there support HTTPS now]) and all in all you also did not keep your promise:     We’ll be working on it over the next 6-8 weeks.   in the blog post     We will be working on it in 2014   in   Also note it is a big security risk when you send cookies over unsecure connections. I don't know how your authentication system is designed, because with different cookies for insecure connections (over HTTP) and secure ones (over HTTPS) you can mitigate this risk a bit - similar to the way Amazon does it, but this is still a bad workaround.  When will we get HTTPS?  Additionally there are still sites with Mixed Content errors (on the home page!). E.g. on  you load an image from . Just adding an s there would fix this.  Even big news sites have managed (see developer.washingtonpost.com/pb/blog/post/2015/12/10/moving-the-washington-post-to-https) to switch to HTTPS and according to their blog post this was not an easy step either. In 2016 it's amazing to see such a famous site to not have complete HTTPS support.

So it looks like Stack Exchange now supports HTTPS (to some extent). Which is awesome! But there are a few problems, the main one being that some content is delivered over the CDN, which is plain HTTP. This causes browsers to complain about "unsecured content":


I use SE and SO a lot. I am so thankful for all the folks who volunteer their time to help me and answer my questions. While I want to, I rarely have time to give back by answering other folks' questions. I feel terribly guilty about this.  I got to thinking, I wouldn't mind paying a membership fee/dues for SE/SO if some of that fee/due went back to the folks who answer questions. Honestly, I wouldn't mind paying $50 USD a month.  I don't know how difficult/complex it would be to set up but I figure the logic would calculate payout based on how many answers you provide that are selected as answers and how many up-votes you get.  Or, if SE/SO tied with some money transfer service so we could quickly "thank" answers by sending them money (how much ever we pick).  I was looking back at all my questions, the answers, and how much time they saved me and I see almost $500 USD value in the collective answers. If there was a way to do it I would gladly pay folks who answered my questions $5 USD for each answer.

If we are effectively generating more traffic to Stack Exchange sites, would it become a better community if users were compensated somehow besides rep points? Even with minuscule alt coins?


My use case is this: There are a number of implementations of an interface, ICommand, that are JSON-serialized and sent to another system where they are deserialized and used. Part of the interface spec is a string property with the name of the specific type, since a type is needed for deserialization. Reading the type name from the JSON string and switching based on that is simple and it works, but it's also ugly and the switch needs to be updated every time a new implementation is added or a type name is changed for any reason: Match match = Regex.Match(json, "\"TypeName\":\".*?\""); if (match.Success) {     // Add cases here as new command types are defined     switch (match.Value)     {         case "\"TypeName\":\"TypeNumberOne\"":             return JsonConvert.DeserializeObject<TypeNumberOne>(json);          default:             break;     } }  What I'm hoping to be able to do is generalize the deserialization in some way. What I'm trying right now is reading the type name out of the JSON and using Type.GetType to get the type, which I'd like in some way to pass to JsonConvert.DeserializeObject<T>. I can get the type just fine, but I can't figure out how to pass it as the T. This return JsonConvert.DeserializeObject<Type.GetType(string.Format("namespace.{0}", typeName))> (json);  and this return JsonConvert.DeserializeObject<Type.GetType(string.Format("namespace.{0}", typeName)).MakeGenericType()> (json);  won't even compile; Intellisense says Operator '<' cannot be applied to operands of type 'method group' and 'Type' - evidently it's not seeing the Type-valued expression as a usable T. Assigning the result of the expression to a variable: Type commandType = Type.GetType(string.Format("VITL.Library.Commands.{0}", typeName)); return JsonConvert.DeserializeObject<commandType> (json);  results in 'commandType' is a variable but is used like a type. Is there a way to derive a type at runtime such that it can be used in invoking a generic function?

What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?  Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod<T>() using the Type stored in the myType variable?  public class Sample {     public void Example(string typeName)     {         Type myType = FindType(typeName);          // What goes here to call GenericMethod<T>()?         GenericMethod<myType>(); // This doesn't work          // What changes to call StaticMethod<T>()?         Sample.StaticMethod<myType>(); // This also doesn't work     }      public void GenericMethod<T>()     {         // ...     }      public static void StaticMethod<T>()     {         //...     } }


Is there any analog in Objective-C to the TreeSet or TreeDictionary in Java. Basically, either a Set or Dictionary data structure that's implemented via a tree (sorted) versus a hash table (un-sorted).   Thanks!

I have an NSDictionary (stored in a plist) that I'm basically using as an associative array (strings as keys and values).  I want to use the array of keys as part of my application, but I'd like them to be in a specific order (not really an order that I can write an algorithm to sort them into).  I could always store a separate array of the keys, but that seems kind of kludgey because I'd always have to update the keys of the dictionary as well as the values of the array, and make sure they always correspond.  Currently I just use [myDictionary allKeys], but obviously this returns them in an arbitrary, non-guaranteed order.  Is there a data structure in Objective-C that I'm missing?  Does anyone have any suggestions on how to more elegantly do this?


This seems like a silly question but when I try to download the 64-bit lubuntu from the main website but I can only get the AMD version. When I tried to install, it did not get recognized by my machine. My machine has the following processor:  Intel(R) Core(TM) i5-4590S CPU @ 3.00GHz  I would think the amd64 version would not run on an Intel machine as they are different architectures. But as I am perusing through their downloads page  I find the AMD 64-bit version is the only 64-bit available. I successfully installed the i386 version. Anyways, don't want to go to the trouble of downloading and trying again since I've already progressed with the i386 version for some time now so hopefully asking here will save some grief and gain some knowledge. What am I missing?

My processor is an Intel Core 2 Duo P8600 (2.40GHz). As far as I know that's a 64-bit processor - I'm a bit confused as the architecture is called AMD 64, is this a generic name given to 64-bit architectures? I've heard of x64 but can't see a release labelled with this.


I'm using TeXnicCenter and it generates pdfs fine but doesn't open them. Adobe pdf reader opens up but not the pdf. TeXnicCenter fails a command and this appears:    What's happening and how do I fix it?    UPDATE:    UPDATE 2:

How to configure TeXnicCenter to work with Adobe Reader DC? When I building and view current file .tex the following error "Can not execute the command" shows up and the PDF is not generated.    If there are any related post, could help. Thanks a lot!


Unfortunately, our hosting provider experienced 100% data loss, so I've lost all content for my hosted blog website:  www.financewalk.com   Yes, I know I should have done complete offsite backups. Unfortunately, all my backups were on the server itself.   Can you please mention any solution/ tools that will help me recover my lost data?  Thanks, Avadhut

Unfortunately, our hosting provider experienced 100% data loss, so I've lost all content for two hosted blog websites:       (Yes, yes, I absolutely should have done complete offsite backups. Unfortunately, all my backups were on the server itself. So save the lecture; you're 100% absolutely right, but that doesn't help me at the moment.  Let's stay focused on the question here!)  I am beginning the slow, painful process of recovering the website from web crawler caches.  There are a few automated tools for recovering a website from internet web spider (Yahoo, Bing, Google, etc.) caches, like , but I had some bad results using this:   My IP address was quickly banned from Google for using it I get lots of 500 and 503 errors and "waiting 5 minutes…" Ultimately, I can recover the text content faster by hand   I've had much better luck by using a list of all blog posts, clicking through to the Google cache and saving each individual file as HTML. While there are a lot of blog posts, there aren't that many, and I figure I deserve some self-flagellation for not having a better backup strategy. Anyway, the important thing is that I've had good luck getting the blog post text this way, and I am definitely able to get the text of the web pages out of the Internet caches. Based on what I've done so far, I am confident I can recover all the lost blog post text and comments.  However, the images that go with each blog post are proving…more difficult.  Any general tips for recovering website pages from Internet caches, and in particular, places to recover archived images from website pages?  (And, again, please, no backup lectures. You're totally, completely, utterly right! But being right isn't solving my immediate problem… Unless you have a time machine…)


This question is about ZSH, not bash.  I have the following lines in my .zshrc file.  Whenever I open a terminal I get a no matches found error referencing the line with the if statement.  if [[!( -a ~/.zkbd/$TERM-${${DISPLAY:t}:-$VENDOR-$OSTYPE} )]]; then     zkbd fi   I read through the ZSH documentation and my if statement appears to be correct.  I don't understand why I'm getting the error.  What I'd like to happen is for the zkbd utility to run if the file in the .zkbd folder does not exist.

I tried using this:  $ if [$a == 1] then { echo 'yes'; } fi;   but I get an error:  -bash: syntax error near unexpected token `}'   What is the correct format?  I tried several with no luck.


I'm making models that has only used few colors. For instance, if there is a gun with arm, the gun only uses 2~3 colors and the arm only requires one.  First what I did was creating multiple materials and assign them to faces without UV mapping. Note that these models were used for my personal game project with Unity Engine.  But the problem is that each material requires high rendering costs in Unity, so I had to reduce the number of material as I possible.  So I changed my models to have single material with UV mapped, and painted textures from Substance Painter 2. But the problem is that it still only needed a few colors but texture images are too big. I want to make texture as small as possible, but I have no idea how to do.  I think it will be good if I can assign UV map to each pixel has different color. Is there a way to achieve this?

First of all, I'm not very familiar with texturing.  So what I want to do is have one texture with a selection of colors as such:    And use that to color my (low poly) models to prevent having to use multiple materials.  If my question still remains unclear. This is what I want my models to look like, by only using one texture.    Is this possible? Any help is appreciated :)


I need to modify the header for this chapter but avoiding modifications in other chapters and the  ToC.   MWE:  \documentclass[11pt,letterpaper,oneside]{book} \usepackage[utf8]{inputenc} \usepackage[spanish]{babel} \usepackage{lipsum} \begin{document} \chapter{Integración del MCC con herramientas de Gestión de Mantenimiento Asistido por Computadora} \lipsum \end{document}   The "issue"

I am writing a book and one of my chapters has a very long title. As it can't be displayed correctly on the top of even pages, I provide a "short title name" via the   \chapter[short title]{long title}   command. But then, "short title" appears in the table of contents instead of the original/true/long one.  How can I have the "short title" in the header of even pages, and the "long title" in the ToC and in the "Title header"?  For reference, here is the code I use:  \documentclass[11pt,a4paper]{book} \begin{document} \tableofcontents  \chapter[Short title]{Very vey very very very very very very long title     i can't display in the header} Lorem ipsum dolor sit amet, consectetur adipiscing elit. \end{document}


I always buy Alpro's vegetable milks that don't have a sweet smell (I think it's vanilla). This week I couldn't find it. I want to make a white sauce for potatoes. Is there anything I can do to improve this smell?

This happens to all of us - be it because we misread the recipe and threw in a tablespoon of sage when it said a teaspoon of sage, or because we were bravely experimenting with new tastes and suddenly noticed something amiss. The question also covers cases where the food is normally seasoned for the average person, but an eater hates a certain aroma and perceives it as strongly unpleasant, and cases where the unwanted aroma does not come from seasoning, but e.g. from burning the food.   In the end, we have a batch of smelly food and wonder where the Undo button is. How do we save it and make it tasty again?


I am wondering how can I change default screenshots to jpg, specially  for MPlayer where default shots are in png which renders the images too large.

I want to make all screenshots I take jpeg automatically -- not png. I am using Ubuntu 12.04.


how can I merge two objects of objects into one object?  Example  let obj1 = {monkey:{size: 120, color: "black"}, cat: {size: 30, color: "gray"}}  let obj2 = {monkey:{country: "africa", test: "test"}, cat: {country: "all", testCat: "testCat"}}   Output should be :  {monkey:{size: 120, color: "black", country: "africa", test: "test"}, cat: {size: 30, color: "gray", country: "all", testCat: "testCat"}}   I dont know how many animals are there.  something like this  let merged = {...obj1, ...obj2}

I need to be able to merge two (very simple) JavaScript objects at runtime.  For example I'd like to:  var obj1 = { food: 'pizza', car: 'ford' } var obj2 = { animal: 'dog' }  obj1.merge(obj2);  //obj1 now has three properties: food, car, and animal   Does anyone have a script for this or know of a built in way to do this?  I do not need recursion, and I do not need to merge functions, just methods on flat objects.


I'm working through OSCP course where I'm getting familiar with terminal-based text editors. I'm quite comfortable with Nano and this material says that penetration testers have reported that Vi editor saved them a great deal of time. How so ? I mean, Nano editor is so straightforward and yet Vi gets the praise.

I have recently started using Ubuntu and hence, the terminal.  As text editor, I have used the pre-installed nano. Now I wonder whether I should install and use vim as well.  What are each of those text editors' special features, advantages and disadvantages? Which one is better suited for newcomers, and for what use cases would the other be preferable?


I work with this perimeter\area fields:    i created it with "Add geometry columns" vector tool. How can i create a dynamic perimeter\ area fields, so when i create a new feature or change existed feature- those fields will be change also.    I try to seek the solution by create a new area field and try to find the correct expression in the field calculation, but with no success.  I can use again the "Add geometry columns" vector tool, so the attribute table will be update- but this solution is very clumsy.

I'm using QGIS 2.6 and regularly update a shapefile layer to indicate felling progress. However, if I edit the nodes of a polygon, save the layer out then look at the Attributes table the area shown doesn't change.


I have been building a PHP web application using the following techniques in the past 2 months:   PHP 5.3.4 MongoDB MySql   I just got my dedicated server running Ubuntu 10.4 LTS x64 with the following hardware:   100Mbit networking speed 120GB SSD  16GB RAM @ 1600 MHZ AMD FX 6100 6 core CPU @ 1400 MHZ each core (3600 MHz total) Linux Kernel 2.6.33 (to support SSD trim) Ubuntu 10.4 LTS x64   The static content for the web application is (uncompressed, unminified) 200kb total. The PHP web application required scalability, it can get a lot of traffic in the start.  Now I have a few questions:   What should I configure in terms of DDOS protection, I got no competitors, the project is  underground and unknown, so what should I consider? What would help me with this since there are so many things around like use a Nginx mod or use Iptables? And how can I configure these? How can I calculate the bandwidth, and how much traffic the server can handle?

This is a  about DoS and DDoS mitigation.   I found a massive traffic spike on a website that I host today; I am getting thousands of connections a second and I see I'm using all 100Mbps of my available bandwidth.  Nobody can access my site because all the requests time out, and I can't even log into the server because SSH times out too!  This has happened a couple times before, and each time it's lasted a couple hours and gone away on its own.  Occasionally, my website has another distinct but related problem: my server's load average (which is usually around .25) rockets up to 20 or more and nobody can access my site just the same as the other case.  It also goes away after a few hours.  Restarting my server doesn't help; what can I do to make my site accessible again, and what is happening?  Relatedly, I found once that for a day or two, every time I started my service, it got a connection from a particular IP address and then crashed.  As soon as I started it up again, this happened again and it crashed again.  How is that similar, and what can I do about it?


I am not able to find dconf in ubuntu-12.04 desktop-32 bit?

Mark Shuttleworth  about the decision to include the Qt libraries in the 11.10 release, with a  Jono Bacon. Mark states that the biggest challenge to integrating apps written in Qt into the larger Ubuntu system is Qt's current non-compatibility with dconf.  What is dconf, and what is the role it plays in Ubuntu?


I'm writing a simple complex number C++ implementation as practice for overloading operators. One of the operators I simply cannot get past is <<. I get an undefined reference error to it whenever I try to call it.  is a gist link to my code. I am compiling it with the following:  g++ -std=c++11 main.cpp complex.cpp -Wall -Wextra -o complex   In addition to the unused parameter warning in main(), I get the following:  /tmp/cc7qVwEF.o: In function `main': main.cpp:(.text+0x1c5): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& rob::operator<< <char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, rob::Complex const&)' collect2: error: ld returned 1 exit status

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 am trying to print a simple value for $AR1_p1 but the variable $i is not evaluating. for i in 1 2 3 4 do     AR1_p1=22     AR1_p2=23     AR1_p3=24     AR1_p3=25     echo $AR1_p$i done   It's like concatenating dynamically. Any suggestions on how to fix this?.


For natural numbers $a$ and $b$, show that $a \Bbb Z + b \Bbb Z = \gcd(a, b)\Bbb Z $  I just basically said that the gcd of a and b { written as C } obviously divides aZ and bZ, therefore it can be rewritten as  CdZ + CeZ -> C[dZ + eZ] -> CZ[d+e] where Cd=a and Ce=b.   if a and b and C are natural numbers, then  so are d and e. the sum of d and e is an integer, that when multiplied by an integer produces an integer. therefore  CZ[d+e] = CZ, so aZ + bZ = GCD(a,b)Z  { Where C is the gcd(a,b) }

Let $m \in \mathbb{Z^+} , n \in \mathbb{Z^+}$ and let $d=\gcd(m,n)$. Prove that  $$ m\mathbb{Z}+n\mathbb{Z}=d\mathbb{Z}. $$  My attempt is use inclusion to show. Let $a \in m\mathbb{Z}+n\mathbb{Z}$. Then we have $a=ms+nt$. Since $d=\gcd(m,n)$, by Bézout's Lemma, we have $d=ms+nt$ for some integers $s$, $n$. Hence, we have $a=ms+nt=d \in d\mathbb{Z}$. Let $a \in d \mathbb{Z}$. Then we have $a=db=msb+ntb \in m\mathbb{Z}+n\mathbb{Z}$. Is my proof valid?  Remark: the following is the part 2 of the question. Prove that $m\mathbb{Z}\cap n\mathbb{Z}=\frac{mn}{d}\mathbb{Z}$. This one I have no idea how to start


my webserver is running apache 1.3.x for a PHP application, along with mysql on the same machine. Most of the time it runs fine, CPU usage still with nice margin, but somehow memory usage keeps growing throughout uptime.  While it looks like it is chunked from time to time, I've had moments my server going down because it's out of memory. Restarting apache or mysql only reduced memusage by 100M.  Attached is an overview of monthly memory usage. The 2 massive drops are server restarts after out-of-memory situations.   Any explanations for his behaviour or how I could solve this?  Thanks! Steven

This is a  about how Unix operating systems report memory usage.   Similar Questions:                    I have production server that is running Debian 6.0.6 Squeeze  #uname -a  Linux debsrv 2.6.32-5-xen-amd64 #1 SMP Sun Sep 23 13:49:30 UTC 2012 x86_64 GNU/Linux   Every day cron executes backup script as root:  #crontab -e  0 5 * * * /root/sites_backup.sh > /dev/null 2>&1   #nano /root/sites_backup.sh  #!/bin/bash str=`date +%Y-%m-%d-%H-%M-%S` tar pzcf /home/backups/sites/mysite-$str.tar.gz /var/sites/mysite/public_html/www mysqldump -u mysite -pmypass mysite | gzip -9 > /home/backups/sites/mysite-$str.sql.gz cd /home/backups/sites/ sha512sum mysite-$str* > /home/backups/sites/mysite-$str.tar.gz.DIGESTS cd ~   Everything works perfectly, but I notice that Munin's memory graph shows increase of cache and buffers after backup.  Then I just download backup files and delete them. After deletion Munin's memory graph returns cache and buffers to the state that was before backup.  Here's Munin graph:  Externally hosted image was a dead link.


I am refactoring some code for several enum collections that support the [Flags] attribute.  I am trying to come up with a generic class that allows for common methods (adding, removing and checking enums exist in the collection etc).  I began with this code:  public class EnumFlags<T> {     protected T collection;      public void Add(T value)     {         this.collection = this.collection | value;     } }   However, I cannot use the | operator on type T.  I cannot add a constraint for T to be an enum (where T : Enum is not allowed).  Any ideas to approaching this problem?

I'm building a function to extend the Enum.Parse concept that  Allows a default value to be parsed in case that an Enum value is not found Is case insensitive  So I wrote the following: public static T GetEnumFromString<T>(string value, T defaultValue) where T : Enum {     if (string.IsNullOrEmpty(value)) return defaultValue;     foreach (T item in Enum.GetValues(typeof(T)))     {         if (item.ToString().ToLower().Equals(value.Trim().ToLower())) return item;     }     return defaultValue; }  I am getting a Error Constraint cannot be special class System.Enum. Fair enough, but is there a workaround to allow a Generic Enum, or am I going to have to mimic the Parse function and pass a type as an attribute, which forces the ugly boxing requirement to your code. EDIT All suggestions below have been greatly appreciated, thanks. Have settled on (I've left the loop to maintain case insensitivity - I am using this when parsing XML) public static class EnumUtils {     public static T ParseEnum<T>(string value, T defaultValue) where T : struct, IConvertible     {         if (!typeof(T).IsEnum) throw new ArgumentException("T must be an enumerated type");         if (string.IsNullOrEmpty(value)) return defaultValue;          foreach (T item in Enum.GetValues(typeof(T)))         {             if (item.ToString().ToLower().Equals(value.Trim().ToLower())) return item;         }         return defaultValue;     } }  EDIT: (16th Feb 2015) Christopher Currens has posted  below, which is well worth a look, and an upvote. I will remove this edit if the solution bubbles further up the page. EDIT 2: (13th Apr 2021) As this has now been addressed, and supported, since C# 7.3, I have changed the accepted answer, though full perusal of the top answers is worth it for academic, and historical, interest :)


We are working with two brochures, which we are looking to copy content from into one new brochure. These two brochures are different page sizes, and so image and text are different sizes as well.   What we would like to do is resize the pages of either brochure and copy them into the new brochure, keeping all the text and images in the same position and in tact (except smaller or bigger).  How would we go about doing this? Any help would be much appreciated!

I'm on Adobe Creative Cloud, so I have the latest InDesign, and I'm attempting to design a poster for my choir's next concert. Traditionally, I've done this in Photoshop, in two separate files, however I've recently started using InDesign after converting to it to create wedding albums through Blurb.  I've created an A4 document, and created an alternate-layout for it in A5. I've then lined them up side-by-side, and I've added a black frame to the A4 page, to act as the black background for my page (by the way, feel free to advise on better ways to do this).  My assumption is that I've failed to understand how this works, as I was hoping that I'd magically get a black frame on the A5 version, and that I could use liquid layout to get this to automatically scale (along with all other elements), in order to create the two versions simultaneously.  All help/advice would be greatly appreciated!


Please forgive if this is a repeat but I couldn't find a similar question (at least as it pertains to me).  I have a database of 30,000 images of digits (0-9). Every image is 28*28. So, every image is represented by a row of 785 columns  with the first column as a label (whether the digit is 0 or 1 or … 9) and columns 2: 785 having a value of black(from 0-255).  Now, I have the pca using pca <- prcomp(df[, -1], center=TRUE) with 784 PCAs. I also have a mean of all the digits using meanDig <- apply(df[, -1], 2, mean) (I don't know if this mean is useful or not).  Now, I am being asked to recreate the '100th' image from the database using first 15 PCs.  I understand from  and other related questions how to recreate one single image from the PCA of that single image.  But if I have PCA of a collective of 30000 images, is it possible to recreate the one single image?  I tried:  recreation <- pca$x[, 1:15] %*% t(pca$rotation[, 1:15]) # which gives me a matrix of 23520000 elements. # I am not sure how I can recreate a 28*28 image? # Then I thought maybe I can do this for the "15th" row: recreation <- pca$x[100, 1:15] %*% t(pca$rotation[100, 1:15]) # but I am not sure what this even means.   Any suggestions?     Edit #1   I am adding more information after taking @chechy_levas suggestions into consideration.  # Read the data: df <- read.csv("classDigits.csv") head(df[, 1:5])  label pixel0 pixel1 pixel2 pixel3 1     2      0      0      0      0 2     4      0      0      0      0 3     7      0      0      0      0 4     2      0      0      0      0 5     8      0      0      0      0 6     9      0      0      0      0  # Calculate PCA: pca <- prcomp(df[, 2:785], center = TRUE) head(pca$rotation[, 1:3])                  PC1           PC2           PC3 pixel0  2.219274e-20 -5.732181e-19  6.287447e-20 pixel1  2.081668e-17  1.110223e-16  2.081668e-17 pixel2 -1.942890e-16  0.000000e+00  4.857226e-17 pixel3 -1.387779e-16  1.110223e-16  4.336809e-17 pixel4  5.551115e-17  0.000000e+00 -1.387779e-17 pixel5  1.110223e-16  1.387779e-16  2.081668e-17  # calculate the mean digit meanImage <- apply(df[, 2:785], 2, mean)  # mean image looks like this:     # The 15th image for reference:     # recreate the image at row 15 with 15 PC. img15 <- pca$x[15, 1:15] %*% t(pca$rotation[, 1:15]) img15 <- img15 + meanImage  # Image with 15 pc:     # recreate the image at row 15 with 100 PC. img15 <- pca$x[15, 1:100] %*% t(pca$rotation[, 1:100]) img15 <- img15 + meanImage  # Image with 100 pc:     # Image with 200 PC

Principal component analysis (PCA) can be used for dimensionality reduction. After such dimensionality reduction is performed, how can one approximately reconstruct the original variables/features from a small number of principal components?  Alternatively, how can one remove or discard several principal components from the data?  In other words, how to reverse PCA?    Given that PCA is closely related to singular value decomposition (SVD), the same question can be asked as follows: how to reverse SVD?


The subclass description states "Monks of the Way of Mercy learn to manipulate the life force of others to bring aid to those in need." But Hands of Healing states "At 3rd level, your mystical touch can mend wounds. As an action, you can spend 1 ki point to touch a creature and restore a number of hit points equal to a roll of your Martial Arts die + your Wisdom modifier." With no specific inclusion or exclusion of yourself. At first glance I interpret this as you can heal others but not yourself. Anyone have a different take?

I first thought that the answer to this question was a definite 'yes.' The target is "A creature of your choice that you can see within range" (PHB 250). Presumably the caster is a creature, can be seen by him/herself, and is within range of 60' of him/herself.  Then I read the description for Greater Invisibility which specifies "You or a creature you touch becomes invisible until the spell ends" (PHB 246). It seems that Wizards have emphasized that Greater Invisibility can be applied to oneself while the same option is not emphasized for Healing Word.  Am I to interpret the lack of a specific option to heal oneself as meaning Healing Word cannot target self?  Bonus question: does this apply to Cure Wounds (PHB 230) as well?


Is there a way to find out from which package installation a certain package was installed as dependency?

For a specific package, can I find out why it is installed?  So, can I see or it's manually installed, or that it is installed as a dependency of another package? Or that it is installed as part of the distro?


I'm making i parkour map with lucky blocks (no mod) and i made everything except the command for the command block. i want to summon a diamond sword with the enchantment id of 16. iv tried this: /summon minecraft:item 320 4 468 {Item:{id:"minecraft:diamond_sword",Count:1,tag:{ench:[{id:16,lvl:1}]}}}. It doesn't work.  I tried the /give version: give @p diamond_sword{display:{Name:"Lucky Sword"},ench:[{id:16,lvl:10}]}. Still, only gives normal diamond sword!  I'm on 1.13 version on PC.  Please help!

I'm making a map where I want players to be able to choose there kits/classes. The problem I'm having with it though is giving players already enchanted Tools/Armour/Weapons.  I'm not sure if you can use the /give [player] [item] [amount] because you'll have to use the whole {} thing and I'm not sure how to make enchanted Tools/Armour/Weapons using that.  Can anyone help?


I am a math undergrad, I know some basics of algebraic geometry and hence, elliptic curves. I was attending a talk today which was about Poncelet's theorem. In the end of the talk, the speaker discussed complex elliptic curves and wrote     $$\Bbb{C}/\Lambda \simeq \text{torus}$$ i.e. complex elliptic curves   are tori. Where $\Lambda$ is a lattice in $\Bbb{C}$.   Is there an intuitive explanation to this? I know some basics of quotient topology and elliptic curves.

In a conference on elliptic curves (an introduction to the subject), the speaker said that an elliptic curve (I.e. an equation of the form $y^2=x^3+ax+b $ where the RHS has distinct roots) is, in the complex space, a torus/Riemann surface of genus 1.  What is meant by that? Are we talking about a 2-dimensional manifold the 4D space?


When trying to create a dual boot (windows and ubuntu) I ran in some trouble. Because I do already have 4 partitions, the 5th one is unusable for ubuntu to install. Now I'm really hesitating which one could be deleted or not. I have the following partitions:  device    type   size     used      system /dev/sda1 ntfs   104mb    25mb      Windows 7(loader) /dev/sda2 ntfs   877973mb 195685mb   unusable         56624mb    an /dev/sda3 ntfs   64424mb  24054mb /dev/sda4 ntfs   1065mb   218mb     Windows Recovery Environment(loader)   As you can see, sda2 is my main partition, and sda 3 is my driver partition.    Can I safely remove sda1 or sda4 partition? I'm not sure what the "loader" is supposed to do.

I would like to install Ubuntu alongside Windows 7 on a HP G62 Notebook. Although I have installed  Ubuntu in a dual-boot many times before, I found out that this model has already four partitions.    Partitions:   SYSTEM (NTFS, 199MB, used 66.59MB) Partition without any tag: NTFS (579GM, used 129GB)  RECOVERY (NTFS 16.74 GB, used 2.42GB)  HP_TOOLS (FAT32, 103.34 MB, used 13.23MB)   Since I am not an expert with partitions I would like to get advice on how to do this.  My first idea is this one:   Free some space from /dev/sda2 (I don't know if could also free some other space) delete the HP_Tools partition (I have already created a backup) create an extended partition with the free space in #1 containing three parititions: swap (1gb); / (EXT4, 30GB);  /home (EXT4, 120GB)   Another option is to use wubi instead.  What do you think? Is there any other way to achieve this?  PS: I really think this HP policy of using 4 partitions is not a coincidence  PS: I tried using gparted from the live CD and I got a warning message saying that if I freed some space from /dev/sda2 I could create serious issues in the system


I have installed google earth. I believe I did it through their website. I'm sure its named something along the lines of google-earth. Every time I do apt update i get an annoying message:  N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository ' stable InRelease' doesn't support architecture 'i386'  So, I intend to uninstall the program and try to re-install it. It does not show up in software center.  I found instructions for searching program names via:  sudo apt search <part-of-name-with-an-asterisk*>   being lazy, I typed:  sudo apt search earth*   this resulted in a very, very long list of programs that did not have "earth" in the filename.  Typing:  sudo apt search google-earth-pro   resulted in one program returned from the query. The correct one:  google-earth-pro-stable/stable,now 7.3.2.5494-r0 amd64 [installed]   Explore, search and discover the planet  Now I can uninstall, however...  Now I'm confused as to why the first attempt yielded different results. If in the future I need to find the exact program name to be able to uninstall it, what is the correct procedure? I'm sure there are many ways to accomplish this, but I feel like I was just being lucky.  Lets say there is a complicated filename 24ewftw2ecw-24wfrew-f2ec or something, and all i can remember about the file was that it had ftw in it somewhere... What is an appropriate method?  What is an appropriate use for using the asterisk on apt search?  Thanks in advance!

Since I have not been able to open Dash Home in 12.04.4 see , I am hoping for a work-around. Is there another convenient way to open apps/programs without having to search through folders? Is this question clear enough? For example, I just installed Kile (publishing program) from the Software Center, but I can't find a link/tile/icon/shortcut to open it. Thanks, to whomever can help.


This is from Axler's 1996 "Down with Determinants," I do not see why this basis would give the desired matrix representation. I would appreciate any help in seeing this.

I wish to prove the following:  if $T:X\to X$ is a nilpotent (and the     linear space $X$ is finite-dimensional), then there exists a basis     of $X$ such that the matrix representation of $T$ is upper     triangular with zero diagonal elements.  I was trying to prove $\{x_1,...,x_{k+1},v, Tv, ..., T^{n-k-2}v\}$ is a basis for $X$ where $x_i$ are basis for $N(T)$ and $v,..., T^{n-k-2}v$ are basis for $R(T)$ where $T^{n-k}=0$ and $n-k$ is minimal. However the matrix representation w.r.t this basis is diagonal. Is there an easy way to prove this ?  I know that for all $T:X\rightarrow X$, there exists a basis that the matrix representation is  upper triangular. How is this useful?


This is probably a very basic, but I have the following header tag
This is a Title
   Now what I want to do is just change the colour of the text and background  of 'This'  and leave 'is a title' alone and on the same line as 'This' to still be a header.

This one has me kind of stumped. I want to make the first word of all the paragraphs in my #content div at 14pt instead of the default for the paragraphs (12pt). Is there a way to do this in straight CSS or am I left wrapping the first word in a span to accomplish this?


So whenever I sum an array of floating numbers, and compare the summed number with another floating number it keeps saying they are not the same.  So the total is 1.63 The numbers are: 0.31, 0.31, 0.37, 0.33, 0.31  These numbers together makes 1.63, but whenever I compare the sum with 1.63 it says they are not the same.  How come this happens?  #!/usr/bin/python  total = 1.63  array = [ 0.31, 0.31, 0.37, 0.33, 0.31 ]  sum = 0 for n in array:   sum += float(n)  print total print sum  if float(total) == float(sum):   print 'ok' else:   print 'not ok'   print total, sum   result:  1.63 1.63 not ok 1.63 1.63

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


I use aws route53 with a wildcard SSL certificate:  the certificate allows: *.domain.com  In order to allow users to access both: "domain.com" and "www.domain.com" I have to setup individual records for each. This does not bother me, but I have a problem when I want to use subdomains:  domain.com www.domain.com sub.domain.com   all work since they match *.domain.com  ... However I also want www.sub.domain.com to work without having to add *.sub.domain.com to the certificate.  How is it possible?

I'd like to know if any certificates support a double wildcard like *.*.example.com? I've just been on the phone with my current SSL provider (register.com) and the girl there said they don't offer anything like that and that she didn't think it was possible anyway.   Can anyone tell me if this is possible, and if browsers support this?


I have upgraded my Samsung Galaxy S4 to Android 5.0.1. It is full of bugs, but I don't wont to downgrade to Kitkat.  I have heard that Android 5.1 is available. Is it possible to get it for my S4?

Android 5.1 (Lollipop) was officially announced on March 9th, 2015.  You can review the high-level changes at the announcement on the official .  Of course, not all devices will get this update right away and others won't get it at all. Each manufacturer and carrier often choose to add their custom modifications which tend to delay the official release.  When will each device get Android 5.1, either officially or unofficially, if ever?  See also:


According to Big Bang theory and The Red shift theory "space" is "expanding". Keeping this notion of "space" as physically something in and of itself(space -time did not exist before The Big Bang); what are the supposed theoretical answers for the omnidirectional expansion of this "fabric"--noting that no matter where you are in the universe "space" is expanding away from you??

Given 2 objects moving at some velocity $v$ relative to one another, is it possible to determine whether they are moving or whether the space between them is expanding?


I use some UTF-8 emojis like 😋 Problem: WP changes that automtaically into img ex:  How can I disabled that ? I need my UFT8 chars and not svg img ? Regards

So WP 4.2 introduced emojis (smileys) that basically adds JS and other junk all over your pages. Something some people may find shocking. How does one completely erase all instances of this?


I have multiple csv files to read and create a table with one or two headerlines. (parameters/units) I would like to use two header lines from this files using \pgfplotstabletypeset. Can anyone help me? It would be enough to give a parameter containing the number of header lines to extract.   \pgfplotstabletypeset[                 %skip first n=1,                 col sep=comma, % the seperator in our .csv file                 every head row/.style={before row={\toprule}, after row={\midrule}},                 every last row/.style={after row=\bottomrule},              ]{test.csv}

I have a dataset in csv file format that I'm loading into pgfplotstable. I can't change the format of the original csv, and being financial data it has a column of item names and two or three explanatory data points at the top of the table. e.g.  \documentclass{article} \usepackage{array,datatool,pgfplotstable}   \begin{filecontents}{sample.csv}     item,2008,2009,2010,2011      ,Actual,Actual,Forecast,Forecast      ,GBP,GBP,GBP,GBP      ,('000),('000),('000),('000) rounded     Area 1 OP, 1000000,1500000,1750000,250000     Area 2 OP, 400000,500000, 450000,-50000     Area 51 OP, 300000,375000,390000,15000     No P, 1250000, 1000000, 950000, 50000     Residuals, 800000, 80000, 90000, 10000   \end{filecontents}  \pgfplotstableread[col sep=comma]{sample.csv}\mystuff   I'm stumped at the next stage which is to typeset \mystuff so I have comma separators and can add a row that sums the 'Area' columns. At the moment to display the table I have to do something like  \begin{document}  \pgfplotstableread[col sep=comma,header=false]{sample.csv}\mystuff  \pgfplotstabletypeset[   columns/0/.style={string type},   columns/1/.style={string type},   columns/2/.style={string type},   columns/3/.style={string type},   columns/4/.style={string type}]\mystuff  \end{document}   How do I tag the top three rows as string and the rest of the last four columns as integer type so I can format and transform them?


I know what padding is and how alignment works. Given the struct below:  typedef struct { char word[10]; short a; int b;   } Test;   I don't understand how C interprets and aligns the char array inside the struct. It should be 9 chars + terminator and it should be regarded as the longest like this:  | - _ - _ - _ - _ - word - _ - _ - _ - _ - | | - a - | - _ - b - _ - | padding the remaining 4 bytes   The "-" represents a byte and "_" separates the bytes. So we have the 10 bytes long word, the 2 bytes long a and the 4 bytes long b and padding of 4 bytes. But when I print sizeof(Test) it returns 16.  EDIT: I got it.

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


I got this warning when I tried to delete:    Even though I'd already deleted the answer.   / ?

Looks like there's a small bug in the UI: I posted a question here on meta.SE which ended up being just something dumb I was doing and no use to anyone in the future. At first I posted an answer saying what the dumb thing was, but then I realized that the whole thing had no value, so I deleted the answer, and then deleted the question — whereupon it asked me:  Delete this answered question? We do not recommend deleting questions with answers because doing so deprives future readers of this knowledge. Repeated deletion of answered questions can result in your account being blocked from asking. Are you sure you wish to delete?  (Screenshot below) Probably shouldn't ask (or add to the tally) if the only answers are deleted ones...


Find all solutions to the diophantine  equation $7^x=3^y+4$ in positive integers. I couldn't have much progress.  Clearly $(x,y)=(1,1)$ is a solution. And there's no solution for $y=2$. Assume $y \ge 3$ and $x \ge 1$. By $\mod 9$, we get $7^x \equiv 4\mod 9 \implies x \equiv 2 \mod 3 $. By $\mod 7$,we get $y \equiv 1 \mod 6$. I also tried $\mod 2$ but it didn't work. Please post hints ( not a solution). Thanks in advance!

I don't know how to solve $7^x-3^y=4$... I tried to see something $\pmod 7$ and $\pmod 3$ but it doesn't help at all. Can anyone give me some hints about it?


According to the answers here at meta, you can lose privileges when you e.g. spend your reputation on bounties. What is the rationale behind that?  By my opinion, it would be more natural if the privileges are persistent once gained. The user is given privileges once he was "tested" by the community. He has to spend some time at the site to gain reputation and see how it works. We consider him trustworthy then.  Once the person is trustworthy, what makes him untrustworthy when he spends his reputation on bounties? Does he become a beginner then? Will he suddenly forget everything he learned at SO?  P.S.: I would understand it for negative points from downvotes (or penalties, if there are any). But when placing bounties.... or when your answers are migrated (I don't know if you lose points in this situation) I don't really see any reason to lose privileges.

My rep went over 2,000 today which meant I could edit other people's posts. Great! Then I added a bounty to a previous question, which brought me back down to 1,984...and I can no longer edit other posts. Should this changed? Or is this ideal?


Now I have this bug which shows up occasionally. It prevents me from editing my comments. While I have only seen the bug on Stack Overflow, I think that is because I use Stack Overflow the most. It may also be present in other Stack Exchange websites.

Across the Stack Exchange network you may leave comments on a question or answer.  How do comments work? What are comments for, and when shouldn't I comment? Who can post comments? Who can edit comments? How can I format and link in comments? My comment doesn't contain some of the text I typed in it; why? My comment appears to be long enough, but I can't post it because it's too short; why? Who can delete comments? When should comments be deleted? Why can't I comment on specific posts even if I have enough reputation to comment? When can comments be undeleted? What are automatic comments? How can I link to comments? Anything else I should know about comments?  Also see the FAQ articles on  and .


Show that there are exactly $\aleph_1$ nonisomorphic countable well orderings. I used the continuum hypothesis to show that $2^{\aleph_0} = \aleph_1$ and then i applied $|\mathbb{R}| = 2^{\aleph_0}$ to get $|\mathbb{R}| = \aleph_1$. Then $\aleph_1$ is equal to the cardinality of all real numbers. As $\aleph_1$ is equal to $\omega_1$ and $\omega_1$ is a well ordered set, so is $\aleph_1$. Then I assumed that $\aleph_1$ is a countable well ordering with the cardinality $|\mathbb{R}|$. My teacher told me that I shall not use the continuum hypothesis here, because it was not told to use it. I am not sure if I have done anything correct, any help would be appreciated, thanks!

Let be the next equivalence relation on $B= \{R \subseteq \mathbb{N}\times\mathbb{N} \ | \ R \ is \ a \ well-order \ on \  \mathbb{N}\}$ : $$"R \equiv R' \leftrightarrow \ (\mathbb{N},R) \cong (\mathbb{N},R') \ are \ well-ordering \ sets \  isomorphic" $$  Which is the cardinality of $B/\equiv$?  Firstly, we can notice that each well-ordering set is isomorphic to an ordinal $\alpha \ $such that $\alpha < \aleph_{1}$, and so it is enough to count how many ordinals are isomorphic to a subset of $\mathbb{N}$. For example, if we consider $A$ the set of the even numbers and $B$ the set of odd numbers with the usual order relation, $A \oplus B$ is isomorphic to $\omega + \omega$. Another example could be: if we consider the order of $\mathbb{N}$ that we use in Sharkowski Theorem, that order is isomorphic to $ \omega^{2} + \omega$. Working with prime numbers we could build also $\omega^{n} \ \forall n \in \mathbb{N}$, and so $\omega^{\omega}$ and maybe something bigger. However, we know that each countable ordinal is isomorphic to a subset of $\mathbb{Q}$, but I bet that the same result is not true for $\mathbb{N}$ because it is "too small".  What can I do?


(Some report that my question is similar to another post. However, that post is talking about writing the "proof", rather than "stating" the theorem. "Proving" a theorem is NOT of the same structure and situation as "stating" a theorem. So this question is not duplicated to the other! Do not let it to be closed! And by the way, I'm also the OP of that question...) In writing a textbook, when we need to state a theorem that is a universal quantification, we can use the word  "for all ..."(or equivalently "for every", "for any", "for arbitrary", "for each")  or  "let ...",  Which of these ways is more ideal? Why? Although I think writing as "for all" is the more natural way to reflect the logical structure, that is a universal quantifier $\forall$, the popular style I have seen tends to use "let". Any theoretical aspect or experience is welcome. Example set 1.   For all natural numbers $n$, if $n$ is even, then $n$ squared is even.  Let $n$ be a natural number. If $n$ is even, then $n$ squared is even.    Example set 2.   Let $A,B$ be two sets. If for all $x\in A$, $x\in B$, then we say $A$ is a subset of $B$.  For all pairs $A,B$ of sets, if for all $x\in A$, $x\in B$, then we say $A$ is a subset of $B$.    Example set 3.   Let $Y$ be a subspace of $X$. Then $Y$ is compact if and only if every covering of $Y$ by sets open in $X$ contains a finite subcollection covering $Y$. (Munkres Topology Lemma 26.1)  For all subspaces $Y$ of $X$, $Y$ is compact if and only if every covering of $Y$ by sets open in $X$ contains a finite subcollection covering $Y$.    Example set 4.   For every $f:X\to Y$ being a bijective continuous function, if $X$ is compact and $Y$ is Hausdorff, then $f$ is a homeomorphism. (adapted by me, maybe ill-grammared?) For every bijective continuous function $f:X\to Y$, if $X$ is compact and $Y$ is Hausdorff, then $f$ is a homeomorphism. (adapted by me.) Let $f:X\to Y$ be a bijective continuous function. If $X$ is compact and $Y$ is Hausdorff, then $f$ is a homeomorphism. (Munkres Topology Theorem 26.6)    New added example set 5 (I skipped the quantification on $E,f:E\to\mathbb{R},L,c$, just focus on the key part here.)   If "$\forall\varepsilon>0,\exists\delta>0,\forall x\in E,0<|x-c|<\delta\rightarrow |f(x)-L|<\varepsilon$", then we say $f(x)$ converges to $L$ when $x$ approaches $c$. If, for all $\varepsilon>0$, there exists $\delta>0$ such that for all $x\in E$, if $0<|x-c|<\delta$ then $|f(x)-L|<\varepsilon$", then we say $f(x)$ converges to $L$ when $x$ approaches $c$. (Using "for all") If let $\varepsilon>0$, there is $\delta>0$, such that let $x\in E$, if $0<|x-c|<\delta$ then $|f(x)-L|<\varepsilon$", then we call $f(x)$ converges to $L$ when $x$ approaches $c$. (Using "let". I think this type is not natural. But I can't tell why.)

While proving a universal quantification, say $\forall a\in D,~P(x)\rightarrow Q(x)$. I see (at least) two type of people, one begin the proof by  (1) Way 1     Let $a$ in $D$,   (or let $a$ be any element in $D$)      $\cdots\cdots$ (some arguments)      $\therefore P(a)\rightarrow Q(a)$      Since we made no special assumptions on $a$, any $a$ in $D$ also deduce   $P(a)\rightarrow Q(a)$. Thus we have shown that $\forall a\in D,~P(x)\rightarrow Q(x)$. (This is exactly what the U.G. rule says.)   one by: (2) Way 2     Arbitrary choose $a$ in $D$,       $\cdots\cdots$ (some arguments)      $\therefore P(a)\rightarrow Q(a)$      Since what we choose is arbitrary, so every element in $D$ also holds true. (some blur here.. Even I guess whether it is "exactly" a usage of U.G. rule)   I'm not ask for a elementary problem that how to prove a universal quantification. Instead, I'm curious which formulation of such a proof is more proper, logical and formal logical structure.  I think way 2 is somewhat not clear since yes, we had indeed arbitrary chosen a element $a$ in $D$, but someone may intensionally argue that "hey, it is because  you're lucky that you randomly chose the right $a$ at the very begin that makes the predicate true in the set! If you want to show that this is true for any element in the set, you should not have use the word choose in the proof's begin; or at least, you should say at end that since our intermediate steps do not use the special assumption of $a$, so it suits for all elements. But in this way, this becomes slightly complex than way 1, why not just use way 1?"   The reason that way II is valid is somewhat of a meta-level, not indicate by the language itself.


I have a model ... several actually but we only need one for the sake of the question ...   public class DeliverableType : BModelBase, ISingleID {      public Int64 ID { get; set; }      public String Label { get; set; }      public String Description { get; set; }      public Int64 TestID { get; set; }  }   So given this model I would like to be able to run a method such as ...   DeliverableType objA = new DeliverableType(); DeliverableType objB = Repository.GetDeliverableType(objA.ID);  objA.Merge(objB);   This would compare the property values of objA against the corresponding properties of objB. Any property value on objA that was assigned the default value (based on its type) should be replaced by the value assigned to the corresponding property on objB.  So if objA values were set to  ...   objA.ID          = 100; objA.Label       = null;  // equals default(String) objA.Description = "Some clever description here"; objA.TestID      = 0;     // equals default(Int64)   And objB values were set to ...   objA.ID          = 100; objA.Label       = "Clever TITLE"; objA.Description = "Some not-so clever description here"; objA.TestID      = 50;       I would want to run ...  objA.Merge(objB);   And the resulting objA property values would look like ...   objA.ID          = 100; objA.Label       = "Clever TITLE"; objA.Description = "Some clever description here"; objA.TestID      = 50;   All the fields on objA that had been assigned default values would have been replaced with values from objB.  I have looked around and found bits and pieces of advice concerning iterating through properties, or finding the type of properties but when putting these pieces together it's not working.  I am creating an extension class so that it will just be tacked on the the appropriate models. I identify which models to tack the extension to based on the base class that they will all derive from.      public static void Merge(this BModelBase model, BModelBase entity)     {         IList diffProperties = new ArrayList();         foreach (var modelProp in model.GetType().GetProperties())         {             var propType        = modelProp.PropertyType;             var entityPropVal   = entity.GetType().GetProperty(modelProp.Name).GetValue(entity);             var modelPropVal    = modelProp.GetValue(model);              if (!Object.Equals(modelPropVal, entityPropVal) )             {                 if (propType.IsValueType && modelPropVal == default(propType))  // compiler chokes on this line                 {                     modelProp.SetValue(model, entityPropVal);                 }             }         }     }   To be fair I did not really expect this exact code to work but expected that it would lead me  in the right direction. However, I am getting a weird error.  On the line ...  if (propType.IsValueType && modelPropVal == default(propType))   the SECOND occurrence of the variable "propType" in the default() call is returning the compiler error ...  The type or namespace name 'propType' could not be found (are you missing a using directive or an assembly reference?)   Which makes no sense because it's clearly it's been defined and is actually being recognized elsewhere in the code, even in the same expression.   Looking for any thoughts on why the compiler is barfing on this line plus any thoughts on how this functionality could be better implemented. If a new direction by-passes my compiler issue ... I'm good with that too.  thanks

I'm using reflection to loop through a Type's properties and set certain types to their default.  Now, I could do a switch on the type and set the default(Type) explicitly, but I'd rather do it in one line.  Is there a programmatic equivalent of default?


Prove that any amount of more that $7$ cents can be represented by $3$ and $5$ cent coins. (Assume $3$ cent coins exist.)  Let P(n) be true if we can find $n$ cents with $3$ and $5$ cent coins.  My basis step is:  $P(8)$ is true since $3 + 5 = 8$  Would this be correct?  As for the inductive step, I'm not sure how to show it.  I've looked around online and it seems to be:   $P(k) = 8 ≤ k ≤ n$  How would I prove this to be true?

I am pretty sure this question has something to do with the Least Common Multiple.    I was thinking that the proof was that every number either is or isn't a multiple of $3, 5$, and $8\left(3 + 5\right)$. If it isn't a multiple of $3,5$, or $8$, great. You have nothing to prove. But if it is divisible by one of them, I couldn't find a general proof that showed that it wouldn't be divisible by another one. Say $15$, it is divisible by $3$ and $5$, but not $8$.


When an electron is observed it acts like a particle and its wave function collapse. This statement is very famous in quantum mechanics, but what is meant by observing an electron? Which devices are used to do so, and by what technics?

My question is not about (pseudo) philosophical debate; it concerns mathematical operations and experimental facts.  What is an observer? What are the conditions required to be qualified of observer, both mathematically and experimentally?


The family seemed to be from the past or Amish. They went about doing daily chores but I think when the bubble was broken, they became violent.   The people on the outside seemed to be studying them and were pelting ice cubes at the barrier using some sort of a tennis-ball-dispensing machine.  The whole point of the movie seemed to be to break the barrier but it had a sense of mystery and horror as well.  I watched this movie when I was around 10 (so ~2002) but the movie was airing on television.

All I can remember is that there were some (human) scientists(?) who had a portal through which they could observe a family(?) who seemed to be on a pic-nic(?) Somehow, they realised the aliens (?) were cannibals - but only when the latter noticed them watching and rushed towards the portal!  I don't remember whether the aliens got out - or anything else much really - but I'd really love to find this story again in the hope that re-reading it would stop it haunting the edges of my imagination/memory!  Anyone ...?


I had a fiver.com contractor create some models for me, and when I open the .blends I get this error (though the files open perfectly well whether I accept or not):  I'm having trouble finding any specific versions of the error online, but I'm kind of getting hints that it's a Maya crossover thing. I tried opening the console in the file but there's nothing there to read.  I also ran Python in the Terminal while opening the file and allowing execution, but there was nothing to see. My question is: is this anything to worry about security-wise?  Did I open myself up to an exploit by executing it? System: Catalina 10.15.7 Blender 2.80

i am just getting into rigging in blender, and in the graph editor with the properties panel open i get a error message saying "ERROR: Phyton auto-execution disabled." Another thing that i noticed is a message on the top menu bar saying "Auto-run disabled."   I am in the graph editor because i want to create a driver for a simple but convent 2d ball rig, and i was wondering will be a problem for me later down the road. Also, what the heck should i do about the message. I don't like "ERROR"  sign being thrown at me.   Thank you, Chris


I'm sure I'm missing something very basic, but I can't see what it is.  The following is an excerpt from a larger program that deals hands of cards and determines their rank in poker.  This function turns the first letter in a card string into an integer so that it can be compared.  So, "king of spades" would  send the "k" to this function and it should return 13, "6 of hearts" sends the "6" and gets back 6, etc.  It considers a, k, q, j, and 1 as special cases and then uses Integer.parseInt() on all other inputs.  But, for some reason, it is not ever evaluating the special cases, it is running the else statement every time and crashing on parseInt() when it gets a letter.  All help is appreciated, thank you.      package testSpace;   import java.util.Scanner;   public class main {   public static void main(String[] args) {     Scanner sc=new Scanner(System.in);          System.out.println("Enter a single digit or an a, k, q, or j");         String thisRank = sc.next();        System.out.print(parseRank(thisRank)); }              public static int parseRank(String thisRank){         if(thisRank=="a"){             return 14;         }         else if(thisRank=="j"){             return 11;         }         else if(thisRank=="q"){             return 12;         }         else if(thisRank=="k"){             return 13;         }         else if(thisRank=="1"){             return 10;         }         else{             return Integer.parseInt(thisRank);         }        }      }

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


I figured I would need to do something like:
blah
 because handling clicks looks like this:
blah
  I've tried using the way shown in the documentation here:  , but on-mouseenter and on-mouseover aren't working as expected.  I'm also having trouble passing parameters to my handlers, but that's a different story.

Is there a canonical way to set up a JS onHover event with the existing onmouseover, onmouseout and some kind of timers?  Or just any method to fire an arbitrary function if and only if user has hovered over element for certain amount of time.


I am trying to show a message box on top of my form and get the result. I am using backgroundworker and in my dowork function, I am calling below function. I used delegates based on my past experience for show the message box but I am not sure what is wrong it is giving me below error.     e.Message = "Cross-thread operation not valid: Control 'Form1'   accessed from a thread other than the thread it was created on."   Would you mind check why I am getting above error even after using delegates?          public delegate DialogResult Del(Form1 fr,string text, string title, MessageBoxButtons mbb, MessageBoxIcon mbi);          public static DialogResult showMessageBox(Form1 fr, string text, string title, MessageBoxButtons mbb, MessageBoxIcon mbi)         {             return MessageBox.Show(fr, text, title, mbb, mbi);         }      public static OutputEventArgs execSync(string exe, string arguments, string standardInput,Form1 fr)         {             OutputEventArgs oea = new OutputEventArgs();             try             {                 using (Process myProcess = new Process())                 {                     ProcessStartInfo startInfo = new ProcessStartInfo();                     startInfo.WindowStyle = ProcessWindowStyle.Hidden;                     startInfo.RedirectStandardOutput = true;                     startInfo.RedirectStandardError = true;                     startInfo.RedirectStandardInput = true;                     startInfo.UseShellExecute = false;                     startInfo.CreateNoWindow = true;                      startInfo.FileName = exe;                     startInfo.Arguments = arguments;                     myProcess.StartInfo = startInfo;                      myProcess.Start();                     string line = string.Empty;                      while (!myProcess.StandardOutput.EndOfStream)                     {                         line = myProcess.StandardOutput.ReadLine();                         if (line.Contains("is already defined in archive"))                         {                             Del handler = new Del(showMessageBox);                              DialogResult dialogResult = handler(fr, "Do you want overwrite the version label?", "OverWrite",MessageBoxButtons.YesNo,MessageBoxIcon.Question);                             if(dialogResult == DialogResult.Yes)                                 myProcess.StandardInput.WriteLine("y");                             else                                 myProcess.StandardInput.WriteLine("n");                         }                      }                      oea.Data = line;                      myProcess.WaitForExit();                     oea.exitCode = myProcess.ExitCode;                 }             }             catch (Exception e)             {                 oea.Data = e.Message;                 oea.ExceptionHappened();             }             return oea;         }

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.


I am a working student (working in software engineering) and this year I'll be completing my CS Bachelor's degree in Italy. I am doing the online degree as I can't attend lectures, due to my job.   I would like to continue my studies with a Master's Degree in CS so I googled a bit and found out that  I am interested in.   Here in Italy the online degree has the same value as the on-campus degree: we take exams on campus, study online with videos and materials provided by the professor, we have conference sessions with the professors for any questions or we can go visit them in their office. The exams are exactly the same as the on-campus degree, so are the professors.  I was wondering if this is the case in the USA and if doing an online degree will be a limit for me to pursue, in a remote future, a PhD. Should I move to the USA to study (I can work remotely) or I can study here, in Italy, and just go to the USA to take exams?

I'm currently in the first year of a six year bachelor's degree aiming for astrophysics. The course is a home/distance learning setup run by the Open University. While I am enjoying it thoroughly, I am aware of the academic politics that can dog professional science. So my question is thus: Upon soldiering on with the degree, then masters, and then PhD, will I be taken seriously within a professional setting given my inability to reference a leading university for my education? Will the format for my studying be "pitied"?   Edit: I suppose a bit more info may help. I'm 27,wife, 2 children, and I currently work as a full time chef, and self employed part time IT technician. I flunked my GCSEs, with no further education. The past 3 years have been a revelation for me, and I have discovered a before unexperienced love for academia; specifically, physics and astronomy. Last year I completed a 1 year OU maths brush up course, which at the time I really struggled with. This year I had a bout of madness and took the plunge for a BSc degree in astronomy. I am now loving the math within the physics so far (yet to hit calculus though!)  PhD, and even masters, is a long way off.  Also, since this original post I've improved my understanding of what a PhD actually entails. So I realise that if I get there, it may well not have anything to do with the OU!     It occurs to me that a lot of my initial queries could have been avoided with a better understanding of the educational and qualification system itself. I now have a greater appreciation as to what a PhD actually is, realising that its a long way off and not necessarily needed for a fulfilling career in research.  I think trying to repair my broken education and fight my way into a worthwhile (and productive!) career is enough of challenge at the moment. There will be plenty of time later for worries concerning doctorates.  It is good to hear that there is at least an open mind towards distance educated professionals.   As has been said, if you've got it, you've got it - you just have to be ready to prove it.