When outputting data prior to rendering it, what is best practice in terms of when to use esc_html()? For example, what if my PHP template contains the following code:  <?php $title = "Contact"; ?> <h1> <?php echo $title; ?> </h1>   Would I need to wrap $title in esc_html()?  If the answer is 'no,' can you give me an example of when I would need to wrap $title in esc_html()?  Assume there is no user input on the page in-question.   seems to say 'yes,' a variable should be escaped with esc_html() anytime it is enclosed in an HTML element.  But  seems to indicate 'no', a variable should be escaped with esc_html() only if there is a chance the variable could text that could be interpreted as harmful/unexpected HTML (i.e. a dynamic variable, or user inputted variable).  Previous Stack Exchange Questions  I've seen the following Stack Exchange questions, which give some insight.  But none have an accepted answer, so I was hoping to get one here.  The replies in these questions indicate that the answer to my question is 'no,' esc_attr() is not needed in my particular case.    - The reply here simply says one doesn't need to esc_html() on hard coded URLs.  - The reply here indicates I need to esc_html(), "...anytime you are not 100% sure that what you want to output is a valid HTML for that context."  - This says, "don't bother to escape static strings, it's pointless."

I got feedback from security guy and he pointed out that I should use proper escaping of user input in my code. So I've done some research and found escaping functions.  What’s the difference between them? When should I use esc_html() and when esc_attr()? And when should I use these functions with _e() at the end?


How do I find alpha values for the various pixels of a ?  There is an array returned by the decode property of the CGImage. Would probing the values of this array be required?  Or should I look at the dataProvider property?  I want to iterate through the pixels and get the alpha value for each pixel.  Edit:  The question linked to as duplicate is an objective-c question. I only know swift.

I have a UIImage (Cocoa Touch). From that, I'm happy to get a CGImage or anything else you'd like that's available. I'd like to write this function:  - (int)getRGBAFromImage:(UIImage *)image atX:(int)xx andY:(int)yy {   // [...]   // What do I want to read about to help   // me fill in this bit, here?   // [...]    int result = (red << 24) | (green << 16) | (blue << 8) | alpha;   return result; }


I use a Raspberry PI as bind and dhcp server. A strange thing happens to me… On the clients, the resolv.conf looks like this: # Generated by NetworkManager search flab nameserver 192.168.1.100 nameserver 8.8.8.8  The network has a machine called ipazia, IP 192.168.1.3. $ nslookup ipazia  ;; Got recursion not available from 192.168.1.100, trying next server ;; Got recursion not available from 192.168.1.100, trying next server Server: 8.8.8.8 Address: 8.8.8.8 # 53  ** server can't find ipazia: NXDOMAIN  $ nslookup ipazia 192.168.1.100  Server: 192.168.1.100 Address: 192.168.1.100 # 53  Name: ipazia.flab Address: 192.168.1.3  That is, it works if I specify the server where to make the query. The query works even if the resolv.conf is changed as follows: # Generated by NetworkManager search flab nameserver 192.168.1.100 # deleted nameserver 8.8.8.8  But in this case the servers outside the subnet are not recognized. I made various tests… without finding a solution. The following is named.conf.options: cl goodclients {     192.168.1.0/24;     localhost;     localnets; };  options {         directory "/ var / cache / bind";          // If there is a firewall between you and nameservers you want         // to talk to, you may need to fix the firewall to allow multiple         // ports to talk. See http://www.kb.cert.org/vuls/id/800113          // If your ISP provided one or more IP addresses for stable         // nameservers, you probably want to use them as forwarders.         // Uncomment the following block, and insert the addresses replacing         // the all-0's placeholder.          // forwarders {         // 0.0.0.0;         //};          // forwarders {         // 8.8.8.8;         // 8.8.4.4;         //};          forwarders {                 8.8.4.4;         };          // forward only;           // =============================================== ========================         // If BIND logs error messages about the root key being expired,         // you will need to update your keys. See https://www.isc.org/bind-keys         // =============================================== ========================           dnssec-validation auto;          // dnssec-enable yes;         // dnssec-validation yes;           listen-on-v6 {any; };          //MARCO        recursion yes;         allow-query {goodclients; };         allow-recursion {goodclients; };         allow-transfer {goodclients; };          allow-query {any; };         allow-recursion {any; };         allow-transfer {any; };         allow-query-cache {any; };         notify yes;          allow-recursion {127.0.0.1; 192.168.1.0/24; };          #querylog yes;          auth-nxdomain no;          listen-on {any; } };  Dig gives me the following answers: $ dig ipazia  ; << >> DiG 9.16.6 << >> ipazia ;; global options: + cmd ;; Got answer: ;; - >> HEADER << - opcode: QUERY, status: REFUSED, id: 13439 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; WARNING: recursion requested but not available  ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags :; udp: 4096 ; COOKIE: 6f54b031555c3e42010000005f9aaeae29abdb401bc977b8 (good) ;; QUESTION SECTION: ; hypatia. IN A  ;; Query time: 3 msec ;; SERVER: 192.168.1.100 # 53 (192.168.1.100) ;; WHEN: Thu Oct 29 12:59:42 CET 2020 ;; MSG SIZE rcvd: 63  $ dig @ 192.168.1.100 ipazia  ; << >> DiG 9.16.6 << >> @ 192.168.1.100 ipazia ; (1 server found) ;; global options: + cmd ;; Got answer: ;; - >> HEADER << - opcode: QUERY, status: REFUSED, id: 55099 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; WARNING: recursion requested but not available  ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags :; udp: 4096 ; COOKIE: 6d3ed396d7e62a5f010000005f9aaed458609fe61b6fc588 (good) ;; QUESTION SECTION: ; hypatia. IN A  ;; Query time: 0 msec ;; SERVER: 192.168.1.100 # 53 (192.168.1.100) ;; WHEN: Thu Oct 29 13:00:20 CET 2020 ;; MSG SIZE rcvd: 63

I have a Linux box (Ubuntu server 11.10) inside a Windows Active Directory domain, and is joined the domain using . The resolv.conf file looks like this:  domain mydomain.com nameserver 192.168.1.1 nameserver 8.8.8.8 nameserver 8.8.4.4   where 192.168.1.1 is the Windows DNS server for the Windows domain. 8.8.8.8 and 8.8.4.4 are Google's public DNS servers that we preferred over our ISP servers.  That setup was working properly, until we decided to disable recursion in the Windows DNS server due to some changes of our network design. I thought that will go well as we have configured it to use Google's servers next, but it seems not:  mydomain\myuser@linux-server:~$ dig google.com  ; <<>> DiG 9.7.3 <<>> google.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55321 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 13, ADDITIONAL: 4 ;; WARNING: recursion requested but not available  ;; QUESTION SECTION: ;google.com.                    IN      A  ;; AUTHORITY SECTION: .                       3600    IN      NS      c.root-servers.net. .                       3600    IN      NS      d.root-servers.net. .                       3600    IN      NS      e.root-servers.net. .                       3600    IN      NS      f.root-servers.net. .                       3600    IN      NS      g.root-servers.net. .                       3600    IN      NS      h.root-servers.net. .                       3600    IN      NS      i.root-servers.net. .                       3600    IN      NS      j.root-servers.net. .                       3600    IN      NS      k.root-servers.net. .                       3600    IN      NS      l.root-servers.net. .                       3600    IN      NS      m.root-servers.net. .                       3600    IN      NS      a.root-servers.net. .                       3600    IN      NS      b.root-servers.net.  ;; ADDITIONAL SECTION: c.root-servers.net.     3600    IN      A       192.33.4.12 d.root-servers.net.     3600    IN      A       128.8.10.90 e.root-servers.net.     3600    IN      A       192.203.230.10 f.root-servers.net.     3600    IN      A       192.5.5.241  ;; Query time: 4 msec ;; SERVER: 192.168.1.1#53(192.168.1.1) ;; WHEN: Wed Jan  8 14:02:22 2014 ;; MSG SIZE  rcvd: 507   Also:  mydomain\myuser@linux-server:~$ ping google.com ping: unknown host google.com   And also I have failed squid proxy connections (which I solved using the  option inside squid configuration and neglected the internal DNS server).  Why DNS requests fails when recursion is declined by the first nameserver? Shouldn't the machine tries the next server? And what can I do if that was the expected (designed) behavior?  EDIT: NSLOOKUP gave other (success) results:  mydomain\myuser@linux-server:~$ nslookup google.com ;; Got recursion not available from 192.168.1.1, trying next server Server:         8.8.8.8 Address:        8.8.8.8#53  Non-authoritative answer: Name:   google.com Address: 173.194.67.102 Name:   google.com Address: 173.194.67.138 Name:   google.com Address: 173.194.67.100 Name:   google.com Address: 173.194.67.113 Name:   google.com Address: 173.194.67.139 Name:   google.com Address: 173.194.67.101   So is this application-dependent? Can I get that (trying next server if the first refuses recursion) to work transparently for all applications requesting name resolution, or name resolution is the responsibility of the program itself? (or am I missing something?!)...  EDIT: Also worth noting, mydomain.com is a registered and public address on the internet and is not owned by us. It's like we've set up an internal domain named apple.com, and I assure you I don't work for Apple, at least not yet ;-).


I am new user to latex and trying to write my thesis in latex. I have received a template in latex that uses following packages. When I try to include \usepackage{subcaption} to include subfigures in my thesis, file does not compile and error appears. I dont know which of the following packages is conflicting with subcaption package Best Regards  \documentclass[b5paper, 11pt]{report} \usepackage{arabtex} \usepackage{lipsum} \usepackage{utf8} \pagestyle{plain} \usepackage{graphicx} \usepackage{bm} \usepackage[]{amsmath} \usepackage{amssymb} \usepackage{afterpage} \usepackage{verbatim} \usepackage{psfrag} \usepackage{color} \usepackage{cite} \usepackage{epsfig} \usepackage{epstopdf} \usepackage{footmisc} \usepackage{fmtcount} \usepackage{stackrel} \usepackage{float} \usepackage{tocloft} \usepackage{silence} \usepackage{url} \usepackage{enumerate} \usepackage{hyperref} \usepackage{fancyhdr} \usepackage{nomencl} \usepackage{makeidx} \makeindex \usepackage{setspace} \usepackage{geometry} \usepackage{graphicx} %\usepackage{caption} %\usepackage{subcaption} \geometry{  b5paper,             total={185mm,255mm},             left=25mm,             right=25mm,             top=25mm,             bottom=25mm,             } \doublespacing \hypersetup{urlcolor=black, colorlinks=true, citecolor=blue} \title{\ttitle}

My .tex file:  \documentclass[a4paper,twoside,portrait,12pt,openright,final,pdflatex]{report} \usepackage[bindingoffset=8mm]{geometry} \usepackage[T1]{fontenc} \usepackage{arabtex} \usepackage{utf8} \usepackage{graphicx} \usepackage{float}  \usepackage{caption} \captionsetup{font=small,labelfont=bf} \setcounter{secnumdepth}{3} \usepackage{fixltx2e}  \usepackage{paralist}  \usepackage{hyperref} \hypersetup{pdftex,linktocpage=true,bookmarks=true,colorlinks=true,citecolor=blue,filecolor=black,linkcolor=blue,urlcolor=black,pdfauthor={Ayman Elmasry},pdftitle={Algorithmic Form Generation: A Thermal Building Envelope Design Approach}} \usepackage[all]{hypcap} \usepackage{lipsum}  \begin{document}  \lipsum[1-20]  \end{document}   I compile with pdflatex, and I get this error:  (/usr/local/texlive/2011/texmf-dist/tex/latex/caption/caption.sty (/usr/local/texlive/2011/texmf-dist/tex/latex/caption/caption3.sty Runaway argument? {\caption@CheckCommand \@makecaption {\long \def \@makecaption ##1##2\ETC. ! Paragraph ended before \@gobble was complete. <to be read again>                     \par  l.901         \unskip\kern-2\captionindent\par   When I comment out:  %\usepackage{caption} %\captionsetup{font=small,labelfont=bf}   ... I get an output PDF file with no problems.


Yes, I know that you have to use Seduction or whatever, but when ever I approach someone I always get attacked. So how am I supposed to feed to go back to level one????

I'm currently a stage 4 vampire in Skyrim. As soon as I try and sneak into a town to feed, I get spotted like a kilometer away, even with an invisibility potion. Nothing seems to work! I don't want to make a new character since I'm a pretty high level. Is there any way I can look for a place to feed without them noticing me!?


I try to use Windows 10 via Parallels Desktop in my new Mac.   In the File Explorer of Windows 10, I see the following sidebar. Does anyone know how to remove 3D Objects and Movies from there?

The 2017 Fall Creators Update to Windows 10 added a "3D Objects" folder to the "This PC" view of Windows Explorer:    How can this be removed?


I am working with Adobe 2020 while transferring the chart from Excel to Illustrator, text change to weird nonnumerical characters. I have tried these before transferring the chart change the font to Arial, Times New Roman, Myriad and then paste change it to PDF, or picture or TIFF or PNG image and then paste to Illustrator Nothing worked... Any help would be highly appreciated Thanks

Using Excel for Mac 16.40 & Illustrator 24.2.3, when I copy a graph from Excel to Illustrator, all the text corrupts:  The text font is Arial. It would be so nice if Excel graph text copied and pasted into Illustrator without being corrupted. Is it possible to copy/paste/import Excel graphs into Illustrator with the text being retained? Help appreciated.


Suppose we have two independent random variables X and Y with exponential probability distributions with two rates $\lambda_x$ and $\lambda_y$, respectively. Also, we have $\lambda_x>\lambda_y$. How can the following probability be calculated? $P(X>Y)?$ can i write as follows? $P(X>Y)=\int_0^\infty P(X>Y|Y=y)dy=\int_0^\infty P(X>y)dy$

$X$ and $Y$ are independent and exponentially ditributed with parameters $a,b$, respectively. Calculate $P(X>Y)$  1)$P(X>Y)=1-F_{X-Y}(0)$. Then I try to calculate density  of $X-Y$ from characteristic functions but I cannot deduce distribution of $X-Y$ from this.  2)ok I can also calculate density of $Z=X-Y$ from transformation of RV formula and then marginalize  3) Is there any simpler way to calculate $P(X>Y)$ than 2)?


I'm making a material in which the color in the Color Ramp Slider changes the color of the fabric material. Because I'm using noise texture to generate patches of 2 different colors, I'm unable to connect the slider color to group input. I tried looking for solution to add driver and it didn't work as intended.  Update: Thanks to moderator for re-opening the thread. I have already seen the link provided by PGmath. The method in the link basically says "This is workaround" and it's bit on complex side. I don't mind playing with math modes to achieve the desired result. But that too doesn't seem to work in my case. The link explains how you can get node group that behaves like Colorramp. What I want is a node input for changing color hue. Anyways, thank you guys for helping out. Got a workaround fiddling with MIXRGB and Math node that achieves what I'm looking for. Below are the images of the result.  BTW, if you guys have been wondering I'm making a procedural Velvet Shader.

Sometimes I create Material Groups to be used as appendable reusable assets. Unfortunately sometimes parameters I want to control using a Group Node's slider are not available for routing to a Group Node's input socket. Some examples of these are the Color Ramp and the Mapping Node.  So here's what I want to do:    Can this be done? If so, how?  Thanks!


I was wondering what the output of capturing flop looks like, if there is a hold time violation from capture flop. Can anyone explain with a timing diagram?

From the Wikipedia article Metastability in electronics:     Metastability in electronics is the   ability of a digital electronic system   to persist for an unbounded time in an   unstable equilibrium or metastable   state. In metastable states, the   circuit may be unable to settle into a   stable '0' or '1' logic level within   the time required for proper circuit   operation. As a result, the circuit   can act in unpredictable ways, and may   lead to a system failure.    That seems to be a good definition, but what does it mean in an application?  From an electronics designer's standpoint, what are some examples of when this might occur and where should this type of failure be of concern?     Is there a more pragmatic or applied definition - something in more specific terms?


When I click on .edit-item then a form is loaded to my page via AJAX  function forms(e, el) {   alert("ok");   // here the ajax form is loaded, didn't paste it here because too much code }  $('.table tbody').on( 'click', '.edit-item', function (e) {   forms(e,this); });   In the loaded form there is a selectbox "change". What I want to do is, on change, simply trigger the .edit-item again.    $('#change').on('change', function(e) {   $(".edit-item").trigger("click"); });   I expect now an ok on change but nothing happens.

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


You see it used in for loop statements, but it's legal syntax anywhere. What uses have you found for it elsewhere, if any?


A pack of 8 batteries is given, with 4 good batteries and 4 bad batteries. We need to take 2 good batteries for our device to work properly. How to calculate what is the smallest number of steps in which we are sure, that we have 2 good batteries? What is the best approach to take I we want to be left with two good batteries in our hand? Only way we can check if a pair is good or bad is to put it in the device. It either works (2 good batteries) or doesn’t work (1 good 1 bad or 2 bad)  EDIT: I've managed so far to find a solution, that we can do this with only 7 checks (where a check is putting two batteries to the device).   Divide 8 batteries into 4 pairs Check each pair (4 checks total) If none worked, all pairs are of type (0,1) or (1,0) Take any two pairs, cross-check them (we already know the result of one possibility, so we're left with 3 other possibilities to check, i.e. 3 checks, 7 checks total)   But I am still wondering, If this can be done with 6 checks only? Can we apply graph theory here somehow?

We have $n$ charged and $n$ uncharged batteries and a radio which needs two charged batteries to work. Suppose we don't know which batteries are charged and which ones are uncharged. Find the least number of attempts sufficient to make sure the radio will work. An attempt consists in putting two batteries in the radio and check if the radio works or not.   I can prove that it is $\leq n+3$ (or $\leq n+4$, look at the comment): Say we have batteries $B_1,B_2,....B_{2n}$, $n$ of them charged and other not. If in one of $n$ attempts $$\{B_1,B_2\}, \{B_3,B_4\}, ...\{B_{2n-1},B_{2n}\}$$ radio work we are done. If non of them work, then in each pair we must have charged and uncharged batteries. Thus in one of next 4 pairs: $$\{B_1,B_3\}, \{B_1,B_4\}, \{B_2,B_3\}, \{B_2,B_4\}$$ must be a pair of charged batteries and we are done (so if 3 times doesn't work we know the last pair is charged). But, can we reduce the number of attempts?


