I'm not sure if this is the appropriate place for this question (I'm a self-proclaimed newbie)...I have a vocabulary with the following scheme:  category1     subcategory1a     subcategory1b   I'm trying to create a URL pattern for the content path so it has the following URL pattern: category1/subcategory1a/[node:title].  I have Drupal 7.22, Entity API 7.x-1.0-rc3, Token 7.x-1.1, and Pathauto 7.x-1.1 and have been trying different token patterns in the URL aliases section.  If I set the pattern to be [node:field-VOCABULARYNAME]/[node:title], then the URL alias generated is: category1-subcategory1a/[node:title]. Is there a way to have a "/" appear between the parent term and subterm instead of a dash?  Or is there a way to create the pattern: [node:field-VOCABULARYNAME:0]/[node:field-VOCABULARYNAME:1]/[node:title]?  The tokens related to individual content items ("nodes") listed are:  [node:field-VOCABULARYNAME]     [node:field-VOCABULARYNAME:1]     [node:field-VOCABULARYNAME:2]     [node:field-VOCABULARYNAME:3]   If I set the pattern to [node:field-VOCABULARYNAME]/[node:field-VOCABULARYNAME:1]/[node:title], then the URL alias generated is: category1-subcategory1a/subcategory1a/[node:title].  In my content type, I have the field that's tied to the vocabulary is set up as a Hierarchical Select widget with Term reference as the field type.  I found these  and  posts and it seemed most relevant to me, but I do not have the taxonomy term tokens listed.  Thank you for your guidance

I am generating breadcrumbs from URL arguments as described .  I have a vocabulary that looks like this:  Arts-> Performing-> Dancing-> Ballet  I want my url to look like this: arts/performing/dancing/ballet  Using the pathauto module, I can do this for taxonomy terms:  [term:parent]/[term:name]   Which, on the Ballet page, gives me the following; not what I want:  dancing/ballet    If I use parents instead of parent,  ([term:parents]/[term:name]); this is close but not quite:  arts-performing-dancing/ballet   How can I get from arts-performing-dancing to arts/performing/dancing?


I heard that moving object is time passed slower than stopped object is. Then, if stopped object passed 1 sec, does how much time passed 'person A' rode on light?  Thanks in advance

Please will someone explain what time dilation really is and how it occurs? There are lots of questions and answers going into how to calculate time dilation, but none that give an intuitive feel for how it happens.


public class countthecontacts {     public void insertcontact(){         list<Account> acclist = new list<Account>();         list<contact> conlist = new list<contact>();         set<id> accids = new set<id>();         for(contact con : conlist){                           accIds.add(con.accountId);                    }             for(account acc:[select id,No_of_Contacts__c,(select id from contacts) from account where id in:accids]){             acc.No_of_Contacts__c=conlist.size();              acclist.add(acc);         }              update acclist;          }         }

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How do I start writing my first unit test?  How do I unit test this code?  I need help writing this unit test.   Salesforce Stack Exchange looks for detailed, specific questions that the community can help you with, and can't write tests on your behalf. We feel that working with the resources below can help you get started, and we encourage you to make an attempt to write your test and return to SFSE with your specific questions when you encounter challenges you can't resolve.


I came across this question when reading a textbook of automata and languages:  For $L\subseteq\Sigma^*$, define $\sqrt{L}=\{x\ |\ \text{there exists $y \in \Sigma^*$ such that $|y|=|x|^2$ and $xy\in L$} \}$. Show that if $L$ is regular, then $\sqrt{L}$ is regular.  When proving a language is regular, I would usually design a DFA/NFA that accepts the language. But I have no idea how to tackle this one. Any help is appreciated, thanks in advance!

Here is the question:     Let $A$ be any regular set over some alphabet $\Sigma$. Is the language   $$ L = \{x \;\mid\; \exists y : |y| = |x|^2, xy \in A\} $$   necessarily regular?   I am unable to approach this question to prove whether it is regular or not. In fact, this seems like a difficult question. Unlike with other regular language problems, it does not seem intuitively clear whether or not the statement is true.


How to determine convergence and divergence of $a_n =\sqrt[\Large^n]c$ ?

Prove that $\lim_{n \to \infty} \sqrt[n]a = 1$ using only the basic properties of sequences  I don't have an idea on how to tackle this problem - I thought about the Squeeze Theorem but I can't think of a sequence of n which approaches 1.  Could you give me some hints on how to solve this? If it is possible, please, choose the least sophisticated method to solve this as I am entirely new to Calculus.


I have a SQL query which return the below data;  I need to write Values to one row depend ID and Code column like below;

Consider a database table holding names, with three rows:  Peter Paul Mary   Is there an easy way to turn this into a single string of Peter, Paul, Mary?


Gödel's famous incompleteness theorem implies, in particular, that there are statements unprovable in $\mathsf{ZFC}$. This implies that we could never hope to settle the truth of every mathematical statement using a reasonable (r.e.) axiom system, shattering Hilbert's program. However, in the 90 years since,  have been found of statements which are independent of the $\mathsf{ZFC}$ axioms.  Is it true (or possible) that any statement in $\mathsf{ZFC}$ (or another r.e. system $\mathsf{S}$) could be proven either:   true; false; independent of $\mathsf{ZFC}$ (resp. $\mathsf{S}$)?   This would allow a weak sort of realisation of Hilbert's program: for any statement, we can either prove/disprove it, or show it is independent of $\mathsf{ZFC}$.

I was just thinking about unprovability. I just wanted to know if it is possible to make a concrete boundary between provable problems and unprovable problems in a certain axiomatic system.   We know that there is a statement that is true yet unprovable. Then is it possible that a statement is true and unprovable, but the unprovability is unprovable?  We can extend it to a question of "unprovability of unprovability of unprovability", or any finite number of times, or even $\omega$ times....  I have no clue. Has there been any research on this kind of topic?


I've seen before where some questions get closed as duplicates of unanswered(or even closed) questions. Is this behavior that should be encouraged?  For instance, there has been a few times where I was going to ask a question and found a similar question beforehand. The similar question had no good answers for me, but I didn't create a new question because I knew it'd get closed as a duplicate. Even if my question was more specific, it was still related enough to be considered a duplicate(even though mine may be more easy to answer due to additional info.)  What do you think? Should asking unanswered questions be OK and not closed as duplicates? Or should we encourage bumping the unanswered question instead or something similar?   Also, some of these questions are so old as to be irrelevant to now. For instance, if a question from 2008 was posted as "What is the best way of dropping this and using jQuery?" back in 2008, a plugin may not have existed that now does. So the good answer of "Try the jQuery plugin Drop-jQuery-and-try-jQuery" will not have been posted. And even if it is bumped, then a person that knows about this plugin may not put it as an answer because the answer is so old as to not matter to the asker now.

What do you do when you want to ask a question, but find an exact duplicate that doesn't actually have a useful answer? This has happened to me multiple times in the past, so I figure it probably happens to others as well and is therefore worthy of discussion.  To give a recent example: I wanted to find an answer of mine that I'd deleted on SO, so I searched meta to see if this was possible. I found that someone had , but it doesn't have any (real/useful) answers. Now, in this case the real "answer" is probably just "you can't", but it's also entirely possible that things have changed since the question was asked.  So, how do I go about getting an answer to my question?  A few obvious options are (with associated problems):   Bump the old question by editing it (or its tags)   not possible for low rep users creates revision noise  Bump the old question by adding an answer   creates unnecessary noise  Just ask the duplicate question   more noise duplicate will probably just be closed anyway     been [status-planned] since July, so may never actually be possible your question may not be so burning that you want to create a bounty (especially for a low rep user), but that doesn't mean the question has no value    & of course I'm sure someone will close this as a duplicate of an old, stale, unanswered question just for the beautiful irony (I did search, but didn't find anything).


Given a Nx4 (width = N and height = 4) rectangle. How many different ways are there to fill with Dominoes (2x1 or 1x2)?  I have found an OEIS sequence   for this.   The recurrence given in the link is a(n) = a(n-1)+5*a(n-2)+a(n-3)-a(n-4).     Any combinatorial proof? or how to get the recurrence?

