This is my first post here. I am new to photography. I am amazed with some of the beautiful works people are doing. Equally I have started to love the power of filters. I jus saw the following photo:    Can some please tell, what is the name of this filter? I wonder If there is any tutorial that helps to recreate this kind of clean nice effect.  Thank you in advance.  Image source:

This is my favorite look for photos, and I've been trying to achieve this for some recent family vacation photographs. What is the process?  Here are some links to some examples:


The following sentence is from The Economist:  On March 14th concerns about China’s grip on Congo’s cobalt production deepened when GEM, a Chinese battery maker, said it would acquire a third of the cobalt shipped by Glencord, the world’s biggest producer of the metal, between 2018 and 2020.  At first, I thought The Economist made a typo: a comma should have been placed after the date "March 14th," which builds a better flow for the sentence in my opinion.  However, I encountered today this sentence from another article by The Economist that is also missing a comma after a date:  On May 23rd the Department of Commerce launched a probe of car imports.  Judging from the fact a comma is persistently omitted in articles by The Economist, I am starting to wonder if the comma usage hinges on stylistic choice rather than is a universal rule in English grammar. Personally, I am used to seeing a date set off by a comma and does not prefer The Economist way.  Let me know what you guys think. Thank you in advance.

Consider the following sentence:     In July of 2012 Jesse informed us that she was engaged to be married   and asked if she could add her fiancée to the lease,   beginning the 15th of August 2012.   Is it any more or less correct to place a comma after the first date?     In July of 2012, Jesse informed us that she was engaged to be married   and asked if she could add her fiancée to the lease,   beginning the 15th of August 2012.   Assuming one is no more correct than the other, does this change the meaning of the sentence, or is it pure style?   Bonus question: Word tells me that it's improper to place a comma after the "August" at the end of the sentence. I've always been taught that a comma should be used to separate the year from the rest of the date. Was I taught wrong, or is Word lying to me?