Assume that $\sum x_n$ is convergent but not absolutely convergent.   Show that for all $x\in\mathbb R$ there is a permutation $\rho : \mathbb N \rightarrow \mathbb N$ such that   $\sum^{\infty}_{n=1}x_{\rho(n)}=x.$   I don't really know where to start on this one.  I'm also having difficulty wrapping my head around the fact that simply changing the order of the terms within the sum can change the sum itself. Of course I accept it as true but I can't quite understand why it would be the case and so an explanation of that would also be appreciated.  Thank you

I think understand that when I have a conditionally convergent series, it consists of series of positive and negative values which are divergent and thus one can find such permutation of indices $\phi : \mathbb{N}\rightarrow\mathbb{N}$ so the rearranged series sums up to an arbitrary value, diverges or oscillates.   This is how I understand what Riemann's rearrangement theorem says, but how do I use it practically? For example, when I have the conditionally convergent series:  $$\sum_{n=1}^{\infty}\frac{(-1)^n}{\sqrt{n}}$$  and I want to rearrange it to be divergent or to sum up to certain value M? How do I define such bijections $\phi$ ?  I appreciate all help.


I have a form with inputs defined like this:  <input class=" validate['required','alpha']">   I would like to apply specific css styling to inputs which have a class of validate['required'], something like this:  input.validate['required]'{border-color:#ff0000}   Is this possible, and if so what is the correct syntax?  Thanks for any help.

What characters/symbols are allowed within the CSS class selectors? I know that the following characters are invalid, but what characters are valid?  ~ ! @ $ % ^ & * ( ) + = , . / ' ; : " ? > < [ ] \ { } | ` #


How can I upgrade my wildfire s to jellybean? Help anyone? What are the risks? I tried to look up on google but couldn't find anything usefull..HELP!

This Community Wiki question is designed to be the "canonical question" for questions asking how to upgrade one's device to a new Android version.   I want to get a newer version of the OS for my Android device. How can I do that?  See also:


How can I determine the available width inside an enumerate environment? In particular, what width argument can I pass to the minipages in the example below so that the minipages take up all of the available horizontal space, but do not give me overfull-hbox errors. Note that I would like to be able to have the minipages get the correct width at any level of nesting for the enumerate environments. When I run the code below, the minipages in the outer enumerate environment are about 25pts too wide, while the minipages in the inner enumerate environment are about 47pts too wide. I was hoping one of textwidth, column width, or hsize would give me the correct width but the minipages, but all three fail.  \documentclass{article}  \begin{document}  \begin{enumerate}  \item \begin{minipage}{\textwidth} some text \end{minipage}  \item \begin{minipage}{\columnwidth} some text \end{minipage}  \item \begin{minipage}{\hsize} some text \end{minipage}  \item \begin{enumerate}  \item \begin{minipage}{\textwidth} some text \end{minipage}  \item \begin{minipage}{\columnwidth} some text \end{minipage}  \item \begin{minipage}{\hsize} some text \end{minipage}  \end{enumerate}  \end{enumerate}  \end{document}

The three lengths \textwidth, \linewidth and \hsize seem to all hold the width of the current line. At least I never saw some real difference between \textwidth and \linewidth in my code. Both seem to be identical even when changed, e.g. by a minipage environment.  Could someone give me an elaborate explanation of the differences between these lengths? I like to understand them in detail. I know that the first two are from LaTeX and the latter one from plainTeX.  There is also \columnwidth which seems to be identical to \linewidth or \textwidth in one-column mode, right? Except when the line is reduced by a minipage or quote etc. environment.


Change the order of integration & evaluate it.  $$ \int_{0}^{2a} \int_{0}^{\sqrt{2ax-x^2}} \phi'(y) \frac{(x^2+y^2)x}{\sqrt{(4a^2x^2-(x^2+y^2)^2})} dxdy $$  I changed the order but could'nt solve it. Is there any 'tricky' variable substitution involved ? I couldn't solve it even with polar co-ordinates due to the presence of $ \phi'(y) $ factor in the integrand? Is there a way to circumvent this?

Change the order of integration in:  $$\int_0^{2a}\int_0^\sqrt{2ax-x^2}\frac{\phi'(y)(x^2+y^2)x }{\sqrt{4a^2x^2-(x^2+y^2)^2}}dxdy$$ and hence evaluate it.    I changed the order of integration and got the limits $y=0$ to $a$ and $x=a-\sqrt{a^2-y^2}$ to $a+\sqrt{a^2-y^2}$. I then tried changing to polar coordinates, but it is only making the integrand more complex.


And design requires that we don't add texts.  The site contains only pictures. I think it needs some text. However, I do not want the text to be shown.  Should I put it on img title? Should I hide it on description? Should I use meta keywords?  What should I do?

How do I best approach common SEO techniques for a website with images as the main content?  The problem here is the content is all image based, so other than Friendly URLS, H1/H2 tags, Sitemap, RSS Feed, Alt Img, what else can be done to gain search rankings?  I realise most search engines (if not all) are text based and text is how they better understand the business and "usefulness" of a site and therefore compare it with other sites, but other than social media and driving constant traffic what is the best thing to do or focus on?


gcc 4.4.2 c89  I have the following enum:  enum drop_options_e {     drop_ssm,     drop_snm,     drop_ssb };   I am just wondering that is the best way to get the string representation value from the enum.  So basically, instead of returning the value of 0 for drop_ssm, I could get the 'drop_ssm' instead.  Many thanks for any advice,

Here's what I am trying to do:    typedef enum { ONE, TWO, THREE } Numbers;   I am trying to write a function that would do a switch case similar to the following:   char num_str[10]; int process_numbers_str(Numbers num) {   switch(num) {     case ONE:     case TWO:     case THREE:     {       strcpy(num_str, num); //some way to get the symbolic constant name in here?     } break;     default:       return 0; //no match   return 1; }   Instead of defining at every case, is there a way to set it using the enum variable like I am trying to do above?


Take a look here:   It is adding weird diamond like shapes and removing formatted text like  from the original body. The database uses UTF8 and I am using nl2br in PHP to pull the record. Any suggestions on how to fix it?  EDIT:  Using this code here:    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">   Seems to have fixed the weird formatting, but the website is still not showing anything in between  such as  that is in the text. Any thoughts on how to repair that then? I am assuming this is caused by the nl2br perhaps?

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


MWE :   \documentclass{article} \usepackage{amsmath,amsthm} \newenvironment{Equation}{\begin{equation*}}{\end{equation*}}   \begin{document} \begin{Equation} x = y \end{Equation} The first line of text which follows the equation (in the same paragraph)  is slightly indented.  \end{document}   Obviously I don't want the indentation.   I'm introducing this new environment because it makes the source code have a nicer color scheme in my LaTeX editor (TeXmaker). Basically I don't want it to recognize the equation environment.

If I create a custom environment based on the equation environment, I get a spacing issue: the next line of text after my environment closes doesn't start on the left margin.  Example code:  \documentclass{article} \begin{document} \newenvironment{myenv}{\begin{equation}}{\end{equation}} \noindent $| \leftarrow$ this is the left margin. \begin{myenv} e ^{i \pi} + 1 = 0 \end{myenv} $| \leftarrow$ this isn't the left margin. \end{document}   Output:    Removing the newline after \end{myenv} solves the spacing problem, but the resulting code is not readable.  Of course, in this example I could just use the equation environment itself. My real issue involves a more complex custom environment that suffers from the same problem, and which also includes an equation environment within it.


I need suggestion on how to display table if you have more than 50 columns on a page.

I have a table that lists various attributes of an individuals personal development plan; objective, time to complete objective, comments etc. The table is editable so the user can directly add comments without having to go to an intermediate form. The problem is that the client wants to add more columns and this is messing up the visual display.   The alternatives I have are:   allowing columns to expand out on click keeping essential attributes in table, rest in 'advanced edit option form' or somesuch I don't know - have you any ideas?   One more thing to add: I think the addition of extra columns is based on user feedback ...  edit: here is what I have gone for


My phone (Note3) has a large amount of ram, but there are always lots of applications that can run back ground which can easily consume  more than 90% of your memory.  It's really annoying to manually clean them time to time.  Can I set it up so that if I click home button then I will end current app completely?

When my phone starts up there are several application/services running in the background that I would rather not.  And when I press the Home button while using an app, that app usually goes into the background without exiting.  How can I stop these apps from running?


$cat shebang.sed  #! /bin/sed -f s/red/xxx/ s/BLUE/1234/  $./shebang.sed rgb lower (#1): "xxx green blue" UPPER (#2): "RED GREEN 1234"  $sed -f shebang.sed rgb lower (#1): "xxx green blue" UPPER (#2): "RED GREEN 1234"   I may guess what #! is doing. However, I don't say I know it. what is "#!"?

I have seen many files which have this line as the first line in them. What exactly is this?  #!/usr/bin/env python   What does it mean? Why is it necessary?


I submitted my paper in Journal of Intelligent Information Systems (springer) The journal says the average time from submission to decision is 1 month, but after 8 weeks the paper status is still listed as "Editor Assignment Pending". I tried to contact the editor in chief and he said"The Editor is still in the process of evaluating your paper as well as finding suitable and able referees."  is it normal?

What steps does a manuscript typically go through from submission to publication (or rejection) in a typical journal? How are these steps referred to, in particular by editorial systems, and how long do they each typically take?  Note that this question is about the typical situation and hence not about:   Journals with an atypical workflow, e.g. those that allow for an instantaneous reviewer–author interaction. Exceptional steps or rare occurrences such as withdrawal or .   This is a canonical question on this topic as per . Due to its nature, it is rather broad and not exemplary for a regular question on this site. Please feel free to improve this question.


The problem is to prove for the function: $$ f(x) = 3^x+4^x-5^x$$ has only one root. I know it isn't a hard problem, but I am really stuck on it so I would appreciate your help. I have calculated the derivative and calculated it to zero: $$ f'(x)=3^x\ln(3)+4^x\ln(4)-5^x\ln(5)=0.$$ Dividing by $5^x\ln(5)$, we have $$\frac{3}{5}^x\ln(\frac{3}{5}) + \frac{4}{5}^x\ln(\frac{4}{5}) = 1 $$ Then I see no clear continuation.

I would like to prove that the equation $ 3^x+4^x=5^x $ has only one real solution ($x=2$)  I tried to study the function $ f(x)=5^x-4^x-3^x $ (in order to use the intermediate value theorem) but I am not able to find the sign of $ f'(x)= \ln(5)\times5^x-\ln(4)\times4^x-\ln(3)\times3^x $ and I can't see any other method to solve this exercise...


Problem: Given that $34!=295232799cd96041408476186096435ab000000$. Find $a, b, c, d$. $a, b, c, d$ are single digits.  I am able to find $a$ and $b$ but cant find $c, d$. I did the prime factorisation of $34!$ using De-Polignac's formula. I got $\frac{34!}{10^7}=2^{25}\times3^{15}\times7^4\times11^3\times13^2\times17^2\times19\times23\times29\times31$  So, i got $b=0$ and $a=2$ since $2^{25}\times3^{15}\times7^4\times11^3\times13^2\times17^2\times19\times23\times29\times31 \equiv 2 \mod 10$.  So, please help me find $c$ and $d$

Find the values of $a,b,c,d\in\mathbb{N}$ such that      $$ 34!=295232799cd9604140847618609643ab0000000 $$   My Attempt:  The factorial of $34$ contains a $3$, so the RHS must be divisible by  $3$. Similarly, it must be divisible by $7$, $11$, $13$, $19$ etc.  But I do not understand how can I calculate $a,b,c,d$ in this equation.


I'm new in Ubuntu 16 and want to know, how to fix this problem.  Reading package lists... Done Building dependency tree        Reading state information... Done 4 packages can be upgraded. Run 'apt list --upgradable' to see them. W: http://archive.canonical.com/dists/precise/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1)

I started setting up by adding repositories and then went to run a sudo apt-get update again before I started installing other software, and I get the Signature key lines and it stops. So it essentially won't let me update any packages now.  d@EliteBook:~/Downloads$ sudo apt-get update Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease Hit:2 http://dl.google.com/linux/chrome/deb stable Release                      Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease               Get:5 http://ca.archive.ubuntu.com/ubuntu xenial InRelease [247 kB] Hit:6 http://ca.archive.ubuntu.com/ubuntu xenial-updates InRelease Hit:7 http://ca.archive.ubuntu.com/ubuntu xenial-backports InRelease Fetched 247 kB in 0s (256 kB/s)                    Reading package lists... Done W: http://dl.google.com/linux/chrome/deb/dists/stable/Release.gpg: Signature by  key 4CCA1EAF950CEE4AB83976DCA040830F7FAC5991 uses weak digest algorithm (SHA1) d@EliteBook:~/Downloads$   I've never seen this before whenever I setup and start installing things in Ubuntu. Is there something else I can do?


I installed Ubuntu 14.04 on my brand new laptop and got this annoying behavior: wireless connection works fine the first minutes and then it just stops working at all. Network manager says it is still connected, other devices works properly and ifconfig has a normal output. I have to reboot and after it Internet starts working fine again, at least for some minutes.

I just installed the OS on my laptop and at first wifi didn't work. After connecting to ethernet and updating everything, the wifi is working. But it disconnects here and there and requires me to reload the service or reboot. The bluetooth on the card does not work at all. It is seen and hciconfig shows an address for it. However, I cannot find bluetooth devices with it. I have seen a lot of different posts with this card but most of them are older. Where can I go from here.


Does anybody known the relationship between the $\Gamma (a)$ and $\Gamma (a+\frac{1}{2})$, is there a equation or approximate equality between this two?

Using the  for $\Gamma(x)$ and $\Gamma\Big(x + \frac12\Big)$, how can I prove the ? This is problem $10.7.3$ in the book , by Boros and Moll.  Any help is highly appreciated.


I would like to start a new line directly below a certain word in previous line. For example, let the first line begins by 'Let A denote ...' and I want to have 'B denote ...' for the second line. However I want 'B' to be exactly below 'A'. Is there a technical method of doing this in Latex? If you have any other suggestions, please let me know.

I want to typeset a piece of code containing line breaks.  New lines should indent to a specified point in the previous line.  Here is a monospaced example to illustrate what I mean.  Notice how 'case' and 'of' line up below, as well as 'let' and 'in':  swap : forall a, b. Tuple a b -> Tuple b a swap a b x = case x              of tuple a b y z. let x' = tuple b a z y                                in x'   The code I want to typeset is not monospaced, so I can't just use a verbatim environment to get what I want.  The actual LaTeX of the first line, for instance, is  \mathsf{swap} : \forall\alpha,\beta.\;\mathsf{Tuple}\;\alpha\;\beta\to\mathsf{Tuple}\;\beta\;\alpha   How can I align some text to a specific point in the previous line?


Find all the prime numbers such that $x^{2} = -1$ doesn't have a solution in $\mathbb{F}_p = \mathbb{Z}/p \mathbb{Z}$. I am not sure how to start this problem, but I have in intuition of the familie of prime numbers. My intuition is that $p = 3\mod 4$. If anyone as suggestions to give me, I would appreciate it.

I have found by a numerical experiment that first such primes are:  $2,5,13,17,29,37,41$. But I cannot work out the general formula for it. Please share any your ideas on the subject.


I am using the IEEE Transaction class in LyX. With a figure float, I was able to put a long equation spanning two columns at the top of the next page, as shown in the pictures below     My questions are: 1. How do I place the long equation at the bottom of the page  and 2. How do I let it appear in the same page (not the next page) where the equation is defined?   Do I need to load some packages? I prefer to still use the figure float in LyX where the labeling and numbering features still work for this long equation than a solution completely using ERT. In that case, I think the numbering and labeling of equations become more cumbersome.

Is there a convenient way to place a figure* at the end of the current page instead of taking up the entire next page in the twocolumn environment? Placement modifiers [Hb] do not work.


What is the mechanism by which a single electron, moving at a constant speed relative to an observer, produces a magnetic field observed by the observer? This question is a fundamental one for electromagnetism, is clear and well-framed, and deserves an answer, even if that answer is "no one really knows".

It is possible to generate a single flying electron (S. Hermelin, et.al., "Electrons surfing on a sound wave as a platform for quantum optics with flying electrons", Nature, 21 Sept 2011, 477 (7365)).   What is the mechanism by which such a single electron moving in free space generates a magnetic field?


When I run following, it gives me output as 20. but int is of 4 byte,float is of 4 byte and character array is of 10 byte, then the total is 18 byte. Why I am getting output as 20 byte?  #include<stdio.h>  struct emp {     int id;     char name[10];     float f; }e1; main() {     printf("\n\tSize Of Structure is==>%d\n",sizeof(e1)); }

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


I'm trying to map somedomain.com to here.anotherdomain.com. I can do any sub domains of the original using a CNAME but the root domain ( somedomain.com ) needs an A record. This is currently set to the ip address of the server ( anotherdomain.com ).  My question is, do I add a CNAME record of somedomain.com to point to here.anotherdomain.com on the server DNS zones?  NAMESERVER RECORDS A somedomain.com 123.123.123.123 CNAME www here.anotherdomain.com  SERVER RECORDS CNAME somedomain.com here.anotherdomain.com   The nameservers are at codeigniter and the server is cPanel.  Thanks for any help  Joe

This is a  about CNAMEs at the apices (or roots) of zones   It's relatively common knowledge that CNAME records at the apex of a domain are a taboo practice.  Example: example.com. IN CNAME ithurts.example.net.  In a best case scenario nameserver software might refuse to load the configuration, and in the worst case it might accept this configuration and invalidate the configuration for example.com.  Recently I had a webhosting company pass instructions to a business unit that we needed to CNAME the apex of our domain to a new record. Knowing that this would be a suicide config when fed to BIND, I advised them that we would not be able to comply and that this was bunk advice in general. The webhosting company took the stance that it is not outright forbidden by standard defining RFCs and that their software supports it. If we could not CNAME the apex, their advice was to have no apex record at all and they would not provide a redirecting webserver. ...What?  Most of us know that  insists that A CNAME record is not allowed to coexist with any other data., but let's be honest with ourselves here, that RFC is only Informational. The closest I know to verbiage that forbids the practice is from :     If a CNAME RR is present at a node, no other data should be   present; this ensures that the data for a canonical name and its aliases   cannot be different.   Unfortunately I've been in the industry long enough to know that "should not" is not the same as "must not", and that's enough rope for most software designers to hang themselves with. Knowing that anything short of a concise link to a slam dunk would be a waste of my time, I ended up letting the company get away with a scolding for recommending configurations that could break commonly used software without proper disclosure.  This brings us to the Q&A. For once I'd like us to get really technical about the insanity of apex CNAMEs, and not skirt around the issue like we usually do when someone posts on the subject.  is off limits, as are any other Informational RFC applicable here that I didn't think of. Let's shut this baby down.


Part (iv) of exercise #2 for chapter 1 in Atiyah and Macdonald's book  asserts that if $f, g \in A[x]$ are primitive then $fg$ is primitive. We know that this is true when the coefficient ring $A$ is a UFD in which case it is the statement of Gauss' lemma. I have tried hard to show it for arbitrary ring as the problem says but did not manage to do that. So my question is: Though I do not doubt the author, is Gauss lemma really valid for arbitrary commutative rings with unity and can I have some hint?

I'm having troubles with one of the problems in the book Introduction to Commutative Algebra by Atiyah and MacDonald. It's on page 11, and is the last part of the second question.  Given $R$ a commutative ring with unit. Let $R[x]$ be the ring of polynomials in an indeterminate $x$ with coefficients in $R$. We say that a polynomial $f = \sum\limits_{i=0}^n r_ix^i \in R[x]$ (with coefficients $r_0, r_1, \ldots, r_n$) is primitive if $\langle r_0,r_1,...,r_n\rangle = R$, i.e., the ideal generated by the coefficients of $f$ is $R$. Let $f$ and $g$ be two polynomials in $R[x]$. Prove that $fg$ is primitive iff $f$ and $g$ are both primitive.  The $\Rightarrow$ part is easy. Say, $f = \sum\limits_{i=0}^n r_ix^i$, $g = \sum\limits_{i=0}^m s_ix^i$; then $fg = \sum\limits_{i=0}^{m+n} c_ix^i$, where $c_k = \sum\limits_{i + j = k}r_is_j$. Since $fg$ is primitive, there exists a set of $\{\alpha_i\} \subset R$, such that $\sum\limits_{i=0}^{m+n} \alpha_ic_i = 1$, to prove $f$ is primitive, I just need to write all $c_i$'s in terms of $r_i$'s, and $s_j$'s, then group all $r_i$ accordingly, rearranging  it a little bit, and everything is perfectly done. And the proof of the primitivity of $g$ is basically the same. The $\Leftarrow$ part is just so difficult. Say $f = \sum\limits_{i=0}^n r_ix^i$, $g = \sum\limits_{i=0}^m s_ix^i$ are both primitive, then there exists $\{\alpha_i\}; \{\beta_i\} \subset R$, such that $\sum\limits_{i=0}^{n} \alpha_ir_i = 1$, and $\sum\limits_{i=0}^{m} \beta_is_i = 1$. At first, I thought of multiplying the two together, but it just didn't work. So, I'm stuck since I cannot see any way other than multiplying the two sums together. I hope you guys can give me a small push on this. Thanks very much in advance, And have a good day.


for i in {0..3} do    echo $i done   returns  0 1 2 3   but  firstNumber=$1 lastNumber=$2  for i in {$firstNumber..$lastNumber} do    echo $i done   returns, for example,  {0..3}   What can I do to use variables in a For loop declaration?

How do I iterate over a range of numbers in Bash when the range is given by a variable?  I know I can do this (called "sequence expression" in the Bash ):   for i in {1..5}; do echo $i; done   Which gives:     1    2    3    4    5   Yet, how can I replace either of the range endpoints with a variable? This doesn't work:  END=5 for i in {1..$END}; do echo $i; done   Which prints:     {1..5}


So I'm using beamerthemeI6dv.sty on ShareLaTeX the beamer poster template.  I keep getting this error that \setbeamerfont{footline}{fg=white, size=\normalsize} and \setbeamerfont*{example title}{size=\large,series=\bf,bg=i6colorscheme1,fg=white} have errors, but I'm not seeing what's wrong with them. ShareLaTeX says that fg and bg aren't defined, yet the lines before them which have the same variables aren't marked errors.  Also when I tried to compile, on the poster .tex file it says that \begin{document} was an error, which I also don't understand.  One more question, how can you format the poster so that it's made for a standard tri-fold poster board?

I found a beamerposter example at this url:   The content suggests that a number of packages may be required, therefore, I use the nominated packages:  \usepackage{fp} \usepackage{xkeyval} \usepackage{type1cm} \usepackage{paralist}   nnsuring that the each of these packages are up to date.  A number of beamer themes have been made available, one such example can be found here:   The example code is shown below.  poster.tex  \documentclass[final]{beamer} \mode<presentation> {% \usetheme{I6dv} }% \usepackage{times} \usepackage{fp} \usepackage{paralist} \usepackage{xkeyval} \usepackage{type1cm} \usepackage{amsmath,amssymb} \usepackage[english]{babel} \usepackage[latin1]{inputenc} \usepackage[orientation=landscape,% size=custom,% width=200,% height=120,% scale=1]{beamerposter} \title[]{Poster Title} \author{Author} \institute[]{Institution} \date{\today} \begin{document} \begin{frame}{}  \vfill \begin{block}{\large Fontsizes} \centering {\tiny tiny}\par {\scriptsize scriptsize}\par {\footnotesize footnotesize}\par {\normalsize normalsize}\par {\large large}\par {\Large Large}\par {\LARGE LARGE}\par {\veryHuge veryHuge}\par {\VeryHuge VeryHuge}\par \end{block} \vfill \end{frame} \end{document}   When the theme is placed next to this .tex file and the .tex is compiled, I initially receive the following error:  ! Package keyval Error: fg undefined   As far as my due diligence in trying to solve the problem, I found , as well as, .  I didn't find too much useful info in either.  When I search the error message, I find , however, there wasn't really anything compelling in the thread.  I saw that the xkeyval is described as an extension to the keyval package, so I tried to include \usepackage{keyval} on the off change that (if in fact it existed) it was also required.  This idea didn't pan out.  Any comments/suggestions are greatly appreciated.  One option might be to locate a different poster example.


<input class="txt_tab_head" type="text"/>Tab 1

<input class="txt_tab_head" type="text"/>Tab 2

Contents of Tab 1

Contents of Tab 2

         //Add tab and content $('.add-contact').click(function(e) {   e.preventDefault();   var id = $(".nav-tabs").children().length;    $(this).closest('li').before('
<input class="txt_tab_head" type="text"/>New Tab ' + id + '
');   $('.tab-content').append('

Contents of Tab ' + id +'

'); });   //Renaming tabs $('.tab-txt').on('dblclick',function(){     $(this).find('input').toggle().val($(this).find('a').html()).focus();     $(this).find('a').toggle(); });  $('.tab-txt').on('blur','input',function(){     $(this).toggle();     $(this).siblings('a').toggle().html($(this).val()); });   //Sorting Tabs $( function() { var tabs = $( "#tabs" ).tabs(); tabs.find( ".ui-tabs-nav" ).sortable({       axis: "x",       stop: function() {         tabs.tabs( "refresh" );       }     }); });

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


I'm just wondering, would creating Stack Overflow Trilogy mobile applications (for iPhone, Android, etc.) be a good idea? What does the community think? Maybe, after a general API is proposed and released, the whole community could somehow get together and create such applications?  NOTE: There have been questions before that asked whether mobile apps for Stack Overflow are currently available - this is not a duplicate, they are simply related.  UPDATE: I just checked out the mobile Stack Overflow web UI, and it's spectacular! However, I still think mobile applications are a good idea. Let's say that we want to make a Stack Overflow iPhone app with the API that will be released in 6-8 weeks (of course, we'll be making it after the API is released, right?). Per one design, we could have these tabs/panes in the app:   Me - this is where your profile info is shown, collated from all associated accounts from your login. You can see all your questions, answers, rep changes, notifications, and more for all 4 Trilogy sites. Also, we could have notifications outside of the app, based on the existing notifications architecture of Stack Overflow. Questions - questions are shown in a grid format (with a similar look and feel to the web Stack Overflow UI), the site you wish to see questions from can be selected through a little tabbed interface at the top (and there will also be tabs such as "Featured", "Unanswered", etc.), once you click on a question, it is displayed with all of its info & metadata and you can answer from inside a question, as well as vote, favorite, retag, etc. Tags - similar to the Tags interface in the web UI, but again, you can select which of the 4 sites you want to see the tags of. Users - see Tags explanation. Search - utilizes the search functions.   So, what do you think? Do you think:   that creating mobile apps for Stack Overflow is a good idea? that the above design is a possible implementation? What other architectures do you think would be a good idea, depending on how the API is developed?

I like using Stack Overflow (or any other Stack Exchange sites) and was wondering if there was an app I could install on my phone or other device that would allow me to use the site on-the-go or straight from my desktop.  Some systems to consider:   Windows 8 Android iPhone/iOS   What are some apps that I could install to my computer or phone to enhance my Stack Exchange experience?


Maybe my question is too broad, but I'd really like to know: what is best to use (and why) between xparse command definition (e.g. \NewDocumentCommand) and LaTeX "standard" definitions (e.g. \newcommand)?  When I started with LaTeX I learnt that LaTeX definitions are more convenient than TeX plain definitions (e.g. \def) for many reasons (e.g. not having the risk to inadvertently override some existing command and such).  I'm wondering if the new xparse definitions are better; for instance sometimes I've seen that the syntax to define a command is more clear (to me) and seems very powerful.  Are there any drawbacks?  Thanks

Are there compelling reasons to stick with \newcommand or should one always use \NewDocumentCommand instead, even when not using any of the additional features offered by xparse?  In addition and more specifically,   If I already require xparse to define one of the macros of my document/package/class, is it a good idea to use \NewDocumentCommand for all my other macro definitions? Will \newcommand eventually get deprecated/discouraged in favor of \NewDocumentCommand with LaTeX3?


So, i'm using an array in my program, and it gives me this error:  Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException  The error is in fourth line of this code:   int n = numbers.length, numBigger10 = 0;  for (int i = 0; i < n; i++)             if (numbers[i] > 10)                 numbersBigger10[i] = numbers[i];                                numBigger10++;                  What can I do to solve?  If you want to know more details about the error please feel free to ask.

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?


I am seeing a weird behavior.      List<String> li = new ArrayList<>();     li.add("a");     li.add("b");     li.add("c");     li.add("d");     li.add("e");     for(String str:li){         if(str.equalsIgnoreCase("d")){             li.remove(str);     //removing second last in list works fine         }     }   But if i try to remove any other than second last in the list, i get ConcurrentModificationException. It came to my attention while reading "Oracle Certified Associate Java SE 7 Programmer Study Guide 2012" which incorrectly assumes that .remove() always works with an example of removing the second last in the list.

I am using a Collection (a HashMap used indirectly by the JPA, it so happens), but apparently randomly the code throws a ConcurrentModificationException. What is causing it and how do I fix this problem? By using some synchronization, perhaps?  Here is the full stack-trace:  Exception in thread "pool-1-thread-1" java.util.ConcurrentModificationException         at java.util.HashMap$HashIterator.nextEntry(Unknown Source)         at java.util.HashMap$ValueIterator.next(Unknown Source)         at org.hibernate.collection.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:555)         at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)         at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)         at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)         at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)         at org.hibernate.engine.Cascade.cascade(Cascade.java:130)