After solving  problem from SPOJ (count the ways to fill a 4xn board with 2x1 dominoes) I found a different solution while searching on internet.   solution uses the recurrence relation $f(n) = f(n-1)+5f(n-2)+f(n-3)-f(n-4)$ where $f(n)$ denotes the number of ways to fill the $4\times n$ board with $2 \times 1$ dominoes.  I don't fully understand how someone gets that kind of relation (I don't know almost anything of combinatorics or recurrence relations) but I think I understand something. The $f(n-1)$ term comes from observing that there is an unique way to fill the last column and the $5f(n-2)$ term comes from observing there are 5 different ways to fill the last two columns.    But i don't get where the terms $f(n-3)-f(n-4)$ come from. So I have two questions, the first one is where these terms come from and second I'd like to ask you for a reference to learn combinatorics and recurrence relations.  May you help me? Thanks in advance.  -edit-  For my solution I used a binary number to represent what configurations of the i-th column was valid. For example 1001 represent that rows 1 and 4 are blocked in the i-th row because in the (i-1)th there is an horizontal domino in that positions. I calculated all the valid transitions such binary numbers could go to (I did this by hand for all the binary numbers from 0000 to 1111). Then I got a function which I programmed using  and a technique called bitmask to represent the binary numbers as integers. The function is:  $f(i,mask) = \begin{cases} 0 &\mbox{if } i = n, mask \neq 0 \\ 1 & \mbox{if } i = n, mask = 0. \\ \sum f(i+1,mask') &\mbox{else} \end{cases}$  Where mask' is taken from the set of all valid masks from where mask could transition to, also i=n means the first column outside the board as I considered 0-indexing. The code for that is  (this is not actually mine, it's from a mate but it's the exactly same idea).


So I'm trying to train a neural network for a rare event detection. Based on that, I have like 1000 times more examples for non-target (everything else) examples that I have for target examples. So I was wondering if I just repeat the set of target examples untill I get balanced examples, what effect would that have on my classification and generalisation performance ? Would I gain anything ? What price would I be paying this way ?  And in general what is the best/most common way to deal with these situations ? I can't do boosting or bagging as I can not afford to train several models. I have computational resource and memory restrictions and I will have only one model (e.g. one neural network) for desicion making at test time.  Thanks !  * My question is clearly what is the effect of duplicating examples of a target class by as many copies as required to balance the number of examples on both classes. More specifically I am using neural networks as the model.  What do I gain or lose if I do such ?

We already had multiple questions about unbalanced data when using , , ,  and a number of other similar questions, what makes it a very popular topic! Unfortunately, each of the questions seems to be algorithm-specific and I didn't find any general guidelines for dealing with unbalanced data.  Quoting , dealing with unbalanced data     (...) heavily depends on the learning method. Most general purpose   approaches have one (or several) ways to deal with this.   But when exactly should we worry about unbalanced data? Which algorithms are mostly affected by it and which are able to deal with it? Which algorithms would need us to balance the data? I am aware that discussing each of the algorithms would be impossible on Q&A site like this, I am rather looking for a general guidelines on when it could be a problem.


I am looking for latex codes for the following characters:  My attempt to use detexify to find the symbols were unsuccessful. \mathbb{1} does not produce the right symbol.

I am trying to get the digit one printed the \mathbb{} font in math mode, however the command  \mathbb{1}   outputs some rubbish. I certainly saw the character I am after in some pdf's generated from latex, hence my question: how do you get it to work?


My system has the main database as a principal (reads/writes only to that database) and then a mirror database on a different site that receives all database updates from the principal database.  This is all working fine, but the transaction log on the principal database is close to 80GB and growing. I have tried shrinking the log but that task fails every time. In my opinion I would not need the log at all, since all updates are mirrored to the other site.  Principal database needs to be in full recovery mode for the mirroring to work.  Can you give me some steps on how to get rid of that annoying transaction log or how to get it into a manageable size? Since the mirror site is my recovery method, can I just delete in?

I have a pair of SQL Server 2008 R2 servers hosting a synchronously mirrored database with no witness. This weekend, we had to do some network maintenance so I paused the mirroring. Upon resuming, the principal's status reverted to the usual Principal, Synchronized. The mirror, however, now reads Mirror, Synchronized / Restoring... I don't recall the Restoring... part usually being there.  The transaction log has begun to grow on the principal, as well, despite hourly log backups. This suggests to me that the synchronization process isn't freeing up transaction log space.  What's going on here and how do I fix it?


I need some help with below. So according to Newton's 2nd law, $a=F/m$, for a given mass, the acceleration depends on mass.   But acceleration due to gravity is independent of mass. There seems some contradiction; I am sure I am missing something, but I can't pin-point what that is.

I'm far from being a physics expert and figured this would be a good place to ask a beginner question that has been confusing me for some time.  According to Galileo, two bodies of different masses, dropped from the same height, will touch the floor at the same time in the absence of air resistance.  BUT Newton's second law states that $a = F/m$, with $a$ the acceleration of a particle, $m$ its mass and $F$ the sum of forces applied to it.  I understand that acceleration represents a variation of velocity and velocity represents a variation of position. I don't comprehend why the mass, which is seemingly affecting the acceleration, does not affect the "time of impact".  Can someone explain this to me? I feel pretty dumb right now :)


I am trying to run a python server on a Raspberry Pi, and I need the local IP address of it to connect. I realize I can just type ifconfig and get my IP address, but I would really like to be able to get it from the python script. I have tried socket.gethostbyname(socket.getfqdn()), but that seems to only work on Windows. When I run it on my raspberry pi, it seems to always return 127.0.1.1. Does anyone know a command that will get the local IP address on linux?

How can I find local IP addresses (i.e. 192.168.x.x or 10.0.x.x) in Python platform independently and using only the standard library?


Ever since we've been using exponentials to work with electromagnetic waves, I've been confused about the imaginary portion and want to confirm my thinking.  What does the imaginary portion represent? Nothing, right? It's just a side effect of using complex exponentials because they are very easy to deal with algebraically. So, in reality we can completely restructure all the math to be written in terms of cos/sin instead and never let a single imaginary number appear, right?

I've read that plane wave equations can be represented in various forms, like sine or cosine curves, etc. What is the part of the imaginary unit $i$ when plane waves are represented in the form $$f(x) = Ae^{i (kx - \omega t)},$$ using complex exponentials?


I had a recent edit which "corrected" my spellings to American English. Should I care?

I just saw someone edit the title of  question to  the spelling from favourite (The British spelling) to favorite (The US-English spelling).  Does SOFU have an accepted standard on language and spelling? Which is it?


Is there some definite relationship between number of covariates and the sample size in logistic regression? (e.g. larger the number of covariates, larger the sample size needed, etc.)  Thank you,

I want to make a logistic model from my survey data. It is a small survey of four residential colonies in which only 154 respondents were interviewed. My dependent variable is "satisfactory transition to work". I found that, of the 154 respondents, 73 said that they have satisfactorily transitioned to work, while the rest did not. So the dependent variable is binary in nature and I decided to use logistic regression. I have seven independent variables (three continuous and four nominal). One guideline suggest that there should be 10 cases for each predictor / independent variable (Agresti, 2007). Based on this guideline I feel that it is OK to run logistic regression.    Am I right? If not please let me know how to decide the number of independent variables?


Hi I am new to Linux Ubuntu 14.04. I wanted to install Inkscape but it has shown following error(Dependencies as it says):  inkscape: Depends: python:any (>= 2.7.1-0ubuntu2) but it is a virtual package           Depends: libaspell15 (>= 0.60.7~20110707) but 0.60.7~20110707-1ubuntu1 is to be installed           Depends: libatkmm-1.6-1 (>= 2.22.1) but 2.22.7-2ubuntu1 is to be installed           Depends: libc6 (>= 2.7) but 2.19-0ubuntu6.1 is to be installed           Depends: libcairo2 (>= 1.10.0) but 1.13.0~20140204-0ubuntu1 is to be installed           Depends: libcairomm-1.0-1 (>= 1.6.4) but 1.10.0-1ubuntu3 is to be installed           Depends: libfontconfig1 (>= 2.9.0) but 2.11.0-0ubuntu4.1 is to be installed           Depends: libfreetype6 (>= 2.2.1) but 2.5.2-1ubuntu2.2 is to be installed           Depends: libgc1c2 (>= 1:7.2d) but 1:7.2d-5ubuntu2 is to be installed           Depends: libgcc1 (>= 1:4.1.1) but 1:4.9-20140406-0ubuntu1 is to be installed           Depends: libgdk-pixbuf2.0-0 (>= 2.22.0) but 2.30.7-0ubuntu1 is to be installed           Depends: libglib2.0-0 (>= 2.35.9) but 2.40.0-2 is to be installed           Depends: libglibmm-2.4-1c2a (>= 2.36.2) but 2.39.93-0ubuntu1 is to be installed           Depends: libgnomevfs2-0 (>= 1:2.17.90) but it is not going to be installed           Depends: libgomp1 (>= 4.2.1) but 4.8.2-19ubuntu1 is to be installed           Depends: libgsl0ldbl (>= 1.9) but it is not going to be installed           Depends: libgtk2.0-0 (>= 2.24.0) but 2.24.23-0ubuntu1.1 is to be installed           Depends: libgtkmm-2.4-1c2a (>= 1:2.24.0) but 1:2.24.4-1ubuntu1 is to be installed           Depends: libgtkspell0 (>= 2.0.10) but it is not going to be installed           Depends: liblcms2-2 (>= 2.2+git20110628) but 2.5-0ubuntu4 is to be installed           Depends: libmagick++5 (>= 8:6.7.7.10) but it is not going to be installed           Depends: libpango-1.0-0 (>= 1.14.0) but 1.36.3-1ubuntu1 is to be installed           Depends: libpangocairo-1.0-0 (>= 1.14.0) but 1.36.3-1ubuntu1 is to be installed           Depends: libpangoft2-1.0-0 (>= 1.14.0) but 1.36.3-1ubuntu1 is to be installed           Depends: libpangomm-1.4-1 (>= 2.27.1) but 2.34.0-1ubuntu1 is to be installed           Depends: libpng12-0 (>= 1.2.13-4) but 1.2.50-1ubuntu2 is to be installed           Depends: libpopt0 (>= 1.14) but 1.16-8ubuntu1 is to be installed           Depends: libsigc++-2.0-0c2a (>= 2.0.2) but 2.2.10-0.2ubuntu2 is to be installed           Depends: libstdc++6 (>= 4.6) but 4.8.2-19ubuntu1 is to be installed           Depends: libxml2 (>= 2.7.4) but 2.9.1+dfsg1-3ubuntu4.3 is to be installed           Depends: libxslt1.1 (>= 1.1.25) but 1.1.28-2build1 is to be installed           Depends: zlib1g (>= 1:1.1.4) but 1:1.2.8.dfsg-1ubuntu1 is to be installed   What am I missing?

Occasionally, when I'm installing stuff, I get an error like the following:  Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  package1 : Depends: package2 (>= 1.8) but 1.7.5-1ubuntu1 is to be installed E: Unable to correct problems, you have held broken packages.   How can I resolve this?


My wife and I are entering Canada via UK in March. We have a valid Canadian immigration visa issued in our SA passports. We know we're exempt from a DATv as we're just in transit in London Heathrow for a few hours then heading on to Canada. We return to South Africa (again via London Heathrow) on 16 April 2018. Our Canadian visa would then have expired and we won't yet have our Canadian residency cards- only the confirmation of residency document (CoPR).   I have read blogs that state if you are flying FROM Canada, US, Australia or NZ via UK (and only in transit for less than 24hrs) within 6 months of having entered that country with a valid visa, you are exempt. I cannot find this clause on any gov.uk site and would like to read the official wording to be sure. Can anyone please confirm or share a link?

Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have.


I'm trying to update from 13.10 to 14.04, but whenever I try to update from terminal by using sudo apt-get update I get the error:  W: Failed to fetch cdrom://Ubuntu 13.10 _Saucy Salamander_ - Release amd64 (20131016.1)/dists/saucy/main/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs  W: Failed to fetch cdrom://Ubuntu 13.10 _Saucy Salamander_ - Release amd64 (20131016.1)/dists/saucy/restricted/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs  W: Failed to fetch cdrom://Ubuntu 13.10 _Saucy Salamander_ - Release amd64 (20131016.1)/dists/saucy/main/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs  W: Failed to fetch cdrom://Ubuntu 13.10 _Saucy Salamander_ - Release amd64 (20131016.1)/dists/saucy/restricted/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs  E: Some index files failed to download. They have been ignored, or old ones used instead.

Every time I try update (using sudo apt-get update) my Ubuntu I get this problem:  W: The repository 'cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1) 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: The repository 'ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/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. E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-i386/Packages  404  Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.   How can I fix it? I use Ubuntu 16.04 LTS


I know it used to be possible to install several different flavours of Ubuntu into the same Ubuntu base.  I could log out of flavour 1 and log back into Flavour 2, and so on I have forgotten how to do this :-( Please advise.

Can I install extra desktop environments without affecting my current environment?   I'm asking because I got mixed messages saying that it is no problem as well as those that say that the universe basically exploded when they switched temporarily.


I'm trying to get the keys and values from a JSON array, and use them to construct a table. The JSON array has been obtained correctly with AJAX.  {"CPU":"1.23","NetworkIN":"4.56","NetworkOUT":"0.00","Uptime":"141"}   I want to turn the array above, into a table constructed like this.

     CPU	     1.23

     NetworkIN	     4.56

     NetworkOUT	     0.00

      Uptime	      141

   I've used the following code, which hasn't worked.     This script returns nothing, but the web browser reports a successful JSON retrieval.  I've tried creating the table by doing:  document.getElementById("tbody#resourceTable").innerHTML = "
............"; document.getElementById("resourceTable").innerHTML = "
............";   Neither work.

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 am getting the error message below when I run javac on ubuntu terminal:  The program 'javac' can be found in the following packages:  * default-jdk  * ecj  * gcj-4.6-jdk  * gcj-4.7-jdk  * openjdk-7-jdk  * openjdk-6-jdk Try: sudo apt-get install <selected package>   While Java -version is working.  How to resolve this?

sachin@sachin-Lenovo-G550:~$ java -version java version “1.7.0_21″ OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-1ubuntu1) OpenJDK Server VM (build 23.7-b01, mixed mode)   When I ran the above command this showed that Java is installed in my system, but when I am going to compile any Java program it gives the following error message:  sachin@sachin-Lenovo-G550:~/programs$ javac abc.java The program ‘javac’ can be found in the following packages: * default-jdk * ecj * gcj-4.6-jdk * gcj-4.7-jdk * openjdk-7-jdk * openjdk-6-jdk Try: sudo apt-get install   Please tell me how to get rid of it and run my Java program.


I am using Ubuntu 18.04. I am trying to install Team Viewer from Ubuntu Software, but it fails after completing the installation. I also tried to install it from the terminal, but it shows this error:  dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.   After running the above command it gives this error:   dpkg: error: parsing file '/var/lib/dpkg/status' near line 33476 package 'libgnome-desktop-3-17:amd64':  'Depends' field, invalid package name 'libgtk%3-0': character '%' not allowed (only letters, digits and characters '-+._')   On one PC all the installation steps succeeded, but I can't find the application anywhere, and on another PC it's stuck only on a dpkg error.

When I try to install any software, I encounter this error, and therefore I cannot update.  Preconfiguring packages ... dpkg: error: parsing file '/var/lib/dpkg/status' near line 51245 package 'oracle-xe':  mixed non-coinstallable and coinstallable package instances present N: Ignoring file 'gcl' in directory '/etc/apt/sources.list.d/' as it has no filename extension N: Ignoring file 'gcl' in directory '/etc/apt/sources.list.d/' as it has no filename extension E: Sub-process /usr/bin/dpkg returned an error code (2)


Please tell me the Difference between 18 and 30 GB wubi installation. Do I get all packages installed in 30gb wubi installation?

I'm new to Ubuntu... I went to the downloads page and downloaded the Windows Installer as I am hoping initially to have a dual boot on my currently Win 7 PC (I would consider preserving my Win7 install as a VM under Ubuntu instead - advice?)  It's asking me to choose an "Installation size" but there's no explanation as to what the significance of this is. Is this a disc partition?  Can I increase it easily later if it's too small?  I came here to ask these questions and now I see a bunch of threads about 'WUBI' and possible downsides of installing Ubuntu this way. Is the Windows Installer I just downloaded going to give me WUBI?


I'm having a strange issue in Ubuntu 16.04.2. Some programs will only start after a delay of roughly 20-30 seconds, or will have this delay when opened a certain way, but not another.  Here are some example programs:  Slow startup:   Chromium/Chrome Terminal (when started with Ctrl+Alt+T) Opera   Normal startup:   Firefox Terminal (When started from Launcher or Dash) Spotify Steam   I can't see any connections, as the slow startup seems to affect both pre-installed/native programs and 3rd party programs.  I've encountered this problem before, and tried re-installing Ubuntu. It worked fine for about a month before it showed back up. Also didn't have the problem when running from USB, so probably isn't hardware. Each time the problem has arisen, is after I've been using mostly Windows for some time, but that's installed on a separate SSD, and it can't read the filesystem on the Linux disk, so I don't think it's Windows' fault.  Most website logins seem to be forgotten once the problem manifests itself, and one website even thought I was on a new machine.  I already know that re-installing Ubuntu works (at least for a while), but I'm wondering if anyone has any idea what could be causing this, or what I can do to narrow it down.  There's free memory and swap, and low CPU usage.  Thanks for having a look!  Update: Tried installing a couple other desktop environments/window managers(?). Switching to XFCE removes the delay when trying to start a terminal with Ctrl+Alt+T, but it's still there for the other programs. Ctrl+Alt+T (and other programs) still slow in GNOME.

When I start up Ubuntu 16.04 some applications take too long to run the first time I open them, including Chrome and any PDF viewer. Others, like nautilus, start up immediately.  The first time I try to use a PDF viewer like okular, it takes too long to open. After it opens a PDF file for the first time, other files open quickly. Even if I close all and open some after a long time, it happens quickly.  How can I speed up these programs opening on the first run?


I am a trivial high school student who loves maths. Recently I found some maths-related YouTube channels. Although they cover a broad range of mathematics, many of them are about integration. So I mainly watched videos about integration.  I found such integrations very difficult or impossible to solve with the scope of the high school maths curriculum. We learn some basic substitution and integration by parts, however, they are insufficient.  For most 'interesting' questions on YouTube, it is not necessary to know the university level of calculus, but the problems require either patience or ingenuity. They often involve several substitutions (which make the calculation very long and complicated) or require creative thoughts that people cannot easily come up with. Challenging questions give me a kind of enthusiasm and encouragement at first, but after 30 mins or so, I feel depressed being unable to solve them and realising my lack of talent.  I fully acknowledge that these YouTubers (or anybody else teaching mathematics and doing such interesting questions) are highly enthusiastic in maths so that they do not hesitate to put a lot of effort learning and practising, and that they are talented and knowledgeable. However, I wonder how they can think so deeply as such, and how they can use such sophisticated arts of techniques to approach to problems.

Looking through old problems, it is not difficult to see that some users are beyond incredible at computing integrals. It only took a couple seconds to dig up an example like .  Especially in a world where most scientists compute their integrals numerically, I find it astounding that people exist that can solve these problems analytically. Sometimes it is a truly bizarre contour, some examples use auxiliary functions and differentiation under the integral sign in a way that feels more like integration by wizardry.  Some of these users seem to have mastered an incredibly large number of special functions to a level of fluency that is almost unimaginable to me. Manipulations involving the error function almost looks like the work of an infant compared to some of these seemingly casual manipulations involving the Airy function, Barnes G function, the Legendre chi function and many more. Every time I read a post by them, it turns into an exercise in reading about yet another special function I have never heard of.   My question is what sort of material do you have to study, or what kind of area do you have to work in to get so good? To me, it doesn't seem as obvious as saying something like, "oh, they know this material because they are a topologist".


The family of explicit Runge–Kutta methods is given by $$ y_{n+1}=y_n+\sum_{i=1}^{s}{b_i k_i}, $$ where $$\begin{align} k_1 & =hf(t_n,y_n),\\ k_2 & =hf(t_n+c_2 h, y_n+a_{21}k_1),\\ k_3 & =hf(t_n+c_3 h, y_n+a_{31}k_1+a_{32}k_2),\\ \vdots\\ k_3 & =hf(t_n+c_s h, y_n+a_{s1}k_1+a_{s2}k_2+a_{s3}k_3+\cdots+a_{s,s-1}k_{s-1}) \end{align}$$  But how Runge and Kutta achieved it? Where this formula come from and what are $k_i\text{'s}$?

Recently, I have been taking a course on ODEs and learning Runge-Kutta methods. To be specific, the 4th order Runge-Kutta method on solving initial value problems. My instructor and the textbook told me the formula but didn't say anything about the thoughts behind the method. I wrote some code and found that the Runge-Kutta method does perform better than the Euler method, but I can't understand why. Is anyone willing to give me a hand on how to get the formula of Runge-Kutta? Thanks!


I want to find out the number of $0$s in the number $30!$, what should I do? Is there any trick that would work for a general question of this type, like number of $0$s in $50!$ ?

Possible Duplicate:          I know that I have to find the number of factors of $5$'s, $25$'s, $125$'s etc. in order to do this. But how can you derive such a formula for any number $n$?


I have attached the source code of rt.jar file ie src.zip to my Eclipse.  My problem is that, After adding the source code of rt.jar to eclipse, when I open any class,for Example "String" class, The eclipse itself showing ".class" file for "String" only,It does nopt showing ".java" file for "String".  How can I see the ".java" file?

I'm a big fan of the way Visual Studio will give you the comment documentation / parameter names when completing code that you have written and ALSO code that you are referencing (various libraries/assemblies).  Is there an easy way to get inline javadoc/parameter names in Eclipse when doing code complete or hovering over methods? Via plugin? Via some setting? It's extremely annoying to use a lot of libraries (as happens often in Java) and then have to go to the website or local javadoc location to lookup information when you have it in the source jars right there!


Let $(C[-1,1],\|.\|_2)$ prove this space isn't a Banach space.  My attempt:  Let $\{f_n\}$ such that   $f_n(x)= \left\{ \begin{array}{lcc}              -1 &   if  & x \in [-1,\frac{-1}{n})               \\ nx &  if &  x \in [\frac{-1}{n},\frac{1}{n})               \\ 1 &  if  & x \in [\frac{1}{n},1]              \end{array}    \right.$  Note each $f_n$ is a continuous function in $[-1,1]$ then $\{f_n\}\subset C[-1,1]$ Moreover is easy show that $\{f_n\}$ is a Cauchy sequence in $C[-1,1]$.     I'm stuck trying to show that $\{f_n\}$ converges to $f$ but $f\not\in C[-1,1]$.

I am trying to prove that under the $L^2$ norm,  $C([0,1])$ does not give rise to a  complete metric space. To do this I am trying to find a Cauchy Sequence which does not converge in $C([0,1])$. As a template (on $C([a,b])$) I am led to believe the following is Cauchy: $$f_n (x) = \begin{cases}  1 &\mbox{if } 0 \leq x \leq \frac{1}{2} \\  1 - 2n(x-\frac{1}{2}) & \mbox{if } \frac{1}{2}\leq x \leq \frac{1}{2n} + \frac{1}{2}\\ 0 & \mbox{if } \frac{1}{2n} + \frac{1}{2} \leq x \leq 1  \end{cases}  $$ But I am struggling to show this is Cauchy, I have tried integrating from 0 to 1 but this is giving a very nasty integral and I was wondering if anyone has a better method?


If I fly into England from a country on the quarantine list (thus requiring me to isolate myself at a single address for two weeks) can I fly out of England within that two weeks?

I am planning to go to England for 2 days in preparation of moving (I already have a place rented and would be staying there) a few weeks later. I am coming from a country where I would need to do a 14 day quarantine as soon as I enter England. Does this mean that I have to stay in England for 14 days or can I leave the country before the end of the 14 day quarantine without facing a penatly? I have found no information about what the rules are for planned stays of less than 14 days on the , while  seems to say that short trips are OK. Official sources would be appreciated.


I am trying to learn linux commands so please bear with any ignorance. I am creating a file with cut command which is written in Script.sh file. But when the file is created it adds '$/r' to end of the filename. So further operations on the created file does not executes as no file is found with the given name. cut somefile.csv -d"," -f1  > file1 so the file1 is created with name as 'file1$/r/' Any help is highly appreciated Edit : cut inputFile -d"," -f6  >file1     cut inputFile -d"," -f1  >file2      paste -d"," file1 file2  > result

This is my script:  #!/bin/bash hd='pwd' cd $hd   When I try to run it, it fails with:  line 3: cd: $'pwd\r\r': No such file or directory   What is going on?


This question is building from the .  I am trying to plot the a point on this plot with coordinates 0.7201 + j0.5093.  When I put this point in like this  \node[solid, cross out, draw=black] at (0.7201,0.5073) {};   I also tried  \node[solid, cross out, draw=black] at (35.27:0.882cm) {};   no luck.  The point goes to the left bottom corner of the plot.  How to get this point 0.7201 + j0.5093 to show up like this:    Here is his original solution:  \documentclass[12pt,tikz,border=2pt]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{polar}  \begin{document} \begin{tikzpicture}   \begin{axis}     [       height=15cm,       unit vector ratio = 1 1,       ymin=0,       xmax=1.1,       ymax=1.1,       samples=100,       axis lines=center,       ticks=none,     ]      \pgfplotsinvokeforeach{0,...,9}     {       \def\zet{(.1*#1)}       \pgfmathsetmacro{\factor}{\zet/sqrt(1-\zet^2)}       \addplot[data cs=polar,domain=0:.35*sqrt(1-\zet^2)] (180*\x,{exp(-pi*\factor*\x})         node [at end, sloped, anchor=south,font=\tiny, inner sep=0pt]{$\zeta{=}0.#1$};       \addplot[data cs=polar,domain=.35*sqrt(1-\zet^2):sqrt(1-\zet^2)] (180*\x,{exp(-pi*\factor*\x});     }      \pgfplotsinvokeforeach{.1,.2,...,1}     {       \def\a{#1}       \addplot[data cs=polar,domain=0:\a] (180*sqrt(\a^2-\x^2),{exp(-pi*\x)});     }   \end{axis} \end{tikzpicture} \end{document}

I have a figure on an axis and want to add descriptive text and signs to it with tikz. However, I need to do the alignment of the text with respect to the axis by visually observing if it matches. Is there a way to tell tikz to use the alignment with respect to the axis. I tried using (axis cs:x,y) command but did not help.   \documentclass{standalone} \usepackage{pgfplots} \begin{document}     \begin{tikzpicture}         \begin{axis}[             width=10cm,             height=4cm,             x axis line style={-stealth},             y axis line style={-stealth},             title={this is my title},             xticklabels={},             ymax = 1.5, xmax=7.5,             axis lines*=center,             ytick={1},             xlabel={f},             ylabel={H(f)},             xlabel near ticks,             ylabel near ticks,             every axis x label/.style={at={(current axis.right of origin)},anchor=west},             every axis y label/.style={at={(ticklabel* cs:1.05)},anchor=south}             ]             \addplot+[thick,mark=none,const plot]             coordinates             {(0,0) (4,1) (5,0) (7,0)};         \end{axis}         % I want this to be aligned with axis' 4 and 5         \draw[<->] (4.0,-0.3) -- (5.0,-0.3) \end{tikzpicture} \end{document}


I edited a question and went to submit it when I was presented with this warning, is there a reason the other person was still allowed to open the edit page even though I was editing it?     Another edit is awaiting approval for this post. Further edits cannot be submitted until the pending edit is reviewed.   I'm not asking why my edit got rejected or why edits aren't being merged, I just want to know if there's a reason two people are allowed to open the edit window at the same time and the second blocked from opening it.

It happened many times that I submit an Edit Suggestion and immediately after that I see the post has already been edited by another guy (usually higher-rep) and my edit has been rejected by either Community or reviewers.  Why there is no mechanism to prevent simultaneous edits and avoid unfair rejection?   This is my first attempt to edit the post:   As you can see it got rejected by community because another user submitted an edit. And immediately after that I wanted to re-edit my edit which turned to this (Actually it rolled back all the edits):


In the following program   #include <iostream>  bool contains ( int * sarr, size_t n, int i ) // checks whether the integer i is in the sorted array sarr of length n {       int * pa = sarr; int * pb = sarr + n;     if (pa == pb) return false; // empty array     --pb;     while (pa != pb)     {         if (*pa == i || *pb == i) return true;         int * pc = (pa + pb)/2;         if (*pc < i)             pa = pc;         else              pb = pc;     }     if (*pa == i || *pb == i)        return true;     else         return false; }   int main ()  {     int arr [] = {1, 1, 6, 10, 19, 22, 22, 22, 50};     std::cout << contains(arr, sizeof(arr)/sizeof(int), 6); // should print 1     return 0; }    I'm getting the compiler error  error: invalid operands of types 'int*' and 'int*' to binary 'operator+'   on the line   int * pc = (pa + pb)/2;   Why is that? I thought it was perfectly valid to add pointers. Or do I need to perform some casts on the right side?  How can I make that algorithm more compact and efficient while continuing to cover all the corner cases?  Also, I'm tagging this as both C and C++ because it's C-style C++.

Does anyone have any good articles or explanations (blogs, examples) for pointer arithmetic?  Figure the audience is a bunch of Java programmers learning C and C++.


I'm using ArcGIS 10.7 trying to calculate a speed field (for my data of roads in California) really simply such that roads = 45 and highways = 65. I know I need to use an if then statement but I'm not too familiar with Python or ArcGIS so I need a function that will allow me to say if the text string includes "FWY" OR "HWY" OR "RTE" return 65 and else = 45. Does anyone know how I could get this done? I'm fine computing with some error as its for an intro class.

I am using ArcGIS 10.2 for Desktop, and I've been looking through this site, and can't seem to figure out my answer yet. Very new to VBA and Python, but lots of years with ArcGIS.  I know I can do this the slow way with Select By Attributes, but It's time consuming.  I am attempting a spatial join between cases of a disease (points layer) and US Census Tracts (polygon layer). This requires count data. For each point/case, I have a field called YEAR with date ranges 2001 to 2012 depending on what year the case happened. I need a count column for each year. For example, the first one I'm calling COUNT01. If the case date in YEAR is 2001, then COUNT01 will have a 1 in it. If it is any other year (2002-2012), then there will need to be a 0. I will have COUNT02, COUNT03...COUNT12 columns. Can't have a "Null" value.   Here's what I've tried so far    And here is what the data looks like in Arc.


Sorry I do not know latex. Why is $\sqrt x \times \sqrt y = \sqrt {xy}$? It also applies for division, but why not addition and subtraction? i.e., why is $\sqrt x + \sqrt y$ not equal to $\sqrt {x+y}$?  Thank you for editing and answering.

Proof  of identity $\sqrt {xy} = \sqrt x \sqrt y$ for $x,y \in \mathbb R^+$  I've been looking at the stated identity, which makes sense in $\mathbb R^+$ but fails in $\mathbb R$, since $\sqrt {-1 \cdot -1} \neq \sqrt {-1} \sqrt {-1}$.  How does one prove this identity ?  Suppose we have $x,y \in \mathbb R^+$ then $\sqrt{xy}^2 = xy = (\sqrt x \sqrt y)^2$.  Idea 1: The square-root function is bijective (monotonic increasing) and has inverse $X^2$. This in turn implies $\sqrt {xy} = \sqrt x \sqrt y$  Idea 2: The equation $X^2 = xy$ has at most $2$ solutions in $\mathbb C$, which implies $\sqrt x \sqrt y$ must be equal to $\pm \sqrt {xy}$.  Are these ideas rigorous enough ? Is there some simpler way of proving this ?


If we define:  1) $R$ is a ring, $I$ is an ideal.  We say that $I$ is prime if $I$ is not equal to $R$ and whenever $ab$ belongs to $I$ then either $a$ is in $I$ or $b$ is in $I$.  2) Let $R$ be a commutative ring and let a be an element of $R$. The set $\langle a\rangle=\{ar: r \in R\}$ is an ideal and any ideal of this form is called principal.  3) Let $R$ be an integral domain and let a be a non-zero element of $R$. We say that $a$ is prime, if $\langle a\rangle$ is a prime ideal.  But suppose $R$ is a finite integral domain. For any non zero $p$, $pa = pb$ iff $a = b$.  Can we conclude that $\langle p\rangle = R$ (thus $p$ can't be prime)?

This is how I'm approaching it: let $R$ be a finite integral domain and I'm trying to show every element in $R$ has an inverse:   let $R-\{0\}=\{x_1,x_2,\ldots,x_k\}$,  then as $R$ is closed under multiplication $\prod_{n=1}^k\ x_i=x_j$,  therefore by canceling $x_j$ we get $x_1x_2\cdots x_{j-1}x_{j+1}\cdots x_k=1 $,  by commuting any of these elements to the front we find an inverse for first term, e.g. for $x_m$ we have $x_m(x_1\cdots x_{m-1}x_{m+1}\cdots x_{j-1}x_{j+1}\cdots x_k)=1$, where $(x_m)^{-1}=x_1\cdots x_{m-1}x_{m+1}\cdots x_{j-1}x_{j+1}\cdots x_k$.   As far as I can see this is correct, so we have found inverses for all $x_i\in R$ apart from $x_j$ if I am right so far. How would we find $(x_{j})^{-1}$?


Is it okay if I ask a question on Stack Overflow about the concern I have in my project? I am midway and unable to figure out how to move ahead.  I am not looking for someone to write and give code for me, but I am stuck at some point where I am unable to understand how to proceed, as it includes different programming languages/nosql database.  Or to put it in another way, where can I ask such question?

There seems to be more than a few computer science/programming Stack Exchange networks (is that the correct term?). Stack Overflow, being the first, has by far the most users, questions, and answers.  What is the reasoning for creating the others, and are there clear guidelines for which kinds of questions should be posted? I can see a large amount of potential overflow, many cases of people not getting a good answer to their question, because the person who has the answer isn't browsing that particular network at the moment.  I understand that they were probably created for organizational purposes, but wouldn't it almost make more sense to just have them as categories under Stack Overflow, keep them separated but still connected, instead of making people have to create multiple 'account's, one for each network?  I am sure there was a very good reason to break them up, but as someone that is new to SE, it can be somewhat intimidating to decide which one to post in to ensure you get a good answer. For example, if I am a computer science student, my first instinct might to be to post in the computer science network, until I see that it literally has 1% of the users as the Stack Overflow network, which still seems to be for programming/computer science related questions.  So my second instinct would then to be to post it into the Stack Overflow site on the basis that I have a significantly higher chance of my question being seen and getting a good answer. Then I notice that there is also a 'programmers' network, and I don't even begin to know where that fits in. I, and I am assuming most people, will probably just post on Stack Overflow to be safe.  My question is, other than the short little description blurb of each one, is there a clear cut set of guidelines which what each network is intended for, what kinds of questions should go to each one, and is anything being done to encourage people to post in these newer, smaller (more specialized?) networks as opposed to just posting in big daddy Stack Overflow?  Now again, this is for computer science/programming/"why isn't this code doing what I want?" related questions, I am not saying that if I had a question about Linux or WordPress or something I would have the same confusion.


if a, b, c>0, then prove: $\frac{a+b}{\sqrt{a^{2}+a b+b^{2}+b c}}+\frac{b+c}{\sqrt{b^{2}+b c+c^{2}+c a}}+\frac{c+a}{\sqrt{c^{2}+c a+a^{2}+a b}} \geq 2+\sqrt{\frac{a b+b c+c a}{a^{2}+b^{2}+c^{2}}}$  I have spent several hours in proving the inequality above with Hölder inequality. But all my efforts were in vain since it turned out that Hölder inequality cannot match the square root form on the right side of inequal symbol. I hope someone could help me solve it at least could offer me some hints. Thanks for your time and efforts in advance.  Though this inequality has been posed in this website 5 years ago, no complete answer using basic inequalities is presented. I am expecting some hints to prove this inequality using some basic inequalities rather than methods of analysis.

let $x,y,z$ are postive numbers,show that $$\dfrac{x+y}{\sqrt{x^2+xy+y^2+yz}}+\dfrac{y+z}{\sqrt{y^2+yz+z^2+zx}}+\dfrac{z+x}{\sqrt{z^2+zx+x^2+xy}}\ge 2+\sqrt{\dfrac{xy+yz+xz}{x^2+y^2+z^2}}$$  My try: Without loss of generality，we assume that $$x+y+z=1$$ and use Holder inequality,we have $$\left(\sum_{cyc}\dfrac{x+y}{\sqrt{x^2+xy+y^2+yz}}\right)^2\left(\sum_{cyc}((x+y)(x^2+xy+y^2+yz)\right)\ge\left(\sum_{cyc}(x+y)\right)^3$$ then we only prove this $$\dfrac{8}{\sum_{cyc}(x+y)(x^2+xy+y^2+yz)}\ge  2+\sqrt{\dfrac{xy+yz+xz}{x^2+y^2+z^2}}$$ then I can't  Thank you


I'm trying to get a json file with file_get_contents and it works fine, the only problem is some of the data returns with special characters instead of their actual data. ie '...' becomes 'â€¦'   I can fix this by outputting the data wrapped in htmlentities tags but I'd rather not do that and instead have the encoding fixed.  I've tried a few things to send headers but still I get the problem.

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


I would really love to use package pst-solides3d to draw 3D solids but so far I haven't been able to work on it. I am just a beginner of using pst-solides3d so and I do not know how to figure this following code out. When I was compiling the simple following code, always was being the error, that is: ! Undefined control sequence. Please anybody helps me with that, many thanks to you.  Code complied:  \documentclass[a4paper]{report} \usepackage{pst-solides3d} \begin{document} \begin{pspicture}(1,1)(2,2) \psSolid[object=cube,a=2,action=draw*] \end{pspicture} \end{document}


$12^2 = 144$  Now reverse the digits and square it: $21^2 = 441$  The digits in the result have also gotten reversed.  The same is true for $13$:  $13^2 = 169$, $31^2 = 961$  As far as I know, this does not hold true for any other number (except, trivially, $0$ through $11$).  Why?  Can it be proven?  The only thing that occurs to me is that, starting with the next number, $14$, the square of its reverse, $41$, is greater than $1000$.  But I don't know why this would make any difference.

If we reverse the digits of $12$ we will get $21$. $12^{2}=144$. If we reverse its digits we will get $441$ which is $21^{2}$.  Here is the puzzle. How many such two digit numbers are there? Digits must be different.  We got an algebraic method to solve it if the square is a three digit number.It given here :  Let $a>b$  $(10a+b)^{2}=100x+10y+z$ and $(10b+a)^{2}=100z+10y+x$  Difference between these two equations will lead to $a^{2}-b^{2}=x-z$  $x-z \leq 8$.Then  $a^{2}-b^{2} \leq 8$.  Since squares are of three digits $a <4$.But since $a>b ,a \neq 1$.  $b=1 \Longrightarrow a^{2} \leq 9$.Then $a=1,2,3$ but only possibilities are $2 $ and $3$.  $b=2 \Longrightarrow a^{2} \leq 12 \Longrightarrow a= 1,2,3$. But possibility is $a=3$. So next such pair will be $13,31$.  Higher values of $b$ will not work since $a$ cannot exceed 3. This is an explanation we obtained from a mathematics group.It works well if the square is a three digit number.What will happen if square is a 4 digit number... Or if we try to extend this problem for numbers having more than two digits ?


I saw him at / in the station a few days ago   I saw a giraffe at / in the zoo yesterday.      What should we use with saw (see)?

I am really confused.  Which preposition is correct?     She is in/at the park.   They are in/at the park.   I am in/at the park.   Should I use in or at in these sentences?


By the "absolute center of mass" I mean the center of all the matter that exists in a given moment. My friend asserted that today and it intrigued us very much but since we only have a CS degree and not very well versed in modern physics we couldn't be sure about that claim.   It is based on the observation that; the total momentum of a given system never changes. Am example; considering a hypothetical situation where an astronaut is floating in the space, to change his speed, he needs to push an object against the direction he wants to move. He gains as much momentum as the object gains in the opposite direction, net momentum is zero and center of mass doesn't changes.  Applying this principle to the beginning of our universe, we arrive to the aforementioned conclusion. Is this true? If not, why?

If the big bang was the birth of everything, and the big bang was an event in the sense that it had a location and a time (time 0), wouldn't that mean that our universe has a center?  Where was the big bang? What is there now? Are we moving away from the center still? Are these even valid questions?


My idea was something similar to rFactor, but very easy to mod. There will be a step by step tutorial.  If I or somebody from the developers make the mods and publish them, do I still need licensing? Now it's just an idea, but I plan to make at least 1000-1500 cars from at least 150 manufacturers, and that would cost a fortune. A lot of the cars would be converted from other games like Forza or GT6 and others modeled by my team.

Is it legal to use car manufacturers' names in a game?   For example:   to describe Audi's quattro drive system? to display a rendering of an Audi? to include a photo (to which I have rights) of an Audi?


Please note that I am new to programing, thus my code is probably incredibly redundant and hard to read, but I REALLY need help!  Im trying to create a matching game, so that when the user picks two buttons that relate to one another, you get a match! I'm currently trying to get the action listener to work properly, but whenever I run the code every if statement implements and all the buttons turn green.   public class Panel extends JPanel {    int[] num = new int[2];    private JButton movie1;    private JButton movie2;    private JButton movie3;    private JLabel question;   private JButton name1;   private JButton name2;   private JButton name3;    public Panel()   {      ImageIcon movie1pic = new ImageIcon("movie1.jpg");      movie1 = new JButton (movie1pic);      movie1.addActionListener(new ButtonHandler());        ImageIcon movie2pic = new ImageIcon("movie2.png");      movie2 = new JButton (movie2pic);      movie2.addActionListener(new ButtonHandler());        ImageIcon movie3pic = new ImageIcon("movie3.png");      movie3 = new JButton (movie3pic);      movie3.addActionListener(new ButtonHandler());        question = new JLabel ("match");      ImageIcon name1pic = new ImageIcon("name1.png");      name1 = new JButton (name1pic);      name1.addActionListener(new ButtonHandler());       ImageIcon name2pic = new ImageIcon("name2.jpg");      name2 = new JButton (name2pic);      ImageIcon name3pic = new ImageIcon("name3.jpg");      name3 = new JButton (name3pic);      setLayout(new BorderLayout());      JPanel southPanel = new JPanel(new FlowLayout());      JPanel northPanel = new JPanel(new         FlowLayout());      southPanel.add(name1);      southPanel.add(name2);      southPanel.add(name3);      northPanel.add(movie1);      northPanel.add(movie2);      northPanel.add(movie3);      add(question, BorderLayout.CENTER);      add(northPanel, BorderLayout.NORTH);      add(southPanel, BorderLayout.SOUTH);           private class ButtonHandler implements ActionListener      {         public void actionPerformed(ActionEvent e)         {             if ( e.getSource() == "movie1.jpg" );            {               num[0] = 1;               ImageIcon green = new ImageIcon("green.png");               movie1.setIcon(green);            }            if (e.getSource() == "movie2.png");            {               num[0] = 2;               ImageIcon green = new ImageIcon("green.png");               movie2.setIcon(green);            }            else if (e.getSource() =="movie3.png" );            {               num[0] = 3;               ImageIcon green = new ImageIcon("green.png");               movie3.setIcon(green);            }             }      }   }

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


I know about Linux terminal. I can also issue many advanced commands over terminal. But one simple concept is not clear to me.  What is terminal and how does it work?  I know about hardware which consists of CPU, RAM, HARD DISK and so on.  I know about kernel which is basically the core of the operating system.  I know about software which sits on the top of kernel.  And I know about users.  And I know that user uses either terminal or GUI to give instructions to the software.(or kernel?)  Now please explain these concepts of terminal and shell.  Graphical explanation and simple non-technical words are preferable.

I think these terms almost refer to the same thing, when used loosely:   terminal shell tty console   What exactly does each of these terms refer to?


I downloaded a piece of software which says it is open source, but I didn't manage to build the project from source (it's written in go).  The other option I have is to download the binary file and run it.  Can it do any harm to my computer if I run this file without giving it root privileges? Maybe it can work well, but it may have a keylogger or other kind of malware... should I be concerned?

Sometimes I have to use some propriety softwares which I don't trust or even pre-compiled open source ones which I don't know if they've been compiled as their source are.   Lets say we installed a propriety application in /opt/software, then we run it as a normal user (without sudo, gksudo, etc).   I know when we run a program it is able to connect to the Internet, monitor X, keystrokes, collect user data and so on. It can't change anything important in the system or infect the system, (because of the Linux permissions system). It is possible for program to add some plug-in/extension to a user's browser (Because browser profiles are available in user home directory). After closing the program and rebooting it can't do anything anymore. Wrong because:   Program can add itself to a shell/file/directory which does the autostart process, so it will run at any login.  If we consider the autostart process clean, without rebooting there is a chance that a process of the program is still active. Programs can delete or modify any file in the user home directory (or any other file which a user has write permission to).   So what should we do?   I think the only safe way to run a propriety program is running it as another user. If running the program as another user somehow is not possible then we should change the autostart files permission so only root can change them. then after closing the program a reboot will do the job.   Am I right? Is there anything that I'm missing?


I can't remember the title or the author. Ugh! Centers around a soldier that now kills for the conquering alien race that took over Earth. They don't know much about the aliens that control them, except they are described as blue poppets. Once back on earth the main character's friends start a rebellion. Any ideas?    Thank you so much if you know this!

I read this book in the early 2000's, but I can't for the life of me remember the title or author and it's driving me crazy!  The story is in the future. Earth and most of the galaxy has been conquered by a super-intelligent computer race who no one ever sees. The main character is a male soldier who fights as a collaborator for the occupiers. He wears armor similar to "Starship Troopers", and his main job is to suppress rebellions.  He has 2 or 3 girl servants as a reward for being an officer, whose job is to give him sex on demand. One is named Hanni (I think). His best friend is a large, hulking, lizard-like alien who is female and also a soldier. In the lizard race, only the females are intelligent. The males make a sound like "bok" when having sex. His female lizard friend isn't into males though. She likes other females.  He has another soldier friend who is female. She keeps a male servant / sex slave for her own use, who has a large nose.  He suppresses lots of rebellions, including ripping the arm off some intelligent insect species. At one planet he is on, humans are mixing with some weird bird-like species. And there is another species that is intelligent and tall, with four legs.  He goes home to Earth and back to his old room. There's a holographic picture on the ceiling which his parents kept for him. It shows a woman who masturbates when he gives it a signal. (Did I mention how much sex is in this book? LOL) There is a rebellion with his old friends back on Earth. He suppresses it, before they are killed. He thinks resistance is pointless and hopeless.  At the end, his lizard friend shows him a huge weapons cache and invites him to join a secret resistance among the soldiers. He decides to join them after all, and there is hope in his life again.  I can remember so much about this book it is amazing, but I can't find it! I would really like to re-read this book, and read some other books by this same author. If someone could help me out, I would really appreciate it! Thanks :)


Where y is an array of objects,  y = [     {property:"",property2:""},     {property:"",property2:""},     {property:"",property2:""},     {property:"",property2:""},     {property:"",property2:""} ]   could someone please tell me why,  for (x in y) {     console.log(x[y].property); }   is so many times slower than,  for (i = 0; i < y.length; i++) {     console.log(x[y].property); }

I've been told not to use for...in with arrays in JavaScript. Why not?


Let $\mathbb{F}$ be a field. I want to show that the ideal $\{ xg + yh \ | \ g, h ∈ \mathbb{F} [x, y] \}$ is not a principal ideal in $\mathbb{F}[x, y]$. Do I work by contradiction first, i.e. assume that it is principal?

The ideal $I= \langle x,y \rangle\subset k[x,y]$ is not a principal ideal.   I don't know how to consider it. Any suggestions?


Im learning combinatorics, and I came across a question I couldn't find the answer to:  I have $n$ identical balls and $k$ different cells, I want to find the number of ways to arrange the balls with the condition that each cell can have at most $x$ balls where $0\le x<n$.  Without the condition it is just arranging of $n$ balls into $k$ cells and the solution is just $\binom{n+k-1}{k}$  Can someone explain to me how we can add the condition and find the number of permutations.  Thanks

The problem of counting the solutions $(a_1,a_2,\ldots,a_n)$ with integer $a_i\geq0$ for $i\in\{1,2,\ldots,n\}$ such that $$a_1+a_2+a_3+....a_n=N$$ can be solved with a stars-and-bars argument. What is the solution if one adds the constraint that $a_i\leq r_i$ for certain integers $r_1,\ldots,r_n$?  e.g. for $n=3$, $N=6$ and $(r_1,r_2,r_3)=(3,3,2)$, the tuple $(a_1,a_2,a_3)=(2,3,1)$ is a solution, but $(2,1,3)$ is not a solution because $a_3=3>2=r_3$.


I'm a US permanent resident (30+ years) and applied for a UK visitor visa. There was a question concerning whether I had ever been "convicted" of a crime. I plead guilty to a crime in 1997 (white collar) and adjudication was withheld so I answered "no". My visa was denied because I answered NO and they saw my record when they ran my prints (I traveled without a problem to the UK in 2000).    Should I reapply and explain, or wait a while, or forget about it because they'll never approve it?

I am from Nigeria and I'm doing a one year Internship program with The Marriott hotel in Wisconsin, I applied for the UK visitor visa two weeks ago to visit my fiance who lives and work in the UK, but I was refused the visa because the letter of my workplace that I provided was back dated of 2014 which they say they are not satisfy it accurately reflects my current employment circumstance. I also provided my pay slips, but they said they were not satisfied with it demonstrating the terms and conditions of my employment, and they also said I did not present any evidence to satisfy me having sufficiently strong ties and commitments in my country of habitual residence or elsewhere to motivate my timely departure from the UK. They said the documents my fiance presented were OK.  How soon can I re-apply for a UK visa after getting a refusal?


I am working on my first ever project , and I have used some copyrighted images(images taken from some other well recognized games). Is it even possible that I edit the images a little bit and then use them as royalty free images?

Background: I'm making a retro style game for both fun, and an unofficial contest.   I have bought a song, song X. However, I then found notation for song X, and all the instruments. So basically, it's a program recreating song X in a sense.  I took the notation, and used another program to make it sound like a chiptune does (just for the fun of it, and it sounds good :P). However, I would like to use this in my game. It's non-commercial, but is this allowed? I would've said yes, because I'm not actually using the original, copyrighted song.  I think the main point is can I:   Use the music with no reference to the author Use the music with a reference, since it's non-profit. Not use the music at all since the melody and rhythm is copyright.


I am trying to access some variables (of script.js) on chrome's console. I'm able to do so only until I turn my script.js into a module (type="module") in index.html. If i try to access any variable when i have type=module on my script tag, i get the following error:  Uncaught ReferenceError: variable_name is not defined at <anonymous>:1:1  <script type="module" src="./script.js"></script>

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


X and Y are two Banach spaces. I've to prove that the set of all subjective bounded linear operators is an open subset of B(X, Y). I think I've to use the open/closed mapping theorem but don't know where to start.

Suppose $E$ and $F$ are given Banach spaces. Let $A$ be a continuous surjective map. Why is there a small ball around $A$ in the operator topology, such that all elements in this ball are surjective?


I have i = double.Parse(TextBox.Text); but when I enter the + symbol, this error appear "System.FormatException: 'Input string was not in a correct format.'"

If I have a string with a valid math expression such as:  String s = "1 + 2 * 7";   Is there a built in library/function in .NET that will parse and evaluate that expression for me and return the result? In this case 15.


In the below example, I extract the class name from the template type T. Now I want to use this string to create an instance of a class. Is there a way to achieve it in C++? template <typename T> class factory {     T obj;     std::string class_name; public:     factory(T obj)     {         this->obj = obj;          class_name = boost::typeindex::type_id<T>().pretty_name();                  //some magic here         class_name instance;     } };

I have a file: Base.h  class Base; class DerivedA : public Base; class DerivedB : public Base;  /*etc...*/   and another file: BaseFactory.h  #include "Base.h"  class BaseFactory { public:   BaseFactory(const string &sClassName){msClassName = sClassName;};    Base * Create()   {     if(msClassName == "DerivedA")     {       return new DerivedA();     }     else if(msClassName == "DerivedB")     {       return new DerivedB();     }     else if(/*etc...*/)     {       /*etc...*/     }   }; private:   string msClassName; };  /*etc.*/   Is there a way to somehow convert this string to an actual type (class), so that BaseFactory wouldn't have to know all the possible Derived classes, and have if() for each one of them? Can I produce a class from this string?   I think this can be done in C# through Reflection. Is there something similar in C++?


I came across the stock market jargons: Bull and Bear. A bit of research on bear helped me understand bear as the person who borrows shares/stocks with speculation that the price of the borrowed shares/stocks may fall in the future. So he/she basically borrows the shares and sells it, with an intention of buying back when the price of that stocks falls below the price at which they were sold. What happens when he/she is not able to buy back the shares, maybe because no one is willing to sell those shares.

For the sake of argument, let's assume a scenario, where the company is very illiquid, and there are no shares for sale and even increasing the buy order doesn't produce sellers. What happens to the short seller, who wants to cover his short position in this scenario?  Or a second scenario: A company like Tesla goes private. The short sellers are not able to buy enough stock in time and they end up unable to cover their short positions.  Does something like this need to be settled between the lender and the shorter or is there a mechanism for this type of situation?


I am using windows 7 with 8GB RAM for last 8 months, C drive of 75 GB currently out of space, 8GB Page file (on auto manage) and 8GB hibernate file, i checked windows folder is of more than 30 GB. is it fair amount of size and how can i clear some space.   Recyclebin is empty, C Drive protection is ON and is consuming 5.7GB only (i wanna keep it max limit is 8GB) and i have installed Visual studio 2013 and MS SQl Express 2012 and Ms Office 2010.

I have always had problems with my windows directory's growing to a huge size.  It started with windows 95 then 98 then 2000 and xp.  Windows 7 however is absolutely huge.  The windows folder itself with out program files is 21.4 gigs...add the program files and other windows files and it is a whopping 32 gigs.  My question is why is it so large and what can I do about it.  At the rate this is going I will be out of space in now time.


The Close Review Queue is not pleasant. Jumped in as soon has hitting 3000. Failed two audits yesterday, and now I've managed to fat-mouse a Leave Open on this:   In addition to taking a circuitous route in the future, is there anything I can do to take back the "Leave Open"?  I see I have 50 Close Votes. To use those on the Review Queue I estimate would take at least three hours. The idea of thousands of >3k zooming in and killing the queue in a short period of time is, I think, not a flyer.

What is accident forgiveness? To me, it is the act of understanding that we are humans, and we make mistakes, so a person who makes a mistake should not be quickly judged or ridiculed. But rather, people should show that person empathy, compassion, and possibly humor.  I was reviewing some suggested edits on SO, and I came to a post that I didn't fully understand. I thought it should probably be rejected because the edit didn't make too much sense, but instead I was just going to skip over it. However, I was thinking about something else, and when I went to click "skip", I accidentally clicked "improve".   Right when it happened, time slowed down, and everything was slow motion. My brain automatically knew I made a mistake and I of course saw the "stop and pay attention" message yelling at me. I don't want this to be on my record forever. Is there anyway to get some accident forgiveness?


ls -d */ runs fine in all other directories that I tried, but in one specifically, I get this:  ls: invalid option -- '/' Try 'ls --help' for more information.   I pasted the command in the terminal, so, it's exactly the same in both cases.

There is a thread that talks about ls "*" not showing any files, but I actually wonder why the simple  ls *   command doesn't output anything in my terminal other than  ls: invalid option -- '|' Try 'ls --help' for more information.   while   ls   will list all the files in the current directories as    1                  ferol                      readme.txt  2                  fichier                    sarku  2018               GameShell                  Templates  22223333          '-|h4k3r|-'                 test  3                  hs_err_pid2301.log         test2  CA.txt             important.top.secret.txt   toto.text  CA.zip             JavaBlueJProject           tp1_inf1070  countryInfo.txt    liendur                   'tp1_inf1070_A19(2) (1)'  currency           liensymbolique             tp1_inf1070_A19.tar  curreny            LOL                        Videos  Desktop            Longueuil                 'VirtualBox VMs'  Documents          Music                      words  douffos            numbers                    Zip.zip  Downloads          Pictures  examples.desktop   Public   Any ideas as to why the globbing doesn't take effect here? I'm on Ubuntu, working in the terminal, I don't know if it makes a difference.  Thanks.


I am trying to use the TiKZ-Feynman package to create Feynman diagrams for a report. However when I try to refer to them by their figure number, it is not generating the number correctly in some cases. It may be something to do with the section or subsection in which the diagram is contained. I am using TiKZ-Feynman 1.1.0 and compiling with LuaLaTeX on sharelatex.  \documentclass[a4paper]{article}  % packages \usepackage[margin=2.75 cm]{geometry} % margins \usepackage{tikz} \usepackage[compat=1.1.0]{tikz-feynman}  \begin{document}  \section{Section 1} This is the first section, including correctly-numbered figure \ref{fig:first}.  % Figure 1 \begin{figure}[h]     \label{fig:first}     \centering     \includegraphics[width=0.8\textwidth]{figures/firstfigure.png}     \caption{Caption correctly numbered.} \end{figure}   \section{Section 2}  \subsection{Subsection 2.1}  Reference to a tikz-feynman diagram with incorrect figure number \ref{fig:second}.  \begin{figure}[h]     \centering     \label{fig:second}     \feynmandiagram [horizontal=a to b] {     i1 [particle=\(e^{-}\)] -- [fermion] a -- [fermion] i2 [particle=\(e^{+}\)],     a -- [photon, edge label=\(\gamma\), momentum'=\(k\)] b,     f1 [particle=\(\mu^{+}\)] -- [fermion] b -- [fermion] f2 [particle=\(\mu^{-}\)], };     \caption{Caption gives the correct numbering} \end{figure}  \end{document}   Specifically, it labels the first as 'Figure 1' both in the text and in the caption. For the second, however, the caption generates correctly ('Figure 2') while the reference in the text says 'Figure 2.1'.

\documentclass{article} \usepackage{algorithm}  \begin{document} \setcounter{section}{54} \section{A section with no label} \begin{algorithm} \label{myalg} \caption{An algorithm with the label `myalg'.} \end{algorithm} Reference to myalg: \ref{myalg}. \end{document}   With this code, the reference givens 55 (the section number); if I move the label after the caption command, I get the correct reference (1).  Why should this be the case? I find it confusing: when thinking about an algorithm as an environment, you expect to be able to label it right after you began it. At the very least I would expect some kind of error or "??" to appear, rather than the previous environment or reference-able entity being used.


Why does Postgres do the opposite thing for TS with and without Timezones?  In one case it adds hours, in the other case it subtracts.  Just to confuse things more, when specifying GMT+x, the hours are added in the case of TZ-naive and subtracted when the column is TZ-aware, but the opposite is done when using a time zone specified as 'Region/City'  Africa/Johannesburg is ahead of UTC by 2 hours, but when I select the column with AT TIME ZONE 'Africa/Johannesburg' it returns the time as the stored value MINUS 2 hours.  SELECT    admission_at AT TIME ZONE 'gmt+2' AS gmt_plus_2,     admission_at AT TIME ZONE 'Africa/Johannesburg' AS africa_jnb,     admission_at AS naieve   FROM admissions WHERE admission_at::date = '2018-06-11'  ORDER BY admission_at LIMIT 3;        gmt_plus_2       |       africa_jnb       |        naieve         ------------------------+------------------------+---------------------  2018-06-11 08:00:00+00 | 2018-06-11 04:00:00+00 | 2018-06-11 06:00:00  2018-06-11 08:00:00+00 | 2018-06-11 04:00:00+00 | 2018-06-11 06:00:00  2018-06-11 08:00:00+00 | 2018-06-11 04:00:00+00 | 2018-06-11 06:00:00 (3 rows)   As a test I created a table with two columns, one for time with and one without timezone information.  SELECT  time1,  time1 AT TIME ZONE 'Africa/Johannesburg' AS naieve,  time1 AT TIME ZONE 'gmt+2' AS t1_gmt2,  time2, time2 AT TIME ZONE 'Africa/Johannesburg' with_tz,  time2 AT TIME ZONE 'gmt+2' AS t2_gmt2  FROM times;                                time1            |            naieve             |            t1_gmt2            |             time2             |          with_tz           |          t2_gmt2            ----------------------------+-------------------------------+-------------------------------+-------------------------------+----------------------------+----------------------------  2018-06-14 08:47:35.382964 | 2018-06-14 06:47:35.382964+00 | 2018-06-14 10:47:35.382964+00 | 2018-06-14 08:47:35.382964+00 | 2018-06-14 10:47:35.382964 | 2018-06-14 06:47:35.382964  2018-06-14 08:47:36.468022 | 2018-06-14 06:47:36.468022+00 | 2018-06-14 10:47:36.468022+00 | 2018-06-14 08:47:36.468022+00 | 2018-06-14 10:47:36.468022 | 2018-06-14 06:47:36.468022  2018-06-14 08:47:37.342908 | 2018-06-14 06:47:37.342908+00 | 2018-06-14 10:47:37.342908+00 | 2018-06-14 08:47:37.342908+00 | 2018-06-14 10:47:37.342908 | 2018-06-14 06:47:37.342908 (3 rows)   The result is exactly the opposite of what I expect.  Why would a timestamp stored as naive convert correctly to 'GMT+2' by adding 2, but a TS with timezone do the opposite?  And why would it be the other way around when converting to 'Africa/Johannesburg', where the TZ-naive sees the value returned having 2 hours deducted while the TZ-aware value gets 2 hours added for the same value?  Note:  This is NOT a duplicate of  which relates to Time Zone abbreviations, which behaves differently from Time Zone Names.  In this instant regardless whether the name or the GMT+offset format is used, the result is reversed (time added vs time subtracted) depending on whether the column type is a TZ naive or TZ aware timestamp.

I was answering this  question and found strange result:   select * from  pg_timezone_names where name = 'Europe/Berlin' ;      name      | abbrev | utc_offset | is_dst  ---------------+--------+------------+--------  Europe/Berlin | CET    | 01:00:00   | f   and next query  select id,    timestampwithtimezone,    timestampwithtimezone at time zone 'Europe/Berlin' as berlin,    timestampwithtimezone at time zone 'CET' as cet  from data ;  id  | timestampwithtimezone  |       berlin        |         cet           -----+------------------------+---------------------+---------------------  205 | 2012-10-28 01:30:00+02 | 2012-10-28 01:30:00 | 2012-10-28 00:30:00  204 | 2012-10-28 02:00:00+02 | 2012-10-28 02:00:00 | 2012-10-28 01:00:00  203 | 2012-10-28 02:30:00+02 | 2012-10-28 02:30:00 | 2012-10-28 01:30:00  202 | 2012-10-28 02:59:59+02 | 2012-10-28 02:59:59 | 2012-10-28 01:59:59  106 | 2012-10-28 02:00:00+01 | 2012-10-28 02:00:00 | 2012-10-28 02:00:00   I'm using PostgreSQL 9.1.2 and ubuntu 12.04. Just checked that on 8.2.11 result is the same.  According to  it doesn't matter if I use name or abbreviation.  Is this a bug? Am I doing something wrong? Can someone explain this result?    EDIT For the comment that CET is not Europe/Berlin.  I'm just selecting values from pg_timezone_names.  select * from  pg_timezone_names  where abbrev ='CEST';  name | abbrev | utc_offset | is_dst  ------+--------+------------+--------   and  select * from  pg_timezone_names  where abbrev ='CET';         name         | abbrev | utc_offset | is_dst  ---------------------+--------+------------+--------  Africa/Tunis        | CET    | 01:00:00   | f  Africa/Algiers      | CET    | 01:00:00   | f  Africa/Ceuta        | CET    | 01:00:00   | f  CET                 | CET    | 01:00:00   | f  Atlantic/Jan_Mayen  | CET    | 01:00:00   | f  Arctic/Longyearbyen | CET    | 01:00:00   | f  Poland              | CET    | 01:00:00   | f  .....   During winter Europe/Berlin is +01. During summer it is +02.  EDIT2 In 2012-10-28 timezone has change from summer time to winter time at 2:00. This two records have the same value in Europe/Berlin:  204 | 2012-10-28 02:00:00+02 | 2012-10-28 02:00:00 | 2012-10-28 01:00:00 106 | 2012-10-28 02:00:00+01 | 2012-10-28 02:00:00 | 2012-10-28 02:00:00   This suggest that if I use one of abbreviations (CET or CEST) for big data range (summer time and winter time) result will be wrong for some of records. Will be good if I use 'Europe/Berlin'.  I changed the system time to '2012-01-17' and pg_timezone_names has changed also.  select * from  pg_timezone_names  where name ='Europe/Berlin';      name      | abbrev | utc_offset | is_dst  ---------------+--------+------------+--------  Europe/Berlin | CEST   | 02:00:00   | t


I have a set of Plugins that I have to restructure according to different sub menus in a Global Menu. For the moment, I have two plugins but each time it recreates the menu for me while I integrate the second plugin directly on the Global menu as the first plugin to Create. class ClassGeneraleMenu:     def __init__(self, iface):         self.iface = iface         # Declaration de mon Menu Global en premier lieu         self.ambition_menu = QtWidgets.QMenu('MenuGlobal')      # Function qui me crée des sous menus dans ma MenuGlobal     def atrqgis_add_submenu(self, submenu):         self.ambition_menu.addMenu(submenu)      # Function iniGuit     def initGui(self):         # Insertion du Menu dans la barre menu de Qgis         self.iface.mainWindow().menuBar().insertMenu(self.iface.firstRightStandardMenu().menuAction(),self.ambition_menu)          # Sous Menu Par projet         # Myprojet Sous Menu         self.adn_menu = QtWidgets.QMenu(QCoreApplication.translate("atrqgis", "&Myprojet"))         self.atrqgis_add_submenu(self.adn_menu)                  # CONTROLE DESIGN Submenu         self.controle_design = self.adn_menu.addMenu('Contrôle')          # Ajout des actions dans dans la fenetre execution         icon = QIcon(os.path.dirname(__file__) + "/icons/import.png")         self.animate_lines_action = QtWidgets.QAction(icon, "A.1.1 Import de données", self.iface.mainWindow())         self.animate_lines_action.triggered.connect(self.baba_fonc)                  # Ajout de l'action dans la CONTROLE DESIGN Submenu         self.controle_design.addAction(self.animate_lines_action)  This example is the same for all my Plugins, except that I want each Plugin to insert into an existing menu

I am new to Python and QGIS and attempting to create some plugins to replicate in-house tools used in other GIS programs. I have added a custom menu using Python and added the plugin to the menu using the following code within the initGui method:  self.menu = QMenu("&Menu Name", self.iface.mainWindow().menuBar()) actions = self.iface.mainWindow().menuBar().actions() lastAction = actions[-1] self.iface.mainWindow().menuBar().insertMenu(lastAction,self.menu) self.action = QAction(QIcon(":/plugins/Trial/icon.png"),"Trial plugin", self.iface.mainWindow()) self.action.triggered.connect(self.run) self.menu.addAction(self.action)   However, if I try and add another plugin to the same menu I end up with duplicated menu item names with only one plugin in the menu, rather than all the plugins under the same menu. Is there a way of adding multiple plugins to an existing custom menu item?


So I've tried to make the camera also follow my character rotation, I tried using the same process that I did for the position follow, using quaternion and transform.rotation but it was giving me some errors. Since I'm pretty new, I will ask for the best solution for my problem, here's the code:  void Start() {     followPos = transform.position - player.transform.position; }   void LateUpdate() {     transform.position = player.transform.position + followPos; }

I want to have a camera, that follow the player, without childing it to the player object. So far I have this one line, that follows the player, but does not rotate with it (meaning the camera should look where the player's front is looking, how can I do it?  transform.position = player.transform.position + offset;


I have a list of dictionaries in python, called all_data. The structure of each dict object hold by all_data is:  {     'href': u'http://malc0de.com/database/index.php?search=c.img001.com',      'type': u'text/html',      'rel': u'alternate',     'title': u'c.img001.com',      'summary': u'URL: c.img001.com/re58/girlshow_20300025849.exe, IP Address: 14.215.74.85, Country: CN, ASN: 58543, MD5: 31d5f481153ccd2829558720f8d90d81',      'title_detail': {         'base': u'http://malc0de.com/rss/',          'type': u'text/plain',          'value': u'c.img001.com',          'language': None      } }   I want to perform sorting base on the name of 'Country' which is present as sub-string to the value of 'summary' key. The content of string is like:  u'URL: c.img001.com/re58/girlshow_20300025849.exe, IP Address: 14.215.74.85, Country: CN, ASN: 58543, MD5: 31d5f481153ccd2829558720f8d90d81',    I want to sort the list of dicts based on the Country name in the alphabetical order.

I have a list of dictionaries and want each item to be sorted by a specific value. Take into consideration the list: [{'name':'Homer', 'age':39}, {'name':'Bart', 'age':10}]  When sorted by name, it should become: [{'name':'Bart', 'age':10}, {'name':'Homer', 'age':39}]


I want to write "Hall thrusters are propulsion devices whose power spans from 0.1 to 20 kW."  I am not sure about "whose" part, because it feels like it's supposed to be used only when talking about humans (am I right?).  So is there any other word that could replace the "whose"? Or can it be used in this way and I am just overthinking it?

We lit a fire whose fuel was old timber wood.   Is the word whose referring to fire, an inanimate object, correct in this sentence? Or is there a more appropriate word?


How to find infinite sum How to find infinite sum $$1+\dfrac13+\dfrac{1\cdot3}{3\cdot6}+\dfrac{1\cdot3\cdot5}{3\cdot6\cdot9}+\dfrac{1\cdot3\cdot5\cdot7}{3\cdot6\cdot9\cdot12}+\dots? $$   I can see that 3 cancels out after 1/3, but what next? I can't go further.


Normally on a PC, if you have caps lock enabled, holding shift will result in lower case characters appearing.  Without Caps Lock  wITH cAPS lOCK   On OSX, this behavior doesn't occur - that is, holding shift while caps lock is engaged doesn't produce lower case. The behavior is specific to OSX, since it doesn't happen in a Boot Camp installed copy of Windows.  Is there a way to change this behavior to be more traditional?

Every so often, I have to type some text consisting mostly of uppercase letters, but with an occasional lowercase letter—essentially, sentence case, but inverted. On Windows, I would simply have caps lock on the entire time, and pressing Shift would give me a lowercase letter. On OS X, however, if caps lock is on, I only get uppercase letters, whether Shift is pressed or not.  So, I can either hold down Shift the entire time I'm typing, letting go of it briefly to type a lowercase letter, or press Caps Lock twice for each lowercase letter I type. Neither works as well as what Windows does.  Is there a way to get Caps Lock to behave as it does on Windows, where pressing Shift while caps lock is on produces lowercase letters?  I am running 10.6.


If $f,g\in H(\mathbb{D})$, and there are no zeroes in $\mathbb{D}$. If $\frac{f'}{f}\left(\frac{1}{n}\right)=\frac{g'}{g}\left(\frac{1}{n}\right)$ $\forall n$, then $f=kg$ for some $k\in \mathbb{C}$.  I don't see what theorem should I use to prove it. Any hints to solve this problem?

Suppose $f(z)$ and $g(z)$ are analytic in domain $D$, $f(z)$ and $g(z)$ never vanish at any $z\in D$ and that     $$ \frac{f'(z_n)}{f(z_n)}=\frac{g'(z_n)}{g(z_n)} $$ at a sequence  of points $\{z_n\}$ converging to $z_0\in D$. Show that $f=Kg$ for some $K\in \mathbb{C}$.   My Solution:   As $f,g$ are analytic in $D$ and none of them have any zero in $D$ implies $\frac{f'}{f}$ and $\frac{g'}{g}$ are also analytic on $D$. As $\frac{f'(z_n)}{f(z_n)}=\frac{g'(z_n)}{g(z_n)}$ and $z_n\to z_0 \in D$, using the identity theorem, $\frac{f'}{f}\equiv \frac{g'}{g}$ on $D$.  Now,  \begin{align*} \frac{f'(z)}{f(z)}=\frac{g'(z)}{g(z)},\ \forall\ z\in D. \end{align*} Solving this differential equation gives me $f=Kg$ for some $K\in \mathbb{C}$. Now my question is after doing the integration we will get $\log(f)=\log(Kg)$, is it valid in the complex logarithm?


I need to find R(AB). It is resistance across terminals A and B.  I really do not know how to solve this kind of circuits. Maybe I have to use transforming from triangle to star? But it is quite inconvinient.  I noticed that on the right side 1 kOhm and 2 kOhm resistors are series. We add them and get 3. But what's next step?

I'm trying to find the Thevenin equivalent for part A of this circuit:    I begin by opening the circuit at the dotted line of part A. Then I try to find \$V_{oc}\$ across the two terminals that are open. I can see that the 47kΩ is in series with the 18kΩ since no current flows to the open circuit, and that the 15kΩ is in series with the 33kΩ. However I'm having a lot of trouble redrawing the circuit. Not really sure about how to make it look simpler. Any ideas?


I tried to find best way of having ternary operator in python, but didn't find conclusive information. Is using lambda, as shown below, the best way? What is the best way to do below operation in one line?  return (lambda: "Yes", lambda: "No") ['hello' == 'hello']()

If Python does not have a ternary conditional operator, is it possible to simulate one using other language constructs?


Let $X$ be a denumerable set and $Y$ an infinite subset of $X$.  There are two functions $g$, $h$ such that $g:X \sim \mathbb{N}$(since $X$ is denumerable), $h:Y\to \mathbb{N}$ and $h$ is defined by $h(y)$ = the number of elements in $\{1,2,3,···,g(y)\} \cap g(Y)$.  Then I have to prove that $h$ is bijection. How to prove it?  ($g:X \sim \mathbb{N}$ means that $g:X \to \mathbb{N}$ is bijecion.)

In my book, it proves that an infinite subset of a coutnable set is countable. But not all the details are filled in, and I've tried to fill in all the details below. Could someone tell me if what I wrote below is valid?  Let $S$ be an infinite subset of a countable set $T$. Since $T$ is countable, there exists a bijection $f: \mathbb{N} \rightarrow T$. And $S \subseteq T = \{ f(n) \ | \ n \in \mathbb{N} \}$. Let $n_{1}$ be the smallest positive integer such that $f(n_{1}) \in S$. And continue where $n_{k}$ is the smallest positive integer greater than $n_{k-1}$ such that $f(n_{k}) \in S$. And because $S$ is infinite, we continue forever. Now consider the function $\beta : \mathbb{N} \rightarrow S$ which sends $k \rightarrow f(n_{k})$.   So in order for $S$ to be countable, $\beta$ would have to be a bijection. $\beta$ is injective since if $f(n_{k}) = f(n_{j})$, then $n_{k} = n_{j}$ because $f$ is injective. We also can conclude $k = j$ because the various $n_{i}$ chosen were strictly increasing.   Edit: $\beta$ also needs to be surjective. So for every $r \in S$ there exists a $q \in \mathbb{N}$ such that $\beta(q) = f(n_{q}) = r$. We know that $f^{-1}(r) \in \{n_{1}, n_{2}, ..., n_{k} ... \}$, so we can let $f^{-1}(r) = n_{d}$. Thus $\beta(d) = f(n_{d}) = r$.


I need to create custom list with predefined list GUID. I have found no clues to do that.Can anyone suggest the code.

I found  which goes over how to add a list, but it doesn't seem possible to specify a GUID if you use this method.  Is there any way to create a list and specify the GUID?  I am trying to recreate several lists on a different server and if they do not have the same GUIDs other functionality may break.


I'm trying to connect to a socket and then check if it is connected. My problem is that my socket IS connecting but when I ask if it is, it returns null.  How I'm getting my connection:  package main;  import java.io.IOException; import java.net.Socket;  public class getIrcConnection {      String Server = "tmi.twitch.tv";     int Port = 80;      declars declars = new declars();      public getIrcConnection() throws IOException{      this.declars.socket = new Socket(Server, Port);      }  }   Where my socket is stored:  package main;  import java.net.Socket;  public class declars {      Socket socket;  }   How I'm checking the connection:  package main;   public class checkIrcConnection {      declars declars = new declars();      public checkIrcConnection() {          if (this.declars.socket.isConnected()) {                    System.out.println("Connected");              }        }  }   All of this is beeing executed in the main method:  package main;  public class Main {      public static void main(String[] args) throws Exception {          getIrcConnection gic = new getIrcConnection();          checkIrcConnection cic = new checkIrcConnection();      }  }

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