I am trying to append one vector to another vector, both vectors being same in "dimension".   int main() { std::vector<int> v1={1,2,3,4,5},v2={10,11,12}; //v1.push_back(v2)? //v1 and v2 have same dimensions  }   Without creating loops and pushing back individual element, is there any way to achieve similar to this python statements?  v1=[1,2,3,4,5] v2=[10,11,12] v1.extend(v2) print(v1)   gives [1, 2, 3, 4, 5, 10, 11, 12]


I posted , but it was closed due to being off-topic.  Why are medical tablets packed in random order? See this picture:  Is there any medical reason for this type of packing?  Is there a SE site that will suit this question?

Is there any Stack Exchange website to ask questions related to medical?  Is the physical fitness website including medical too? Can anyone ask questions related to psychology?


I want to print out an array of those 100 numbers.  However, my program stops after generating certain amount of numbers. Here's my code.  class A4     public static void main(String[] args)     {         int[] array1 = new int[101];         int num, i = 0;         boolean repeat = false;         while(i < 100)         {                num = (int) (Math.random() * 100) + 1;             array1[(i)] = num;             for (int e = 0; e < i; e++)             {                 if (num == array1[e])                     repeat = true;             }              if (repeat == true)             {                 continue;             }              array1[i] = num;             System.out.println(array1[i]);             i++;         }     } }

How do I generate a random int value in a specific range? I have tried the following, but those do not work: Attempt 1: randomNum = minimum + (int)(Math.random() * maximum);  Bug: randomNum can be bigger than maximum. Attempt 2: Random rn = new Random(); int n = maximum - minimum + 1; int i = rn.nextInt() % n; randomNum =  minimum + i;  Bug: randomNum can be smaller than minimum.


I am really curious about ways to tackle this since it is such an open ended problem.   I thought about it purely visually and after an embarrassingly long time figured out the answer to be      \begin{align*} 44 \end{align*}   I would love to hear how others think about it! I have also found a neat "rigorized" solution I would be happy to share.

How many times are the hands of a clock at right angle in a day?    Initially, I worked this out to be $2$ times every hour. The answer came to $48$. However, in the cases of $3$ o'clock and $9$ o'clock, right angles happen only once. So the answer came out to be $44$. Is the approach correct?


I'm trying to set up an ssh port forwarding from my router to my linux host. I'm using the dynamic dns service from . I'm using their subdomain and I have already installed the client to update the ip when it changes.  On my router, ZXHN H108N, I have set up port forwarding for ssh to a linux host. I have checked using the service at  whether the ssh port is available or not, it is available. Yet when i'm trying to ssh on my subdomain, it says   ssh: connect to host XX.XX.XX.XX port 22: Connection refused   Any idea?

I'm on Fedora 19 and I have a problem with ssh.  Ssh is up and running and I can connect when I enter my lan ip. But when I try my server name (blahblah.no-ip.org) I get a connection refused. No-ip is already running as a service and is working properly (sending the correct ip).  I've already set up port forwarding on my router, I also changed the port of ssh both on the service and on the router port forwarding (in case my beloved ISP decided to block those ports). But still I get a connection refused and when I nmap the hostname I see that the ssh port is closed.  One thing though: I have two PCs under the same external ip (I've set up the port forwarding to the correct internal ip). When I nmap blahblah.no-ip.org I get a Port 23 and 80 open. 80 seems OK but I've never started telnet service on my machine.  Any ideas what else to try? Router is zte zxv10 and port forwarding is correctly set up. I say this because I've already set up port forwarding for deluge and it's working properly.


I have a problem that started just yesterday after using upgrade version of Ubuntu 14.04 since its release. Namely, all of a sudden, Ubuntu won't accept my password. I  changed it with passwd user, Ubuntu seemed to have accepted the new password, but yet again, it won't let me log in. It looks like Ubuntu is recognizing the password, starts the login process, but then it takes me back again to the welcome screen. Let me stress that I knew my password, that it was working properly and I had no problems whatsoever. I have a dual boot system with Ubuntu 14.04 and Xubuntu 14.04, so luckily, all my Ubuntu files are accessible from Xubuntu. Any suggestions? Thanks

My laptop was working perfectly yesterday, and now today I can't log in.  At first, I was only getting a black screen. However, after following instructions in some questions here on AskUbuntu, I first reinstalled lightdm, and then I had to change the ownership of the file ~/.Xauthority to be my user name. Now, I get the log in GUI screen.  However, once I enter my username, it flickers and then comes back to the login GUI. It does not matter if I use Gnome, Unity, or Gnome-Flashback.  I don't know why lightdm needed to be reconfigured, or how ~/.Xauthority got changed, but in any case, what is still standing in my way, preventing me from logging in?  Update: I have tried deleting the .Xauthority file, and the .profile files in my home directory. It has not changed anything.  Logging in as guest also fails to work.  The following commands did not work:  mv ~/.config ~/.config.BAK mv ~/.cache ~/.cache.BAK   Inside .xsession-errors in my home directory, it says:  Gdk-CRITICAL: gdk_x11_display_get_xdisplay: assertion 'GDK_IS_DISPLAY (display)' failed


was closed and locked by a moderator with the remark "open a meta question on it and if we can reach agreement, it will be reopened"  I'd like to point out that this question had numerous up-votes and was actually flagged to be put as a community wiki, which is something completely different from being closed and locked. So I ask you very gently if you could please unlock and reopen that question, as:   the people that are on the  tag are very appreciative about that question it is completely in line with a lot of other questions, as pointed out in the comments it is about programming and developing, and not a copy of another question like that closing of these questions directly lead to questions such as  and

I frequently come across a really useful answer on StackOverflow which has been closed because it doesn't match the Q&A format.  Examples include  ,  ,   ,  and there are others.  Where should this information be exchanged if it's not on stackoverflow?  It seems the moderators are often somewhat overzealous...  ---edit  When I say best, I mean they are informative and useful for someone who's looking for an answer to them.  Even if they do become a bit of a discussion, I value other people's opinions on the relative merits of the different JPA frameworks.  I come here looking to choose one and the answer helps me.  So what if it's not a definitive answer?  ---edit  I don't care how popular a question is, nor how interesting it is.  Users are interested in stuff that's useful to them.  Plenty of those were useful (as judged by the upvotes on the answers: 'This answer is useful'), but closed because they didn't have a definitive answer, as far as I can tell.  ---edit  Seems I'm not the first person to think this: there are various similar questions to mine like this one:   In it the user lists lots of other useful questions which have been closed:                    So isn't there a place on stackoverflow for these questions?  A discussion section, maybe?


I am aware flash is EOL. However, I need it for . according to  however trying to use flash results in "Right Click to enable Adobe Flash". when I do that it does nothing.  Edit: I have chromium Version 73.0.3683.103 (Official Build) Built on Ubuntu , running on Ubuntu 19.04 (64-bit) and  says Yes Flash 32.0.0 is installed in this browser  Edit 2: about:components does not have flash recognized.  in chrome it looks like   something about the sandbox broke it. --no-sandbox "fixed it"

I tried loading Adobe Flash player in Chromium on Ubuntu 19.04 (Lubuntu in this case) using various answers on AskUbuntu.com. I get to the point where the Allow Flash popup happens. But when I click to allow it, it says "Right-click to run Adobe Flash Player". When I rightclick and choose Run this Plugin, nothing happens. I've tried to apply fixes using the Pepperflash technique, as well as the Adobe Flashplugin technique.


I have two different references with different years but same first authors. I expect the outcome of citings to be Doe et al. (2005) and Doe et al. (2007). However the produce output is John, Mike, and Dave (2005) and John, Mike, Plank, et al. (2007)  What is going on here and how can I fix it?  \documentclass[11pt,a4paper,oneside]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[a4paper, top=2.5cm, right=2.5cm, bottom=2.5cm, left=4cm]{geometry}     \usepackage[backend=biber, style=authoryear, date=year, firstinits=true, natbib=true]{biblatex}     \usepackage{csquotes}     \usepackage{filecontents}   \begin{filecontents*}{\jobname.bib}   @article{doe1,   title={Lorem ipsum dolor sit amet},   author={John, D. and Mike, L. and Dave, O. },   journal={Some Journal},   volume={14},   number={10},   pages={2959-2967},   year={2005}, }  @article{doe2,   title={Placeholder placeholder placeholder},   author={John, D. and Mike, L. and Plank, R. and Dave, O. },   journal={Another Journal},   volume={7},   number={5},   pages={757-762},   year={2007}, }  \end{filecontents*}   \addbibresource{\jobname.bib}   \begin{document}  \section{mwe} {  \citet{doe1}, lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a fermentum tortor. Curabitur lacinia feugiat eros. \citet{doe2}, aenean sagittis pulvinar orci id sodales. Aenean vulputate leo elit, vitae euismod odio cursus sed. Integer nec risus semper, lobortis arcu nec, sodales urna. Sed convallis vitae justo nec vehicula. Maecenas eleifend, erat sit amet ultricies ultricies, mi nibh hendrerit arcu, in consequat leo dui vitae eros.   }  \printbibliography \end{document}

In the header of my document I set the maximal author names to 2:  \usepackage[style=authoryear-icomp, maxbibnames=9, maxcitenames=2, backend=biber]{biblatex}   Now, when I cite texts with two authors, LaTeX gives me the following:     (Author_A/ Author_B 2012: 232)   When I have three authors or more, LaTeX makes it:     (Author_A/ Author_B et al. 2012: 232)   But I want LaTeX to just name the first author if there are more than two authors ... like this:     (Author_A et al. 2012: 232)   Any tips on how to achieve this ?


I need to sample a sine wave in order to create a lookup table. I know the Shannon theorem but I still don't understand how to apply it. I want to have 256 discrete samples of the sine wave that will have to be output with a frequency of 100Hz. I know that the formula to calculate the samples is: amplitude*sin(2 * pi_g * sample_rate * t) with t that varies from 0 to a certain number. Can you explain me how to calculate the samples in order to have the possibility to output a sine wave with a frequency of 100Hz? In order to obtain a continous function, t has to vary from 0 to what number?

Overview-  I'm making a bank of analog sine wave oscillators and I'm interested in keeping the design compact.  I've started by making a Wien Bridge oscillator. As I'm working from a single power supply and I'm trying to keep the design small, I've been using the LM386n-1 IC.  I'll be using the oscillators to do some additive audio synthesis, maybe some FM and I'll probably need some of the oscillators as LFOs.  My questions are-  Is this a suitable approach for making a compact analog sine wave oscillator?  Also, how would you suggest I control the frequency, which component value should be changed to achieve this? - I've tried messing with all the resistors to change the pitch, but they all seem to be interdependent.  Here is the circuit I've been working from, it's from the National Semiconductor LM386 Low Voltage Audio Power Amplifier datasheet-    And this is what my implementation looks like, I don't have a suitable incandescent bulb so I've just replaced it with a 1KΩ pot. I'm still not sure what I'll use in the final circuit as AGC, suggestions are welcome.


I can't update my machine anymore.   To me it seems I have the problem that my machine doesn't accept the package signatures. However I have no idea how to solve it, any help would be appreciated.  Software Updater complains with:  Failed to download repository information - Check your Internet connection. -> While I have internet.  sudo apt-get update:  ... Ign:15 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main  amd6 DEP-11 Metadata Ign:16 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main DEP-11 64x64 Icons Fetched 45.2 kB in 19s (2,289 B/s) Reading package lists... Done W: GPG error: http://packages.microsoft.com/repos/vscode stable  InRelease: The following signatures couldn't be verified because the  public key is not available: NO_PUBKEY EB3E94ADBE1229CF W: The repository 'http://packages.microsoft.com/repos/vscode stable  InRelease' is not signed. N: Data from such a repository can't be authenticated and is therefore  potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user  configuration details. W: GPG error: http://ppa.launchpad.net/font-manager/staging/ubuntu  xenial InRelease: The following signatures couldn't be verified  because the public key is not available: NO_PUBKEY F738B17DF9E284B7 W: The repository 'http://ppa.launchpad.net/font-  manager/staging/ubuntu xenial InRelease' is not signed. N: Data from such a repository can't be authenticated and is therefore  potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user  configuration details. W: An error occurred during the signature verification. The repository  is not updated and the previous index files will be used. GPG error:  http://ppa.launchpad.net/budgie-remix/ppa/ubuntu xenial InRelease: The  following signatures couldn't be verified because the public key is  not available: NO_PUBKEY 3B139A1EF422D205 W: The repository 'http://ppa.launchpad.net/chris-lea/node.js/ubuntu  xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore  potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user  configuration details. W: Failed to fetch http://ppa.launchpad.net/budgie-  remix/ppa/ubuntu/dists/xenial/InRelease  The following signatures  couldn't be verified because the public key is not available:  NO_PUBKEY 3B139A1EF422D205 E: Failed to fetch http://ppa.launchpad.net/chris-  lea/node.js/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not  Found W: Some index files failed to download. They have been ignored, or old  ones used instead.   As suggested by comment I followed the URL:    - not signed (I downloaded it together with anaconda) -> url doesn't exist  xenial There seems to be a 0.7.3~201712020419~ubuntu16.04.1 version  - there is ./dists/xenial/Release (I'm not sure if this is what you are looking for)  - I couldn't find the xenial/Release file   I'm sorry but I'm still a bit unsure what I'm exactly looking for as my experience with the package manager is quite limited. As it is right now I can't update any package (for example the ones in canonical).

I added some extra repositories with the Software Sources program. But when I reload the package database, I get an error like the following:     W: GPG error:  trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8BAF9A6F   I know I can fix it using apt-key in a terminal, according to the official Ubuntu documentation. But I would have liked to do it graphically. Is there a way to do this without using a terminal?


I am trying to show that $S_4 \cong X \rtimes_{\varphi} S_3$ where $X= \mathbb{Z}_2 \times \mathbb{Z}_2$. I know that the group of automorphism on $X$ are isomorphic to $S_3$. I'm not sure if that is something I can use to here. Any help would be appreciated.

Note that $\text{Aut}(V_4) \cong S_3$. I know how to prove that $S_4$ isomorphic to some semidirect product of $V_4$ and $S_3$. I know if it works for an isomphorism it works for any isomorphism. However, I'm having trouble seeing that the $\phi$ must be an isomorphism of $\phi: S_3 \to \text{Aut}(V_4)$ (i.e. the kernel is trivial). Is there a better way to check this without doing each case (kernel cannot be 3-cycles, or all of $S_3$)?


I've got to perform some mathematical operations which involve the 12th root of 2. The following two lines output the value 1.05946 to the console.  double x = pow (2.0, 1.0/12.0); cout << x << endl;   I was expecting more significant figures. Is there a better way of getting a precise value (accurate to ~9 sf) for nth roots?

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


I only remember learning how to factor 2nd degree polynomials, but I don't have a straight method into factoring something like $y^3-32y+64$ into $(y-4)(y^2+4y-16)$. Would appreciate some help into figuring out a way to do so for general problems like these, thanks in advance!

My polynomial: $2x^3 +7x^2+12x+9$.  Now, I've tried both of the techniques given in , but neither of them worked for this problem. Synthetic division is something which I think would work, but it seems like a lot of work to first use the Rational Zeros Theorem to check all the possibilities using synthetic division and then come up with a quadratic equation.  The solution given is as follows: .  Obviously, one cannot use synthetic division to factor our $(2x +3)$ for the division works only for factors of the form $(x-c)$. So my question is, how do you factor a polynomial like this?


I need is to save an area of 300X300 Kilometers for offline viewing. When I disconnect the internet connection and open GE, the images don't load... I know that there is an option for this on mobile, but can this be done on Desktop?

I'd like to run Google Earth on a PC that does not have internet access. This was possible in NASA Worldwind if you downloaded all of the maps and stored them offline.  However, I have yet to see such documentation for Google Earth.  I've seen the links mentioned below and also the .  The problem is that this PC will NEVER have internet access.  I'm looking to find a way to copy the data over, so getting online, filling up 2GB of cache and then getting offline is not the end solution.


I have written composer.json in my module, after running this file, I got all phpExcel dependcies included. Structure formed is like  vendor --phpoffice ---phpexcel ----classes ----phpexcel.php  I am setting classes to psr-0 level for autoloading but I'm not able to call PhpExcel class in my controller.  Any idea about this?  @edit  I have read below articles, but can't find satisfactory solution for this issue. I have implemented below described approach, but still can't figure out whats exactly I'm missing.     install  in   project/modules/contrib folder.      Install       Installed library from  and place   it in "libraries" folder at root.   Now when I went to enable my modules it is simply giving me error:      The website encountered an unexpected error. Please try again later.   Error: Class 'Drupal\libraries\StreamWrapper\LibraryDefinitionsStream'   not found in   Drupal\Core\StreamWrapper\StreamWrapperManager->addStreamWrapper()   (line 156 of   core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php).   If I include the phpexcel library using composer, it get included. But the issue is.  This library has no namespaces. And If I call PhpExcel class in my controller,like  use PhpExcel/PhpExcel;  $spreadsheet = new SpreadsheetReader($file_path);   It gives error class not found.  How can I read excel file using phpExcel library?

I have a third party php library which I would like to use in a module. How do I do that in Drupal 8? In drupal 7, I have done things like the following code, but libraries_get_path() doesn't exist in Drupal 8, and I'm not exactly sure how things change, not that we use namespaces (of which I am a beginner).  require(libraries_get_path('twitter-api-php') . '/TwitterAPIExchange.php');   And, where should I place my library? Should I create a new libraries directory and put it in the root, just like modules and themes are now in the root?


Not sure how to say "Clickable" maybe hyperref?  I'm using the acronym package \usepackage{acronym} in my thesis.  And at the beginning I, adding the list of acronyms as:  \chapter*{Acrónimos} \addcontentsline{toc}{chapter}{Acrónimos} \input{acronimos.tex}   Each acronym is defined in the acronimos.tex file like:   \acrodef{SNC}{Sistema Nervioso Central} SNC: Sistema Nervioso Central.  \acrodef{TENS}{Transcutaneous electrical nerve stimulation por sus siglas en inglés} TENS: Spinal Cord Injury.   And calling each acronym in the text as   ... parapleja es causada por \ac{SCI}, las señales  ...   I'd like to know if is possible that the acronym in the pdf could be clickable and it goes to its definition in the acronyms list? Just like \cite{source} does.  Is it possible?  And a seccond question, why my latex doesn't complete the acronyms? not even if I write the command \a + Ctrl space it doesn't find the \ac{} command only shows \acute{}. It doesn't autocomplete \ac{} but it compiles ok.  Thanks

Currently, I'm using the acronym package to keep my thesis clear and understandable, because it is quite heavy on the use of acronyms in some parts. Because of this, some pages have so many acronyms, that they more or less look like someone went haywire with a blue text coloring tool.  So my question is: is it possible for either the acronym package, or the hyperref package, to only use one hyperref per acronym per page? So if one encounters an acronym for the first time on a page, he will be able to click on it and taken to the acronym definition list. The rest of the same acronyms on the same page will be printed without link.  I do not know if it is even possible for LaTeX to have this kind of 'reflection' on pages and links while compiling the document. Searching on this provided no results, which is why I'm resorting to the gurus over here.


I am busy working on a 3D $n$-body galaxy simulator and I am having some difficulty wrapping my head around determining the initial velocity components of each particle to ensure a circular orbit around a central mass.  I know that the magnitude of the velocity to ensure a circular orbit is calculated from: $$ v = \sqrt{\frac{GM}{r}} $$  How then can I determine what the individual velocity components in 3D will be for the particle?

I'd like to write an N-body simulation in which I collide two disk galaxies. To give you an idea of the accuracy I'm trying to achieve, I'm aiming to make this my screensaver at 30fps on my work desktop. Think Euler's method, large epsilons in denominators to prevent blow up, all that lazy stuff.   One place I don't want to be lazy, however, is in the initial construction of the galaxies I'm trying to collide. I want to design a galaxy that will at least sort of hold together by its own gravity until it smash it into another one.   How might I go about selecting the orbital velocities for each of the bodies composing the galaxy?


Whenever I try to rename a file in Windows 10, the behavior (since Windows 7) is to select only the file name, and not include the file extension.  In other words, when I try to rename filename.txt, only filename is auto-selected.  I understand why this is the default behavior (to stop non-techie users from accidentally renaming files to a point where they can't open them), but is there a Registry option to override this, so that it selects the entire filename.txt?  Obviously I can manually select as much as I want, but I'd love to change the default option.

Does anyone know if it's possible to change a setting so that the full file name is selected when you rename a file in newer versions of Windows?  (i.e. to match the behavior in Windows XP).  Currently it doesn't select the extension, so I have to do it manually.


This is how I interpret the story of Spirited Away:   The bathhouse represents the society. People work with each other towards a common goal. Every night, 8 million gods come to the bathhouse and workers serve them, worship them. In a way they deal with them, do business with them. In Asian cultures, fire, air, earth, water, food, etc. are represented as gods, so bathhouse very accurately represents a working society. The 'spell' breaks if they stop working. Yubaba is the culture. She manages the bathhouse. She is a tyrant and rules over people by taking their real names and giving them new names. Chihiro was given a new name by Yubaba, 'Sen', which means 'one thousand', similar to how a person is given a roll number or employee number in an organisation. That number becomes her new identity. Haku has forgotten his real name. Similar to Islamic terrorists, he's become a slave to the tyrannical culture. He'll do anything the culture tells him to do. The baby is the belief system of the society. Yubaba is  protective of him.   One thing I can't understand is, who is Zeniba, Yubaba's twin sister.   Yubaba and Zeniba are two parts of a whole. Yubaba keeps the baby locked in a room, afraid that he might get sick because of germs. Zeniba turned the baby into a mouse so that he might have a little freedom. Zeniba lives in the swamp bottom. There used to be trains running between the bathhouse and the swamp bottom in old days, but the return trains from the swamp bottom have stopped. Now it's a one-way road towards the swamp bottom. The tickets to the swamp bottom Kamaji gave to Chihiro had been with him for 40 years. 'Zeni' has  meanings in Japanese, 'money' and 'ancient'. 'ba' means 'old lady'. The meaning of Zeniba which seems to fit the story is 'ancient old lady'. Yubaba wanted to steal a seal from Zeniba, which was supposedly very precious.   So what do Yubaba and Zeniba represent in this story? It looks like they might represent:   culture and nature tyranny and individuality life and death interdependence and self reliance   but none of these seem to elegently fit all the points I've mentioned above.

This is how I interpret the story of Spirited Away:   The bathhouse represents the society. People work with each other towards a common goal. Every night, 8 million gods come to the bathhouse and workers serve them, worship them. In a way they deal with them, do business with them. In Asian cultures, fire, air, earth, water, food, etc. are represented as gods, so bathhouse very accurately represents a working society. The 'spell' breaks if they stop working. Yubaba is the culture. She manages the bathhouse. She is tyrannical and rules over people by taking there real name and giving them a new name. Chihiro was given a new name by Yubaba, 'Sen', which means 'one thousand', similar to how a person is given a roll number or employee number in an organisation. That number becomes his new identity. Haku has forgotten his real name. Similar to Islamic terrorism, he's become a slave to the tyrannical culture. He'll do anything the culture tells him to do. The baby is the belief system of the society. Yubaba is  protective of him.   One thing I can't understand is, who is Zeniba, Yubaba's twin sister.   Yubaba and Zeniba are two parts of a whole. Yubaba keeps baby locked in a room, afraid that he might get sick because of germs. Zeniba turned baby into a mouse so that he might have a little freedom. Zeniba lives in swamp bottom. There used to be trains running between bathhouse and swamp bottom in old days, but the return trains from swamp bottom have stopped. Now it's a one-way road towards swamp bottom. The tickets to swamp bottom Kamaji gave to Chihiro had been with him for 40 years. 'Zeni' has  meanings in Japanese, 'money' and 'ancient'. 'ba' means 'old lady'. The meaning of Zeniba which seems to fit the story is 'ancient old lady. Yubaba wanted to steal a seal from Zeniba, which was supposedly very precious.   So what does Zeniba represent in this story?


Scenario: I'm trying to build a random forest regressor to accelerate probing a large phase space.  I'm using python/scikit-learn to perform the regression, and I'm able to obtain a model that has a reasonably low cross-validation error on known data split into training/test sets.  Now I'd like to begin asking my model how confident it is (I'm a bit confused about the difference between confidence intervals and prediction intervals).  Currently I know how to return some estimator $y$ given data $x$, and now I'd like to be able to get a measure of uncertainty.  If the model is sufficiently uncertain, I'd like it to let me know so that I can add that case to the training set.  My impression is that random forests are an ensemble methods.  We grow $N$ decision trees, and then our predictor is given by: $$ y = \sum_i^N w_iT_i\left(x\right) $$ Where $w_i$ is some weight and $T_i(x)$ is the value predicted by the $i$-th tree.  Perhaps the simplest (and by no means most promising) approach would be to try to take something like a variance:  $$ \sigma^2 = \sum_i^N \left(T_i(x) - y(x)\right)^2 $$   seems to suggest we can do quantile analysis using each tree as an observation.  Unfortunately I'm not sure I follow that logic, because it seems to me that even for data points that were in the training set that there should be some variance among the trees.   seems to mention the flaws in the above methods, however I unfortunately can't really follow what they suggest we do instead (as my skills in R aren't what they could be).  Can someone weigh in on whether this is the train I should be following, and perhaps help me understand what's going on?  I can't understand where to work in assumptions about the sample.  Seeing similar code in Python would likely be really helpful to me.   also seems like it might be useful, but the terms/notations are entirely outside of my specialty, and its essentially unreadable to me right now.  While I've worked in statistics on an application level, it's been a while since my last formal class.  So part of the barrier to entry for me is terminology/symbol use.  Edited to provide more detail.

If I run a randomForest model, I can then make predictions based on the model.  Is there a way to get a prediction interval of each of the predictions such that I know how "sure" the model is of its answer.  If this is possible is it simply based on the variability of the dependent variable for the whole model or will it have wider and narrower intervals depending on the particular decision tree that was followed for a particular prediction?


I've stuck in an expression $$ \lim_{n\rightarrow \infty}n\int_0^{\pi/4}\tan^n(x)\ \text{d}x $$ I use Mathematica and it gives me $\frac 12$, but I don't know how to calculate it. May someone give me a hand?  BTW: Why $$ \frac{\partial}{\partial y}\int_a^b (f(x))^y\text{d}x= \int_a^b(f(x))^y\ln f(x)\ \text{d}x $$ but not $$ \int_a^b yf'(x)(f(x))^{y-1}\ \text{d}x $$

$$f(x)=\lim_{n\to\infty}\biggl(n\int_0^{\pi/4}(\tan x)^n\,dx\biggr)$$ I try to this way, $\tan x\ge x$, when $x\in(0,\frac\pi4)$, but this turns out to be $\tan x\ge0$, which is obvious even without calculation. I think it can be solved by using the squeeze rule but I can't find a proper scaler to meet $A=g(x)\le f(x)\le h(x)=A$ when $n\to\infty$   $\color{red}{Edit}$: According to@Khallil's advice, I can solve that $f(n)+f(n+2)=\frac1{n+1}$, and it's trivial that $\frac1{n+1}=f(n)+f(n+2)\le 2f(n)\le f(n-2)+f(n)=\frac1{n-1}$. So $f(x)=\frac12$.  This is easy and quick. Btw, is there any other idea?  $\color{red}{Edit[2]}$: I find that @Byron Schmuland 's method is especially useful in a specific kind of problem. $$f(x)=\lim_{n\to\infty}\int_0^1\frac{x^n}{1+x}dx$$,for example, Let $X_,...,X_n$ be i.i.d. random variables with density$f(x)=1$ on $(0,1)$, CDF(cumulative density function) of $X$ is $F(x)=x$. Now let $M=\max(X_1,\dots,X_n)$, its density function is: $f_M(x)=nx^{n-1}$ for $x\in(0,1)$ Also, it's also not hard to see that $M\to1$ in distribution as $n\to\infty$. So,$$f(x)=\lim_{n\to\infty}\int_0^1\frac{x^n}{1+x}dx=\lim_{n\to\infty}\frac1n\int_0^1{f_M(x)\frac{x}{x+1}dx}=\lim_{n\to\infty}\frac1nE(\frac{M}{M+1})=0$$ Although this simple example can be solved by other ways more easily, but this gives us another perspective.


I want to parse a JSON string in JavaScript. The response is something like  var response = '{"1":10,"2":10}';   How can I get the each key and value from this json ?  I am doing this -   var obj =  $.parseJSON(responseData); console.log(obj.count);   But i am getting undefined for obj.count.

How do I enumerate the properties of a JavaScript object?  I actually want to list all the defined variables and their values, but I've learned that defining a variable actually creates a property of the window object.


I'm hoping this will be a relatively simple one for someone in the know. I've tried as many options as i can think off but i must be missing something. I am attempting to create an insert statement in PHP using a file path which looks like this:  $filename = "images/stories/virtuemart/product/product05.jpg";   My insert statement looks like this:  $insert = 'INSERT INTO `jos_virtuemart_medias`(`virtuemart_vendor_id`, `file_title`, `file_description`, `file_mimetype`, `file_type`, `file_url`,`published`) VALUES (1,'basename($filename)','substr(basename($filename), 0, strrpos(basename($filename), '.'))', images/jpeg, Product, '$filename', 1)';   But its giving me a server error. I have checked the logs and nothing is showing, i also have display errors set at the start of the code. I just can't seem to get the syntax correct.

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


Finally, can someone settle the argument about the period going inside or outside of the close paren in this free-standing sentence?

Where should the period go when using parentheses? For example:     In sentence one, I use this example (which has a parenthesis at the end.)   Should the period be inside, or outside of the parentheses? What about if the entire sentence is a parenthetical (as below)?     (Where does the terminal punctuation go here?)   Is there a hard and fast rule?


As "lousy" is a pejorative for someone or something being infested with lice, why is it pronounced with a "z" instead of an "s" sound?  OTOH, when a person is called a "louse," the "s" sound is used.  Doubtless most people who use the word (lousy) don't really know what they're saying, thus the mispronunciation, but how did it get started in the first place?

Inspired by comments on :  The word lousy is traditionally pronounced with a /z/ sound, as though it were louzy.*  Contrastingly, the word mousy is always pronounced with an /s/ sound.  The difference seems to be pretty consistent and well-established: these are the only pronunciations listed in the OED and Merriam-Webster for each.  But their root words, louse and mouse, are pronounced identically, both with /s/.  Indeed, these words are parallel in almost every other way: they form analogous plurals — lice, mice — and have very similar origins.  So how and why did the pronunciations of lousy and mousy diverge?  And are there any other analogous words that also form analogous adjectives?  (House doesn’t form *housy; and blousy exists, but blouse is not analogous to the other words.)  *: It seems that recently, since the literal meaning “infested with lice” has become rare, it may sometimes get pronounced with /s/ in this sense, as a .


I have a problem in this method(it is not complete but the problem is on those lines). The thing is that I have a matrix "x", but after going through the absMatriz function, it changes its values. I would like to know how to keep my x matrix, I have tried saving it in another matrix "www" but it does not work.    public Matriz[] problema(Matriz x){          Matriz www=new Matriz(x.m,x.n); //the parameters are the dimensions of the matrix          www= x;          double mm= max(absMatriz(x));          return www;     }

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


In the past and recently I have clicked accidentally on the UP arrow to vote up but this is only an accident.  If I click on DOWN arrow to redo my vote, the counter is directly decremented by 1.  I search, I searched and I don't find any solution to remove my accidental vote.  Example:  The vote counter for a specific question is 0.  I click accidentally on UP and the vote counter is 1.  I see that immediately and I will correct my error and I click on the DOWN arrow but now the counter is -1 and not 0.  What is the solution to my problem?

What limits are there on how I can vote?  How often can I vote? How do my votes become locked/unlocked?


i recognized a successful hacking attempt where someone managed somehow to modify a file under my drupal installation and to inject javascript code  the file that was hacked was :jquery-1.9.1.min.js which is a general javascript library file that i downloaded earlier (clean with no hacking code)  i cleaned the file now but i want to know how the person got in?  and also another very strange thing , the last modified date of the file was intact since years even though the code was added to the file recently, can someone hack the site then change the last modified date as well to cover their tracks?  My question in simple words, where do i start looking to find clues to find the security hole?

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


I see a large number of posts stating that users ended up with their device going into a bootloop after flashing TWRP. If TWRP is flashed to the /recovery/ partition, how is it possible for the device to go into a bootlop during a normal start up?

I follow this XDA tutorial to . However, after flashing TWRP via Odin, the phone only boots into recovery, not system. Even factory reset or  cannot help. I have to reflash its . This erases TWRP and replace with the stock recovery. This is what the tutorial says, which I follow exactly:  Flash with ODIN in the AP slot. Put your device in DOWNLOAD mode. Uncheck Auto reboot. Load the respective file below into the AP slot and hit start. After flashing and ODIN reports PASS immediately reboot to recovery by holding POWER + HOME + VOL DOWN. As soon as the screen goes blank change to VOL UP whilst still holding POWER + HOME. You should now see TWRP recovery.  Yes I see TWRP recovery, but now the system cannot be booted.


I have a problem with find. It doesn't find *.sh files if I am in certain directory level. It does, however, find *.sql files.  /path$ cd do_not_upload/updates/1.1.1/ /path/do_not_upload/updates/1.1.1$ find . -path *.sh ./run_pre_update/002.sh ./run_pre_update/001.sh ./run_post_update/001.sh /path/do_not_upload/updates/1.1.1$ find . -path *.sh ./run_pre_update/002.sh ./run_pre_update/001.sh ./run_post_update/001.sh /path/do_not_upload/updates/1.1.1$ cd .. /path/do_not_upload/updates$ find . -path *.sh ./1.1.3/run_pre_update/002.sh ./1.1.3/run_pre_update/001.sh ./1.1.3/run_post_update/001.sh ./1.1.1/run_pre_update/002.sh ./1.1.1/run_pre_update/001.sh ./1.1.1/run_post_update/001.sh /path/do_not_upload/updates$ cd .. /path/do_not_upload$ find . -path *.sh ./updates/1.1.3/run_pre_update/002.sh ./updates/1.1.3/run_pre_update/001.sh ./updates/1.1.3/run_post_update/001.sh ./updates/1.1.1/run_pre_update/002.sh ./updates/1.1.1/run_pre_update/001.sh ./updates/1.1.1/run_post_update/001.sh /path/do_not_upload$ cd .. /path$ find . -path *.sh /path$ find . -path *.sql ./do_not_upload/updates/1.1.3/sql_migrations/002.sql ./do_not_upload/updates/1.1.3/sql_migrations/001.sql ./do_not_upload/updates/1.1.1/sql_migrations/002.sql ./do_not_upload/updates/1.1.1/sql_migrations/001.sql  $ find --version find (GNU findutils) 4.4.2  /path$ stat do_not_upload/   File: ‘do_not_upload/’   Size: 60          Blocks: 0          IO Block: 4096   directory Device: 14h/20d Inode: 159862      Links: 3 Access: (0775/drwxrwxr-x)  Uid: ( 1000/  jorgee)   Gid: ( 1000/  jorgee) Access: 2014-09-10 14:02:34.449376973 -0300 Modify: 2014-09-10 13:54:13.805363567 -0300 Change: 2014-09-10 13:54:13.805363567 -0300  Birth: -

Possible Duplicate:          I'm having some confusion with the find command.  If I type:  find . -name *.xml   or   find ./ -name *.xml   I receive a list of all the xml files in subdirectories of the current directory, UNLESS the current directory contains an xml file, in which case I get:  find: paths must precede expression: foo.xml Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]   What is the correct way to search for files with wildcard when the current directory may contain a match?


I'm new to Ubuntu and it's an awesome system but i can't find vlc on the ubunut search or figure out how to install any software like flash player etc can anyone help out please will be greatly appreciated

The title says it all. I'd like to know how I can install software - an example is the Chromium web browser.


I was trying to calculate integer xor of 0..n. I named the function xored(n).  Note that in examples below ^ does not mean power but integer xor (like in C or Java language)  So, xored(0) = 0, xored(1) = 0 ^ 1, xored(2) = 0 ^ 1 ^ 2, xored(3) = 0 ^ 1 ^ 2 ^ 3, etc... Or, if you prefer recursive definition: xored(0) = 0 xored(n) = n ^ xored(n-1)    First, I created a naive implementation that that loops through the values and xors them together.  Then, I noticed a funny thing. I noticed a pattern with my results.  All you need to do is to calculate n modulo 4 (call it m) then: if m = 0, xored(n) = n if m = 1, xored(n) = 1 if m = 2, xored(n) = n + 1 if m = 3, xored(n) = 0    My question is. Why does it work? How can this be proven mathematically? I am not good at proving theorems...

I hesitated to post on StackOverflow but I think the problem has little to do with programming and more to do with mathematics. So, here it is:  I wanted to compute the function $ f(n) = 0 \oplus 1 \oplus 2 \oplus \dotsb \oplus n$ in O(1) instead of O(n) so I computed $f(1), f(2),...$ to see the global look of the function and it appears that it has an easily identifiable pattern, which can be used to transform $f$ like so:  $$  f(n) = \left\{  \begin{array}{ll}   n  & \mbox{if } n \equiv 0 \pmod 4 \\                 1  & \mbox{if } n \equiv 1 \pmod 4 \\                 n+1  & \mbox{if } n \equiv 2 \pmod 4 \\                 0 & \mbox{if } n \equiv 3 \pmod 4 \\  \end{array} \right. $$   Does anyone know why the function has such pattern ?


Is there a way to make PDFs assume different colours when viewed on screen as opposed to when printed on paper?  As an example, I am using the titlesec package to make section labels a fancy dark blue. However, when I go on to print it, the labels look practically black. I'd like to fix this problem without having to produce a second version of my document by automatically replacing dark colors with brighter ones during printing.  Update regarding Ulrike's comment: I need this to work not just with Adobe Acrobat but other viewers as well. The suggested solution therefore does not work for me.

I am interested in displaying some things (e.g.: title page) in full color on screen, while having the same object/page display in a black and white friendly form when printed.  According to , there is built-in functionality in the PDF specification for Screen-Only objects and Screen-And-Print objects.  There may also be a way to add a layer on top of the B&W page that only displays the full color page on screen via the PDF 1.5 Optional Content Groups feature.  Similarly,  demonstrates the selective printing of text via ocg-p.  But it is not clear how I can use this package in the way that I need to.  My scenario is compounded by the fact that my color page text is white on a dark background.  MWE:  This code presents the way I am currently switching back and forth between color and b&w.  I change the printincolor bool variable to make the change.  \documentclass[11pt]{article}  \usepackage[demo]{graphicx} \usepackage{etoolbox}  \providebool{printincolor} % Will set color title page and section headings \setbool{printincolor}{false}  % Setup color if needed \ifbool{printincolor}{% \usepackage[pagecolor=none]{pagecolor}% \definecolor{MyBlue}{HTML}{1b3667}% \usepackage{afterpage}}{}  \begin{document}  % Begin Title Page {  \thispagestyle{empty}   \ifbool{printincolor}{%   \pagecolor{MyBlue}%   \afterpage{\nopagecolor}}{}   \begin{center}   {\ifbool{printincolor}{\color{white}\sffamily}{\sffamily}%  Set text color white or leave [default] black   \ifbool{printincolor}{\includegraphics[width=1.5in]{logo-gold}}{\includegraphics{logo-blue}}% put logo gold or blue   \\ \vskip 1in   \begin{huge}         \textbf{Title}         \vskip 0.1ex\rule{0.5\textwidth}{0.8pt}\vskip 1ex         Subtitle         \\         \end{huge}   \vfill\vfill   \begin{large}    Authors:\\   John Doe and Jane Doe\\   \end{large}   }   \end{center} }  \end{document}   How can I layer (or otherwise display) two versions of the title page in a way that color displays on screen, but black and white is printed?


I recently got a new ps4 and when I logged into my account, the games I bought on my ps3 did not show up. Is there any way I can transfer them?

Does the PS4 have backwards compatibility of some form? The majority of forums/sites suggest not, or posters are adamant it doesn't yet. Others imply that some form of backwards compatibility will include a cloud service and PS3 titles? I've even heard on some forums that PS4 does actually play PS3 games but those posts seem to be a minority compared to those that say it's not...


I am often disappointed with PCA plots in the scientific literature. Typically PCA plots do not provide a breakdown of the variables and their weights, just something like PCA1 (70% variance explained), PCA2 (10% variance explained). How could one tell which variables are strongly loaded into a component?  Are there PCA visualizations that can provide more insight into the data?

Is it possible to visualize the output of Principal Component Analysis in ways that give more insight than just summary tables? Is it possible to do it when the number of observations is large, say ~1e4? And is it possible to do it in R [other environments welcome]?


I downloaded a vector from an online stock image library. The vector is of a car that should only have one color, black. Unfortunately, it has some white areas that I need to be transparent. The only color I want on the vector is black. I tried selecting all of the white areas and deleting them but that just makes everything black because the white areas are layered on top of the black areas.  Is there a way for me to tell illustrator to just cut out all of the white areas and everything in the layer below these areas? Basically I want to do a global "minus" of every area that is white.   See image below.  Thanks.

I am working with a pretty complex traced AI that I received, and I want to basically make it so that all the visually black stuff is shapes, and all the white outlines (invisible here) are removed. Most of the spaces when a line crosses over another is created by a white outline.   I know about expanding appearance and the pathfinder tool, but because there are so many lines that are crisscrossing, I haven't had an easy way of minusing the fronts away. I could expand appearance and sort every object carefully, but I feel like there may be a quicker way of doing this.  If I put it in Photoshop as a smart object in 'screen' mode, it looks right.. I could put that back in Illy and trace it, but I don't want to complicate the paths.


In my AJAX success function, I've written:   rt = JSON.parse(responseText); for (i = 0; i < rt.length; i++) {   $("#inv").append("
" + rt[i][0] +     "	<input type='submit' value='Sync' " +     "class='syncnow' id='sync"+rt[i][6]+"' />
"); }   I've tried jQuery code:  $(".syncnow").on("click", function() {   alert("Hi"); });   Tried .click(), $(".tdclass").on("click", ".syncnow", function() {}) etc., but to no avail.  Can anyone help me with this?

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


How to calculate the limit above without using L´Hôpital rule? I am not able to factor the numerator and I´ve also tried factoring the numerator.

I need to solve   $$\lim_{x\to 1}\frac{\sqrt[3]{x}-1}{x-1} $$  But without using L’Hopital’s Rule, could someone help me?


I am on OSX and installed Homebrew to get the GNU coreutils.  I wanted gsort to be used instead of the preinstalled sort command so I created a symlink to gsort.  My limited experience tells me that running sort from the CL or in a script will use gsort, however that's not what's happening:  $ which gsort; which sort /usr/local/bin/gsort /usr/local/bin/sort $ ll /usr/local/bin/ | fgrep sort 1083450 lrwxr-xr-x  1 alex  admin  -   34B Mar 23 15:56:52 2016 gsort@ -> ../Cellar/coreutils/8.25/bin/gsort 1083466 lrwxr-xr-x  1 alex  admin  -   35B Mar 23 15:56:52 2016 gtsort@ -> ../Cellar/coreutils/8.25/bin/gtsort 1088327 lrwxr-xr-x  1 alex  admin  -   34B Mar 23 16:57:41 2016 sort@ -> ../Cellar/coreutils/8.25/bin/gsort $ echo ${PATH}  /usr/local/opt/gnu-sed/bin/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin $ gsort --version | fgrep GNU sort (GNU coreutils) 8.25 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. $ /usr/local/bin/sort --version | fgrep GNU sort (GNU coreutils) 8.25 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. $ sort --version | fgrep GNU sort (GNU coreutils) 5.93 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.   Notice that when checking the version of gsort and sort (when using the absolute path to the symlink) it properly shows the newer coreutils version, but just running sort still gives me the old, preinstalled version.  Can anyone tell me why?

When I execute a program without specifying the full path to the executable, and Bash must search the directories in $PATH to find the binary, it seems that Bash remembers the path in some sort of cache. For example, I installed a build of Subversion from source to /usr/local, then typed svnsync help at the Bash prompt. Bash located the binary /usr/local/bin/svnsync for "svnsync" and executed it. Then when I deleted the installation of Subversion in /usr/local and re-ran svnsync help, Bash responds:  bash: /usr/local/bin/svnsync: No such file or directory   But, when I start a new instance of Bash, it finds and executes /usr/bin/svnsync.  How do I clear the cache of paths to executables?


I'm using C# SharpDevelop. A DataGridView is created/initialized in Mainform Designer.cs and I want to access it (clear/add row) in MainForm.cs but is getting a "cross thread run time error" :     accessed from a thread other than the thread it was created on   Any simple ways around this?  Thanks.

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.


This is an example, of hyper-parameters search in a hypothetical python code. My question is How can I be sure that RandomSearch really will find the best parameters that lies within the top 5% of the true maximum, with 95% probability.  I read this , and its claims that with 60 iterations of random search I will find that 5% with 95% of probability. But that looks like a magic number and I don't know if that works just for any case or any type of problems without considering any other characteristic of the problem or the amount of hyper-parameters    import numpy as np from sklearn.model_selection import ParameterSampler #... lot of imports and code that doesn't matter right now parameters = {         "sequence_length": np.arange(50, 300, 50),         "vocabulary_size": np.arange(1000, 50000, 1000),         "embeddings_size": np.arange(64, 257, 64),         "dropout": np.arange(0.2, 0.8, 0.1)     }     param_grid = ParameterSampler(parameters, n_iter=60)      for grid in param_grid:         my_awesome_lstm_model.fit(parameters=grid)

I'm currently going through Bengio's and Bergstra's Random Search for Hyper-Parameter Optimization  where the authors claim random search is more efficient than grid search in achieving approximately equal performance. My question is: Do people here agree with that claim? In my work I've been using grid search mostly because of the lack of tools available to perform random search easily. What is the experience of people using grid vs. random search?


Sure, hascodes are used in hastables and collections but what about that:  class TwoDPoint : System.Object{     public readonly int x, y;     //...left out some code     public override int GetHashCode(){       return x ^ y;    } }   Source:  The snipped above directed me to the following sentence:     You should not assume that equal hash codes imply object equality.   Source:   What I wonder is if we shouldn't always check for object equality after two hash codes match. Consider the following two dots:  P1.x = 2; P1.y = 4; Hash = 16 and P2.x = 4; P2.y = 2; Hash = 16   If I only check the hash before inserting an item into a hashtable wouldn't that be a huge problem?  Or is the this function maybe just used to provide a more performant way of checking "simmilarity" but always requires an equality check after a match?  Or should I not care and just use the hashcode and assume it doesn't matter?

Given the following class  public class Foo {     public int FooId { get; set; }     public string FooName { get; set; }      public override bool Equals(object obj)     {         Foo fooItem = obj as Foo;          if (fooItem == null)          {            return false;         }          return fooItem.FooId == this.FooId;     }      public override int GetHashCode()     {         // Which is preferred?          return base.GetHashCode();          //return this.FooId.GetHashCode();     } }   I have overridden the Equals method because Foo represent a row for the Foos table.  Which is the preferred method for overriding the GetHashCode?  Why is it important to override GetHashCode?


I am trying to understand the result of the Frisch-Waugh-Lovell Theorem that we can partial out a set out regressors. The model I am looking at is $y=X_1\beta_1 + X_2\beta_2 +u$  So the first step would be to regress $X_2$ on $X_1$: $$ \begin{align} X_2&=X_1\hat{\gamma}_1+\hat{w}\\ &=X_1\hat{\gamma}_1+M_{X_1}X_2 \end{align} $$ with $M_X$ being the orthogonal projection matrix ($M_X=I-P_X$). The second step is then to regress $y$ on $X_1$: $$ \begin{align} y&=X_1\hat{\gamma}_2+\hat{v}\\ &=X_1\hat{\gamma}_2+M_{X_1}y \end{align} $$ And the third step would be to regress the residuals of the previous regressions on each other: $$ \begin{align} \hat{w}&=\hat{v}\beta_2+u\\ M_{X_1}y&=M_{X_1}X_2\beta_2+u \end{align} $$ Can somebody tell me whether this would be a correct way of describing this result and in particular whether the residuals in the last equation $u$ are equal to the residuals in the model?

Not sure if normalize is the correct word to use here, but I will try my best to illustrate what I am trying to ask. The estimator used here is least squares.  Suppose you have $y=\beta_0+\beta_1x_1$, you can center it around the mean by $y=\beta_0'+\beta_1x_1'$ where $\beta_0'=\beta_0+\beta_1\bar x_1$ and $x_1'=x-\bar x$, so that $\beta_0'$ no longer has any influence on estimating $\beta_1$.  By this I mean $\hat\beta_1$ in $y=\beta_1x_1'$ is equivalent to $\hat\beta_1$ in $y=\beta_0+\beta_1x_1$. We have reduced equation for easier least square calculation.  How do you apply this method in general? Now I have the model $y=\beta_1e^{x_1t}+\beta_2e^{x_2t}$, I am trying to reduce it to $y=\beta_1x'$.


I was wondering if it is true that : $X$ and $Y$ gaussian and $\mathbb E[XY]=0\implies X$ and $Y$ independent ?

I read in a textbook that when two gaussian variables are uncorrelated, then they are statistically independent? How can I prove that?


I am very curious about SEO for the past few days. I noticed that when searching the Laravel website, below the website description, the name of the developer appears. I tested three search engines, Google, Bing and DuckDuck Go, and only on Google does the name of the developer appear below the website description, how is this possible? I didn't see any meta tags on the website containing the name Taylor Otwell PICTURE:

What I am referring to is say you search for . You can see on the sidebar of the results page all of the company's wiki information.  My current website does not show my company's wiki page. I am trying to figure out if there is a certain time limit for Google to show the wiki page or if some other validation is required for it to show that is documented?


When i use internal Word "Save As" PDF it never embed the font. When i use PDF Creator it works ok, but then i lose the bookmarks and cross references.  I'm using Windows 7, when i go to the font folder, the font i'm using "Font Embeddability" property is listed as "Editable", which i believe should be enough to embed.  If i set "Bitmap text when fonts may not be embedded" it displays the pdf correctly, but i cant copy the text.

I'm trying to convert a Word 2016 document to pdf. It is important that the entire document is in 300 dpi.  However, some of the special fonts I use (otf) only have a resolution of 72 dpi when I export them to pdf (I have tried with several programs). It seems that Word only sets the resolution of the font to 72 dpi.  Images are as they should be (have adjusted necessary settings)  otf should be vector based, hence, there should not be problems with resolution.     I have tried to save as pdf with integrated fonts. I have tried to print via primopdf and setting resolution there to 300 dpi.   So, how do I get Word to output fonts in 300-dpi resolution for printing / exporting document to a professional printer?


As per above title.  The complete sentence would be: You are hereby instructed not to proceed with any construction works for the units shown on the plan attached.  Thanks.

This is one thing that keeps bugging me, and maybe there's a direct answer. Grammatically, which one is more correct of these two?  Does it make a difference?  I tried not to do that. I tried to not do that.


Can I go directly to my main destination without going to member state of first entry in Schengen area? What can I do if visa is issued after the intended date of travel? How can I change my first entry to my main destination?  From comments...   I didn't received my visa from France (Main Destination) yet, in application I have filled spain as my first entry. If my visa is issued from france then is it possible to travel directly to france without going to spain?

In case, if I get a multiple-entry Schengen visa in one of the embassies in Ukraine, Kyiv - should my first trip be to the country which issued the visa?  Any there any requirements of this sort? Does this condition vary depending on embassy which issued the visa?  What are the possible consequences on not visiting that country first? Does it somehow depend on country where the embassy is (i.e. non-Schengen and not EU members)?


I'm on Ubuntu 16.04 and I notice that in the "Additional Drivers" tab of "Software & Updates", the latest versions of NVIDIA drivers I can install are   version 367.57 from nvidia-367 (proprietary) version 370.28 from nvidia-370 (open source)   Aside from the fact that I don't know what "proprietary" and "open source" mean here, I also don't see an option to select the driver version based on my actual graphics card. I'm using GTX 1080 and the current Long Lived Branch version is 375.20; will the Ubuntu graphics PPA be updated eventually, or will I have to manually install 375?

Is there a package of Ubuntu drivers as driver pack solution? I tried to search for it, but I did not find it. If there is, how can I easily get it?


I cannot compile this program which from a file with this format (where "Via" is the italian for "road")  Via Emilia-->Via Botti  Via Castello-->Via Emilia  Via Appia-->Via Botti  Via Botti-->Via Emilia  Via Castello-->Via Amendola  Via Appia-->Via Ancona  Via Castello-->Via Botti  Via Matteotti-->Via Carso  Via Ancona-->Via Matteotti  Via Carso-->Via Matteotti   And at the third questions asks me to find which roads  are recursive one into another (like a->b and b->a), but when I try to put conditions to remove the possibility of having duplicate answers (like a and b are recursive and b and a are recursive) I get this error "java.util.ConcurrentModificationException", what does it mean?  This is the main  public static void main(String[] args) throws Exception{      ArrayList<percorso> perc = new ArrayList<percorso>();      String line;     BufferedReader br = new BufferedReader(new FileReader("vie.txt"));      while ((line = br.readLine())!=null){     percorso p = new percorso (null,null);     String [] e = line.split("-->");     p.from = e[0];     p.to = e[1];     perc.add(p);     }     br.close();     //punto1(perc);     //punto2(perc);     punto3(perc); }          This is the method to compile the answer at the third question      public static void punto3(ArrayList<percorso> perc) throws Exception{      BufferedWriter bw=new BufferedWriter(new FileWriter("3.html"));     bw.write(" \n  \n");     bw.write("
 Punto 3
 \n");     bw.write("
 Trovare le coppie di strade che formano un anello chiuso
 \n");     ArrayList<percorso> perc2 = new ArrayList<percorso>();     for (percorso k: perc)         perc2.add(k);      ArrayList<String[]> Arr = new ArrayList<String[]>();      for (percorso i: perc2){         for (percorso j: perc2){             if (i.from.equals(j.to) && i.to.equals(j.from)){                 String [] e = {i.from,i.to};                 Arr.add(e);             }         }     }      ArrayList<String[]> Arr2 = new ArrayList<String[]>();     for (String [] z: Arr){         Arr2.add(z);}      for (String [] f: Arr){         for (String [] j: Arr2){             if (f[0].equals(j[1]) && j[0].equals(f[1]))                 Arr.remove(j);         }     }     for (String [] x: Arr)     bw.write("le vie "+x[0]+", "+x[1]+" formano un anello chiuso
");     bw.write(" \n  \n");     bw.close();     }   And the class percorso is the following     public class percorso {    String from;    String to;     public percorso (String from,String to){     this.from = from;     this.to = to;    }    }

We all know you can't do the following because of ConcurrentModificationException:  for (Object i : l) {     if (condition(i)) {         l.remove(i);     } }   But this apparently works sometimes, but not always. Here's some specific code:  public static void main(String[] args) {     Collection<Integer> l = new ArrayList<>();      for (int i = 0; i < 10; ++i) {         l.add(4);         l.add(5);         l.add(6);     }      for (int i : l) {         if (i == 5) {             l.remove(i);         }     }      System.out.println(l); }   This, of course, results in:  Exception in thread "main" java.util.ConcurrentModificationException   Even though multiple threads aren't doing it. Anyway.  What's the best solution to this problem? How can I remove an item from the collection in a loop without throwing this exception?  I'm also using an arbitrary Collection here, not necessarily an ArrayList, so you can't rely on get.


I previously animated a short animation. I wanted to redo the animation. So I redid the animation and it can be seen when you scrub through the frames in the time frame but when you hit the animation button it replays the old animation. Can can I force blender to use the new keyframes?

Blender is rendering an older version of my project, not the most recent one. I have made it using the Blender Render but it does not want to render in cycles either. A black and grey screen is rendered as if everything is transparent. Checked general camera, lighting and compute devises in case I messed something up but I can't find anything. All my textures and objects look normal, does anybody know what is wrong or what to check?  Ok added link:


I want Ubuntu to run as second OS on my Laptop which has Windows 10 preinstalled. I had a Kubuntu version running but unfortunately Windows 10 was installed with UEFI while I installed the Kubuntu in lagacy BIOS.  That worked but it was quite anoying to switch operating systems (also Kubuntu had huge problems with my touchpad). So I installed Ubuntu in UEFI mode on the partitions the Kubuntu was once installed on. I expected my laptop to let my choose between Windows and Ubuntu the next time I restart but Windows starts automatically.   The installation was without errors and Windows quickstart is disabled. What can I do to make the Windows Bootmanager recognize Ubuntu?  I have an Acer Aspire V5-591G-54PC

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


I have a result from recursive query that gives me Table1 (SQL Server 2008 R2). I need to convert the Table1 to Table2 and I don't know the best and simplest approach to do it. Any suggestions? Table1  Table2  Regards.

I've read many posts about using pivot to get the data in the format I want, but the more I read the more confused I get.  I have this data:    That I'm trying to get into a format similar to this:   For the most part, everything I try results in an SQL error, and the only successful attempt I've had didn't return the data in the format I'm looking for.  Any help would be appreciated.


I use apt for update, full-upgrade, and to install, remove, and purge. Sometimes I use autoremove but it is probably unnecessary because I am not lacking disk space. I do not recall ever needing to use apt-get since I became aware of apt.   Has apt made apt-get unnecessary for the vast majority of users?

I read about the new fancy progress bar which was added to apt 1.0 in  and how to enable it . However on running sudo apt-get update, I did not see the fancy progress bars. On reading the second link again, the solution explicitly requires you to use sudo apt update.  Hence my question is the difference between apt and apt-get. I thought they were one and the same.


I am trying to create a game where one scene would be the "Past" and one scene would be the "Future". The player can travel through a portal to move between the past and future scenes. In the past scene, the player makes a wooden house and in the future scene it will be turned into something else. There can be multiple instances of these buildings in different places in the scene. So far, I've tried...  Using DontDestroyOnLoad to carry the object through from the past to future when loading between scenes.  Using singletons to avoid duplicating the object multiple times when loading back and forth. But that has a problem: using singletons causes restricts me to just one instance of the building per scene, and I want to have several.   The reason why I wouldn't want to unload the old object when the scene unloads is because I wanted the player to be able to build in any area available within the scene. Something like the Fallout 4 building mechanics, where you can build in certain areas and keep those buildings, but I want it to become a different prefab in the future scene. How can I implement a feature like this?

I am developing my first 2D game in Unity and I have come across what seems an important question.  How do I handle data between scenes?  There seems to be different answers to this:   Someone mention using , while other people told me this should be used to store other things like screen brightness and so on. Someone told me that the best way was to make sure to write everything into a savegame everytime that I changed scenes, and to make sure that when the new scene loads, get the info from the savegame again. This seemed to me wasteful in performance. Was I wrong? The other solution, which is the one I have implemented so far is to have a global game object that isn't destroyed between scenes, handling all the data between scenes. So when the game starts, I load a Start Scene where this object is loaded. After this ends, it loads the first real game scene, usually a main menu.   This is my implementation:  using UnityEngine; using UnityEngine.UI; using System.Collections;  public class GameController : MonoBehaviour {      // Make global     public static GameController Instance {         get;         set;     }      void Awake () {         DontDestroyOnLoad (transform.gameObject);         Instance = this;     }      void Start() {         //Load first game scene (probably main menu)         Application.LoadLevel(2);     }      // Data persisted between scenes     public int exp = 0;     public int armor = 0;     public int weapon = 0;     //... }   This object can be handled on my other classes like this:  private GameController gameController = GameController.Instance;   While this has worked so far, it presents me with one big problem: If I want to load directly a scene, let's say for instance the final level of the game, I can't load it directly, since that scene does not contain this global game object.  Am I handling this problem the wrong way? Are there better practices for this kind of challenge? I would love to hear your opinions, thoughts and suggestions on this issue.  Thanks


When I try to add or multiply in a python3, I get an obvious error, although the operation is very simple and can be easily verified.  # for example:  a = 0.3 * 3 b = 0.3 + 0.3 + 0.3 c = 0.6 + 0.3  print('a = ',a) print('b = ', b) print('c = ',c)   I expect the answer to be 0.9, but it is different.  a =  0.8999999999999999 b =  0.8999999999999999 c =  0.8999999999999999   Can someone explain why this is happening. I use: Python 3.6.8 :: Anaconda custom (64-bit)

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


I have added the following rule to .htaccess  RewriteCond %{HTTP_HOST}   !^example\.com [NC] RewriteCond %{HTTP_HOST}   !^$ RewriteRule ^/(.*)         http://www.example.com/$1 [R=301,NC,L]   I suppose it says that if url is not example.com, redirect it to www.example.com.   I need to do this as I have a Cname example.rhcloud.com and is mapped to www.example.com. But I still can access example.rhcloud.com and is being indexed by Google as well. I certainly do not want my data to be available on 2 different domains and want example.rhcloud.com to be redirected to www.example.com  With above rewrite rule, it does nothing and gives access to example.rhcloud.com.  I also tried using   RewriteCond %{HTTP_HOST} ^example.rhcloud.com$ RewriteRule (.*)$ http://www.example.com/$1 [R=301,L]   But it says too many redirects as it try and retry to connect to example.rhcloud.com.  How do I have this redirect work?  Also, If that makes any difference, I have added WordPress URL and site URL set to www.example.com only.

Openshift application url: example.rhcloud.com  Custom domain: example.com  I came across this  and added the redirection rule. However, I can not access example.rhcloud.com now. My custom domain is www.example.com.  To avoid duplicate content problems, I tried this redirection.   Here is my .htaccess file:  RewriteEngine on   # Uncomment the following lines to force HTTPS #RewriteCond %{HTTP:X-Forwarded-Proto} !https  #RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R,L]   # WordPress Defaults RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]  # Redirect Https traffic to Http RewriteEngine on  RewriteCond %{SERVER_PORT} ^443$ [OR] RewriteCond %{HTTPS} on RewriteRule  ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]   # Redirect non-www to www RewriteEngine on  RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]    # Redirect openshift rhcloud domain to custom domain RewriteEngine on  RewriteCond %{HTTP_HOST} ^example.rhcloud.com$ RewriteRule (.*)$ http://www.example.com/$1 [R=301,L]   Why is example.com not redirecting to ww.example.com? How do I fix this?  Also, I see that since I have https to http redirection and non www to www redirection, my blog has been loading slow. How can I reduce it to lesser number of rules?  Edit:  In chrome:   In Firefox:     The page isn't redirecting properly, Firefox has detected that the server is redirecting the request for this address in a way that will never complete.     This problem can sometimes be caused by disabling or refusing to accept cookies.


I've noticed recently that colleagues, friends, and others seeking employment, have shown, among other things, their Erdős number on their resume/CV.  I've also seen some put down their h-index, or their publication with the most citations (the running tally of citations for that publication), or the Impact Factor journal that they have ever published in, etc.  I know there is a  on just h-index in a CV/resume (so please do not mark as duplicate), but this is a broader question about other figures of merit, especially Erdős number.  I realize that having a CV/resume that stands out is important and can give an edge to getting that coveted position, but is listing these types of things appropriate?  Let me just make clear that I am not endorsing doing this or saying that I have done it, I am just asking if this is common, acceptable, or purposeful.

I'm finishing my PhD and looking for postdoc jobs. I've published a decent number of papers (and also have a fair number of citations), and want to emphasize this on my CV.  Should I actually state my h-index on my CV? If so, is Google Scholar the easiest/best way to compute this?  2014.03.12 EDIT: Thanks for the advice. I had originally planned to put my h-index at the head of my list of publications (as a clickable link to my Google Scholar profile).  Based on the advice from many of you I will just omit this altogether for now. My scholar profile is easy to find (for potential PIs who care about such metrics), and not explicitly stating my h-index myself avoids any negative connotations among those who object to the h-index or calculating it via Google Scholar (e.g. Google includes self-citations, arXiv/non peer-reviewed papers etc).


What is the most efficient way to count a number of occurrences of a substring in another string in C++? For example, I have a very huge string like  "GQWHIWQGHWGGEEEGQIHIGWHIQWGHIEEEGPHIQPIWGHQPWGPHEEEGQIHWPWGQHPQWGEEE"   and I want to count how often "EEE" occurs.  I could go step by step in a for loop and check every letter if it's an E and if so, count them and if there are 3 es, increment a counter, but I guess there is a more efficient way of doing this.  Maybe a string function? I just wasn't able to find or google a suitable one.  I am searching for a clean C++11 solution.

I am doing something where I realised I wanted to count how many /s I could find in a string, and then it struck me, that there were several ways to do it, but couldn't decide on what the best (or easiest) was.  At the moment I'm going with something like:  string source = "/once/upon/a/time/"; int count = source.Length - source.Replace("/", "").Length;   But I don't like it at all, any takers?  I don't really want to dig out RegEx for this, do I?  I know my string is going to have the term I'm searching for, so you can assume that...  Of course for strings where length > 1,  string haystack = "/once/upon/a/time"; string needle = "/"; int needleCount = ( haystack.Length - haystack.Replace(needle,"").Length ) / needle.Length;


i have problem with my code. the program should print tab backwards but it gives also additional numbers example: 7  6  8  7  2  1    6 1 2 7 8 6 7  #include<iostream> #include<ctime>  int main() {     using namespace std;     srand(time(nullptr));          int tab[6];          for (int i = 0; i < 6; i++)     {         tab[i] = rand() % 8 + 1;         cout << " " << " " << tab[i];     }          cout << "   ";     for (int i = 6; i >= 0; i--)     {         cout << " " << tab[i];     }

What is a magic number?  Why should it be avoided?  Are there cases where it's appropriate?


I am trying to add the HelpText in to the VF Page and I tried few options like below  and none of them is working for me. Added the HelpText in the <apex:pageblockSectionItem> <apex:pageblockSectionItem helpText = "Test">    <apex:outputPanel >       <div class="ListLevel02">          <apex:outputLabel value="Type 1" ></apex:outputLabel>       </div>     </apex:outputPanel>    <apex:inputcheckbox value="{!conRec.Type_I__c}" styleClass="ListLevel02"></apex:inputcheckbox>   </apex:pageblockSectionItem>      HelpText is not enabled and cant click on them. I tried to have the HelpText added at the field  And tried using them like  <apex:pageblockSectionItem helpText= "{!$ObjectType.Contact.Fields.Type_I__c.inlineHelpText}">  Even this has the same behaviour. Can anyone say what am I missing here

I have a table inside of a pageblocksection and then inside of that I have an  that I am trying to utilize the default help text for but it's not showing up.  <apex:pageBlockSection columns="1">   <apex:outputPanel>     <table> width="100%">       <tr>         <td>           <apex:pageBlockSectionItem helpText="test text">             <apex:inputCheckbox value="{!searchBySKU}" />             <apex:outputLabel value="Search for this SKU or text in the SKU name" />           </apex:pageBlockSectionItem>         </td>       </tr>     </table>   </apex:outputPanel> </apex:pageBlockSection>   Any ideas why this doesn't work as I expect?  EDIT:  So, I just did some more testing and it creates the text if it's a direct child of the pageBlockSection. Is there any way to get around this restriction without going the fully custom route to do so?


It says specifically in this AWS readme documentation to make a .aws folder, and other folders of this type exist (.ext), but windows says "you must type a file name" in order to try and create a folder like this and won't let you.   I could be reading this wrong, so correct me if I am.  The \ is confusing and I am used to seeing this in commenting code, but not in actual file folders.   You need to set up your AWS security credentials before the sample code is able to connect to AWS. You can do this by creating a file named "credentials" at ~/.aws/  (C:\Users\USER_NAME\\.aws\ for Windows users) and saving the following lines in the file:  [default] aws_access_key_id = <your access key id> aws_secret_access_key = <your secret key>

Many programs needs folder names that starts with a dot, like .emacs.d, .gimp-2.2, .jedit etc. How do I create such a folder?  When using the Windows Explorer in Windows 2000 (and other versions), I get an error message saying "You have to enter a filename". The only solution I have come up with, is to open a command prompt (Start > Run > "CMD" > OK) and enter mkdir .mydir.  Why have Microsoft this error message in the Explorer, but not in the command shell? Is there any registry hack out there to fix this, so that I am able to enter the folder name directly in the Explorer?


I'm doing a leetcode problem - rightSideView. When I create an inner helper function, I thought I'd have access to the outer function variables. However, that only holds true for result (a list) but not maxHeight (an int). Code referenced below: class Solution(object):     def rightSideView(self, root):        result = []        maxHeight = 0        def dfs(node, height):            if node is not None:                height += 1                if height > maxHeight:                    maxHeight = height                    result.append(node.val)                dfs(node.right, height)                dfs(node.left, height)        dfs(root, 0)        return result  This can be fixed if I reference self.maxHeight; however I don't have to do the same for result. Why is this? Could it be that lists are created as global variables inside classes in python? Not sure how else to explain this. The following code works without errors: class Solution(object):     def rightSideView(self, root):        result = []        self.maxHeight = 0        def dfs(node, height):            if node is not None:                height += 1                if height > self.maxHeight:                    self.maxHeight = height                    result.append(node.val)                dfs(node.right, height)                dfs(node.left, height)        dfs(root, 0)        return result

The following code works as expected in both Python 2.5 and 3.0:  a, b, c = (1, 2, 3)  print(a, b, c)  def test():     print(a)     print(b)     print(c)    # (A)     #c+=1       # (B) test()   However, when I uncomment line (B), I get an UnboundLocalError: 'c' not assigned at line (A). The values of a and b are printed correctly. This has me completely baffled for two reasons:   Why is there a runtime error thrown at line (A) because of a later statement on line (B)? Why are variables a and b printed as expected, while c raises an error?   The only explanation I can come up with is that a local variable c is created by the assignment c+=1, which takes precedent over the "global" variable c even before the local variable is created. Of course, it doesn't make sense for a variable to "steal" scope before it exists.  Could someone please explain this behavior?


I have the DnD 4e red box, and some friends and I are keen to play more.  I live in Belgium (Europe) and finding your gear here isn't all that easy. Most of the books sold online come from America.  Which books should I get? First I thought I'd get the 3 core rulebooks, but now I see that there's alot (even game changing) errata. I also notice that there are different ways to get all your rules, some speak of buying 2 essential books and the compendium... I want to play the game, with quite some content, what is the way to go? Anyone that can point me out a good site that has these things for me?  (Then I also noticed that there are things like Players Handbook 2 etc. These are not updated version but expansions I presume?)  Thanks!

Me and my group just finished the essentials red box, and are looking at moving to the full 4e game. I'm doing some preliminary reading of the books and one thing is confusing me a little.  The characters from the red box are up to level 2 now, and I don't know where I'd find the information on what EXP they level up at. Furthering that, whilst I've found (in the PHB) how many hit points a class would gain at a certain level, I can't find where it says what amount should be added to other attributes, like perception, dexterity, etc.  Many on forums say move to Heroes of Forgotten Kingdoms, but the same character classes (Cleric, Warrior, etc.) don't reappear in that book - it just adds some new ones.  Which book would I find this information in? Or am I just missing it?  TL;DR: Where do I find attribute increases for classes by level & where do I find leveling up EXP?  Thanks in advance, Joe


I have some functions which may take a longer time to execute, in which case I would like to cut them short (in such a case I do not care about what happens in the function and the consequences to stop it short)  Since these functions are not all mine, I would like to exert this control from the calling program and not implement a check within the function itself (it would be a solution if there is a loop in the function where I could check the time spent, or use timeouts on some calls which support it etc.).  In other words I do not want to change the function.  Is such a mechanism available?  My immediate idea was to start a thread with the function as worker and periodically check if the thread is still live, killing it if it has not came back after the limit time. Unfortunately I learned that killing a thread in a non-cooperative way is not possible (that would be a solution for a process, though but using a process is not practical because it would complexify the existing shared objects).  EDIT: please note that this is not a duplicate of , the solutions there either point to a cooperative shutdown, or process vs thread. Both are addressed in my question. I slightly modified the title to emphasize where the control is.

There is a socket related function call in my code, that function is from another module thus out of my control, the problem is that it blocks for hours occasionally, which is totally unacceptable, How can I limit the function execution time from my code? I guess the solution must utilize another thread.


I dont fully understand Zscore,  I need to standardise raw data to use them for further uses, so I though about using Zscore. When I calculated it, some of the results I got are greater than 1 and I wonder if I can control these result without ruining the standardisation . Is it possible to calculate zscore and ensure result range between 1 and -1? or i have to use other methods

I am lost in normalizing, could anyone guide me please.  I have a minimum and maximum values, say -23.89 and 7.54990767, respectively.  If I get a value of 5.6878 how can I scale this value on a scale of 0 to 1.


The story is about a neolithic shaman who becomes injured by aliens, and when they heal them they make him immortal.

I read a book about a man who was geneticall modified during prehistoric times by aliens, and lived forever. I keep thinking it was Ben Bova or Greg Bear story but I cannot think of it. I read it as a kid and now I cannot remember name or author. It seemed to follow his life through out history into modern times. I have googled this to no end. Anyone recall this book?


I'm trying to solve Problem II.2.2 in textbook Analysis I by Amann/Escher.        Could you please verify whether my attempt on (b) and (c) is fine or it contains logical gaps/errors?    My attempt:  From binomial theorem, we have $$2^n = (1+1)^n = \sum_{k=0}^n {n \choose k} = {n \choose 4} + \sum_{k=0 \atop k\neq 4}^n {n \choose k} = n(n-1)(n-2)(n-3) + \sum_{k=0 \atop k\neq 4}^n {n \choose k}$$  As a result, $$\begin{aligned} \lim \dfrac{n^3}{2^n} &= \lim \dfrac{n^3}{n(n-1)(n-2)(n-3) + \sum_{k=0 \atop k\neq 4}^n {n \choose k}} \\ &= \lim \dfrac{1}{n \left( 1-\dfrac{1}{n} \right) \left(1-\dfrac{2}{n} \right) \left(1-\dfrac{3}{n} \right) + \dfrac{\sum_{k=0 \atop k\neq 4}^n {n \choose k}}{n^3}} \\ &= \lim \dfrac{1}{n + \dfrac{\sum_{k=0 \atop k\neq 4}^n {n \choose k}}{n^3}} = 0\end{aligned}$$

For a class of mine we were given a midterm review; however, I just cannot figure out how to finish this one:      Find the limit $$\lim_{n \rightarrow \infty}\left( \dfrac{n^3}{2^n} \right)$$   My attempt so far:  Let $s_n=\dfrac{n^3}{2^n}$. Note that $2^n=(1+1)^n$. Thus by the Binomial Theorem we have that,  $ (1+1)^n=\sum_{k=0}^{n} {n \choose k}(1)^{n-k}(1)^n $ Evaluating some of the first couple I get the following terms: $1+n+\dfrac{n(n-1)}{2}+\dfrac{n(n-1)(n-2)}{6}+\dfrac{n(n-1)(n-2)(n-3)}{24}+...$  I have noticed that for $n<4$, $n^3 \geq 2^n$. However, it seems that when $n\geq 4, n^3 < 2^n$. Thus, would it be possible to make an argument that for $n \geq 4, s_{4}>s_{5}>s_{6}>...$? Therefore, by evaluating for $n=4$ and using some algebra you get the following:  $s_{4}=\dfrac{24n^3}{24+24n+4n(n-1)(n-2)+n(n-1)(n-2)(n-3)} \leq \dfrac{24n^3}{n^4} = \dfrac{24}{n}$   and we know that lim$_{n \rightarrow \infty} \left( \dfrac{1}{n} \right)=0$ and lim$_{n \rightarrow \infty} \left( -\dfrac{1}{n} \right)=0$  Therefore, since $\dfrac{1}{n} \geq s_{4} > s_{5} >s_{6} > ...s_{n}\geq-\dfrac{1}{n}$, by the Squeeze Theorem $s_{n}$ converges to zero as well?


I bought my laptop from at an action and it has a admin password and since I don't know who the original owner is I can't get the help I need from dell so can anyone tell me how to get past the administrative password and reset it

I have forgotten the Administrator password of my Windows XP installation and locked out. Is there a way to reset it? I do have physical access to the PC.


I have to find the characteristic polynomial equation of this matrix  $$ A= \begin{bmatrix}2 &1 &1&1 \\1&2&1&1\\1&1&2&1\\1&1&1&2 \end{bmatrix}$$  Is there another way than the rather long $\det(A-\lambda I)$ method ?  Maybe the fact that $A$ is symmetric ($A =A^t $) may be helpful ?

I have the following $n\times n$ matrix:  $$A=\begin{bmatrix} a & b & \ldots & b\\ b & a & \ldots & b\\ \vdots & \vdots & \ddots & \vdots\\ b & b & \ldots & a\end{bmatrix}$$  where $0 < b < a$.  I am interested in the expression for the determinant $\det[A]$ in terms of $a$, $b$ and $n$.  This seems like a trivial problem, as the matrix $A$ has such a nice structure, but my linear algebra skills are pretty rusty and I can't figure it out.  Any help would be appreciated.