We made a custom base64 encode algorithme. This code work on Android finally byte b = (((bArr[i4] & 255) << 16) |((bArr[i4 + 1] & 255) << 8) | (bArr[i4 + 2] & 255));  However, when i tried to write the same line in java on linux it says: incompatible types: possible lossy conversion from int to byte  I can't cast the whole variable because it made an error in base64 encoding Could anyone give me the reason why ?

Can any one tell what is numeric promotion?


I use this code to change id to an <input type="button" id="avvia_timer" value="AVVIA" />:  $("#avvia_timer").click(function() {     $(this).val("INIZIA");     $(this).attr("id", "inizia_timer"); });   I changed id with $(this).attr("id", "inizia_timer"); Then I want to show 'id' with an alert but doing click on the element with the new id  $("#inizia_timer").click(function() {     alert($(this).attr("id")); });   this doesn't work. Why? How can I fix?  Html code:
     <input type="button" id="avvia_timer" value="AVVIA" />     <input type="button" id="stop_timer" value="FERMA" />     Timer


We are supposed to calculate the limit of the integral $\lim_{n\to\infty}\int_0^\pi \frac{\sin nx}{nx}dx$.  What I am currently thinking is this. Since $|\frac{\sin nx}{nx}|<\frac{1}{n}$, we can prove that this converges uniformly and can then use the dominated convergence theorem to shift the limit inside the integral, as in  $\int_0^\pi \lim_{n\to\infty}\frac{\sin nx}{nx}dx = \int_0^\pi \frac{1}{n} \,dx$.  However, I don't think that this is correct. Does someone know the correct way to solve this?

