Edit: This is not a general question about microbenchmarking. I know the garbage collector is unpredictable. I want to know how IN THIS SPECIFIC case it's possible that a single toString() of an array's .length property could so reliably cause such a change consistently on multiple JVMs.  Original question follows:  I'm a high school teacher. I was attempting to put together a little example to show my students that arrays of primitives are slightly more efficient than arrays of Integer objects. This sample program gives me unexpected output.  50000 objects...    sorted in 1377 ms. 50000 primitives... sorted in 2565 ms.   However, if I remove a single print statement (by toggling the boolean), I get:  50000 objects...    sorted in 1444 ms. 50000 primitives... sorted in 772 ms.   (The print statement in question is not inside the loop, of course.)  When the slowdown is in effect, changing the order of the tests (primitives first, then objects) makes it so that whichever happens SECOND slows down:  50000 primitives... sorted in 775 ms. 50000 objects...    sorted in 3640 ms.   Adding a delay between the two loops also "fixes" the slowdown.  I've tried adding System.gc() between instead of the delay, but it doesn't help.  I have also tried on multiple JREs, and I get similar output on Oracle's 1.8.0_31 and OpenJDK's 1.8.0_91. It times out on IDEOne because it takes longer than 5 seconds, but smaller array sizes don't exhibit the error on IDEOne.  public class PrintSlowdown {     public static void main( String[] args ) {         int[]     prims = new int[50000];         Integer[] objs  = new Integer[prims.length];         long start, stop;          boolean slowDown = true;         boolean compensate = false;          // initialize both         for ( int i=0; i<prims.length; i++ ) {             prims[i] = (int)(Math.random()*1000);             objs[i] = new Integer(prims[i]);         }          // Objects         if ( slowDown )             System.out.print(objs.length + " objects...    "); // WHY?!?         else             System.out.print("50000 objects...    ");         start = System.nanoTime();         for ( int i=0; i<objs.length-1; i++ ) {             int min = i;             for ( int j=i+1; j<objs.length; j++ ) {                 if ( objs[j].compareTo(objs[min]) < 0 )                     min = j;             }             if ( min != i ) {                 Integer temp = objs[i];                 objs[i] = objs[min];                 objs[min] = temp;             }         }         stop = System.nanoTime();         System.out.println("sorted in " + (stop-start)/1000000 + " ms.");          if ( compensate )             try { Thread.sleep(2000); } catch (Exception e) {}          // Primitives         System.out.print(prims.length + " primitives... ");         //System.out.print("primitives... ");         start = System.nanoTime();         for ( int i=0; i<prims.length-1; i++ ) {             int min = i;             for ( int j=i+1; j<prims.length; j++ ) {             if ( prims[j] < prims[min] )                 min = j;             }             if ( min != i ) {                 int temp = prims[i];                 prims[i] = prims[min];                 prims[min] = temp;             }         }         stop = System.nanoTime();         System.out.println("sorted in " + (stop-start)/1000000 + " ms.");     } }   Sorry for such long sample code, but any smaller and it doesn't trigger the weirdness. (I spent nearly two hours trying to reproduce with less code, and this was the best I could do.)  Any ideas?!? I'm going crazy here.

How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related:


I have a website lets say xyz.com for which i have the sitemap index at xyz.com/sitemap.xml  Within the sitemap index file there are multiple sitemap links which are hosted on a subdomain of xyz.com lets say sitemap.xyz.com.  So the structure of sitemap index file  is as follows  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <sitemap> <loc> https://sitemap.xyz.com/sitemap1.xml </loc> </sitemap>  <sitemap> <loc> https://sitemap.xyz.com/sitemap2.xml </loc> </sitemap> </sitemapindex>   Also i have submitted the sitemap index file in Google search console and google correctly shows the total count of pages from all sitemaps  Is this structure recommended or will there be any issue with this architecture   PS This question is not about cross domain sitemaps

Just out of curiosity, I have developed a small app analysing and generating sitemaps for a given domain.   Can I tell search engines to look for the sitemap of a given domain on my app using a dynamic url i.e. can you use cross-domain sitemaps.xml without validating you are owner of the destination domain?  For example :   http://example.com/mydomain.com/sitemap.xml


Actually I wrote a code to find a character from the list and print the index but am not getting the difference between these two codes please help me out:  #My list: l = ["MA-%78*%%1","MA%-78*%1","MA%%-%78*1","M%A#-78*%%1"]  search(l,"%")   Code 1:  def search(string_list,search_character):     sl = string_list     char1 = search_character     l1 = list()     l11 = list()     for j in range(len(string_list)):         l1.clear()         s1 = string_list[j]         for i in range(len(s1)):             if s1[i] == search_character:                 l1.append(i+1)         l11.append(l1)     return l11   This yields the output: [[1, 8, 9], [1, 8, 9], [1, 8, 9], [1, 8, 9]]  Code 2:  def search(string_list,search_character):     sl = string_list     char1 = search_character     l11 = list()     for j in range(len(string_list)):         l1 = list()         s1 = string_list[j]         for i in range(len(s1)):             if s1[i] == search_character:                 l1.append(i+1)         l11.append(l1)     return l11   I get correct output when I initialized the list again without clearing it:  [[4, 8, 9], [3, 8], [3, 4, 6], [2, 9, 10]]  I didn't understood what is wrong with l1.clear() function.

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


Fellow typesetters,  I have such a stupid problem: I want to declare footnotes outside the paragraph text (as in the MWE below). I believe this makes the TeX file much easier to read. The problem is that even though the .tex is compiled without errors, footnote reference symbols all come out zeroes. The \footrefs don't seem to "catch" the footnote declarations. The footnotes must be declared in the .aux file since the PDF is produced without errors.  I have already tried changing order with the footnote declarations above the paragraph.   Declaring the footnotes with \footnote instead of \footnotemark solves the nubering but the symbols show up as characters in paragraphs of their own.  I don't want to use the optional argument approach but stick with automatic numbering to avoid issues with page breaks.  \documentclass{report}  \usepackage[multiple]{footmisc} \usepackage{footnote}  \begin{document}  Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae\footref{note:lockout}. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam a libero gravida, dignissim neque id, commodo libero. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae\footref{note:dbversioner}\footref{note:lockin}, ipsum dolor sit amet, consectetur adipiscing elit.   \footnotetext{Det finns.\label{note:lockout}}  \footnotetext{Vid uppgradering av   databasen.\label{note:dbversioner}}  \footnotetext{Ett annat exempel.\label{note:lockin}}  \end{document}   I compile the original document with XeLaTeX. The MWE have the same problems wether I use XeLaTeX or pdfLaTeX.  I know there's an obvious answer but now I feel stuck. Anyone up for some easy points?  Cheers

I would like to use footnotes without cluttering the container paragraph. Something like:  This is a very long complex\footnote[a] sentence.  \foottext[a]{So complex that I would prefer to pull out the footnote text.}   The idea comes from the [linktext][1], [1]: http://url.com markdown syntax.


If i take $a$ and $b$ such as $GCD(a,b)=1$ then for the bezout lemma the inverse of $a$ mod $b$ will exist . If $GCD(a,b)\neq 1$ there can be multiple inverses of $a$ mod $b$ or simply the inverse doesn't exist ?

I need help with this:  If a is an element of $\mathbb Z_n$ and $\gcd(a,n) > 1$ , then a is not invertible.   First you show that if $a$ is an element of $\mathbb Z_n$ and $\gcd(a,n)>1$, then there  is an element $b$ of $\mathbb Z_n$ and ($b$ is not equal to the zero element) from which $ab = 0$.   The second part I cant get. i.e. show if $b$ is not the zero element  and $ab=0$ then $a$ is not invertible.


How does one implement the friend concept in Java (like C++)?

I would like to be able to write a Java class in one package which can access non-public methods of a class in another package without having to make it a subclass of the other class. Is this possible?


I want to change the color of equation in a beamer presentation slide from the rest of text. I used following code, but the color of equation number is still black. How can change it. MWE:  \documentclass[11pt]{beamer} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usetheme{default} \begin{document}       \begin{frame}         \frametitle{}          The equation is given as          \begin{align}{\label{xn}             \color{blue} x_{n}             =\frac{1}{\sqrt{N}}\sum^{N-1}_{{k}=0}             X_k e^{j2\pi kn/N},  \hspace{20mm} n=0,1, \dots,{N-1}}         \end{align}     \end{frame} \end{document}

I have a long series of equations in an align environment and I want to highlight only the last one (final result) using \color{red}. However, the label number stays black (unlike to what happen in the equation environment). How do I change also the color of the number?  MWE  \documentclass[11pt,a4paper]{report}  \usepackage{amsmath, amssymb} \usepackage{color}  \newcommand{\colorlabel}[1]{%   \refstepcounter{equation}%   \tag{\textcolor{#1}{\theequation}}}  \begin{document}  \begin{equation} \label{eq:equation} \color{red} a = b + c \end{equation}  \begin{align} \label{eq:align} a &= b + c \nonumber \\ & \colorlabel{red}\color{red} = e + f \end{align} Eq~\eqref{eq:equation} shows that referencing using the equation environment gives black text. Eq~\eqref{eq:align} shows that referencing using the align environment gives colored numbers with black brackets.  \end{document}     UPDATE  Building on jarauh's solution, I am currently using   \newcommand{\colorlabel}[1]{%   \refstepcounter{equation}%   \tag{\color{#1}{\theequation}}}   which, however, keeps the brackets black. Also, when references, the number is colored but not the brackets. This behavior is different from the one shown using equation (everything is black when referenced). I would like to have a consistent behavior between them (it would be great to have one single command, without manually modifying the color before/after the equation).


I am trying to show this is statement holds for all metrics:  Any help would be awesome

Let $\overline{B_d (x, r)}$ be the closure of an open ball, and let $\hat B_d (x, r)$ be a closed ball. Show that in any metric space $(X, d)$, $\overline{B_d (x, r)} \subseteq \hat B_d (x, r)$ for all $x \in X$ and $r > 0$.    I used the definition of closure: $\overline{B}$ = $B \bigcup B'$. If $x \in \overline{B}$, then $x \in B$ or $x \in \overline{B}$, or both. If $x \in B$, then clearly $x \in \hat B$ since $B \subseteq \hat B$. But, if $x \in B'$, then $x$ is an accumulation point. Since $\hat B$ is closed, it contains all accumulation points of $B$. Thus, $x \in \hat B$.  Is this approach correct, or at least in the right direction? Should I be using the closure definition, or try another one? Thank you.


I heard somebody say that you get her off of me. I thought that "you get her off me" is right. So what is the difference between "off" and "off of"?

What is the difference when you say "get off of something" and "get off something"?


I have the following problem and I think I should use OLAP functions, but I'd never used them before.  So I have:  row_no       Id       category         sell_value 1           1111          5             1670.75 2           2222          4             2777.51 3           3333          15             151.8          4           4444          9               24.54 5           5555         25               110   And I want to get:  id   category_5  category_4  category_15   category_9    category_25 1111   1670.75        0           0             0            0 2222      0        2777.51        0             0            0   3333      0           0          151.8          0            0 4444      0           0            0           24.54         0 5555      0           0            0             0           110   Is there any possibility to have my result by using only pls/sql? Or a procedure is required, or how can it be done.  Regards,

Trying to find some simple SQL Server PIVOT examples.  Most of the examples that I have found involve counting or summing up numbers.  I just want to pivot some string data.  For example, I have a query returning the following.  Action1 VIEW   Action1 EDIT   Action2 VIEW   Action3 VIEW   Action3 EDIT     I would like to use PIVOT (if even possible) to make the results like so:  Action1 VIEW EDIT   Action2 VIEW NULL   Action3 VIEW EDIT     Is this even possible with the PIVOT functionality?


I have a homework for the university and I am 'on this' for the entire week, so I really need help. The question: let $p>2$ be a prime number and $n\in \Bbb N$, $\ p-1\nmid n$. Prove that $1^n+2^n+...+(p-1)^n \equiv 0\pmod p$. I thought:  it is pretty clear that $p-1$ is composite so I can write $p-1=q_1^{t_1}q_2^{t_2}...q_k^{t_k}=\prod_{i=0}^{k} q_i^{t_i}$ and I know that $2 \le q_i\le p-1 \ , \ \ 0 \le i \le k \ $ and that $ \ 2\mid p-1$ so $ \ p-1=2k$. The sum is $\sum_{i=0}^{p-1} i^n=1^n+2^n+...+(p-1)^n \equiv 0\pmod p$ but I don't know what can I understand from that.  I really need help. Thank you

I've been working through a bit of Ireland and Rosen's Number Theory for fun. Problem 4.11 of Ireland and Rosen asks     Prove that $1^k+2^k+\cdots+(p-1)^k\equiv 0\pmod{p}$ if $p-1\nmid k$, and $-1\pmod{p}$ if $p-1\mid k$.    My work is leading where I didn't expect to go. Here I assume $p$ id odd. First, if $p-1\mid k$, then we can wrike $k=(p-1)j$ for some $j$. But then $$ 1^k+\cdots+(p-1)^k\equiv 1^{(p-1)j}+\cdots+(p-1)^{(p-1)j}\equiv \underbrace{1+\cdots+1}_{p-1\text{ times}}=\frac{(p-1)p}{2}\equiv 0\pmod{p} $$ since $p-1$ is even.   Secondly, I suppose $p-1\nmid k$. WLOG, I can assume $0<k<p-1$, Since if $k=(p-1)j+r$ with $0<r<p-1$, then  $$ a^k\equiv a^{(p-1)j+r}\equiv a^r\pmod{p}. $$  Then if $g$ is a primitive root, $$ 1^k+\cdots+(p-1)^k=\sum_{i=1}^{p-1}(g^k)^i=\frac{g^k(1-g^{k(p-1)})}{1-g^k}. $$ Since $g$ is primitive, $p\nmid 1-g^k$, but $p\mid 1-g^{k(p-1)}$, so the above sum is again congruent to $0\pmod{p}$.  So in all cases, I get the sum is congruent to $0$ regardless. Have I messed up, or is there a typo? Thanks.


I have to update columns in a table with data. And in one of column's data has & in it like( 'Salt & Pepper').   So when I run the update statement, it is prompting me to enter the value.  But in my case, it should not ask, it should insert the data 'Salt & Pepper' into the table's column.  UPDATE dishes SET ingredient = 'Salt & Pepper' WHERE dish_id = 5000;   How can I do that?

I have a SQL script that creates a package with a comment containing an ampersand (&). When I run the script from SQL Plus, I am prompted to enter a substitute value for the string starting with &. How do I disable this feature so that SQL Plus ignores the ampersand?


The question asks to convert $\neg(p \lor \neg q) \rightarrow (\neg r \land (p \rightarrow r))$ to a DNF.  I got it till $\neg(\neg p \land q) \lor (\neg r \land \neg p)$. I dont know how to simplify it further. I know that the first clause can be simplified further using DeMorgans but then it would become a disjunct instead of a conjunct. What should I do?

The question gives the following: ¬(p ∨ ¬q) → (¬r ∧ (p → r))  With my own working, I have come to the answer of (p ∨ ¬q) ∧ (¬r ∧ ¬p) ∧ (¬r ∧ r). Can anyone tell me if this is correct?  Also, please tell me what Disjunctive Normal Form really means (without complicated terminology). The answer I got was from trying to break down what other similar questions have done. I still don't know what it really means.


Hy! I want to use an EC key for ECDH and ECDSA too. Using the same key does compromise the security of the key in a cryptographic / mathematical sense? I read a lot in this theme, but I found nothing exact. I know that the usage of the same key for encryption and for signing is not recommended (because of encryption keys must be escrowed, and signing keys must not be escrowed), but is there any mathematical/cryptographic reason to use different keys? (Only in Elliptic curve cryptography of course). Is there an RFC or something formal paper about this? (A haven't found any) I want to generate an EC key on a HSM, but I can't enable SIGN, and DERIVE at the same time. (I think that's because the HSM generates an ECDSA key in the precending case, and an ECDH key in the latter case, and don't know what to do if they are enabled in the same time). But I can generate an EC key with openssl without so much as to know if I want to use it for ECDH, or ECDSA purposes. Is there any workaround for that? Can I generate a general EC key on the HSM?

Are there any security risks using a single key-pair for both key-exchange and signing?  I'm mainly interested in using Curve25519 for key-exchange and Ed25519 for signing. But similar combinations, such as EC-DH and EC-Schnorr or even EC-DSA with the same key pair would be interesting too.   Curve25519 hashes the output of an x-coordinate only Diffie-Hellman key exchange Ed25519 is a slight variant of EC-Schnorr signatures.   I saw some recommendations to avoid using a single key for multiple purposes, but I couldn't find anything concrete.


What happens to photons when they hit our eye? where do they end up? if they generate heat, why our eye don't get overheated?  Similarly what happens to electrons when the light hits certain metals, which causes "weakly connected" electrons to get hit out?  Shouldn't then light constantly shining on a piece of metal eventually cause it to decay, and get split to electrons, and other particles?  (sorry if I'm not using right scientific terminology)

I know that the light is reflected from a object to my eyes, but I don't understand exactly how. The photons appear from the light source and disappear in my eye! Can someone explain the phenomenon of where the photons go and do to allow us to see?


Here is my config:  server {         #...         location ^~ /wp-login.php {            auth_basic           "Restricted";            auth_basic_user_file /var/www/.htpasswd;         }          location / {             try_files $uri $uri/ /index.php?_url=$uri;         }          location ~ \.php {             fastcgi_index  /index.php;             fastcgi_pass unix:/var/www/php-fpm/fpm.sock;             include fastcgi_params;             fastcgi_param  QUERY_STRING    $query_string;             fastcgi_split_path_info       ^(.+\.php)(/.+)$;             fastcgi_param PATH_INFO       $fastcgi_path_info;             fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;             fastcgi_param  APPLICATION_ENV dev;             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;             fastcgi_intercept_errors on;              try_files    $uri =404;         }         #...     I}   All works perfect except wp-login.php. If wp-login.php was initiated it will be downloaded as php file even with declined auth_basic authorization. It means I auth_basic window appered and after that wp-login.php will be downloaded.  What is incorrect in configuration?

I have the following nginx location block:  location ^~ /publish {   allow 127.0.0.1;    #Allow home   allow 99.100.101.102;    deny all; }   Then this location block to process PHP after:  location ~\.php {   try_files $uri =404;   fastcgi_index index.php;   fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;   fastcgi_intercept_errors on;   fastcgi_pass 127.0.0.1:9000;   include /etc/nginx/fastcgi_params; }   The problem is that files inside of /publish like execute.php aren't being processed by the fastcgi PHP processor, they simply output the pure PHP code when called from CURL. How do I enforce the security rules defined in the /publish block but also still execute the PHP block if the file ends in .php?


See this question:    This is a question from the ongoing CodeChef contest. The OP should not ask about it here. However, there is no valid way to stop him/her.  Although this question in itself is good, it is a form of cheating. Should we stop this behavior somehow?  Note: this question in itself is not that bad; it got +3 before I pointed out that it is from a contest.  There are also other questions like this, so it is becoming a trend:  Is Stack Overflow the new cheating panel for these contests / homeworks / etc.?  Edit Okay, I probably got a bit too excited. Anyway, it is nice to know people cares about it, and the original questions got took care of. Guess I'll be looking out for such questions in the future:)  EDIT Another one:

I am requesting for a new flag so that we can immediately flag questions in which people are asking for help on a problem from an ongoing contest, and if there is anything related to code or the algorithm in that question, it is deleted permanently from the view of others.  I am asking for this because I have seen a few questions, in which the OP was asking us to help fix their code on Stack Overflow. The Code they posted was from an ongoing contest on , and that would be considered cheating.  On codechef, we are told to not share anything from code, algorithm, or anything related to a problem from an ongoing contest, but since users are unable to ask their questions there, they come to Stack Overflow and ask it there.  Up till now, when I encounter questions like that, I flag them for moderator attention explaining the reason ( I don't have enough reputation to vote to close ).   I have not been a user on SO for long, but I have met a few questions like this already. This is one  . It's already deleted, but I think there should be a quick way to flag it so that it is brought to the notice of moderators quickly so that the code is not leaked. ( I don't want to increase the Work load on moderators, but something similar would be useful ).  So I request a new flag so that these questions can be flagged quickly to prevent the leaking of code and also make it easier, rather than having to type a good reason and wait for a moderator to accept it.  Please forgive me If this is a Duplicate as I could not find anything related to this on MSE yet.


I am trying to Serialize a class in C# this works fine when there is no null value in the object. Following is the class  public class EnquiryResponseInfo {     public string EnquiryId { get; set; }     public EnquiryViewModel Enquiry { get; set; } }   When I supply the following value it works great.  EnquiryResponseInfo tt = new EnquiryResponseInfo() {     EnquiryId = "xxx",     Enquiry = new EnquiryViewModel()     {         Name = "Test user",         Address = "Test Address"     } }   But when Enquiry is null it does not Serialize. I have a condition where the Enquiry will be null but there will be value in the EnquiryId there.  Following is the method to Serialize the class.  public static string Serialize<T>(T toSerialize) {     XmlSerializer xmlSerializer = new XmlSerializer(typeof(T));     using (StringWriter textWriter = new StringWriter())     {         xmlSerializer.Serialize(textWriter, toSerialize);         return textWriter.ToString();     } }   Please help.

I have a class with a nullable int? datatype set to serialize as an xml element.  Is there any way to set it up so the xml serializer will not serialize the element if the value is null?    I've tried to add the [System.Xml.Serialization.XmlElement(IsNullable=false)] attribute, but I get a runtime serialization exception saying there was a an error reflecting the type, because "IsNullable may not be set to 'false' for a Nullable type. Consider using 'System.Int32' type or removing the IsNullable property from the XmlElement attribute."  [Serializable] [System.Xml.Serialization.XmlRoot("Score", Namespace = "http://mycomp.com/test/score/v1")] public class Score {     private int? iID_m;     ...      /// <summary>     ///      /// </summary>             public int? ID      {          get          {              return iID_m;          }          set          {              iID_m = value;          }      }      ... }   The above class will serialize to:  <Score xmlns="http://mycomp.com/test/score/v1">     <ID xsi:nil="true" /> </Score>   But for IDs that are null I don't want the ID element at all, primarily because when I use OPENXML in MSSQL, it returns a 0 instead of null for an element that looks like


I am running an apache webserver on a linux EC2 instance.  The problem is that you can access the server using the IP address, DNS and the domain name. This causes a problem for SEO and I want to tidy it up.  I have read on the apache documentation that you can do a mod_rewrite and this needs to be done in the httpd.conf if you have root access otherwise in the .htaccess for per directory override.  I have root access so I am trying to change the  httpd.conf  If the user types in   or   I want them to be redirected to  www.example.com  This is what I tried  <VirtualHost *:80>  DocumentRoot "/var/www/html/my-website"  # Other directives here  RewriteEngine On  RewriteCond %{HTTP_HOST} !^52.17.12.123.com$  RewriteRule /* http://www.example.com/ [R] </VirtualHost>   It seems to partially work but www.example.com does not load due to to many redirects.

This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.


I've made honey cake pretty often, and it almost always splits open in the middle. Why does that happen and how can I prevent it?  Edit: attaching a picture of the cakes I just made    Basic recipe (not so exact):  Ingredients 6   eggs 1   glass oil 2   glasses sugar     Pinch of salt 4   teaspoons baking powder 1   cup coffee (glass of water + some instant coffee) 4   cups flour 4   Tablespoons brandy     Pour in cinnamon - teaspoon+ 1   pound honey Directions  Mix first 3 ingredients. Add rest of ingredients besides honey and mix. Put in honey last – pour slowly as it mixes Bake for 1 hour at 350. Cover towards the end

Some time ago, I baked a cake (Sachertorte to be exact). The taste and texture was fine, so my recipe is okay.  My biggest issue was the shape. In the middle it was really a lot higher than on the sides. I would like to redo it in the near future, but preferably with a flat(ter) surface. (Especially since I put icing on top and I don't want it to drip off this time.)  Anyone knows the cause of my problem, or even better a solution? I think I put enough butter on the side of my springform pan, in case this is an option.


Back in the pre-Disney days, there was a wealth of canon works of various stripes that dealt with the Star Wars galaxy after the events of Return of the Jedi. From the Dark Forces / Jedi Knight / Jedi Academy games to the books (I had a personal preference for the X-Wing series).  Since the relegation of all of this to Legends status, what works remain in canon to cover the time period between Return of the Jedi and The Force Awakens?  I am aware of  (which is somewhere on my future reading list). I'd be specifically interested in any that deal with the development of the New Republic.

For all types of derivative works, namely:   Movies Novels Comic books Other written works (including RPG materials) Cartoons Video games Derivative movies (such as the infamous Ewok movies and even more infamous )   According to what rules does something become "canon" and who is responsible for the evaluation of a published work?


From   date -d "next ${1- hour}" '+%H:00:00'   What is ${1- hour}? Is it some shell parameter expansion, or  input format of date and time?   Why does ${1 hour} not work?  Thanks.

How does "${2:-}" work in an 'if-then-else example' below?  Somehow I cannot help but think that being ${2:-} it means the second argument, but I am curious what the colon(:) and dash(-) after the digit 2 mean?    if [ "${2:-}" = "Y" ]; then      prompt="Y/n"      default=Y   elif [ "${2:-}" = "N" ]; then      prompt="y/N"      default=N   else      prompt="y/n"      default=   fi    read -p "$1 [$prompt] " REPLY </dev/tty


The A.I. was in the kid's room, who only had to learn from it for a couple hours a day, and could then go play outside with the other neighborhood kids. It completely replaced traditional school - everyone had one. I think it learned the child's learning style to better teach them.  Sorry, that's all I have on it. It was from around 15 years ago, I think. I read it as a kid.

I'm trying to find an short story I read in a collection about ten years ago. Publication date before 1980.  Here's everything I remember:   The story is about kids who found an old book with stories about schools in the 20th century. In this future, kids study at home with a robot teacher. They don't know how to study with other kids. These kids (maybe sister and brother) run away from their teacher to read this book in a loft or cellar. They liked those stories about schools.


As you can see I have rotated one of the symbols to face it upwards.   I want to apply the same effect to each symbol individually  Unfortunately, if I rotate it as a group, the symbols will look like this (It changed their position)     So how do I rotate the symbols to face upwards without doing it individually and without changing their position? It's such a waste of time.

There is ideas, how to rotate a lot of objects around their each center?


I am asking for help on the following exercise:     Find two isomorphic extensions of $\mathbb Z_3$ by $\mathbb Z_3 \times \mathbb Z_3$ which are not equivalent.   as taken from , see my other  for the notation.  There are  of order $27$. I found example extensions with the same groups that are not equivalent, but I was unable to give an isomorphism of extensions. Namely $E = \mathbb Z_3 \oplus \mathbb Z_9$ with $\mu(1) = (0,3)$ and $\overline \mu(1) = (1,3)$. Then an automorphism $\beta : E \to E$ giving equivalent extensions has to fulfill $\beta(0,3) = (1,3)$, but as $\beta(0,3) = \beta(0,1) + \beta(0,1) + \beta(0,1) = (0, x) \ne (1,3)$ this is not possible. The same argument works for the semidirect product $\mathbb Z_9 \rtimes \mathbb Z_3$, but both could not be made isomorphic extensions if we use the only non-trivial automorphism $\alpha(1) = 2$ on $\mathbb Z_3$. In $\mathbb Z_{27}$ we have only one way to embed $\mathbb Z_3$, so this will not work either. And $G = \mathbb Z_3 \oplus \mathbb Z_3 \oplus \mathbb Z_3$ will not work either, as we can alway write $\mu(Z_3) \oplus U = G$ as this is an $\mathbb Z_3$-vector space, hence make every isomorphism  $\overline \mu(\mathbb Z_3) = \beta(\mu(\mathbb Z_3)$ into an automorphism of $G$. So the only promising candidate seems to be $UT(3,3)$, but here as every element has order three I am somewhat unable to go along the same lines above to show that certain maps could not be extended to isomorphisms.  So I am asking for help on this exercise! Any hints?  EDIT: It is not a duplicate question, the other had a very specific question concerning understanding what is asked for. This one asks for help on the exercise themselve. Should not be difficult to tell that they are both different!

The following exercise from  confuses me:     Find two isomorphic extensions of $\mathbb Z_3$ by $\mathbb Z_3 \times \mathbb Z_3$ which are not equivalent.   For two  $N, E, G$ and $\overline N, \overline E, \overline G$ with injections $\mu : N \to E, \overline\mu : \overline N \to \overline E$ and projections $\varepsilon : E \to G, \overline\varepsilon : \overline E \to \overline G$ a homomorphism of extensions is a triple of homomorphism $(\alpha, \beta, \gamma)$ from $N$ to $\overline N$, $E\to\overline E$ and $G \to \overline G$ such that the resulting diagram commutes, see  from the book.  An equivalence between extensions $N, E, G$ and $N, \overline E, G$ is a triple of morphisms $(1_N, \beta, 1_G)$, an isomorphism between extension $N, E, G$ and $\overline N , \overline E, G$ is a triple of morphisms $(\alpha, \beta, 1)$ where $\alpha$ (and hence $\beta$) are isomorphisms. Note that in an isomorphism in general $N \ne \overline N$ , where they are equal for the notion of equivalence.  Coming back to the exercise, first as $\mathbb Z_3$ is a field, the only isomorphism from $\mathbb Z_3$ to $\mathbb Z_3$ is the identity map. So, as I see it, there is no way to give an isomorphism $\alpha \ne 1_{\mathbb Z_3}$, hence not possible to give an isomorphism which is not also an equivalence?  Or do I misunderstand something? Could you please clarify what this exercise asks for?


I was always thinking that binning of data if data is naturally continuous is bad. However, here is the case. The goal of study was to find if there is an association between a biomarker and disease progression.  I have 40 data points, measured in percents (disease progression). I have one biomarker which is factor (yes or no). I perform Wilcox test between groups with and without biomarker, comparing disease progression, I got p-value 0.07.  Doctors have clinically significant thresholds (symptoms decrease, symptoms remain more or less the same or symptoms highly increase). They divide data into these 3 categories and count number of times this biomarker occur within the subgroup (so it form contingency table $2\times 3$). They perform exact Chi squared test in this binned data (this is actually the ) and get p-value of 0.03. Expected values in contingency tables are not super-low - 40 data points are nicely distributed across 6 cells of the contingency table.  So, 2 questions: 1) in this particular case - does it mean that exact chi squared on binned data is more powerful test than Wilcoxon test? or it is just a coincidence? (I am not surprised that tests gave different p-values - I am surprised by the magnitude of difference in p-values) Or it is likely a violation of parametric assumption of this "exact chi-squared test" (I am unfamiliar with, but I think  test was assumed)? Of course I understand that Wilcox test between groups and proportion test within 3 subgroups are answering different questions - but the initial goal is to find if there is association between biomarker and disease progression and it seems that both statistical tests are answering it.  2) Is binning preferred over continuous data in some situations? In which?

I'm wondering what the value is in taking a continuous predictor variable and breaking it up (e.g., into quintiles), before using it in a model.   It seems to me that by binning the variable we lose information.   Is this just so we can model non-linear effects?  If we kept the variable continuous and it wasn't really a straight linear relationship would we need to come up with some kind of curve to best fit the data?


I will be travelling from Belgrade in Serbia to London UK in a few weeks. There is a stopover at Instanbul in Turkey.   Given the recent laptop travel ban, I probably be required to put my laptop in cargo. I am wondering whether anyone knows if it is possible to insure the laptop against damage or theft while on the cargo of the plane.

While I plan to travel with a , I am yet to find an insurance that covers much of significant value.  We have coverage that comes with credit cards with limits of $200 to $500 per item, depending on the card. Airlines also have a limit around that amount even for upgraded insurance and searching known travel insurance companies, I found similar coverage.  Does insurance exist for checked luggage between $5000 and $10000 CDN ($4000 - $8000 USD)? If so, who offers such coverage?


While trying to install MSCOREFONTS the following error occured:  $ sudo apt-get install ttf-mscorefonts-installer Reading package lists... Done Building dependency tree        Reading state information... Done ttf-mscorefonts-installer is already the newest version (3.6). You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies:  fonts-lohit-mlym : Breaks: ttf-malayalam-fonts (<= 1:0.5.12) but 1:0.5.11ubuntu1 is to be installed  fonts-mlym : Breaks: ttf-malayalam-fonts (< 2:1.0) but 1:0.5.11ubuntu1 is to be installed  fonts-samyak-mlym : Breaks: ttf-malayalam-fonts (< 2:1.0) but 1:0.5.11ubuntu1 is to be installed  fonts-smc : Breaks: ttf-malayalam-fonts (< 2:1.0) but 1:0.5.11ubuntu1 is to be installed  ttf-mscorefonts-installer : Depends: cabextract E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

I am attempting to install the MS Core fonts on Ubuntu 14.04 LTS, and am running into the following error:  vagrant@vagrant-ubuntu-trusty-64:~$ sudo apt-get install ttf-mscorefonts-installer Reading package lists... Done Building dependency tree Reading state information... Done 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:  ttf-mscorefonts-installer : Depends: cabextract but it is not installable E: Unable to correct problems, you have held broken packages.   Running dpkg --get-selections | grep hold doesn't return anything and I can't find a package in apt-get called cabextract.  From everything I've Googled, installing the MS Core fonts is relatively straightforward, so I'm a tad lost.  How can I resolve this issue and install the core fonts?  Edit:  Here's my /etc/apt/sources.list file  ############################################################# ################### OFFICIAL UBUNTU REPOS ################### #############################################################  ###### Ubuntu Main Repos deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted multiverse  ###### Ubuntu Update Repos deb http://us.archive.ubuntu.com/ubuntu/ trusty-security main restricted multiverse deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted multiverse


We Have Mistakenly Dropped a Table in my DB and am using MySql . Is it Possible to ROLL Back or any other options . Please Provide your Valuable Suggestions

I accidentally dropped a MySQL database on my server.  Are there any ways to recover a dropped database?


How can I go back to the state before the package was installed?  Install:  # apt-get -y install --no-install-recommends build-essential ... The following additional packages will be installed:   binutils cpp cpp-5 dpkg-dev g++ g++-5 gcc gcc-5 libasan2 libatomic1   libc-dev-bin libc6-dev libcilkrts5 libdpkg-perl libgcc-5-dev libgdbm3   libgomp1 libisl15 libitm1 liblsan0 libmpc3 libmpfr4 libmpx0 libperl5.22   libquadmath0 libstdc++-5-dev libtsan0 libubsan0 linux-libc-dev make patch   perl perl-modules-5.22 xz-utils Suggested packages:   binutils-doc cpp-doc gcc-5-locales debian-keyring g++-multilib   g++-5-multilib gcc-5-doc libstdc++6-5-dbg gcc-multilib manpages-dev autoconf   automake libtool flex bison gcc-doc gcc-5-multilib libgcc1-dbg libgomp1-dbg   libitm1-dbg libatomic1-dbg libasan2-dbg liblsan0-dbg libtsan0-dbg   libubsan0-dbg libcilkrts5-dbg libmpx0-dbg libquadmath0-dbg glibc-doc   libstdc++-5-doc make-doc ed diffutils-doc perl-doc libterm-readline-gnu-perl   | libterm-readline-perl-perl Recommended packages:   fakeroot libalgorithm-merge-perl manpages manpages-dev   libfile-fcntllock-perl rename The following NEW packages will be installed:   binutils build-essential cpp cpp-5 dpkg-dev g++ g++-5 gcc gcc-5 libasan2   libatomic1 libc-dev-bin libc6-dev libcilkrts5 libdpkg-perl libgcc-5-dev   libgdbm3 libgomp1 libisl15 libitm1 liblsan0 libmpc3 libmpfr4 libmpx0   libperl5.22 libquadmath0 libstdc++-5-dev libtsan0 libubsan0 linux-libc-dev   make patch perl perl-modules-5.22 xz-utils   Removal:  # apt-get -y --purge --auto-remove remove build-essential ... The following packages will be REMOVED:   build-essential*  # apt-get -y --purge autoremove ... The following packages will be REMOVED:   g++* g++-5* libstdc++-5-dev*   Why is the other stuff kept?

I installed gnome-core package on Ubuntu (minimal version for the beagle bone) and it was almost 600mb. However, when I try to un-install it using  sudo apt-get autoremove gnome-core    It removes only 49 MB. Any Ideas, how to remove the entire 600 MB?


How to programmatically insert a row/record into a table (generated by third party software) where one of the fields is named when and user which are coincidentally sql keywords.  The sql command is:  INSERT INTO APPT  (ApptID,Type,Descrip,When,Flag,User,DTS)  VALUES  (41,0,'Test Note','20/10/2014 1:42:00 PM',16,'AP','22/10/2014 8:24:01 AM')    Which gives the errors:  Error 156: Incorrect syntax near the keyword 'When'. Error 156: Incorrect syntax near the keyword 'User'.

One of my columns is called from. I can't change the name because I didn't make it. Am I allowed to do something like SELECT from FROM TableName or is there a special syntax to avoid the SQL Server being confused?


Consider the following MWE: \documentclass{amsart} \usepackage{hyperref} \begin{document} \begin{equation}     \tag{tag}     1+1=0 \end{equation} \clearpage \begin{equation}     \label{mylabel}     1+1=3 \end{equation} Eq~\eqref{mylabel} is on page \pageref{mylabel}. \end{document}  If I compile it with pdflatex, the \pageref correctly says that the equation (1) is on page 2, however the hyperref points to page 1. If we change the first equation to equation*, the hyperref points correctly to page 2. Note that this change does not alter the aux-file, but in the log-file the warning pdfTeX warning (ext4): destination with the same identifier (name{equation.0.1}) has been already used, duplicate ignored  disappears. Hence, my question is: Should one always use starred environments (like equation*) for \tagged equations? (I cannot find something related in the documentations of amsmath and hyperref.)

In the following MWE, I receive a warning and a reference points to the wrong element.  \documentclass{article} \usepackage{hyperref} \usepackage{amsmath} \begin{document}     \begin{equation}         \label{eq1}     \end{equation}      \begin{equation}\tag{\ref*{eq1}b}         \label{eq1b}     \end{equation}      \begin{equation}         \label{eq2}     \end{equation}  This reference is incorrect: \ref{eq2} points to 1b. Also, this warnings appear: \begin{verbatim}         pdfTeX warning (ext4): destination with the same identifier         (name{equation.0.2}) has been already used, duplicate ignored     \end{verbatim} \end{document}   In this variant with equation*, the latter problem is fixed, but a new one introduced. A link that was fine before is now wrong:  \documentclass{article} \usepackage{hyperref} \usepackage{amsmath} \begin{document}     \begin{equation}         \label{eq1}     \end{equation}      \begin{equation*}\tag{\ref*{eq1}b}         \label{eq1b}     \end{equation*}      \begin{equation}         \label{eq2}     \end{equation}      This reference is incorrect: \ref{eq1b} points to 1. No warning. \end{document}   How can I get all references correct?  These questions are similar, but don't help:


I have about 500 files of text files similar to the output below.    GigabitEthernet15/0/ 1                                                                GigabitEthernet16/0/ 1                                                                GigabitEthernet16/1/ 1                                                                GigabitEthernet15/1/ 1   My goal is to have it look like this:  GigabitEthernet15/0/1                                                                GigabitEthernet16/0/1                                                                GigabitEthernet16/1/1                                                                GigabitEthernet15/1/1

I have more than 1000 lines in a file. The file starts as follows (line numbers added):  Station Name Station Code A N DEV NAGAR ACND ABHAIPUR AHA ABOHAR ABS ABU ROAD ABR   I need to convert this to a file, with comma separated entries by joining every two lines. The final data should look like  Station Name,Station Code A N DEV NAGAR,ACND ABHAIPUR,AHA ABOHAR,ABS ABU ROAD,ABR ...   What I was trying was - trying to write a shell script and then echo them with comma in between. But I guess a simpler effective one-liner would do the job here may be in sed/awk.  Any ideas?


I submitted a paper to Thomson Reuters ESCI Journal, and they are asking me to complete a registration and pay a fee of around $400 to publish the paper.   But later I found that my University gives preference to Scopus-Indexed journals. How can I cancel the previous submission (the paper has not been published), and how can I submit to another Scopus-Indexed journal?

I'm an inexperienced researcher and I made the stupid mistake of submitting my article to a predatory journal. I realised the journal was fake when they failed to provide the reviewers comments.   I then requested that the article be withdrawn. I received an email back from the 'editor' saying that the article had been withdrawn and guaranteeing that they wouldn't publish the article without my permission. I didn't sign the transfer of copyright, pay any money and the article hasn't appeared on their website.  My question is whether my article is now a write off? Can I resubmit it elsewhere or just write off as a bad learning experience? I would really like to salvage if if possible.


I have overwritten the user-profile-form with hook_form_alter.   Right now there are additional fields in the user-profile-form, so the user can add more information about him/her and these fields will be visible in /user/% page.  I'm wondering is it possible to add more details in /user/% without using the user-profile-form?  Let's say to display a field "Profile of [name_of_the_user]", so anyone who enters the user profile (Example John) in the top of the page will be displayed "Profile of John".  Is there any hook for that?

The user page doesn't look good. I want to edit it, but (If I am right) that is a default page. I am not able to find where to edit it.  How can I edit the user page?


I have a CentOS server where i am logging in as a user jenkins but user name is appearing as root instead of jenkins  [root@centos-7-1 ~]# sudo su - jenkins   Last login: Sat Jul 14 20:21:16 UTC 2018 on pts/0 [root@centos-7-1 ~]# hostname   centos-7-1   I checked the sudoers file i found this, i am not sure if it is somehow related to the problem  [root@centos-7-1 etc]# cat group | grep jenkins jenkins:x:993:  [root@centos-7-1 ~]# grep jenkins /etc/passwd  jenkins:x:996:993:Jenkins Automation Server:/var/lib/jenkins:/bin/false [root@centos-7-1 ~]#   When I execute whoami after switching users I get:  [root@centos-7-1 ~]# su - jenkins  Last login: Sat Jul 14 20:33:18 UTC 2018 on pts/0  [root@centos-7-1 ~]# whoami  root

Why is it that when I switch user su <username> and then execute who am i is outputs the previous user which I was logged as and not the one I've switched to?


One of the tasks of the mysterious Community user is to      Randomly poke old unanswered questions every hour so they get some attention   We  the following:     The Community user will bump non-negatively scored questions that have at least one answer scoring 0 and none scoring more than that. The number of unanswered questions bumped per hour depends on the site: 4 per hour on Stack Overflow, 1 per hour on Meta, and 2 per hour on Super User and Server Fault. The default for a new site is 1 per hour.   But I'd like to know some more details about how this works in particular. Since Community himself speaks of "old unanswered questions", is there any age factor/limit involved in the selection process? And is the choice truely random or are there other factors to bias it (like many votes, few views, ...)?  Likewise on  there are days when Community seems to bump questions at an hourly basis and then other times feeled weeks of inactivity for Community. Are there factors that prevent the regularly-scheduled bump from happening? (Or is it that we just didn't have any candidates at bump time (though there should be some if it really only goes by the criteria above)?)  It may also be that all this information is deliberately kept undisclosed, but if not, I'd be pleased to gain some more insights into the doings of this user.

What can cause a question to be "bumped" to the first page in the Active tab of a Stack Exchange site? (Changing the "Last Active" date.)  .


Since using Linux mainly for developer purposes, I often encounter running various sudo apt-get commands downloading different tools.  These also install many dependency libraries.    Now is there a solution, through command-line or GUI, whereby it shows all apt-get commands executed for downloaded apps listing its required dependency tree?  That way it would be lovely to simply track what all stuff you did with your system.

Is there a way to show the history of packages that were changed by apt-get via command line?


I was trying to take a screenshot from my desktop, and decided to experiment with different programs. No matter what application I chose, the copied image from snapshot would get erased from clipboard if I closed the app. I've tried this with flameshot, spectacle, and looking back at this I know I have experienced this issue before with LXQT's default screenshot tool. How can I make this annoying issue go?  I am using lubuntu 19.10.

I find that a lot of the time if I copy some text for example and then close the window being copied from, the paste function does not paste anything.  I've noticed this in Ubuntu 9.04 right up until present version. Is there a work around for this? Is there any reason why the developers are not looking into this?


I have a question, I want to know for which values of $p\in \mathbb{R}$ this integral have finite value: $$\int_{0}^{\infty} \frac{\sin{x}}{x^p}dx $$ I have shown that for $p=1$ the integral is finite and equals to $\frac{\pi}{2}$, so, if $p\geq1$ is easy to see that the integral converges. The intuition says that if $p<1$, it diverges. But I don't know how to prove that. Any idea?

Hi I am trying to find out for what values of the real parameter does the integral $$ I=\int_0^\infty \frac{\sin x}{x^s}dx $$ (a) convergent and (b) absolutely convergent.     I know that the integral is convergent if $s=1$ since $$ \int_0^\infty \frac{\sin x}{x}dx=\frac{\pi}{2}. $$ For $s=0$ it is easy to see divergent integral since $\int_0^\infty \sin x\, dx$ is divergent.  However I am stuck on figuring out when it is convergent AND or absolutely convergent.  I know to check for absolute convergence I can determine for an arbitrary series $\sum_{n=0}^\infty a_n$ by considering $$ \sum_{n=0}^\infty |a_n|. $$ If it helps also $$\sin x=\sum_{n=0}^\infty \frac{(-1)^{2n+1}}{(2n+1)!} {x^{2n+1}}$$. Thank you all


People sometimes post images showing alleged UFOs, cryptids, or other unusual content.  Are there techniques or tools can be used to conclusively show that the UFO/cryptid/etc has been manually added to the image?

How can I tell if a photo has been edited or manipulated? Are there techniques for distinguishing real photos from fakes?  Are there software tools that can help? Are there things I can do in Photoshop or other imaging software which will help reveal the truth?


I have a ScrollViewer, which contains a DockPanel, which contains a ListBox as its filled element.  The problem I'm facing is that, when the ListBox contains many items, and the height of the window is reduced to the point where a scrollbar is necessary, the ScrollViewer's scrollbar appears, pushing my controls with DockPanel.Dock="Bottom" off the screen.  The ListBox's scrollbar never appears.  Instead, when the window height is reduced, I would like the ListBox's scrollbar to appear first.  Then, after the ListBox shrinks to some minimum height that I specify, the ScrollViewer's scrollbar should appear to take care of the rest.  How do?

I creating a control for WPF, and I have a question for you WPF gurus out there.  I want my control to be able to expand to fit a resizable window.   In my control, I have a list box that I want to expand with the window. I also have other controls around the list box (buttons, text, etc).  I want to be able to set a minimum size on my control, but I want the window to be able to be sized smaller by creating scroll bars for viewing the control.   This creates nested scroll areas: One for the list box and a ScrollViewer wrapping the whole control.   Now, if the list box is set to auto size, it will never have a scroll bar because it is always drawn full size within the ScrollViewer.   I only want the control to scroll if the content can't get any smaller, otherwise I don't want to scroll the control; instead I want to scroll the list box inside the control.  How can I alter the default behavior of the ScrollViewer class? I tried inheriting from the ScrollViewer class and overriding the MeasureOverride and ArrangeOverride classes, but I couldn't figure out how to measure and arrange the child properly. It appears that the arrange has to affect the ScrollContentPresenter somehow, not the actual content child.  Any help/suggestions would be much appreciated.


What is the best approach for solving the equations of the form      $p^x = x^q$ ; where $p$ and $q$ are some constants.   Basically, I wanted to solve $2^x = x^2$ to analyze algorithms with respective growth functions.


One person with whom I've emailed before said to "drop me [them] a line". I always thought the intention of this phrase is to call the person, specifically by phone (via telephone line). It seems this person means to email them. I do think it's possible they mean to call them. Is it a widely accepted use of this phrase to mean "contact me" in general? Is this usage common among certain groups of people? Am I wrong in associating this with phones in particular?

According to , dropping someone a line means sending them a short message.  Is this correct? I always thought it meant phoning someone, the line referring to a telephone line.


I know this is not a new question but I want to sort CSV file by Column preferred in java8.  The Data-structure of CSV is List<List<CsvEntity> I need to sort first by one field of the CsvEntity then by other (not must) example by: firstName then by lastName.  class CsvEntity{    private String firstName    private String lastName    private String address }   Following this -   What modifications do I need to make for supporting sort on multiple keys in Java8?

Assume you have some objects which have several fields they can be compared by:  public class Person {      private String firstName;     private String lastName;     private String age;      /* Constructors */      /* Methods */  }   So in this example, when you ask if:  a.compareTo(b) > 0   you might be asking if a's last name comes before b's, or if a is older than b, etc...  What is the cleanest way to enable multiple comparison between these kinds of objects without adding unnecessary clutter or overhead?   java.lang.Comparable interface allows comparison by one field only Adding numerous compare methods (i.e. compareByFirstName(), compareByAge(), etc...) is cluttered in my opinion.   So what is the best way to go about this?


Here is my code:  int newSize = size + 1; //lets say size = 0 char * newArray = malloc(newSize * sizeof(char)); printf("%li", sizeof(newArray)); //Should be 1, prints 8 printf("%li", newSize * sizeof(char)); //Should be 1, prints 1   I have no clue why it's doing this, but I need newArray to have exactly newSize number of char spots. Any ideas?

First off, here is some code:  int main()  {     int days[] = {1,2,3,4,5};     int *ptr = days;     printf("%u\n", sizeof(days));     printf("%u\n", sizeof(ptr));      return 0; }   Is there a way to find out the size of the array that ptr is pointing to (instead of just giving its size, which is four bytes on a 32-bit system)?


I am sorry if this sounds redundant but I couldn't find a good explanation on this anywhere else yet. I understand that controlling for a variable in a regression can be imagined by drawing separate regression lines through different values of that variable as illustrated here: (first figure). My question is, when we have several regression lines, how do we end up with a single regression coefficient? Is it an average of the slopes of all the separate lines or something? Let's say I regress wage on years of experience and education. I am interested in the effect of experience holding education fixed. So I run: $wage = \beta_0 + \beta_1 experience + \beta_2 education + u$ And let's say $\beta_1$ turns out to be 2.3. So is 2.3 an average of all slopes across all education levels (average of all regression lines)? Thanks for your help!

The coefficient of an explanatory variable in a multiple regression tells us the relationship of that explanatory variable with the dependent variable. All this, while 'controlling' for the other explanatory variables.  How I have viewed it so far:  While each coefficient is being calculated, the other variables are not taken into account, so I consider them to be ignored.   So am I right when I think that the terms 'controlled' and 'ignored' can be used interchangeably?


If $C(n, a)=C(n, b)$. Prove that $a=b$ or $n=a+b$. I looked for this on the internet. But no clue. I tried it myself, but failed. I have already asked for the help by posting similar question, about 20 days ago, and got some hints and finally, i was unable to complete the proof myself. The simplest proof is needed and will be appreciated.

I am given that $${n \choose a}={n \choose b}$$ I need to show that $n=a+b$ or $a=b$.  Now I am left with $a!(n-a)!=b!(n-b)!$.  I don't know what to do next. I checked there on google to solve the above, it says:- "On comparing, we get the required result." But it makes no sense to me.


I have been noticing, even if I use AF-S with Single-Point focus and set the focus on the eye of the bird, still the final photo either comes out blurred or has less details.  Someone in a response to one of my previous question advised me to first half-press the shutter button and set the focus on the subject. Then move the center point slightly to either left or right and then take the shot.  I tried this as well. Still the exposure and focus both are not satisfactory.  In the below picture, I set the ISO sensitivity to Auto.  Other parameters are:   Camera: Nikon D5600 Lens: 300 mm Shutter Speed: 1/160 sec. Aperture: f/14 ISO: 2800     I set the focus on the eyes, still it came out blurred.  Edited This question is not related to Auto-Focus. It is related to:   Manual Focus Aperture Priority, and Shutter Priority modes   Is the problem with the Lens or Camera is not equipped for such type of shots? I read D5600 does not have optical image stabilization.

Probably a novice question, but how do I correctly diagnose from a photo for what reason that camera wasn't able to focus properly?  It can be any 1 of the following   Unsteady hand Lens issue Metering Re-Calibration required in camera or ...   Is there a set of unsaid protocols that needs to be followed by a photographer?  Goal is to get a sharp and crisp image prior to editing.  [PS: I own a Nikon D5200.]


I use the package mathrsfs to get a separate \mathscr. While I like the way it looks, it does not come with a bold version. More specifically, the usual \mathcal is compatible with \boldsymbol and \boldmath (see ), whereas \mathscr is not: \documentclass{article} \usepackage{mathtools} \usepackage{mathrsfs} \begin{document} \[     \mathcal{S}, \mathscr{S}. \] \[     \boldsymbol{\mathcal{S}}, \boldsymbol{\mathscr{S}}. \] \end{document}   Is there an alternative package that provides similar looking letters to mathrsfs, but which does come with a bold version?

Does anyone know how to bold calligraphic \mathscr fonts in a math environment? I can get a fancy calligraphic font if I use \mathscr, but \boldsymbol does not work, nor does \mathbf. There is a hack which uses poor man's bold, but I was wondering if there is an alternate way to do this "cleanly". I've also seen \bm used for \mathcal font, but that's not what I'm looking for unfortunately.  I'm using calligraphic fonts with the following packages:  \usepackage{amsmath} \usepackage{amsfonts} \usepackage{mathrsfs}


I have a problem with apt.  When I try to update or upgrade Ubuntu, I receive an error telling me that I have dependency problems, and I can't go on. I've tried to solve the problem with apt-get install -f, aptitude install -f, and using Synaptic, but I couldn't solve it.  When I try to run Synaptic, it tells me that I have broken packages, but if I try to delete them, it tells me that it will remove a lot of essential packages like mount and hostname. I think that it would be the end of my Ubuntu if I proceed.

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?


hello please help guys i cant enable blue tooth in my laptop    user@spider-king:~$ lspci -knn | grep Net -A2; lsusb; uname -a 02:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n [14e4:4365] (rev 01)     Subsystem: Lenovo Device [17aa:0621]     Kernel driver in use: wl     Bus 001 Device 002: ID 8087:8000 Intel Corp.      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 002 Device 005: ID 105b:e065       Bus 002 Device 004: ID 174f:14b2 Syntek      Bus 002 Device 003: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller     Bus 002 Device 002: ID 04ca:0061 Lite-On Technology Corp.      Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Linux spider-king 3.16.0-57-generic #77~14.04.1-Ubuntu SMP Thu Dec 17 23:20:00 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

i have ubuntu 14.04 on my Lenovo G500. I don't know why, but when I activate bluetooth in the control panel or in blueman nothing happen. Help me please, TY!  Sry for duplicate question, I'm newbee in "Linux World" and can't understand what I should to do...  Mb it can help  dmesg | grep Bluetooth [    5.408892] Bluetooth: Core ver 2.20 [    5.408913] Bluetooth: HCI device and connection manager initialized [    5.408916] Bluetooth: HCI socket layer initialized [    5.408920] Bluetooth: L2CAP socket layer initialized [    5.408927] Bluetooth: SCO socket layer initialized [    5.414020] Bluetooth: RFCOMM TTY layer initialized [    5.414027] Bluetooth: RFCOMM socket layer initialized [    5.414031] Bluetooth: RFCOMM ver 1.11 [    5.418647] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [    5.418650] Bluetooth: BNEP filters: protocol multicast [    5.418654] Bluetooth: BNEP socket layer initialized   and  lsmod | grep bluetooth bluetooth             491520  11 bnep,btusb,rfcomm   and mb that  uname -a; lsusb Linux inyellowbus-laptop 3.19.0-39-generic #44~14.04.1-Ubuntu SMP Wed Dec 2 10:00:35 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 003 Device 007: ID 105b:e065   Bus 003 Device 003: ID 12d1:1051 Huawei Technologies Co., Ltd.  Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 004: ID 0bda:5728 Realtek Semiconductor Corp.  Bus 001 Device 003: ID 09da:3010 A4 Tech Co., Ltd  Bus 001 Device 005: ID 1a2c:0c23 China Resource Semico Co., Ltd  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


What is the historical reason for this term?  Derivative represents slope function of curve. I am not getting why  this term make sense?

What is the historical background for this term?   I cannot quite see what is integral about an integral, even if we go back to the viewing it as the area under a curve.  It seems to me a strange choice of word.


I've json response from server looks like that  {     "117":{        "09:00":5,      "10:00":5,      "11:00":5,      "12:00":5,      "13:00":5,      "14:00":5,      "15:00":5,      "16:00":5,      "17:00":5,      "18:00":5,      "19:00":5   } }   How I can bind this to normal select to looks like that  <select name="time" id="time">    <option value="5">09:00</option>    <option value="5">10:00</option>   <option value="5">11:00</option> </select>   Hours are not always the same, could be from 11:00 to 21:00.  Any idea how to display this in php or bind by jquery. Thank you for response

I have a JavaScript object like the following:  var p = {     "p1": "value1",     "p2": "value2",     "p3": "value3" };   Now I want to loop through all p elements (p1, p2, p3...) And get their keys and values. How can I do that?  I can modify the JavaScript object if necessary. My ultimate goal is to loop through some key value pairs and if possible I want to avoid using eval.


pval <- 0 for(i in 1:dim(rData1Q1)[1]){      pval[i] <- t.test(rData1Q1[i,1:25],rData1Q1[i,26:34])$p.value   }  I couldn't find the error source. When I run it for one row, it works. But in this loop it gives an error. What am I missing?

I have three replicates of an experiment which gives me ratios of the abundance of different peptides.  If I take the data for one peptide:  pep1 <- c(4.3, 5.7, 6.3)   I can use a one-sample t-test to test the hypothesis that the ratio is different from 1:  t.test(pep1,         alternative=c("greater"),        mu=1,        paired=FALSE,        var.equal=FALSE,        conf.level=0.95)   output:  data:  pep1 t = 7.4818, df = 2, p-value = 0.0087 alternative hypothesis: true mean is greater than 1 95 percent confidence interval:  3.703107      Inf sample estimates: mean of x   5.433333    However if I try and apply this to the rows of a dataframe called peptides, where each row is a separate peptide, with three ratios:  t_test <- function(x) p_val =  t.test(x,                                        alternative=c("greater"),                                       mu=1,                                       paired=FALSE,                                       var.equal=FALSE,                                       conf.level=0.95)$p.value  apply(peptides, 1, t_test)   I get the data are essentially constant error.  I don't understand! I think apply is doing what I want because if I substitute 't-test' for 'mean' then it does the correct calculations.   My aim is to get the p-values for each peptide and then adjust these for multiple comparisons.  I'm relatively new to R, and any advice would be very much appreciated!


I have found out the formula of a_n by recursion method but after that I am being unable to show that it converges.

I am stuck on the 4 th one.I have done the rest.I have found out the value of a_n.But not getting how to proceed for the 4 th one.


Should I attend a likely lesser university, PSU in Pittsburg, Kansas, for a graduate degree in history, or should I attend the University of Minnesota for a second bachelors degree in psychology? All of this is aimed at eventual graduate work in philosophical counseling and the history of philosophy. I want to take the time to read and study ancient philosophy in depth so that I can teach it, but I'm also pretty sure that I have the ability to become a decent philosophical counselor and have spent a good deal of my time thinking and reading about it. The U is a stretch financially at the moment, but I might be able to make it work. Financial aid is sparse for a second bachelors degree. This is why there is even a question. I can definitely afford to live in Pittsburg, KS and I do like it there and I can go to PSU and sort of revive my rusty study habits (3.5 yrs since graduation) in a slightly less rigorous setting, most likely, that I should be able to receive adequate loans for. If I can manage to pay for 13 credits at the U, the rest are free. That is one semester, with tuition around 18k. Living in Minneapolis is very expensive too, all the amenities are higher and rent averages 600 just for a room. I have a lot of history there and friends, but haven't lived there in some time. I also have friends and history in Pittsburg whom I've seen more recently. I have no idea what to do at this point. Looking at both acceptance letters, reading them back to back, over and over, and feeling paralyzed. School starts in January.

I currently study for my B.Sc. in Media IT. I easily could finish a second Bachelor if I do one more semester. I want to do master's degree in Media IT afterwards.  I'm already 23 and in the third semester, since I finished an apprenticeship as a software developer before. Is it useful to start my master's with 26 and probably finish it when I'm ~28?


My image texture looks like this:   And yet when I try to add a transparent BSDF shader it doesn't work properly, and the result looks like this:   I've tried many things; changing the BSDF color to black, adding the image texture to the fac, adding the image alpha to the fac, removing the normal map, changing the BSDF settings, and a lot more, but to no avail.   Here's my node setup at the moment:   How would I go about removing the black void around it while not making the metal itself transparent as it is now? Thanks.

How do I get the Cycles Principled BSDF shader to support a base color image such as a 32bit png with alpha or a tga with an alpha channel, and get the transparency to work. I don't see anywhere on the Principled BSDF shader that handles transparency.  Without success, I have tried:   Properties Editor>Render tab>Film rollout>Transparent Properties Editor>Material tab>Settings rollout>Viewport Alpha (changing to other than Opaque). Adding a Transparent BSDF and Diffuse BSDF after the base color image node and using a Mix Shader to combine them.


I've been working old qualifying exam problems from my university. I've been struggling with the following:  Suppose $f$ is an entire function with the property that $f(2z)=\frac{f(z)+f(z+1)}{2}$ for all $z$. Prove that $f$ must be a constant function.  Here are my thoughts Write $f(z)=\sum_{n=0}^{\infty}c_nz^n$. Then \begin{align*} 2\sum_{n=0}^{\infty}c_n2^nz^n&=\sum_{n=0}^{\infty}c_nz^n+\sum_{n=0}^{\infty}c_n(z+1)^n\\ &=\sum_{n=0}^{\infty}c_nz^n+\sum_{n=0}^{\infty}\sum_{k=0}^{n}c_n\binom{n}{k}z^k. \end{align*} By equating the coeffients of the power series, we have $$ c_n2^{n+1}=c_n+\sum_{k=0}^{\infty}c_k\binom{k}{n}, $$ or $$ c_n2^{n+1}=2c_n+\sum_{k=n+1}^{\infty}c_k\binom{k}{n}. $$ Thus $$ (2^{n+1}-2)c_n=\sum_{k=n+1}^{\infty}c_k\binom{k}{n}. $$ Furthermore, \begin{align*} (2^{n+1}-2)c_n-(2^{n+2}-2)c_{n+1}&=\sum_{k=n+1}^{\infty}c_k\binom{k}{n}-\sum_{k=n+2}^{\infty}c_k\binom{k}{n+1}\\ &=c_{n+1}(n+1)+\sum_{k=n+2}^{\infty}c_k\left(\binom{k}{n}-\binom{k}{n+1}\right) \end{align*} However here I am stuck. I realize that these equations should contain everything needed to solve this problem, but I don't see how to use them. Are there any easier ways to approach this problem? Any help is greatly appreciated. Thank you.

Let g be an entire function such that   $2g(z)=g(\frac{z}{2}) + g(\frac{z+1}{2})$ holds $\forall z\in \mathbb{C}$   the I want to prove that $ g $ is constant.  Hint: Apply maximum modulus principle on $cl(B_r (0))=${$ |z| \leq r $}$ $  also   if $g$ has no zeros and  $cg(z)=g(\frac{z}{2}) g(\frac{z+1}{2})$  holds $\forall z\in \mathbb{C}$ and for some $c\in \mathbb{C}$ prove that $g(z)=ce^{\frac{-b}{2}}e^{bz}$ for some $b\in \mathbb{C}$   I have no idea how to prove this statement . Any Hints leading to solutions  are appreciable


I need to convert a byte array to a string to send to an SPI device.  Is there a more efficient way of doing this ?  def writebytes(bytes):   str = ""   for i in bytes: str += chr(i)   self.spi.transfer(str)

I'm using this code to get standard output from an external program:  >>> from subprocess import * >>> command_stdout = Popen(['ls', '-l'], stdout=PIPE).communicate()[0]   The communicate() method returns an array of bytes:  >>> command_stdout b'total 0\n-rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file1\n-rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file2\n'   However, I'd like to work with the output as a normal Python string. So that I could print it like this:  >>> print(command_stdout) -rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file1 -rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file2   I thought that's what the  method is for, but when I tried it, I got the same byte array again:  >>> binascii.b2a_qp(command_stdout) b'total 0\n-rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file1\n-rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file2\n'   How do I convert the bytes value back to string? I mean, using the "batteries" instead of doing it manually. And I'd like it to be OK with Python 3.


After collecting a sample my data is positively skewed, what does this show? I have collected data on the price of books and I have found my data to be positive skewed however I am not sure what this actually shows.

What is skewness of a distribution?  I ask it why any particular indices seem indecisive about symmetry, and in some case also about asymmetry.


I am trying to figure out how to make this class work in Python 3, it works in Python 2. This is from a tutorial by D. Beasley for generators. I am new to Python and just working through tutorials online.   Python 2  class countdown(object):     def __init__(self, start):         self.count = start     def __iter__(self):         return self     def next(self):         if self.count <= 0:             raise StopIteration         r = self.count         self.count -= 1         return r  c = countdown(5)  for i in c:     print i,   Python 3, not working.  class countdown(object):     def __init__(self, start):         self.count = start     def __iter__(self):         return self     def next(self):         if self.count <= 0:             raise StopIteration         r = self.count         self.count -= 1         return r  c = countdown(5)  for i in c:     print(i, end="")

How would one create an iterative function (or iterator object) in python?


I'm trying to make a small username and password input box.  I would like to ask, how do you vertically align a div?  What I have is:

Username
Password

    <form action="" method="post">       <input type="text" border="0">
       <input type="password" border="0">    </form>

   How can I make the div with id Username and Form to vertically align itself to the center? I've tried to put:  vertical-align: middle;   in CSS for the div with id Login, but it doesn't seem to work. Any help would be appreciated.

I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS needed for this to work on all common browsers?

testing...


how do you play wot on unbuntu.I`m new to linux os and know how to do about nothing on how to use it.

I play world of tanks (a Game) in windows. Will it work on ubuntu? Better, worse, same? I would like to try Ubuntu but not if w.o.t won't work.


Let $R$ a set with $+$ and $\cdot $ s.t.  1) $(R,+)$ is a group (not necessarily comutative)  2) $\cdot $ is associative, and distributive for $+$, i.e. $a\cdot (b\cdot c)=(a\cdot b)\cdot c$, $a\cdot (b+c)=a\cdot b+a\cdot c$ and $(a+b)\cdot c=a\cdot c+b\cdot c$  3) there is $1\in R$ s.t. $1\cdot x=x\cdot 1=x$.  Show that $R$ is a ring.  I really don't know how to did it. I think that I have to show that $(R,+)$ is commutative, but I didn't success.

I have a simple question answer to which would help me more deeply understand the concept of (non)commutative structures. Let's take for example (our teacher's definition of) a ring:  Let $R\neq \emptyset$ be a set, let $\oplus:A\times A \to A$ and $\bullet :A\times A \to A$ be binary operations. Moreover, let $(R, \oplus)$ be a commutative group, $(R, \bullet)$ be a monoid and following property holds for all $a, b, c\in R$: $$a\bullet(b\oplus c) = (a\bullet b)\oplus(a \bullet c)$$ $$(b\oplus c)\bullet a = (b\bullet a)\oplus(c \bullet a)$$ Then ordered triple $\mathbf R = (R, \oplus, \bullet \mathbf)$ is called a (unitary) ring.  Moreover, we call ring $\mathbf R$ commutative iff $(R, \bullet)$ is a commutative monoid. Commutativity of a ring is always a matter of its multiplicative operation because the additive operation is always assumed to be commutative.  Could anyone explain me the bold part? Why do we even in non-commutative rings (and fields etc.) assume the addition to be always commutative? Is there some serious reason? Would it make any trouble? Or studying of structures with non-commutative addition just doesn't give us anything new so we can take addition as commutative simply because of our comfort?


In qgis, how to generate the blue outer edge (the concave surface close to the outer edge point) in Fig. 2 from the point in Fig. 1. Any suggestion?

I have an input point layer that is grouped into clusters, so I want to have each cluster of points converted into polygon. This question  (this question was removed) seems to come close to what I wanted by it hasn't been answered. So basically, I need an algorithm in QGIS that will convert each cluster of points (based on attribute field) as seen below into a polygons?  I have tried  plugin and it gave me wrong result seen below...  A copy of my data is found .


Just out of curiosity, how does one integrate something like this using residue theory?     $$\int_{0}^{\infty}\frac{(\log x)^2}{x^2+x+1} dx$$   According to Wolfram Alpha, the  is $\dfrac{16\pi^3}{81\sqrt{3}}$.  I have seen similar integrals before, like  and , and they all require seem some sort of ingenuity. I am sure  will come to rescue soon. :)

I was thinking this integral : $$I(\lambda)=\int_0^{\infty}\frac{\ln ^2x}{x^2+\lambda x+\lambda ^2}\text{d}x$$ What I do is use a Reciprocal subsitution, easy to show that: $$I(\lambda)=\int_0^{\infty}\frac{\ln ^2x}{\lambda ^2x^2+\lambda x+1}\text{d}x =\frac{1}{\lambda}\int_0^{\infty}\frac{(\ln x-\ln \lambda)^2}{x^2+x+1}\text{d}x \\ =\frac{\ln ^2\lambda}{\lambda}\int_0^{\infty}\frac{1}{x^2+x+1}\text{d}x+\frac{1}{\lambda}\int_0^{\infty}\frac{\ln ^2x}{x^2+x+1}\text{d}x \\ =\frac{\ln ^2\lambda}{\lambda}\frac{2\pi}{3\sqrt{3}}+\frac{2}{\lambda}\int_0^1\frac{\ln ^2x}{x^2+x+1}\text{d}x$$ But I hav no idea on process the remaining integral:( Anyone knows how to solve it?  THX guys! I came with another method might work for this: Recall the handy GF $$\frac{1}{x^2+x+1}=\frac{2}{\sqrt{3}}\sum_{k=0}^{\infty}\sin \left(\frac{2\pi}{3}\left(k+1\right)\right)x^k$$ Then we have :  $$\int_0^1\frac{\ln ^2x}{x^2+x+1}\text{d}x=\frac{2}{\sqrt{3}}\sum_{k=0}^{\infty}\frac{2}{\left(k+1\right)^3}\sin \left(\frac{2\pi}{3}\left(k+1\right)\right)x^k$$ With $$\sum_{k=1}^{\infty}\frac{\sin (kx)}{k^3}=\frac{\pi ^2}{6}x-\frac{\pi}{4}x^2+\frac{x^3}{12}$$ What can we arrived?


How much zoom is needed for a distance of 600ft?

I am thinking about buying a new lens specifically to take photos of distant targets (birds, bears, etc). I currently own the Canon 70-300 IS USM, which is a nice lens, but I find that if I want to take a photo of anything further away than about 10 meters, the target does not fill a large amount of the frame (meaning I have to significantly crop in post production).  I am currently looking at the Canon prime 400mm, however I would like to determine at what distance an object will fill a reasonable proportion of the frame.  Is there a formula or rule of thumb I can apply that will help me in this situation? I realise the size of the target I am shooting will play a role here, so if we need to make an assumption about the size of the target please let me know.


I have a dataset which has float values in every feature, and the feature has the data-points not much varying, here is a part of training-set data :  95.08273,94.13686,95.843,95.83886,95.38811,1 94.37234,93.47385,94.54948,94.67984,93.80062,1 94.02294,94.96799,95.075,95.41348,94.93842,1 95.1664,94.84861,94.82346,95.61005,96.62745,0 95.23271,94.87994,95.42258,95.48337,96.3997,0 93.77203,94.3065,94.33946,93.70812,93.42625,0 94.79427,94.70049,94.40502,94.61435,94.92593,1  The last column of each train data is the class-label - either 0 or 1. And I need to predict the same for the similar test data samples.  I can't seem to determine what basis should be there for classifying the test data, since the samples in the training data are very similar.  I have already tried scaling the data by using scikit-learn's preprocessing.scale method, as well as taking the mean of a column, subtracting from each sample (xi), and then dividing by the standard-deviation, but still accuracy is same as before.  How should I normalize data, and which classifier I should use in this case ?


public  class Time {      public int Minutes, Hours, TotalMin;     private String  correctedMinutes ;     public String valid, TimeofDay;     public static int error;       //-----------------------------------------------------------------     //  Sets up the time by defining its minutes and hours      //----------------------------------------------------------------- public  Time(int  hours, int minutes)     { if (minutes>59|| minutes<0|| hours>23 || hours<0)                { Hours=0;        Minutes=0;           error=1;}         else       {Minutes=minutes;       Hours=hours;           error=0;}        }  public String Time2(int hours, int minutes, String timeofday) {          if (Hours>12 || Hours<0)         return "This is not a valid number of hours";          Hours=0;           if ( minutes>59|| minutes<0)                  {Minutes=0;                  error=1;                 return "This is not a valid number of minutes";}           if (!timeofday.equals ("AM") || !timeofday.equals ("PM"))          {TimeofDay.equals("AM");          return "You incorrectly enetered AM or PM";}                 else                { Hours=hours;             Minutes=minutes;                 return "";}               }      //----------------------------------------------------------     //     //     //-----------------------------------------------------------  public int addMinutes (int hours, int minutes, int elapsedMin)     {          if (elapsedMin<0)         return error=1;              else {             TotalMin=elapsedMin+Minutes;                     return error=0;}         }{      while (TotalMin>60)             {TotalMin=TotalMin-60;             Hours=Hours+1;   if (Hours==25)              { Hours=0;}               Minutes=TotalMin;              }        }     //----------------------------------------------------------     //     //     //-----------------------------------------------------------          public String toString ()         {             String correctedMinutes = String.format("%02d", Minutes);             return (Hours+ ":" + correctedMinutes + TimeofDay);     }   The test class  public class TimeTest {      public static void main(String[] args) {         // TODO Auto-generated method stub   int minutes, hours, elapsedMin;  String timeofday, startTime;  Scanner scan=new Scanner (System.in);  System.out.println("Please enter starting hour (1-12):"); hours=scan.nextInt(); System.out.println("Please enter starting minute (0-59):"); minutes=scan.nextInt(); System.out.println("Please enter AM or PM:"); timeofday=scan.next();   Time classtime = new Time (hours, minutes);  if (Time.error!=0)     System.out.println("This is an invalid time");   System.out.print(classtime.Time2(hours, minutes, timeofday));  {     if (Time.error!=0)         System.out.println("This is an invalid time");      System.out.print("The class begins at "); System.out.println (classtime.toString());  startTime=classtime.toString();  System.out.println("Enter a time in minutes representing the class duration:"); elapsedMin=scan.nextInt();  classtime.addMinutes (hours, minutes, elapsedMin); System.out.println (classtime.toString());   System.out.print(elapsedMin + " minutes after "+ startTime + " is "); System.out.println (classtime.toString());      System.out.print("The class ends at "); System.out.println (classtime.toString());   System.out.print("The class ends at ");  System.out.print("MILITARY"); }}} import java.util.Scanner;   It is giving me the error  Exception in thread "main" java.lang.NullPointerException at Time.Time2(Time.java:39) at TimeTest.main(TimeTest.java:29)   I know this is NOT this code's only problem, so if you have any advice I'm all ears.

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?


My hdd is just one partition in ntfs (500gb) and 430 gb is used by my photos/movies/music etc which I never will want to lose. Actually I installed Ubuntu on a usb flash drive (using it right now) but it is too slow that way. But my problem is : My computer is damaged ( maybe chipset or but not sure) and none of the windows versions (xp,vista,7) works on my pc. I get blue screen error as soon as windows startup logo shows. But Ubuntu just works flawless. That means I cannot use wubi. I wanted to shrink my hdd without losing data (which can be done in windows) but found nothing about that on Ubuntu forums. Is this possible? Or install Ubuntu on my ntfs filesystem?  Note : I don't have chance to backup 400 gbs of data.  Sorry for my question if it's written a bit compex. I hope you get the point and someone has an idea ;)

Can I install Ubuntu on a partition formatted as NTFS, instead of EXT4?  After installing Ubuntu 11.10 using ext4, I keep on getting disk errors at boot up.  But on this same harddrive, I have Windows 7, and I don't get these errors.  So I wanted to try NTFS, instead of EXT4, and see if it makes any difference.  The harddrive is about 5 years old.  So if it is failing, I would think it would be giving trouble in Windows just as well.


I'm looking for quick, yet professional looking ways of making text stand out on a photos which don't really have nice bland areas to put text. Something which would take an experienced photoshopper 5 minutes or less to do.  I found the image below as an example, but the text shadowing technique usually looks pretty amateurish.  What is typically done in advertising circles? Blurring of the image, dodging?

I want to display a text over a video. However, the video may include any color from white to black. What is the best text effect (color/stroke/shadow/glow ... etc) that can be applied on the text so that it will be very clear on any background color.


I'm writing a function that take a date from the user in the form DD/MM/YYYY, I want the user to enter the numbers only and the program print /.  I've wrote a code that show a massage prompt the  user to enter the date and store the day , month and year in separate variable.       int day;     int month;     int year;      cout << "Enter your birthday date:  "     cin >> day;     cout << "/";     cin >> month;     cout << "/";     cin >> year;   what I want is when the user enter the day witch is 2 digit number the program automatically move to the next line and print / so the user enter the next input without pressing enter. But the code I have wrote require pressing enter after each input.

I can never remember how I do this because it comes up so infrequently for me. But in C or C++, what is the best way to read a character from standard input without waiting for a newline (press enter).  Also ideally it wouldn't echo the input character to the screen. I just want to capture keystrokes with out effecting the console screen.


I purchased a domain through a company that has ceased function, but I need access to be able to move the domain and utilize my property.  Thoughts?

About a year ago, I registered a domain name with KalyHost, . It seems to have left me in limbo with how I am now to go about renewing my domain name, which expires in 3 days.   I notice in the who-is information, there the entry Sponsoring Registrar: Key-Systems. Can anyone advise what my next steps need to be? Do I need to contact this sponsoring registrar to transfer my domain to another party? Who actually holds the registration for the domain now?


Can you please help me by giving an example of a stochastic process that is Martingale but not Markov process for discrete case?

1. On the internet, it is suggested that  $$ X_t=\left(\int_0^t X_s \;ds\right)\;dW_{t} $$ is a martingale, but not a Markov process. I understand that the process  $$ I_t(C)=\int_0^t C_s \; dW_s$$ is a martingale, but I don't see $X_t$ as an Ito's integral. In order to show it is a martingale but not a Markov process, I want to show that  $$ E(X_t\mid\mathcal{F}_{t-1})=X_{t-1}\neq E(X_t\mid\sigma(X_{t-1})). $$ I don't know how to take the expecation in this case.  Other counterexamples available online might be wrong. (Or, I could be wrong.)    2. Invalid counterexample: Let $e(t)$ be a random variable which is not independent of $y(0)$ and  $$ y(t)=y(t-1)+e(t)-E{[}e(t)|F(t-1){]}. $$  Then y(t) is a martingale but it is not a Markov process.  I will show that it is both a martingale and a Markov process. Define $X_{t}$ as  $$ X_{t}=X_{t-1}+e_{t}-E\left(e_{t}|\mathcal{F}_{t-1}\right) $$  Then, $\{X_{t}\}$ is a martingale because $$ E(X_{t}|\mathcal{F}_{t-1})  =  E\left(X_{t-1}+e_{t}-E\left(e_{t}|\mathcal{F}_{t-1}\right)\bigg|\mathcal{F}_{t-1}\right)   =  E(X_{t-1}|\mathcal{F}_{t-1})+E\left(e_{t}|\mathcal{F}_{t-1}\right)-E\left(e_{t}|\mathcal{F}_{t-1}\right)  = E(X_{t-1}|\mathcal{F}_{t-1})   =  X_{t-1} $$  However, it is also a Markov process. $$ E(X_{t}|\sigma(X_{t-1})) =  E\left(X_{t-1}+e_{t}-E\left(e_{t}|\mathcal{F}_{t-1}\right)\bigg|\sigma(X_{t-1})\right)   =  E(X_{t-1}|\sigma(X_{t-1}))+E\left(e_{t}|\sigma(X_{t-1})\right)-E\left(E\left(e_{t}|\mathcal{F}_{t-1}\right)\bigg|\sigma(X_{t-1})\right) $$  Since $\sigma(X_{t-1})\subset\mathcal{F}_{t-1}$, by the towering property, $$ E\left(\left(e_{t}|\mathcal{F}_{t-1}\right)\bigg|\sigma(X_{t-1})\right)=E\left(e_{t}|\sigma(X_{t-1})\right). $$  Thus $$E(X_{t}|\sigma(X_{t-1}))  =  E(X_{t-1}|\sigma(X_{t-1}))+E\left(e_{t}|\sigma(X_{t-1})\right)-E\left(e_{t}|\sigma(X_{t-1})\right)   =  E(X_{t-1}|\sigma(X_{t-1}) $$  Since $X_{t-1}$ is $\sigma(X_{t-1})$-measurable, $E(X_{t-1}|\sigma(X_{t-1}))=X_{t-1}$. Thus $$ E(X_{t}|\sigma(X_{t-1}))=X_{t-1}=E(X_{t}|\mathcal{F}_{t-1}) $$ Hence $\{X_{t}\}$ is also a Markov process.    3. Invalid counterexample from the textbook answer key. Alison Etheridge's textbook gives an example:  $$ S_{n+1}=S_{n}+\xi_{n+1} $$  where $\xi_{n}\in\{-1,1\}$ and $\{\xi_{n}\}_{n\geq0}$ are iid. Then, $$ P\left(S_{n+1}=k+1\bigg|S_{n}=k\right)=p \text{and }P\left(S_{n+1}=k-1\bigg|S_{n}=k\right)=1-p. $$ The author claims that $\left\{ S_{n}\right\} $ is a Markov process.  Then in the homework answer key, someone gives $\left\{ Z_{n}\right\}$ as a counterexample of a martingale not being a Markov process: $ \displaystyle{Z_{n}=\sum_{i=1}^{n}\xi_{i}} $  where $P(\xi_{i}=1)=\frac{1}{2}=P(\xi_{i}=-1)$.  Obviously, $Z_{n+1}=Z_{n}+\xi_{n+1}.$ So what's the difference between this counterexample and the example? Moreover, given $P(\xi_{i}=1)=\frac{1}{2}=P(\xi_{i}=-1)$, I think is both $\left\{ Z_{n}\right\}$ is both a martingale and a Markov process.


Would energy be released if a black hole made out of antimatter and another of matter were to collide?

Let's say we have one black hole that formed through the collapse of hydrogen gas and another that formed through the collapse of anti-hydrogen gas. What happens when they collide? Do they (1) coalesce into a single black hole or do they (2) "annihilate" into radiation?  One would expect (1) to be the case if the No Hair Theorem were to hold. So I guess what I'm really asking for is a modern understanding of this theorem and its applicability given what we know today.


I have a separable Hilbert space H. How can one prove that the closed unit ball B is separable?  I'm told it's trivial but I can't see it.  My initial idea is to take the set A (dense set of H) and intersect it with B. This new set is clearly constable and it's closure is in B. but how can I show that B is in th closure of this set?  Thanks for any help

Let $X$ be a separable normed space. Is it true that every subspace is separable? If it was Hilbert space I would take the dense set and then their projections.  It sounds trivial but I cannot prove or disprove it...  Thank you.


Given that $x, y, z \in [0, 2]$ and $x + y + z = 3$. Calculate the maximum value of $$\large x^3 + y^3 + z^3$$   I'm done. Should you have different solutions, you could post them down below. Having a solution there already, I want to see unfamiliar thoughts.

It is given that, $x+y+z=3\quad 0\le x, y, z \le 2$ and we are to maximise $x^3+y^3+z^3$.   My attempt : if we define $f(x, y, z) =x^3+y^3 +z^3$ with $x+y+z=3$ it can be shown that,   $f(x+z, y, 0)-f(x,y,z)=3xz(x+z)\ge 0$ and thus $f(x, y, z) \le f(x+z, y, 0)$. This implies that $f$ attains it's maximum whenever $z=0$. (Is this conclusion correct? I have doubt here).   So the problem reduces to maximise $f(x, y, 0)$ which again can be shown that $f(x, y, 0)\le f(x, 2x,0)$ and this completes the proof with maximum of $9$ and equality at $(1,2,0)$ and it's permutations.   Is it correct? I strongly believe even it might have faults there must be a similar way and I might have made mistakes. Every help is appreciated


I'll do my best to describe it; a kind of faded out look, the focus seems right but still the image looks like it was shot in light fog. Is there a name for "that look" and how is it usually achieved?   and   Page with more  (have no connections to neither the author nor anything, just like the page and would like to try to accomplish that effect myself).

I found this image on  and quite a few have this vivid yet pastel effect.   Can it be achieved in Photoshop or Lightroom?


I am a webmapping newbie so pardon any misnomers I am probably making.  I have a geoJSON file that represents garbage cans as lines running along a street (i.e. the line is an aggregated representation of all the cans on that street, so if 1 can is 20 lbs and there are 3 cans on the street, the line feature on that street will have a weight attribute of 60 lbs).   These lines have four attributes: weight, time (seconds per picking up all cans on that street), number of cans on the street, and the route number that services them. These attributes appear in a div at the bottom of the screen when you click/select a given line:   Is it possible to allow the user/client to change the route attribute value in a manner that it changes the original geoJSON and then refresh the web page to see the new changes (lines are symbolized by route number)?

I am trying to publish my feature service using the Boundless GeoServer. It appears that in order to have edit capabilities (I want to be able to add new points to an existing point layer tied to my PostGIS db and edit attributes in existing points if necessary), I have to use the WFS (Web Features Service) in the dashboard. I followed the instructions and set it up with transaction level capabilities connected to my workspace.     However, when I go to preview the layers in GeoExplorer, I get the "transaction support not enabled" error when I use edit to create or edit. I then tried checking in Demos (as directed by this link: ) to test and see if my transaction support was enabled. It came back that for my user and password it was not enabled.   Is this somehow tied to a role or password?