I'm stumped at the last part of this problem. Could anyone advise, please? Thank you.  Here is  my  proof.   Define  $f: \mathbb{R} \to \mathbb{R}$ by $$ f(x) = \left\{\begin{aligned} &\frac{\sin nx}{nx}&&, x \neq0 \\ &1 &&, x=0 \end{aligned} \right.$$   Hence, $$f(x) = \sum^{\infty}_{k=0}(-1)^k\frac{(nx)^{2k}}{(2k+1)!} , \forall x \in \mathbb{R} \mbox{ and } f \in {\mathscr R[0,b]}.$$  $$\int^{b}_{0} \frac{\sin nx}{nx}dx = \int^{b}_{0}f(x)dx=\sum^{\infty}_{k=0}\int^{b}_{0}(-1)^k\frac{(nx)^{2k}}{(2k+1)!}dx= \sum^{\infty}_{n=0}(-1)^k\frac{(n)^{2k}b^{2k+1}}{(2k+1)(2k+1)!}$$  $$\lim_{n \to \infty} \sum^{\infty}_{k=0}(-1)^k\frac{(n)^{2k}b^{2k+1}}{(2k+1)(2k+1)!}=  ?$$


i have a shuttle barebone pc (link to description: ). I would add some RAM, but i don't know if the one i want to buy is compatible (DDR3 1333 MHz 2gb 10600). Could someone help me?

If I want to add more RAM to my computer, how can I buy something compatible? What kinds are there? How do I determine which kind my computer will accept and how much I can add?


I have 2 elements:  Label <select>   <option>1</option>   <option>2</option>   <option>3</option> </select>   I want to trigger the select element to show its list when I click the span element. I can only use JavaScript (no JQuery) to achieve this.  So far I have tried  mousedown function {     var btn = getElementById("button");     btn.nextSibling.click() }   and:  mousedown function {     function eventFire(el, etype){       if (el.fireEvent) {         el.fireEvent('on' + etype);       } else {         var evObj = document.createEvent('Events');         evObj.initEvent(etype, true, false);         el.dispatchEvent(evObj);       }     }      eventFire(btn.nextSibling, 'click'); }   But haven't been able to get it work.  If I do  mousedown function {    console.log(btn.nextSibling); }   This does return the right element, so I know my target is right. It's just not responding to .click(); or the eventFire function.  Would anyone know why this is?  (I can include the rest of the mousedown function if need be, but it large and conplex and for the sake of this part, still works as a normal onmousedown)

Is it possible to use JavaScript to open an HTML select to show its option list?


How do we find the average value of this function with the intervals $[0,1]$?  $$f(t)=10(e^{5t}-1)$$

I have the following solution for my question but I am not sure if I have done the steps right:


Im trying to  integrate jasper community edition with java,      RestClientConfiguration configuration = RestClientConfiguration.loadConfiguration("jasper.properties");     configuration.setAcceptMimeType(MimeType.JSON).setContentMimeType(MimeType.JSON).setJrsVersion(JRSVersion.v6_0_0).setLogHttp(true);     configuration.setRestrictedHttpMethods(true);     configuration.setHandleErrors(false);     configuration.setLogHttp(false);     configuration.setLogHttpEntity(false);     JasperserverRestClient client = new JasperserverRestClient(configuration);     Session session = client.authenticate("jasperadmin", "jasperadmin");     OperationResult<InputStream> result = client             .authenticate("jasperadmin", "jasperadmin")             .reportingService()             .report("/reports/interactive/CustomersReport")             .prepareForRun(ReportOutputFormat.HTML, 1)             .run();     InputStream report = result.getEntity();   Every thing is fine, im  getting response as some Object, which i can save in file also, Now my question is i want to convert the InputStream to toString, so that i can get actual html content and i can print it in my jsp page,  I have tried   but its not working for me, can any one help?

If you have a java.io.InputStream object, how should you process that object and produce a String?    Suppose I have an InputStream that contains text data, and I want to convert it to a String, so for example I can write that to a log file.  What is the easiest way to take the InputStream and convert it to a String?  public String convertStreamToString(InputStream is) {     // ??? }


A Google search yields 41,200,000 results for the former but only 3,150,000 for the latter.  Are split infinitives really to boldly be avoided in English grammar, or are millions of people just unaware of / uncaring for their existence?

Mark's generosity in this crisis seems to more than make up for his earlier stinginess.   Should those sentences always be avoided, or are there cases where they are valid?


I'm trying to create a Java guessing game, but the first part I'm working on is having issues and I would like some help. The program first asks a user to input a number, then the program asks them to confirm whether their number is what they inputted. If they enter yes to whether they inputted the correct number, it currently just outputs "bru". If no is inputted then they re-enter the input number and the cycle will go on until the user correctly inputs their number and confirms it. I'm trying to accomplish this with a while loop. Unfortunately when I run the program everything works fine until I'm asked to enter yes or no to confirm my number. If I enter yes it still asks for me to re-enter the number. But if I enter no and then I say no again confirming my number it gives me the output for when I confirm that I inputted the correct number. import java.util.Scanner; import java.util.Random;  public class Assignment6 {      public static void main(String args[]) {         Scanner input = new Scanner( System.in );         System.out.print ( "Please enter the upper bound of the secret number.");         int UpperBound = input.nextInt();         System.out.print ( "The UpperBound you entered is" + " " + UpperBound + "." + "Is that correct?" + "" + "If yes please enter yes, if not please enter no.");         String TrueOrFalse = input.next();         while (TrueOrFalse == "no" | TrueOrFalse == "No");         {             System.out.print ( "Please enter the new upper bound of the secret number.");             UpperBound = input.nextInt();             System.out.print ( "The UpperBound you entered is" + " " + UpperBound + "." + " " + "Is that correct. If yes please enter yes, if not please enter no.");             TrueOrFalse = input.next();         }         System.out.print ("Bru");     } }

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


For a project I want to count the number of points in a raster, just like the picture below, in order to get idea of the point density. It seems simple but for some reason I am unable to find away to do this.

I have a raster and a vector point file. I need to generate another raster of same resolution showing how many points are inside the corresponding pixels of the original raster.  Something like that:   Is there a way of doing that in QGIS?   I just want the number of points, no attributes involved.


What is the name of the MySQL table that relates to all of the field tables

I have been currently learning Drupal while trying to duplicate a Drupal application into CakePHP.  I have been looking at the  database tables to know where data is being stored so I can safely migrate any data or study how it is working.  I have researched and have come across questions like:     So far, I have only seen the title in my Drupal (7) installation.  What I have seen in my node revisions table for a recipe content type, which includes fields like, field_ingredients, field_instructions, field_description, field_preptime, field_cookingtime, just the title of the recipe. This is a sample record on my node_revision table.  nid   |  vid  |  title         |  log   | timestamp  | status | comment | promote  | sticky ------------------------------------------------------------------------------------------- 1     |  1    |  Awesome Sauce |        | 1369998600 | 1      | 2       | 1        | 0   As you can see I can only see the title. Where are the other field contents?


I have applied Kmeans on a dataset top_feat represent the features and I have created list of lists in cluster.   I want to get which feature belongs to which cluster. But using this code, I get same values in all the clusters. Ideally I should get values as           len(cluster[0])=249 #(I don't know the exact number)          len(cluster[1])=1          len(cluster[2])=1          #..          len(cluster[5])=1.   I have 2500 features in total. But running this code, I get length of all clusters as 2500. It is as if all clusters are getting all the features.  I have used a for loop from 0 to 2500; such that cluster[w[i]] = top_feat[i] where w[i] is the value of the label. w= kmeans.labels_  So, if w[i] == 1, it will be cluster[1].append(top_feat[i]). Here, max(w) = 6           cluster = [[]]*((max(w)+1))         for i in range(0,2500):             cluster[w[i]].append(top_feat[i])

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?


I have seen it mentioned in many places that for some matrix $A \in \mathbb{R}^{n \times n}$  $\displaystyle\sup_{x \in \mathbb{R}^n, x \neq 0} \frac{\|Ax\|}{\|x\|}$ is equivalent to $\displaystyle\sup_{x \in \mathbb{R}^n, \|x\| = 1} \|Ax\|$.  I can see why this makes sense intuitively, but it is possible to prove it formally?

I am having trouble with understanding the following definition while studying some basic things related with matrix norms:  For every matrix $A\in M_n(\mathbb{R})$  $$\sup_{x\neq 0}{} \frac{\|Ax\|}{\|x\|} = \sup_{\|x\| = 1}{\|Ax\|},\; x \in\mathbb{R}^n$$  Why we are taking $\|x\| = 1$?  Is there any proof of above statement?  Added: Why to take sup in the definition of norm?  I need help to understand above mentioned fact.   Thank you very much.


I have the following  regex and want to access the capturing groups only. I don't care about the whole matches. That is, I want ONLY the labels (16 in the example) without the label tags.  My code is very simple, and it's the following, but in the console.log I get an array with the whole <label for="blah blah">label</label> records.  var exp_code = $('#exp_iframe').contents().find('body').html(); exp_matches = exp_code.match(/<label for=".*">(.*)<\/label>/g); console.log(exp_matches);   What am I doing wrong?  TIA.

I want to match a portion of a string using a  and then access that parenthesized substring:  var myString = "something format_abc"; // I want "abc"  var arr = /(?:^|\s)format_(.*?)(?:\s|$)/.exec(myString);  console.log(arr);     // Prints: [" format_abc", "abc"] .. so far so good. console.log(arr[1]);  // Prints: undefined  (???) console.log(arr[0]);  // Prints: format_undefined (!!!)   What am I doing wrong?    I've discovered that there was nothing wrong with the regular expression code above: the actual string which I was testing against was this:  "date format_%A"   Reporting that "%A" is undefined seems a very strange behaviour, but it is not directly related to this question, so I've opened a new one, .    The issue was that console.log takes its parameters like a printf statement, and since the string I was logging ("%A") had a special value, it was trying to find the value of the next parameter.


I have a output of the command df and using cut I have successfully extracted  22%. But the problem is I want only 22 not the %, as I will be comparing the value with another integer variable. How to do it in Bash ?

Here is what I tried doing:  #!/bin/sh res=`df | awk 'FNR == 2 { print $5 }'` res2=$((res+0))   Here is my error:     -bash: 53%: syntax error: operand expected (error token is "%")   I Googled 'string to int bash' which showed me $((res+0)) but it doesn't work due to the % in the string (53%). How do I convert it in such a way I can do an if statement such as the one below (but that works)?  if [ "$res2" -ge 50 ] then     echo "Your disk >=50% full!" fi


I am sorting a list of elements:  var matchEle = listOfElements.Where(e => e.Properties().Any(p => p.Name.Contains("Key", Asking for IEqualityComparer))).First();   I am used to just going straight to a StringComparer, OrdinalIgnoreCase or CurrentCultureIgnoreCase, however when calling Contains() in this context, it is asking for an IEqualityComparer. I imagine because of the data structure/level. I saw an example of how to set up an IEqualityComparer such as  strEqualityComparer = new IEqualityComparer();   and defining the class for strEqualityComparer but I am not sure beyond that. Can someone help me get my linq statement to work with an ignore case?  Update: Just so I'm clear here is an example of the data structure:  listOfElements = [element1, element2, etc..] element1.Properties = ["Prop1", "Key1", "Prop2", "Key2", etc.]   I need to extract the elements which pass the filter if any of its properties has a value containing the keyword, in this case "Key" therefore it cannot be .Equals or IndexOf.

Is there a way to make the following return true?  string title = "ASTRINGTOTEST"; title.Contains("string");   There doesn't seem to be an overload that allows me to set the case sensitivity.. Currently I UPPERCASE them both, but that's just silly (by which I am referring to the  issues that come with up- and down casing).  UPDATE This question is ancient and since then I have realized I asked for a simple answer for a really vast and difficult topic if you care to investigate it fully. For most cases, in mono-lingual, English code bases  answer will suffice. I'm suspecting because most people coming here fall in this category this is the most popular answer.  answer however brings up the inherent problem that we can't compare text case insensitive until we know both texts are the same culture and we know  what that culture is. This is maybe a less popular answer, but I think it is more correct and that's why I marked it as such.


I use Kubuntu 17.04 with Auto Login.  My Login password is different than my Keyring and Kwallet passwords. Each time I open Skype for Linux Beta 5.5.0.1 a dialog box opens saying     Enter password for keyring "default keyring" to unlock.   I enter the password and I can use Skype. I would like not to have to enter my password each time. I did some searching in Dolphin and found I have Ubuntu, Gnome and Python keyrings. I can find nothing in my applications or settings to access the keyring. I do have KDEwallet/Kwalletmanager. What can I do?  Some think this is caused by the presence of dbus-user-session  $ dbus-user-session --version dbus-user-session: command not found   With Auto Login to Kubuntu enabled:  $ ps aux | grep keyring user  1808  0.0  0.0  14288  1024 pts/1    S+   19:06   0:00 grep --color=auto keyring   With Auto Login disabled:  $ ps aux | grep keyring user  1258  0.0  0.1 203168  5152 ?        Sl   20:35   0:00 /usr/bin/gnome-keyring-daemon --daemonize --login user  1856  0.0  0.0  14288   972 pts/1    S+   20:36   0:00 grep --color=auto keyring

Since a few days ago my Gnome-keyring daemon hasn't been starting up properly.  After logging in:  ps aux | grep keyring user       3496  0.0  0.0 214408 15800 ?        SLl  13:30   0:00 /usr/bin/gnome-keyring-daemon --daemonize --login   Apps complain about not being able to access the keyring (and fail to do so), some shortcuts are very slow CTRL+ALT+T for terminal or Print screen can both take up to a minute between key press and action)  Seahorse does not show the login keyring  $ /usr/bin/gnome-keyring-daemon SSH_AUTH_SOCK=/run/user/1000/keyring/ssh $ ps aux | grep keyr user       3496  0.0  0.0 214408 15800 ?        SLl  13:30   0:00 /usr/bin/gnome-keyring-daemon --daemonize --login user       8524  0.1  0.0 211004 12468 pts/5    SLl  13:38   0:00 /usr/bin/gnome-keyring-daemon   Then, as soon as an app wants to access I get the keyring password prompt. Once unlocked, the keyring works properly.  I had a look to startup apps for my session and I only have one command that is relevant:  /usr/bin/gnome-keyring-daemon --start --components=ssh   I added /usr/bin/gnome-keyring-daemon to startup apps, but it will prompt for the keyring password after each login, which wasn't happening before.  Any idea on what happened and how to fix this please?


ADDITIONAL INFORMATION  Again i am writing on the above issue (Preventing multiple instances of my application)  the code works for if i start two instances from programe menu/desktop shortcut. but in my envrironment,   one instance is running from Window Service.   another from Desktop shortcut with Same parameter.  Any help how to write the code ?

I need to make sure that user can run only one instance of my program at a time. Which means, that I have to check programatically, whether the same program is already running, and quit in such case.  The first thing that came to my mind was to create a file somewhere, when the program starts. Then, each other instance of the program would check for this file and exit if it found it. The trouble is, that the program must always exit gracefully and be able to delete the file it created, for this to work. In case of, say, power outage, the lock file remains in place and the program can't be started again.  To solve this, I decided to store the first program's process ID into the lock file and when another instance starts, it checks if the PID from the file is attached to some running process. If the file doesn't exist, is empty, or the PID doesn't correspond to any existing process, the program continues to run and writes its own PID to the file.  This seems to work quite fine - even after an unexpected shutdown, the chance that the (now obsolete) process ID will be associated with some other program, seems to be quite low.  But it still doesn't feel right (there is a chance of getting locked by some unrelated process) and working with process IDs seems to go beyond the standard C++ and probably isn't very portable either.  So, is there another (more clean and secure) way of doing this? Ideally one that would work with the ISO 98 C++ standard and on Windows and *nix alike. If it cannot be done platform-independently, Linux/Unix is a priority for me.


I have the following define to check an unsigned int bitmask for a certain bit. Is there a more straightforward way (that doesn't include power of calculation) which I'm not aware of?  This is my :  #include <iostream> #include <cmath>  #define IS_BIT_SET(x) (foomask & (int)std::pow(2, x-1)) >> x-1 == 1   using namespace std;  int main() {      unsigned int foomask = 0xFFFFFFFF;     if(IS_BIT_SET(1))         cout << "Bit 1  is set" << endl;      if(IS_BIT_SET(32))         cout << "Bit 32  is set" << endl;      return 0; }

int temp = 0x5E; // in binary 0b1011110.   Is there such a way to check if bit 3 in temp is 1 or 0 without bit shifting and masking.  Just want to know if there is some built in function for this, or am I forced to write one myself.


I am running GNOME 3.14.4 and I can't find what is the purpose of one of the bottom buttons in the GNOME system menu.    The four bottom buttons can be used to, in order:   Access system settings ? Lock the screen Restart or power off the machine   What does the second button do? It is a toggle control -- when clicked, its icon changes from a circled arrow to a circled arrow with padlock.  The first thing that came to my mind is screen rotation, but it's just a wild guess.

I can't figure out what the icon between my settings and lock-screen icon in Gnome3 is supposed to do.  It has two states, locked and unlocked, but it's not the lock screen. When I click it, it toggles its status.


In a script, I have:  CMD='/usr/bin/find /etc -type f -exec /usr/bin/md5sum {} \; '  MD5=$("${CMD}")   But the script gives the error:  -bash: /usr/bin/find /etc -type f -exec /usr/bin/md5sum {} \; : No such file or directory   However the contents of the $CMD work when typed verbatim at the command line, i.e.  /usr/bin/find /etc -type f -exec /usr/bin/md5sum {} \;   Correctly generates a list of md5 hashes.  I've tried everything I can think of, including escaping the backslash and semicolon in the string, but can't seem to get it to work.  I've also tried invoking the command with backticks, which doesn't change the result.  What am I doing wrong ?

Or, an introductory guide to robust filename handling and other string passing in shell scripts.  I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some file names).  I encountered a problem such as the following:   I have a file name containing a space hello world, and it was treated as two separate files hello and world. I have an input line with two consecutive spaces and they shrank to one in the input. Leading and trailing whitespace disappears from input lines. Sometimes, when the input contains one of the characters \[*?, they are replaced by some text which is is actually the name of files. There is an apostrophe ' (or a double quote ") in the input and things got weird after that point. There is a backslash in the input (or: I am using Cygwin and some of my file names have Windows-style \ separators).   What is going on and how do I fix it?


I am currently writing protocolls with latex. I want to numerate my equations like this: (1.1), (2.3) and so on, but it´s only numbering from (1) to (n) without remarking the sections. My preamble is, but with it its not working how i want: \documentclass[a4paper, 12pt]{scrartcl} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{subfiles} %\usepackage{enumitem} \usepackage{enumerate} \usepackage{amsmath,amssymb,amsfonts,amsthm,mathtools} \usepackage{graphicx} \usepackage{tabularx} \usepackage{color} \usepackage{colortbl} \definecolor{softgreen}{rgb}{.6,.98,.6} \usepackage{parskip} %Deaktiviert Absatzeinrückung \usepackage{tikz} \usepackage{multirow} \usepackage{hyperref} %Anklicken von Referenzen ermöglichen \usepackage[a4paper, includefoot, left=24mm, right=24mm, top=15mm, bottom=15mm]{geometry} \usepackage{cleveref} %Referenzieren ermöglichen \usepackage{chemformula} \graphicspath{{Grafiken/}} %\usepackage{uhrzeit}     \begin{document}   \section{Theoretische Grundlagen}  \begin{equation} 2 + 3 = 5 \end{equation}        \end{document}

Some document elements (e.g., figures in the book class) are numbered per chapter (figure 1.1, 1.2, 2.1, ...). How can I achieve continuous numbering (figure 1, 2, 3, ...)?  And vice versa: Some document elements (e.g., figures in the article class) are numbered continuously. How can I achieve per-section numbering?  \documentclass{book}% for "vice versa" variant, replace `book` with `article`  \begin{document}  \chapter{foo}% for "vice versa" variant, replace `\chapter` with `\section`  \begin{figure} \centering \rule{1cm}{1cm}% placeholder for graphic \caption{A figure} \end{figure}  \end{document}   Bonus question: Is it possible to adjust the numbering of the sectioning headings themselves? Can I, e.g., switch from per-chapter to continuous numbering of sections in the book class?


Let $\{a_n\}$ be a sequence of positive integers, then prove/disprove:  If $\sum n^2 a_n^2<\infty$ then $\sum a_n$ is convergent.

Let's suppose that $(a_n)$ is a sequence so that $\sum a_n^2 n^2$ converges, so I have to prove that $\sum |a_n|$ converges.    By the Cauchy criterion we have that, since $\sum a_n^2 n^2 $ converges if $\varepsilon > 0$ then there is a $k\in\mathbb N$ so for all $m,n$ naturals that satisfy $m > n \geq k$: $$ |n^2 a_n^2 + ... + m^2 a_m^2| < \varepsilon $$ but I can't get $| |a_n| + ... + |a_m|  | < \varepsilon$ to show that $\sum |a_n|$ converges. Could you give me a hint? Is there any way to prove this without resorting Cauchy criterion. Thanks!


So it seems that my java program is not able to recognize two identical objects even though I'm using the same method as in a previous question where java did recognize the two objects as being the same. The only difference in this program is I have an extra keyboard.nextLine() which is necessary for inputting the name/address of object two.  Here's the class input      public boolean equals(Person num1) {     if ((this.name==num1.name)&&(this.address==num1.address)&&     (this.age==num1.age)&&(this.phoneNumber==num1.phoneNumber))         return true;     else         return false; }   Here's the demo input     import java.util.Scanner;    public class PersonDemo {     public static void main(String[] args) {      Person num1, num2;     num1=new Person();     num2=new Person();      String name, address;     int age;      long phoneNumber;      Scanner keyboard = new Scanner(System.in);      System.out.println("Input the name of person 1:");     name=keyboard.nextLine();     System.out.println("Input the address of person 1:");     address=keyboard.nextLine();     System.out.println("Input the age of person 1:");     age=keyboard.nextInt();     System.out.println("Input the phone number of person 1:");     phoneNumber=keyboard.nextLong();     keyboard.nextLine();      num1.setName(name);     num1.setAddress(address);     num1.setAge(age);     num1.setPhoneNumber(phoneNumber);      System.out.println("\nInformation of person 1: ");     System.out.println(num1);      System.out.println("\nInput the name of person 2:");     name=keyboard.nextLine();     System.out.println("Input the address of person 2:");     address=keyboard.nextLine();     System.out.println("Input the age of person 2:");     age=keyboard.nextInt();     System.out.println("Input the phone number of person 2:");     phoneNumber=keyboard.nextLong();      num2.setName(name);     num2.setAddress(address);     num2.setAge(age);     num2.setPhoneNumber(phoneNumber);      System.out.println("\nInformation of person 2: ");     System.out.println(num2);      if (num1.equals(num2))         System.out.println("\nPerson 1 and person 2 are identical.");     else          System.out.println("\nPerson 1 and person 2 are not identical."); }      }

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


My Car is up for repo my grandfather is a co signer on the car and recently just passed. I heard that the car will be paid off.. Is that true? By the granffather that passed. I was told that because he passed that since it is up for repossession that it will be paid off.

A grim and tragic question perhaps, but I'm curious:  What happens when a person that co-signed on a loan dies? Is the co-signer's estate potentially liable until the loan is paid off, the same as if the co-signer had borrowed the money themselves?  Or, does the responsibility for the loan die with the co-signer?  Does the bank/lender take on that risk?


I'm trying to install . I'm using Ubuntu (trusty 14.04 with LXDE) on my Chromebook (via ). It has an ARM processor (not Intel or AMD) so I can't use the .deb because that's built for Intel architecture.   I've attempted to follow the instructions  but cannot seem to get it to compile. Using the Terminal, how can I compile Atom?  Update: The errors I am getting  Following , I can get to step 3 but when I type script/build I get the error:  /usr/bin/env: node: No such file or directory   I cloned atom into /home/username/atom if that helps.  Update 2  Thanks to the comments below I was able to start the build process. Unfortunately, I'm now getting the following errors:  gyp: name 'chromeos' is not defined while evaluating condition 'target_arch=="arm" and chromeos==1' in deps/breakpad/breakpad.gyp while loading dependencies of binding.gyp while trying to load binding.gyp gyp ERR! configure error  gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16) gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12) gyp ERR! System Linux 3.8.11 gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/henrywright/atom/build/node_modules/minidump gyp ERR! node -v v0.10.25 gyp ERR! node-gyp -v v1.0.2 gyp ERR! not ok  npm ERR! cb() never called!   Does anyone know how to solve these errors?

I don't understand why the node command will not work, whereas nodejs works:  $ node --version zsh: command not found: node $ nodejs --version v0.10.15   I tried apt-get install nodejs, but the latest version is already installed.  And furthermore:  $ npm zsh: command not found: npm   I thought npm was included in NodeJS > 0.10?


This type of question has been asked, But the error that person got was also different. I don't want to take no chances with my computer so asking it here again.  I was working on my stuff when this error sign occurred on the top of the screen, I clicked on it. This is the screenshot :    After that I ran the command apt-get update as asked by this error. This is what I got as output :  I am also pasting the same thing here in case the image is not loading  Reading package lists... Error! E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) E: Unable to lock directory /var/lib/apt/lists/ E: can not open /var/lib/apt/lists/in.archive.ubuntu.com_ubuntu_dists_eoan_InRelease - fopen (13: Permission denied) E: The package lists or status file could not be parsed or opened.     What I have tried :  Looked for the directory which was causing the problem which was /var/lib/apt/lists/ It looked something like this :    I noticed 3 files including a folder have a cross sign on them, and these are the three files terminal showed in the error ! Please help me solve this problem, I am new to Ubuntu and so, don't know about it a lot, probably you can help me.  My system information that you might need   OS : Ubuntu 19.10 GNOME : 3.34.1 OS -type : 64-bit  This information may not be useful but I still added, just in case.

I get this error whenever I try to install programs using the terminal:  home@ubuntu:~$ apt-get install myunity E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?   Also I'm unable to install updates using the terminal.


Hello I'm trying to change one thing in my code and thats including an image in my background instead of simply a color. I put in the url inside of my code but it gives an error stating that I cant convert a color to string. what am I doing wrong here?  package blackjack; import javax.swing.*; import java.awt.*; import java.awt.event.*;  /**  *   * @author tacomeat  */ public class BlackjackGUI extends JFrame {  public static void main( String [] args ) {     JFrame frame = new BlackjackGUI();     frame.getContentPane().setBackground( FOREST_GREEN );             frame.setSize( 580, 480 );     frame.show(); }  private BlackjackDealer dealer; private GUIPlayer       human; private final JPanel players = new JPanel( new GridLayout( 0, 1 ) ); private static PlayerView Dealerview;  private static final Color FOREST_GREEN = new Color( 35, 142, 35 );  public BlackjackGUI() {       setUp();     WindowAdapter wa = new WindowAdapter() {         @Override         public void windowClosing( WindowEvent e ) {             System.exit( 0 );         }     };     addWindowListener( wa ); }  // needs to be protected if subclassed private PlayerView getPlayerView( Player p ) {     PlayerView v = new PlayerView( p );     v.setBackground( FOREST_GREEN );     return v; }     // needs to be protected if subclassed private void setUp() {     BlackjackDealer dealer = getDealer();     PlayerView v1 = getPlayerView( dealer );     this.Dealerview = v1;      GUIPlayer human = getHuman();     PlayerView v2 = getPlayerView( human );      PlayerView [] views = { v1, v2 };     addPlayers( views );      dealer.addPlayer( human );      addOptionView( human, dealer ); }  public PlayerView getDealerView(){     return this.Dealerview; }   // needs to be protected if subclassed private void addPlayers( PlayerView [] p ) {             players.setBackground( FOREST_GREEN );     for (PlayerView p1 : p) {         players.add(p1);     }       getContentPane().add( players, BorderLayout.CENTER );         }  private void addOptionView( GUIPlayer human, BlackjackDealer dealer ) {     OptionView ov = new OptionView( human, dealer );     ov.setBackground( FOREST_GREEN );     getContentPane().add( ov, BorderLayout.SOUTH ); }  private BlackjackDealer getDealer() {     if( dealer == null ) {         Hand dealer_hand = new Hand();         Deckpile cards = getCards();         dealer = new BlackjackDealer( "Dealer", dealer_hand, cards );     }     return dealer; }  private GUIPlayer getHuman() {     if( human == null ) {         Hand human_hand = new Hand();         Bank bank = new Bank( 1000 );         human = new GUIPlayer( "Human", human_hand, bank );     }     return human; }  private Deckpile getCards() {     Deckpile cards = new Deckpile();     for( int i = 0; i < 4; i ++ ) {         cards.shuffle();         Deck deck = new VDeck();         deck.addToStack( cards );         cards.shuffle();     }     return cards; }  }

I have a  to which I'd like to add JPEG and PNG images that I generate on the fly.  All the examples I've seen so far in the , specially in the  use ImageIcons.  I'm generating these images as byte arrays, and they are usually larger than the common icon they use in the examples, at 640x480.   Is there any (performance or other) problem in using the ImageIcon class to display an image that size in a JPanel? What's the usual way of doing it? How to add an image to a JPanel without using the ImageIcon class?   Edit: A more careful examination of the tutorials and the API shows that you cannot add an ImageIcon directly to a JPanel. Instead, they achieve the same effect by setting the image as an icon of a JLabel. This just doesn't feel right...


I need help with this problem:  $$\int_0^1 \frac{\ln{(x+\sqrt{1-x^2})}}{x} \ dx = \frac{\pi^A}{B}$$ Find $A + B$.  I've tried all the analytical approaches I can think of, so I've been exploring series solutions but haven't come up with anything that works. My most promising attempt is as follows: Substitute $x = \sin{(\theta)}$, $dx = \cos{(\theta)} \ d\theta$, thus the integral becomes $$\int_0^{\frac{\pi}{2}}\frac{\ln{(\sin{\theta}+\cos{\theta})}}{\sin{\theta}}\cos{\theta} \ d\theta$$ Multiplying by $\dfrac{2}{2}$ leaves $\dfrac{1}{2}$ outside the integral and squares the inside of the natural log: $$\frac{1}{2}\int_0^{\frac{\pi}{2}}\frac{\ln{(1+2\sin{\theta}\cos{\theta})}}{\sin{\theta}}\cos{\theta} \ d\theta$$ I then used the series representation of $\ln{(1 + x)}$ and multiplied each term by $\dfrac{\cos{\theta}}{\sin{\theta}}$. I then integrated each term of the series from $n = 1$ to $n = 5$ (using Symbolab) but didn't get a result that lined up with any series representation for the form $\dfrac{\pi^A}{B}$ I know that there are a lot of series representations for the form $\dfrac{\pi^A}{B}$, which is why I'm using this approach. I'm finishing calc 3 just for reference of my skill level. This was an honors project question that was assigned to me a while ago, and I never solved it, but it's been bothering me ever since. Can I get some help solving it?

By integration by parts and the substitution $x = \sin t$ we can easily calculate the integral $\int_{0}^{1} \ln (x+ \sqrt{1-x^2})dx$ which equals to $\sqrt{2} \ln (\sqrt{2} +1) -1.$ I’ve tried to use the same substitution $x = \sin t$ to calculate the integral $ \int_{0}^{1} \frac {\ln (x+ \sqrt{1-x^2})}{x}dx,$ which becomes $$ \int_{0}^{\frac {\pi}{2}} \frac {\ln \sin (t+ \frac {\pi}{4})}{\sin t}dt$$ It seems difficult to solve the particular integral. Any help?


I am not comfortable with the idea how Canonical implements it’s name in all DuckDuckGo search queries in Ubuntu. Maybe it’s not a huge privacy issue but I just don’t like such practices happening without my permission or even giving the choice to opt out. I realize that the company behind Ubuntu has to make money somehow and that’s OK. To the point: I would like to remove ‘t=canonical’ string in DDG url bar search. However, it seems this is not possible anymore via editing the ddg xml files as described in earlier AskUbuntu questions. Removing the DDG search engine and re-adding it does not solve the issue as well. That being said I guess my question really is: can I purge Canonical’s Firefox entirely and re-installing a pristine Mozilla’s browser while keeping ALL my user settings (including add-ons and about:config tweaks). I don’t believe in Firefox cloud profiles and I don’t want to create one for this purpose. So after uninstalling Ubuntu’s stock Firefox which exact folders should I delete and which must I keep before installing Firefox from source in order to preserve my custom settings? edit: The solutions provided here seem to not work on newer Firefox versions as mentioned above.

In Ubuntu 14.04, when I do a search in Firefox using either the address bar or the search bar, the system always adds t=canonical to my searches. So the full string becomes: https://duckduckgo.com/?q=cat+cooking+salmon&t=canonical.  However, if I perform the same search by going directly to the search engine, i.e. typing the search engine name and doing the search from the presented search box, this does not happen. In this case the string is: https://duckduckgo.com/?q=cat+cooking+salmon.    How do I stop Ubuntu/Firefox from adding t=canonical to my search queries? And, why is this behavior there in the first place?


When does $az+b\overline{z}+c=0$ represent a line?   All of $a,b,c$ are complex numbers.  I know that a line in the complex plane is usually represented by $z=a+bt$, where the parameter $t$ runs through all real values.   So suppose we're given the equation $az+b\overline{z}+c=0$. If $z$ represents a line $d+et$, we must have $a(d+et)+b(\overline{d}+\overline{e}t)+c=0$. Since the equation holds for all real values $t$, it must be that $ae+b\overline{e}=0$, and as a result $ad+b\overline{d}+c=0$. How can we get to a condition involving only $a,b,c$ from here?

$a,b,c$ and $z$ are all complex numbers. My idea was to show that it passes through the point $\infty$ in the extended complex plane, but I'm not quite sure how to execute that.  Update: It says in the text that a straight line can be represented by a parametric equation $z = a+bt$, where $a$ and $b$ are complex numbers, and $b\neq 0$, $t\in\mathbb{R}$


There are a number of objects in a file I've been working on for a long time that have this setup I don't understand. They show as being on all layers but they are one object. They can be edited, so they aren't objects linked from another file.     I must have done this months ago but I can't recall how or why, and I'd like to change it. What is this setup and how do I get rid of it?

I have the same objects in all 20 layers. If I delete one of them, the objects in all twenty layers are deleted, not the single one.  I would like the have my object in the first layer only. Any solutions?


I need to create a banner that is 18 feet wide by 2.5 feet high.  What would be the best way to go about planning this as it is going to be made in Illustrator and every element will be a vector.  Would my best bet be to create the document in its native size and then scale it down in Illustrator to keep the ratio but reduce the file size?  I've come across this before working at large sizes but not quite this large.

For wall-sized graphics and large banners (e.g. 3m × 5m), what is an acceptable PPI for print? As I understand it 300 ppi is the typical for 'small' artworks (esp. for clean text resolution). However, for small artworks, the audience usually engages at a much closer distance. Therefore, in the interests of keeping a bitmap file down to a reasonable size, can you get away with a much-reduced PPI for a large format/banner print?


I am working for a small automobile dealership. I had a question regarding the usage of keywords in the title tag.  The problem I am facing is that:  The dealer name is XYZ Chevrolet. Here "XYZ" is the city name. If I target a keyword for e.g. XYZ Chevrolet Dealer or Chevrolet Dealer in XYZ. It clashes with the dealer name.  If I write a title like -   Chevrolet Dealer in XYZ | New & Used Vehicles | XYZ Chevrolet   will this be considered as spamming? I don't want my website to be penalized. We are a small dealership.

I have an eCommerce based on Opencart, but I have some doubts about how many times I can repeat the same word.  For example, the keyword is present in the title, description, h1, h2 and is repeated several times in the text:   Page Title: Shop Iphone other keyword Page description: Shop Iphone other keyword   (and they continue appearing below)   H1: Shop Iphone other keyword H2: Shop Iphone other keyword 10 more times in the text: Shop iPhone   I mean, if Googlebot sees the same WORD 30 times, can it be considered SPAM? Can I lose something or can I use keywords a lot?  In WOORANK I saw my review and I noticed that I need to improve my keywords, and a lot. I have some keywords like: payment, description, promotion, sales... keywords really "empty"  [ UPDATE ]  Can repeating keywords make them lose importance?


In LaTeX, I would like to define  \newcommand{\ACROeg}{e.\,g.} This is a sample sentence, \ACROeg it does not make much sense.   but this yields     This is a sample sentence, e.\,g.it does not make much sense.   i.e. the space between \ACROeg and it was gobbled.  I do not want to use \ACROeg{} or \ARCOeg\. Can I define the macro in a way so it does not read into the next token?

I have a definition:  \newcommand{\arnold}{Arnold Schwarzenegger}   When I refer to it by:  \arnold is a   it is rendered as:   Arnold Schwarzeneggeris a    In order to have a space in front of "is" I would need to write  \arnold\ is a   Is there some other shorter way?