I want to print a invoice page into pdf. But i do not want to use any such a library like a dompdf and any library.This is a client work in project to invoice mail in pdf format. Please help me.

I have an HTML (not XHTML) document that renders fine in Firefox 3 and IE 7.  It uses fairly basic CSS to style it and renders fine in HTML.  I'm now after a way of converting it to PDF.  I have tried:   : it had huge problems with tables.  I factored out my large nested tables and it helped (before it was just consuming up to 128M of memory then dying--thats my limit on memory in php.ini) but it makes a complete mess of tables and doesn't seem to get images.  The tables were just basic stuff with some border styles to add some lines at various points; : I actually had better luck with this.  It rendered some of the images (all the images are Google Chart URLs) and the table formatting was much better but it seemed to have some complexity problem I haven't figured out yet and kept dying with unknown node_type() errors.  Not sure where to go from here; and : this seems to work fine on basic HTML but has almost no support for CSS whatsoever so you have to do everything in HTML (I didn't realize it was still 2001 in Htmldoc-land...) so it's useless to me.   I tried a Windows app called Html2Pdf Pilot that actually did a pretty decent job but I need something that at a minimum runs on Linux and ideally runs on-demand via PHP on the Webserver.  What am I missing, or how can I resolve this issue?


What is the most Dense material in the Universe? Is it Neutron Star Material? I would think that the Singularity in a Black Hole would be the densest material, or the material that exists moments before that material becomes the Singularity since it seems that the Singularity in not a material? So what then is the densest material in the the universe? I will accept both known and theoretical answers.

Black holes have very high gravitational force that tends to crush everything. So as we know atoms in a molecule have inter-atomic spacing between them and further electrons also revolve at a certain distance to the nucleus and inside the nucleus there is also some empty space. So does the strong force of a black hole crush them all the way, leaving no space in between them? And, if that happens, then it should give rise to a completely new species of atoms and molecules, right?


When I was reading a project paper, I came across this phrase:     particularly if you have a lot of data and a model without many degrees of freedom.   What is meant by a model without many degrees of freedom?   I have gone through this , but the thread just gives a general definition for df.

From , there are three interpretations of the degrees of freedom of a statistic:     In statistics, the number of degrees of freedom is the number of   values in the final calculation of a statistic that are free to vary.      Estimates of statistical parameters can be based upon different   amounts of information or data. The number of independent pieces of   information that go into the estimate of a parameter is called the   degrees of freedom (df). In general, the degrees of freedom of an   estimate of a parameter is equal to the number of independent scores   that go into the estimate minus the number of parameters used as   intermediate steps in the estimation of the parameter itself (which,   in sample variance, is one, since the sample mean is the only   intermediate step).      Mathematically, degrees of freedom is the dimension of the domain of a   random vector, or essentially the number of 'free' components: how   many components need to be known before the vector is fully   determined.   The bold words are what I don't quite understand. If possible, some mathematical formulations will help clarify the concept.  Also do the three interpretations agree with each other?


I have earned 111 Reputation with 10 Badges, When i try to take the code for Stackoverflow's Flair, I can see only 66 Reputation in the theme : default and the other theme has the correct values, May i know the Reason for it ?

Please see the following image, where you can find the inconsistency of SO reputation score among different flair themes (one with 7165, while all other three 7265).   I always thought that these four themes are based on the same data until now. Is this a bug? Are different flair themes really updated individually?    P.S.: The inconsistency only shows on my mobile, no problem from my desktop.


While doing some flagging (yes, I'm a little bit addicted) I stumbled upon the user . At first the case seemed clear, Spammer, but...and that's a big one, he seems to be a productive member of SU and SO (his account on SF isn't there anymore, but it's still in the Data-Dump of the explorer, not sure what happened).  He does never seem to link against StarWind-Software, except with his name and profile. He also  that he's a developer there...so...at what am I looking here? I can't really place him somewhere.


I am trying to simplify an expression I've found that is related to converting from a number base to another: $$n\,\mathrm{ mod }\,b^{k+1} - (n\,\mathrm{ mod }\,b^{k+1})\,\mathrm{ mod }\, b^k$$ In this sense I mainly want to simplify the second term. I know, for instance, about the identity $$(a\,\mathrm{ mod }\,b)\,\mathrm{ mod }\,b = a\,\mathrm{ mod }\,b$$ But I don't know if it could actually help.

I noticed relation between modulo operation and number which is power of two  Example I have to calculate $ 3431242341 \mod 2^5 $, which is $ 5 $ but it is equivalent to  $ ( 3431242341 \mod 2^9 ) \mod 2^5 $   I tried many examples and it seems to be true in general, and I am not sure if it is a coincidence or true in general that I can use first modulo operation ( greater number) and the result will be the same.


import time  for i in range(100):      time.sleep(0.1)      print("sleeping is happening")   I think it will print the string every 0.1 seconds, but actually it prints the string 100 times on the output client after the code is done.  The answer is a little different (python version 3.5):  following is not useful   import sys sys.stdout.flush()    and   print("sleeping is happening", flush = True)   is corret.

How do I force Python's print function to output to the screen?


I need advice regarding the copyright of the work done as a research associate.  I am working for a university as a research associate and my principal investigator insists on publishing my work without my consent. She thinks that she is entitled to do so because i worked on her idea and she paid me the salary. So she has a right to publish my work without my consent and I have no right on that work any more.   Is this true?

Jane is doing a PhD and is supervised by Professor Mary. Mary asked Jane to put together a review article for a book based on a draft chapter from Jane’s thesis with additional suggestions from Mary. The book article was submitted with the authors listed as Jane and Mary (corresponding author). I am unsure whether this has actually been published, though it was submitted well before the now-published review by Mary.  Sometime later, Mary submitted a broader review article online which used large chunks of text and figures from the book article which were directly written/generated by Jane. Whole paragraphs were copied verbatim from the first article to Mary’s article, and many more paragraphs were slightly rewritten but contained exactly the same references and phrases from the first article. Mary’s paper did not cite the book review. Mary was listed as the sole author. Jane was not informed this review was being written, and was not asked for permission to include her figures or content from the book article, which were originally written by her for her thesis.   Did Jane ‘hand over’ the rights to her written material to Mary by agreeing to submit the book article under both of their names? Should Mary have credited Jane in the article as a second author because she used exact sentences from the book article which were written by Jane? Will Jane still be able to use these (her) phrases and figures in her thesis despite not being credited on Mary’s online article?


Since Lehmer we know that $$ \sum_{n\geq1} \binom{2n}{n}^{-1} = \frac{2\pi\sqrt3}{27} + \frac43, $$ which is due to the identity $$ \sum_{n\geq1} x^n \binom{2n}{n}^{-1} = \int_0^1 \frac{x(1-t)}{(1-xt(1-t))^2} dt. $$ Substituting different values of $x$ above gives a variety of remarkable formulae.   However, I have not found similar expressions for any $\sum_{n\geq1} \binom{2n}{n}^{-k}$ with $k>1$. In particular, I am interested in $\sum_{n\geq1} \binom{2n}{n}^{-2}$. Unfortunately I cannot get a better ''closed form'' expression for this sum than the hypergeometric series $\frac14{}_3F_2(1,2,2;\frac32,\frac32;\frac{1}{16})$.     Does a closed form expression exist for $\sum_{n\geq1} > \binom{2n}{n}^{-2}$?

If $k=1$, we have \begin{align} \sum_{n\ge1}\frac{1}{\binom{2n}{n}}&=\frac12\sum_{n\ge1}n\mathrm{B}(n,n)\\ &=\frac12\int _{0}^{1}\sum_{n\ge1}n(t-t^2)^{{n-1}}{\mathrm  d}t\\ &=\frac12\int _{0}^{1}\frac{1}{(t-t^2-1)^2}{\mathrm  d}t\\ &=\frac13+\frac{2\sqrt3\pi}{27} \end{align} I wonder if there exists a general formula of $\sum_{n\ge1}{\binom{2n}{n}^{-k}}$ with $k\in\Bbb N^*$. This may involve some ${}_pF_q$ functions.


Important: I also posted this question on English Learner Stack Exchange and set a bounty. (Link: ) But apparently, this question is too complex for the learner community, so I posted it here. If you are interested in getting a bounty, you can go there and help answer it.  Enter the reasons why I asked: From my understanding, zero conditional is used to talk about facts or habitual stuff, and the first conditional is used to talk about a specific event or case. (Source: ) I am wondering how to use zero and first conditional when talking about things in the past. Do we just need to backshift the verbs and modal verbs? I came up with some examples below.  My examples: Example 1 - zero conditional in the past to talk about a general fact)  When I was young, my parents were strict with me. Unless I received good scores in school, they didn't allow me to play video games.  Example 2 - first conditional in the past to talk about a specific event)  I once played a truth-or-dare game with my friends and sister. My sister ended up sharing a lot of secrets with us. She wanted me to keep her secrets. As long as I kept her secrets, she would reward me by telling our parents that I did well in school.  Example 3 - first conditional in the past about to talk about a specific event)  A Few years ago, I met a lovely girl at the beginning of school. Unless I talked to her, I would not have a chance to make friends with her. So I talked to her.   My questions: Question 1:  In my examples, I used "would" when it is first conditional and simple past when it is zero conditional. Are my examples correct? Do we just need to backshift the verbs and modal verbs?  Question 2:  When using zero and first conditional in the past, do we also use zero conditional to talk about general or habitual stuff and first conditional to talk about a particular case?


I've one problem regarding manage information from two different Postgres servers.   In the one server I've one table a containing id bigserial and phone varchar(200)  On the other server I've table b that contains id bigserial and tell varchar(200)   Is there a way that I can compare witch rows from table a are present in the rows of table b, comparing by phone = tell?

I'm going to guess that the answer is "no" based on the below error message (and ), but is there anyway to perform a cross-database query using PostgreSQL?  databaseA=# select * from databaseB.public.someTableName; ERROR:  cross-database references are not implemented:  "databaseB.public.someTableName"   I'm working with some data that is partitioned across two databases although data is really shared between the two (userid columns in one database come from the users table in the other database). I have no idea why these are two separate databases instead of schema, but c'est la vie...


I have nearly 1750 papers in PDF on one folder, all pertaining to medical research. What's the best way to organize them? I have thought about creating one folder for every subject/sub-category, but I want to know if there's anything more efficient that many academics use.

As a thirsty graduate student, I've amassed a burgeoning collection of research articles in both paper and digital formats. Right now I manage pdfs and references with Zotero, but I'm still searching for an organization logic for paper documents that allows rapid access and prevents redundant printing and storage.  have suggested organizing by topic, while another approach is to sort by author name. Topical organization has not worked well for me in the past because my research is highly interdisciplinary, confounding my categorization efforts. For a coupled digital-physical organization system I'm considering the following:   Digital documents and references stored and tagged in Zotero Indicator in Zotero whether or not I've printed in the file Physical documents stored in manila file folders labelled alphabetically   What is the most effective way that you've found to maintain both paper and digital document repositories?


As an engineer of some years, I'm slightly puzzled and embarrassed to be asking this question, but I genuinely can't find an answer elsewhere.  Consider a .  Every example has it oscillating about a Y position of zero, which for the sine wave in isolation makes perfect sense.  Suppose it is not oscillating about a Y position of zero though, but about some other point in Y.  To generalise, this could be a constant position, or a position moving arbitrarily as defined by some other function.  This position would be the centre of the sine wave as a periodic waveform (i.e. the mean   - whether arithmetic, least-squares or some other method - as duration tends to infinity).  Starting/finishing phase is not relevant.  What do we call this Y offset from zero in the context of the sine wave?  Does it have a name?  To generalise further, I suspect this will be general for any periodic waveform and not just a sine wave, but I'm writing a document which is particularly considering sine waves so I would be happy with an answer in that context.  The best I can come up with is "centre" or "offset", neither of which I'm particularly happy with, but I'm not aware of a better term for the concept and I can't find anything online.  Hence asking on here!  Note that this is not modulation - the sine wave amplitude, frequency and phase are unchanged.

I am trying to find the name for the value at the center of a sine wave $$ y(t) = A\sin (kx \pm \omega t+\varphi) + D $$ i.e. the offset $D$ of the wave in the $y$-direction.  calls it Center Amplitude, but further googling this name is difficult and does not provide any further sources. I also found the expression , but I'm not sure that it refers to the same thing. Is there a commonly used name for the $y$-direction-offset of a sine wave?


I want to prove following:     Let $R$ be the subring $\{a+b\sqrt{10}\mid a,b\in \mathbb{Z}\}$ of $\mathbb{R}$. Then $4+\sqrt{10}$ is not a prime in $R$.   To show $4+\sqrt{10}$ is not a prime, I need to come up with an example such that $4+\sqrt{10}\mid ab$ but $4+\sqrt{10}\not\mid a$ and $4+\sqrt{10}\not\mid b$. However, I wasn't able to come up with an example. Can anyone help me? Thanks.

I'm currently working through some extra problems while studying for an algebra exam. Right now, I am having trouble showing that $4+\sqrt{10}$ is not prime in $\mathbb{Z}[\sqrt{10}]$. I've been trying to find elements $a,b \in \mathbb{Z}[\sqrt{10}]$ such that $ab \in (4 + \sqrt{10})$ but neither $a$ nor $b$ are in the ideal. This method worked well for showing that 2 and 3 are not prime in this ring, but I'm not having much success for this example. I know that I could also show that $\mathbb{Z}[\sqrt{10}] / (4 + \sqrt{10})$ is not an integral domain, but I don't think that simplifies anything. Is there another approach that I'm missing?


I want to insert Facebook Embedded Post in to mysql database table EMBEDDED_POST_MASTER.  My Facebook Embedded Post is:

Post by SilkyQuote.

   When i am inserting this embedded post into table its gives error like :  Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'div id=\"fb-root\">  I also use $insert_data = mysql_real_escape_string($input_data);   but it is not working, still same error comes, when i insert without embedded post then its inserted successfully.  means the error accure only when i insert Embedded post.

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


I am compiling a file which makes a call to my getPdbFile method in my utils class. I receive the following error:   *method getPdbFile in class utils cannot be applied to given types;             utils.toFileNoApp(new java.io.File(preInDir,aId+".pdb"),utils.getPdbFile(aPdbId,aChain));                                                                          ^   required: String   found: String,String   reason: actual and formal argument lists differ in length*   However, in my utils class, I have two versions of the getPdbFile method, one of which takes two Strings as arguments. Can someone help me understand why I still get this error? The methods are:    public static String getPdbFile(String pdbId) throws Exception{     ...   }    public static String getPdbFile(String pdbId,String chainId) throws Exception{     ...   }   I have searched through a few other posts that give very similar error messages but the situations I found appear different from my problem.

I'm sure you all know the behaviour I mean - code such as:  Thread thread = new Thread(); int activeCount = thread.activeCount();   provokes a compiler warning.  Why isn't it an error?  EDIT:  To be clear: question has nothing to do with Threads.  I realise Thread examples are often given when discussing this because of the potential to really mess things up with them.  But really the problem is that such usage is always nonsense and you can't (competently) write such a call and mean it.  Any example of this type of method call would be barmy.  Here's another:  String hello = "hello"; String number123AsString = hello.valueOf(123);   Which makes it look as if each String instance comes with a "String valueOf(int i)" method.


File 1.php load an external php file (2.php) inside a div called

   I load 2.php (template) using load().  this template contain a line like  all   but when i click "all" the script doesn't work.  if i put   all   inside 1.php all work fine. inside 2.php not.  this is the click function  $('#showall').click(function() {             $( "#myoutput" ).hide();             $('.rowresult').show();         });   How to access to the DOM on an external file?

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 was wondering if there was a document or a website that shows how statsitical techniques relate to each other and when to use each of them. I'm an engineer and every time I need to use a certain model (for bayesian inference for example), I have to go throw a lot of papers and websites to find what really applies to my problem. Should I use Conditional random fields, Deep Gaussian processes, recursive bayesian models, ... ?  A statistician might know his way around these techniques and instantly know what to use, but I don't seem to find a book or a website that translates the "math" in simpler terms, something like : if you have this stuation, you should use this model (don't get me wrong I love a good model and I'm ready to go through its details if necessary), but for someone who has basic understanding of PCA, factor analysis and LDA, going through methods like CRF, GP, HMM, .. without knowing if it's really what's you're looking for can be really tiring ..   So back to my question, I would like to know if there was some kind of "taxonomy" of statistical tools (something like this ()) but for statistical analysis, inference and bayesian models not for machine learning.   Any suggestion is much appreciated.  Thanks for all of you !

I was wondering if there is a statistical model "cheat sheet(s)" that lists any or more information:   when to use the model when not to use the model required and optional inputs expected outputs has the model been tested in different fields (policy, bio, engineering, manufacturing, etc)? is it accepted in practice or research? expected variation / accuracy / precision caveats scalability deprecated model, avoid or don't use etc ..   I've seen hierarchies before on various websites, and some simplistic model cheat sheets in various textbooks; however, it'll be nice if there is a larger one that encompasses various types of models based on different types of analysis and theories.


I have a problem..  I want to update my kernel, but I have a notice when I install the new kernel like this please install the kmod first.  so I install kmod, but when I install the kmod, my terminal say  Reading package lists... Done Building dependency tree        Reading state information... Done Package kmod is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'kmod' has no installation candidate   why?? and when I check dpkg -l kmod i have this   ||/ Name           Version        Description +++-==============-==============-============================================ in  kmod           <none>         (no description available)   can you help me to update my kernel, my friend? I'm newbie ubuntu user. My kernel 3.5.0-23-generic .. Thank You ..

Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found:  $ sudo apt-get install vlc Reading package lists... Done                Building dependency tree        Reading state information... Done     E: Couldn't find package vlc


If I want to have a website that behaves just like SO but is populated by users asking questions about cars (or waffles or ponies), can I buy or license the platform?  What's available with regard to SAS hosted or frameworks that I can run on my own hardware?

Is the Stack Exchange engine that powers Stack Overflow available to download or install internally for an enterprise or company?  I think Stack Exchange's engine is very great and could be very cool to use for internal enterprise patterns and practices, like the engine of Wikipedia.


I want to get a list of ('A_1','A_2','B_1','B_2','C_1','C_2'), with something like '_'.join() and [(x, y) for x in ['A','B','C'] for y in [1,2]].  How to write this?

How can I get the Cartesian product (every possible combination of values) from a group of lists?  Input:   somelists = [    [1, 2, 3],    ['a', 'b'],    [4, 5] ]   Desired output:  [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...]


I have a  Nvidia GeForce GT 740M gpu with 384 cores with driver version 430 installed in ubuntu 18.04 but while rendering , blender spawns only on thread so rendering on gpu is much slower than CPU with 8 threads. I've already tried this in blender 2.80.4 and 2.80.7 but the problem still persists. Also changing the number of threads manually has no effect. Any help is appreciated.Thanks

I am using Blender 2.77 and an R7 250 GPU on Windows.  Compute Device >> OpenCL (Oland).  OpenSubdiv >> (Tested with all).  Device >> GPU Compute.


and  both have some community ads that are twice the usual size — specifically 440 x 500 pixels. Apparently these work, and are for improved display on Retina screens.  Do all Stack Exchange sites support these double-size ads? In addition to Community Ads, will they work in   I suspect they might, but there's enough site-specific special case features across the network that I'm not sure. I'm looking for something conclusive, like a staff response or a link to something from staff.

On the meta posts that collect community ads (), I see ads in two sizes, 300x250px and 600x500px.  (Everything renders the same when ads are actually used on the sites, as you would expect.)  The requirements for ads include:     The image that you create must be 300 x 250 pixels, or double that if high DPI.   I assume "high DPI" is a property of the software used to create the ads, or perhaps some "image export" property.  I'm not a graphics person; the ads I've made have usually started out as photos or similar art that I crop and scale to 300x250 using low-end software (Paintbrush on Mac, Paint on Windows, that kind of thing).  Should I be making them double size?  I haven't because nothing in my software says anything about "high DPI" so I assume it doesn't apply to me.  In a few months we'll be doing the next round of ads on my sites, and if I should be doing something different to make better images, I'd like to know.


This isn't an actual problem - but more of a curious question, when I run while true; do ps aux | grep abc; echo done; done I get the following:  user    29733  0.0  0.0  11748   924 pts/1    R+   20:25   0:00 grep --color=auto abc done user    29735  0.0  0.0  11748   920 pts/1    S+   20:25   0:00 grep --color=auto abc done user    29737  0.0  0.0  11748   924 pts/1    S+   20:25   0:00 grep --color=auto abc done done done done user    29745  0.0  0.0  11748   924 pts/1    R+   20:25   0:00 grep --color=auto abc done user    29747  0.0  0.0  11748   924 pts/1    R+   20:25   0:00 grep --color=auto abc done user    29749  0.0  0.0  11748   924 pts/1    R+   20:25   0:00 grep --color=auto abc done user    29751  0.0  0.0  11748   924 pts/1    R+   20:25   0:00 grep --color=auto abc done user    29753  0.0  0.0  11748   924 pts/1    S+   20:25   0:00 grep --color=auto abc done user    29755  0.0  0.0  11748   924 pts/1    S+   20:25   0:00 grep --color=auto abc done done user    29759  0.0  0.0  11748   924 pts/1    R+   20:25   0:00 grep --color=auto abc done user    29761  0.0  0.0  11748   920 pts/1    R+   20:25   0:00 grep --color=auto abc done   Sometimes grep doesn't actually see itself in ps aux. Is this just a timing issue between the two processes running? This also happens when I run the commands individually and not in a loop.   This is happening both on my computer and another machine over ssh, but it is happening more frequently on the remote computer (which the output is from).  Ubuntu 14.04

I've never really thought about how the shell actually executes piped commands. I've always been told that the "stdout of one program gets piped into the stdin of another," as a way of thinking about pipes. So naturally, I thought that in the case of say, A | B, A would run first, then B gets the stdout of A, and uses the stdout of A as its input.    But I've noticed that when people search for a particular process in ps, they'd include grep -v "grep" at the end of the command to make sure that grep doesn't appear in the final output. This means that in the command ps aux | grep "bash" | grep -v "grep" it is implied that ps knew that grep was running and therefore is in the output of ps. But if ps finishes running before its output gets piped to grep, how did it know that grep was running?   flamingtoast@FTOAST-UBUNTU: ~$ ps | grep ".*" PID TTY          TIME CMD 3773 pts/0    00:00:00 bash 3784 pts/0    00:00:00 ps 3785 pts/0    00:00:00 grep


I am a c++ programmer and am learning pygame so I am very new to python. I noticed this behavior of functions and don't know what to do about it: let's say we have a global variable: x = 10  Now let's say we have a function that changes the value of x: def foo():     x = 100  Now, inside my main pygame loop, if I call foo(), the variable x is still 10 after the function call. How is this happening???

How can I create or use a global variable in a function?  If I create a global variable in one function, how can I use that global variable in another function? Do I need to store the global variable in a local variable of the function which needs its access?


I'm basically building my own version of phpPgAdmin (if I get good enough to make it good enough I'll post it on a repository hosting service) and currently I'm revising my primary key tool to replace an existing primary key.  Unfortunately I've run in to two issues as I'm used MySQL though have been learning PostgreSQL for about two months and can get around fairly well.   Setting a primary key initially is not a problem, changing a column to replace an existing key doesn't seem to work as pgAdmin III reports the original primary key column is still the primary key column.   Unlike MySQL that sets the type to autoincrement when setting the type PostgreSQL uses serial and bigserial however apparently it's not possible to convert an existing (all empty rows) column from numeric to bigserial. Using the following query...   ALTER TABLE custaddress ALTER COLUMN id1 TYPE bigserial;   ...I receive the error...     ERROR:  type "bigserial" does not exist   How do I properly change the primary key of a table if a column is already set to be the primary key?  Do I have to convert the original primary key type to numeric before changing the primary key?  Do I have to do something different when setting the primary key if I have to delete the original primary key first or change it's type?

So I'm currently creating some SQL to read through the postgres (9.1) catalogs to build table definitions. However, I am encountering a problem with SERIAL/BIGSERIAL data types.  Example:  CREATE TABLE cruft.temp ( id BIGSERIAL PRIMARY KEY ); SELECT * FROM information_schema.columns WHERE table_schema='cruft' AND table_name='temp'; "db","cruft","temp","id",1,"nextval('cruft.temp_id_seq'::regclass)","NO","bigint",,,64,2,0,,,,,,,,,,,,,"db","pg_catalog","int8",,,,,"1","NO","NO",,,,,,,"NEVER",,"YES"   It gives me database name (db), schema name (cruft), table name (temp), column name (id), default value (nextval( ... )), and data type (bigint and int8 .. NOT bigserial) ... I realize that I could just check to see if the default value was a sequence - but I don't believe that would be 100% accurate since I could manually create a sequence and create a non serial column where the default value was that sequence.  Does anyone have a suggestion for how I might accomplish this? Anything other than checking the default value for a nextval(*_seq)?  Edited for SQL solution added here in case of TL;DR or new users unfamiliar with the pg_catalog:  with sequences as (   select oid, relname as sequencename from pg_class where relkind = 'S' ) select   sch.nspname as schemaname, tab.relname as tablename, col.attname as columnname, col.attnum as columnnumber, seqs.sequencename from pg_attribute col join pg_class tab on col.attrelid = tab.oid join pg_namespace sch on tab.relnamespace = sch.oid left join pg_attrdef def on tab.oid = def.adrelid and col.attnum = def.adnum left join pg_depend deps on def.oid = deps.objid and deps.deptype = 'n' left join sequences seqs on deps.refobjid = seqs.oid where sch.nspname != 'information_schema' and sch.nspname not like 'pg_%' -- won't work if you have user schemas matching pg_   and col.attnum > 0   and seqs.sequencename is not null -- TO ONLY VIEW SERIAL/BIGSERIAL COLUMNS order by sch.nspname, tab.relname, col.attnum;


I have 250Gb HDD that is splitted between Ubuntu (20 Gb) and Windows 8.1 (230Gb).  Now I need to have more size for Ubuntu. I suppose scenario in my case should look like:   Make Windows partition smaller. Resize Linux partition to make it bigger.   Unfortunately I have no idea how to make these steps, but I think both of them should be possible to make from Ubuntu side.  Would you help me to solve this task?  UPD  I started gparted from Ubuntu booted from live CD.     I took part of windows partition and now I would like to copy whole sda3 to unallocated place. In this case I expect to have additional space after deleting original sda3 at the bottom of Linux partition. I think that will allow me to expand newly created Linux partition. From gparted menu I can only copy sda5 - for others copy menu is not active. Probably that is because sda3 and sda5 are with key image that I think means 'locked'. How to solve problem and copy locked partitions.

I've Win8/Ubuntu Dual boot. I already have 4 partition so i cannot create a new partition and mount it elsewhere. So, this () question did not help.  Here's a screen shot of my Gparted (run on Ubuntu Live)   How can I extend /dev/sda6  so that  i can make use of unallocated space ?  (w/o failing my current grub)


When I try to use Fetch as Google on pages for my website, the Googlebot fetches it partially, and when I check the crawl log, tells me that some of my assets are temporarily unreachable:      What should I do about this?

The page I'm trying to fetch is public.  The server logs show no request.  Google reports that any page on my site is "Temporarily unreachable". It won't even fetch the verification file, a static HTML file that was successfully used to verify with the webmaster tool application itself.   My site is running on the .  What is causing this?


What is correct:     My name has five letters   or     My name have five letters   I do not know which one is correct.

Can anyone tell me where we have to use "has" and where we have to use "have"? I am confused.  Can anyone explain me in a simple way?


So I am having trouble proving that if  $$ K= \{0\} \cup \left\{\frac1n: n = 1,2,\ldots\right\} \cup \left\{\frac1n + \frac1m : n=m,m+1,\ldots; m=1,2,\ldots \right\} $$  then 0 and the points $\frac1m$ are the only limit points of $K$. Cooke proves this by saying that:  Since $x\geq0$ for all $x \in K$ and for any positive number $\epsilon$ there is only a finite set of number s in $K$ larger than $1+\epsilon$, it is clear that no negative number and no number larger than 1 can be a limit point of K. Hence we need only consider positive numbers $x$ satisfying $0\lt x \lt 1 $. If $x$ is such a number and $x$ is not one of the points $\frac1m$, let $p$ be such that $\frac1{1+p} \lt x \lt \frac1\epsilon$, and let $\epsilon=\frac12\min(x-\frac1{p+1},\frac1p - x)$.  The intersection of the set $K$ with the interval $(x-\epsilon,x+\epsilon)$ is contained in the set of points  $$ \left\{\frac1{p+1}+\frac1k:p+1\le k \lt \frac1\epsilon\right\} \cup \left\{\frac1m+\frac1n:m\le n \lt \frac1{p+1} - \frac1{p+2}; m=p+2, \ldots,2p+2\right\}, $$  which is a finite set. Therefore $x$ cannot be a limit point of $K$.  I understand why you take $\epsilon$ to be half of $\min$, and the using that every neighborhood around a limit point contains infinitely many points, but I don't understand why the intersection of $K$ with the interval $(x-\epsilon,x+\epsilon)$ is contained in the set mentioned above, and why it is finite. Is it a typo? $$ \left\{\frac1m+\frac1n:m\le n \lt \frac1{p+1} - \frac1{p+2}; m=p+2, \ldots,2p+2\right\}, $$  here I think n is meant to be an integer in order for the finite argument to work, but how can be  $$ n \lt \frac1{p+1} - \frac1{p+2}\:\:? $$ Here is how I fixed the typo to work: if  $$ \left\{\frac1m+\frac1n:m\le n \lt \frac1{p+1} - \frac1{p+2}; m=p+2, \ldots,2p+2\right\} $$  is changed to  $$ \left\{\frac1m+\frac1n: m\le n, \frac1n \ge \frac1{p+1} - \frac1{p+2}; m=p+2, \ldots,2p+2, n \in N\right\}, $$  then $m\le n \le (p+1)(p+2)$ which would be finite. Am  I understanding this argument correctly? I think there is a typo or error in Cooke's solution, as the original version can't seem to work.  I know there are other constructions that can be understood easily, but I would like to understand Cooke's proof of $\frac1n + \frac1m$ and see if there are are any typos or errors in the original solution. Thanks a lot.

I need to find limit points of the set $\{  \frac{1}{n} +\frac{1}{m} \mid n, m = 1,2,3,\dots \}$.  My try :   If both $m$ and $n$ tend to very large values say $\infty$ then the value of $\{ \frac{1}{n} +\frac{1}{m} \}$ tends to $0$, and if only one of $m$ or $n$ tends to very large values, then the set $\{ \frac{1}{n} \mid n=1,2,3,\dots\} $ acts as limit points.   So is it true that a set of limit points is $\{0\}$ $\cup$  $\{\frac{1}{k} \mid k=1,2,3,\dots \}$?  How should I write this proof rigorously?


I'm pretty sure that the answer isn't that difficult, but I'm not sure where to look for it.  I would like to attach a jQuery event handler when a div gets created. For example:  $('#somediv').click(function(){     //do something });   But... #somediv doesn't exist. Because of some AJAX loads it will. So what I need is something like.  $('#somediv').whenImcreated(function(){     $(this).click(function(){         //do something     }); });

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.


In the sentences:   He tries going to the city He tries to go to the city   Are there differences in meaning? If no, why not?

I tried to open the door. I tried opening the door   We can use both infinitive and gerund with verb "try" as used in above sentences. Does it change the meaning of the  sentence if use gerund or infinitive?.(here i don't know if the meaning of sentences is changed.)     The same confusion arise in these two sentences.  1.I stopped seeing him. 2. I stopped to see him.(But in case of these two sentence i know the meaning is changed but don't know exactly what the change is).


I'm working on creating a connection between a Java program and a MySQL database. The only thing not included in the code is the ConnectionValue class which pulls all the relevant connection data needed for each specific connection/query. This class does work. When I run the code, it creates a NullPointerException. import javax.sql.rowset.CachedRowSet; import java.sql.*;  public class SQLCommands {     private Connection connection;     private PreparedStatement preparedStatement;     private CachedRowSet cachedRowSet;      public void createConnection(ConnectionValues connectionValues) throws SQLException {         connection=DriverManager.getConnection(connectionValues.urlString,connectionValues.userName,connectionValues.password);     }      public void createCachedRowSet(ConnectionValues connectionValues, String query) throws SQLException {         cachedRowSet.setUsername(connectionValues.userName);         cachedRowSet.setPassword(connectionValues.password);         cachedRowSet.setUrl(connectionValues.urlString);         cachedRowSet.setCommand(query);     }      public void createPreparedStatement(CachedRowSet cachedRowSet) throws SQLException {         preparedStatement=connection.prepareStatement(cachedRowSet.getCommand());     }      public CachedRowSet readDataBase(int dbID, String query) throws Exception {         ConnectionValues connectionValues=new ConnectionValues(dbID);         createConnection(connectionValues);         System.out.println(connectionValues.urlString+"\n"+connectionValues.password+"\n"+connectionValues.userName);         createCachedRowSet(connectionValues,query);         createPreparedStatement(cachedRowSet);          try {             preparedStatement.execute();             return cachedRowSet;         }catch (Exception e){             System.err.print("ERROR!\nFunction: readDataBase\nClass: SQLCommands\n");             System.err.print(e);         }finally {             connection.close();         }         return cachedRowSet;     } }  The stack trace reports that the error is occurring at line 14. Which is the cachedRowSet.setUsername(connectionValues.userName); in the function createCachedRowSet. The data is correct, I have a test print method that prints the relevant information in the code and it not only pulls the same data without error but also prints the correct information. So I'm not sure what is wrong. Knowing me, it's probably obvious but I can't see it.

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 have created some cool favorite color gradients in the node editor.  i want to save all of these so i can use them again later , also for use in other projects , but where is the save button ?  on the picture you can see the gradient color , but there is no save button near around it . how do i do this ?  to be more specific , in one project i want to be able to choose from hundreds of cool gradients that i have created in blender and have saved these , for later use.  so when i work on a project and i don't like a gradient that i have used , i can go to a list where i have saved my selfmade gradients , and just pick out 1 of them , and than check out a next one , until i find one that i like. just about the same idea how you would do with choosing a right jpg for your texture, you have a folder somewhere , where you saved all your favourite jpgs , where you can choose from and check out which one fits best to your object. image now you can only choose from one JPG texture,  or in the worst case you need to hustle around a lot to try to import a second jpg etc etc .  that is how i feel now with the gradient question . there should be a save and load button somewhere to enjoy working with gradients on your object , just like you would enjoy cool JPG textures on your object. it seems no problem to choose from thousands of cool jpgs. just by one click , and keep going searching until you find your best one that fits here on your object.  if i can't save my cool self made gradients , i have no other choice then wait for an update for this , hopefully soon , maybe did i miss here something , but i have seen no option to load and save cool selfmade gradients. anyone ?  this question has been marked as a double, but it is different in my opinion.  Can I make a custom node from a group and have that available in other projects? that was the other question that has been compared to my question. it is different , because i am not asking for a node combination to save it and use it elsewhere.  my question is how to save a specific part inside the node it self. how to save a favorite selfmade gradient collor ramp. and have these gradients saved in a folder with maybe 50 other different color combinations. that is not the same like how to make a custom node from a group.  because i don't want to make a new node for every color change that i wil make. so there is the difference. so far i only see answer where i can change my gradient when i create new nodes , but this is not gonna be a good solution .  imagine you have to create a new node for every jpg texture that you will import ? i mean in a situation when you scroll through your list ofjpgs and want to test all of them to pick out the best texture. it is easy and quick , with just a click , and the same workaround should be for changing a rollorramp, and go through your list of gradients , where you can choose your favourites to see if it fits your object in your project.  that is not the same thing as creating custom nodes to use in other projects question .  blender has been around for a long time now , it should be there. it is so standard for an app working with gradients.   i am afraid blender is still in the stoneage regards to some specific simple basic functions that should be already updated long time ago .  lets just hope, it will happen someday.  but if i missed something , and someone can point me to an answer i would be happy to hear it .    i am not looking for a complete node combination export , like the other question. and than re-use ,  for each tiny color change that i make,   i need to create a list in a folder next to my jpg texture folders, where i can keep all my favorite gradient colorramp patches and choose them as easy as i choose a new jpg texture.  i guess the answer is No , but it should be yes . anyone agree ?

I've found some neat combinations of nodes to create certain effects, so I'd like to make them a group and then have that node available on my list of available nodes, even when I reload the startup file. How would I do that?


I need to create folder such as  /.well-known/pki-validation/ in drive c .I have a VPS and for verify SSL certification must create folder with .well-known name and inside it folder with pki-validation name.  how to do it?

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


Is it need or needs?        Highway 68 and Robinson Canyon Road need your support.   Highway 68 and Robinson Canyon Road needs your support.      I voted needs.

Can anyone tell me if I should use inspire or inspires in this phrase?     An extraordinary leader whose vision, values, integrity and boundless curiosity inspires all who follow in his footsteps.


I had lots of reputation points on some Stack Exchange sites, and my account just got deleted, without me knowing.  Can I restore it, and if I can, how?

Is it possible to recover an account that was explicitly deleted by a Stack Exchange team member (as opposed to an elected diamond moderator)? That is, the kind of account where the user requested the deletion, or committed atrocities against the community?


I've looked through many threads on how to do this but and applied the things on there but still struggling to do this, the text does get centered but the actual elements still stay on the left of the screen.  The form:

                 <form id="my-form" method="post">

                         <input asp-for="OrderEmail" />
                     <button id="update-profile-button" type="submit" class="btn btn-primary">Send</button>                 </form>

   CSS:  .formdiv {     display: block;     text-align: center; }  #my-form {     display: inline-block;     margin-left: auto;     margin-right: auto;     text-align: left; }

How can I horizontally center a
 within another
 using CSS?

Foo foo


I tried the curse of binding, but that only prevented armor from being taken off once put on.  I need this because I have a class system on my server and I don't want players giving each other items.

Is there a way to disallow players to remove a certain item from a certain inventory slot. What I have tried is to add a curse of binding to the item as following:  /replaceitem entity @p slot.hotbar.8 wool 1 0 {ench:[{id:10,lvl:1}]}   But as you may know, this only works for armor slots, not other inventory slots.


Currently, the only way to determine the status of a flag is to look at your flagging history in your profile. This is a time consuming process, as the flags are ordered by the time the flag was issued. If you wish to see only flags that have been disputed or declined, you need to go through multiple pages of flags.  In the UI, I propose making the information the right, in the flagging history, links that filters the flags to the appropriate flags.  By making these two options links, I could quickly see which flags were declined or disputed.

Here is my flagging summary on SU:   Your flagging history   32 posts flagged as requiring moderator attention    2 are waiting for review   3 were marked valid   1 were marked invalid   (older flags were not recorded valid/invalid)    2 posts marked as spam    It is too complicated to look for invalid flags. Would it be possible to make filters on the top of the page (like on favorites for example) with:  By date, By type (off-topic, spam, dupes), By status (accepted, pending, rejected)  It would make it easier for reviewers to check their flagging and eventually know what to improve on.  Or is there another easy way to audit this?


I know that the ROC curve plots true positives vs false positives, but does it have any other interpretation, or is it just an arbitrary performance measure? Also, in the case of very unbalanced response variable's classes (say 10 to 1) is an AUC of 0.5 still a bad thing?

Searched high and low and have not been able to find out what AUC, as in related to prediction, stands for or means.


I have just Installed GNOME Shell on Ubuntu 16.04.  There a area in layout I don't know what is it name exactly. This area in below picture (Area 1):    I think some Icon in area 1 should be in area 2 (taskbar) and I already install a test Ubuntu with Gnome shell in another PC, it exactly in taskbar.  My question is how to disable area 1 and how to move icon in area 1 to area 2 (taskbar)?

The legacy tray (see the screenshot below) will be removed in GNOME 3.26. I want to wean myself off it before the change arrives in Ubuntu (17.10 or 18.04).    Can I disable the legacy tray in Ubuntu GNOME 17.04?


What does "The" emphasize in the phrase "The UK has approved a COVID vaccine"? It seems to mean that "UK has approved a COVID vaccine" is itself OK. I am not very sure.  The UK has approved a COVID vaccine — here’s what scientists now want to know The Pfizer–BioNTech vaccine has passed safety and efficacy tests — but scientists still have many questions about how this and other vaccines will perform as they’re rolled out to millions of people. Source:    Dec.3, 2020

I have been taught that it's grammatically proper to use the before countries like "Sudan and Yemen" but I was never given a reason (if there exists any, of course) when I asked why, except for "it is one of those ambiguous parts of English language that we – as non-native speakers – should just accept without trying to look for a reason". Now, I'd like to know if there is any answer to this "why" or I should keep on believing that there are no hard and fast rules when it comes to questions like these.


I found this asked by someone 2 years ago and it worked great.   sed 's/$/      /' SUDIP1>SUDIP2   But I have found if I add white space to every line, it messes up later sed commands. I'd like to search for EQU:  EQU       888-111-2222   T   1234   then move down one line and add the extra spaces at the end of these following types of lines and leaving alone all other lines in between.  888-111-2222   T   1234(6 white spaces here)   Several people in this site have marked my question as a duplicate, but it is not. The question they point out was searching for a string after the letter C appears, and then replacing it with a different string. My question is different because it involves adding white space to the end of the line and not changing the text on the line. Please don't be so quick to call a question a duplication. It affects people's reputation and points!

I have the following text:    A   Hello   world   B   Hello   world   C   Hello   world   I know that I can replace Hello by Hi using sed:  sed 's/Hello/Hi/g' -i test   but this replace each Hello with Hi:    A   Hi   world   B   Hi   world   C   Hi   world   what I really want is to replace only the Hello after B:    A   Hello   world   B   Hi   world   C   Hello   world   so I have tried this:  sed 's/"B\nHello"/"B\nHi"/g' -i test   but nothing happened, How can I do this?  Note: There are some white-spaces on the beginning of each line of the file.


I don't really understand the proof for this. It says "consider a set $A=\{ax+by\mid x,y\in \mathbb{Z}\}$. Then let the smallest element of of $A$ be $d$.Then $d=ak+bn, k,n\in Z$. Show $d|a$ and $d|b$ so that $d$ is the common divisor. Then show that if $m|a$ and $m|b$ then $m \le d$."  I don't really know how if $d=ak+bn, k,n\in Z$ then $d$ divides $a$ and $b$ also I know how $m$ dividing $a$ and $b$ makes it less than $d$. I can understand it being equal but not less than.

Here is my proof of $\gcd(a,b)=ax+by$ for $a, b, x, y \in \mathbb{Z}$. Am I doing something wrong? Are there easier proofs?  $a,b \in \mathbb{Z}, g=\gcd(a,b)$ and suppose $g \neq ax + by$. Let $c$ be a common divisor of $a$ and $b$. Then   $$\forall x', y' \in \mathbb{Z}: c | ax' + by'\Longrightarrow\exists q_1, q_2 \in \mathbb{Z}\,\,\, s.t.\,\,\, c q_1 = ax' + by'\,\,,\,\,cq_2 = g$$   So   $$gcd(a, b)=g=c q_2 = c q_1 \frac{q_2}{q_1} = \left(\frac{q_2}{q_1}x'\right)a + \left(\frac{q_2}{q_1}y'\right)b$$ So if we have $q_1|q_2$ then we found $\gcd(a,b)=ax'+by'$ for all $x', y' \in \mathbb{Z}$.  Now   $$\frac{q_1}{q_2}=\frac{c q_1}{c q_2} = \frac{ax'+by'}{g}$$ but $g|a$ and $g|b$ so $\exists q_3 \in \mathbb{Z}: \frac{q_1}{q_2}=q_3 \Rightarrow q_1=q_2 q_3 \Rightarrow q_1 | q_2\,$ . QED.


I am learning VC++. I am wondering why i can't see full value {99,20,14,80} in "printElements3". I could see only "arr" 0xmemory address and following by "99", the first value.  Does this mean I have to pass by Reference in order to see the full array values?    Appreciate someone can help me understand this. below is my code.   #include <iostream>   void printElements3(int *arr, int size)  {    for (int i= 0 ; i < size; ++i)   {     std::cout << arr[i] << std::endl;   }  }    int main()   {      int arr[4]={ 99, 20, 14, 80 };      printElements3(arr,4);      return 0;   }

If you have a statically allocated array, the Visual Studio debugger can easily display all of the array elements.  However, if you have an array allocated dynamically and pointed to by a pointer, it will only display the first element of the array when you click the + to expand it.  Is there an easy way to tell the debugger, show me this data as an array of type Foo and size X?


Like many people, I've been doing a good bit of sourdough baking during the quarantine and, like many people, I am in a state of near-constant panic that I have to use up the starter that is constantly growing! I tend to bake breads but am branching out into enriched doughs and desserts. I am curious if there are any hard and fast rules, ratios, or techniques to how to take a yeast recipe (bread, pastry, cake, whatever) and make it with a sourdough levain instead?

I know that there are formulas for switching from and to sourdough and or preferments, but even though my library grows I haven't found such a formula. I have a general idea of the fact that a sourdough bread usually requires around 40% of sourdough and a regular yeasted bread requires something from .1% to a stunning value of 2% of yeast. Other that this general idea I have not found anything in the literature I have at home since most of the books usually treat these subjects separately.  Is there a formula that transforms a recipe from fresh yeast to sourdough and vice versa? What about preferments?  EDIT: The question is under the assumption that a started is intended as a 100% hytration one, if you know of a conversion for a 50% hydration starter or pasta madre feel free to pitch in.


Original: os.system("echo \u001b[31mU have Been Hacked"). And I have tried print(u""), print() but nothing works and I don't want to install any libraries so can someone help me?

How can I output colored text to the terminal in Python?


This is a homework question I can't figure out.   Find the output of:      public static void main(String[] args) {         Object o = new A();         A a2 = new B();         B b = new B();         a2.report(b);     }  public class A {     public void report(Object o) {         System.out.println("Object");     }      public void report(A a) {         System.out.println("A");     } }  public class B extends A {     public void report(A a) {         System.out.println("A again");     }      public void report(B b) {         System.out.println("B");     } }   When I tried to work the solution, I first tried to figure out what would happen at the compile time. I thought that a2 would use class A and report b which is not defined in class A and therefore would default to report object. This would give the solution of "Object". However, this is not correct. I can't figure out how this method would report "A" when the function is should be calling report(B b).

Yesterday I had a two-hour technical phone interview (which I passed, woohoo!), but I completely muffed up the following question regarding dynamic binding in Java.  And it's doubly puzzling because I used to teach this concept to undergraduates when I was a TA a few years ago, so the prospect that I gave them misinformation is a little disturbing...  Here's the problem I was given:  /* What is the output of the following program? */  public class Test {    public boolean equals( Test other ) {     System.out.println( "Inside of Test.equals" );     return false;   }    public static void main( String [] args ) {     Object t1 = new Test();     Object t2 = new Test();     Test t3 = new Test();     Object o1 = new Object();      int count = 0;     System.out.println( count++ );// prints 0     t1.equals( t2 ) ;     System.out.println( count++ );// prints 1     t1.equals( t3 );     System.out.println( count++ );// prints 2     t3.equals( o1 );     System.out.println( count++ );// prints 3     t3.equals(t3);     System.out.println( count++ );// prints 4     t3.equals(t2);   } }   I asserted that the output should have been two separate print statements from within the overridden equals() method: at t1.equals(t3) and t3.equals(t3).  The latter case is obvious enough, and with the former case, even though t1 has a reference of type Object, it is instantiated as type Test, so dynamic binding should call the overridden form of the method.  Apparently not.  My interviewer encouraged me to run the program myself, and lo and behold, there was only a single output from the overridden method: at the line t3.equals(t3).  My question then is, why?  As I mentioned already, even though t1 is a reference of type Object (so static binding would invoke Object's equals() method), dynamic binding should take care of invoking the most specific version of the method based on the instantiated type of the reference.  What am I missing?


Recently I checked my Apache domlog and noticed the following attack:  POST /index.php?page=shop.item_details&cat_id=150&flp=flp_images.tpl&prod_id=9191&vmcchk=1&option=com_vm&Itemid=999999.9)+%2f**%2fuNiOn%2f**%2faLl+%2f**%2fsElEcT+0x393133359144353632312e39,0x393133358134383632322e39...   which is an obvious attempt at SQL injection.  This proceeded to occur around 3000 times from the same IP.  Now I could blacklist this IP but are there some better rules to apply to prevent things like this from occuring server side?  This server is running CentOS 6.4

My web server periodically comes under attack, and I get a bunch of requests that look like  /my.page?union+all+select+0x31303235343830303536%2C0x31303235343830303536%2C0x31303235343830303536--  Are there simple command line tools to decode this?


I know there are tons of this question on here already but none of them seem to have solved my issue.  I've done a clean install of 14.04 Server and install Unity (I know, boss asked for it so he can do some things himself) with this;  sudo apt-get install --no-install-recommends ubuntu-desktop   He uses file.sh to execute a special program which works flawlessly from command line but it won't run from the GUI. Boss wants GUI so I need to figure this out.  I've set it executable from the properties window, set it executable from CLI with chmod +x, run  gconftool-2 --set /schemas/apps/nautilus/preferences/execute_text_activation --type=string ask   Tried creating a script.desktop file but get a generic execution error I haven't been able to resolve yet.  I don't have to use Unity so if XFCE or Gnome resolves the problem I'll do it. If anyone has any more ideas I would very grateful to hear them!

When I double-click on a script in Nautilus to run it, the script just opens in my text editor with no option to run it. Using Nautilus, how do I run executable text files and/or scripts?


I have few events in my Calendar that are scheduled weekly at the same time with the same name.  Because of some issues with syncing between Outlook/Hotmail Calendar/Google Calendar these events are no longer repeated events in my GCal but many independent events. Therefore I can't delete a single event using "All following" option. I wan't to delete all the events in series.  How can I solve this problem?

How to delete all events on many dates all at once but not the whole Calendar in Google Calendar? I tried to click on a date that got an event to delete and dragged my mouse to 2 days after that date, but then I always see "create an Event". I thought I could press backspace or delete to delete all those events.  What I did so far = deleting event one by one :(


I created my custom Beamer template to include background graphics, logo, etc. I also changed the colour of texts, bullet points to match the images colours.  The problem I have is that the circles in the itemize environment are displayed as squares, but when I copy and paste the symbol in a text editor they are really circles (\textbullet in LaTeX).  I have the theme file plus images, these are the definitions.   beamerthememytheme.sty  \mode<presentation>  % Requirement \RequirePackage{tikz} \RequirePackage{fontspec} \RequirePackage{graphicx}  % Set graphics path \graphicspath{ {images/} }  % Set main font for the presentation % Note: the following fonts need to be installed \setmainfont{Open Sans} \setmonofont{Source Code Pro}  % tikz settings \usetikzlibrary{positioning}  % Settings %\useinnertheme{mytheme} %\useoutertheme{mytheme} %\usecolortheme{mytheme}  % here the relevant content from theme files (the ones commented above)  \definecolor{titlecolor}{RGB}{31,153,215} \definecolor{subtitlecolor}{RGB}{163,162,162} \definecolor{listscolor}{RGB}{31,153,215}  % Settings \setbeamercolor*{title page header}{fg=titlecolor} \setbeamercolor*{subtitle}{fg=subtitlecolor} \setbeamercolor*{author}{fg=black} \setbeamercolor*{date}{fg=black}  \setbeamercolor*{itemize item}{fg=listscolor, bg=white} \setbeamercolor*{itemize subitem}{fg=listscolor, bg=white} \setbeamercolor*{itemize subsubitem}{fg=listscolor, bg=white}  \setbeamercolor*{enumerate item}{fg=listscolor, bg=white} \setbeamercolor*{enumerate subitem}{fg=listscolor, bg=white} \setbeamercolor*{enumerate subsubitem}{fg=listscolor, bg=white}  % end content  \setbeamertemplate{itemize items}[circle] \setbeamertemplate{enumerate items}[default] \setbeamertemplate{navigation symbols}{} \setbeamertemplate{blocks}[rounded][shadow=false]  \mode<all>    Test.tex  \documentclass[aspectratio=1610, 8pt]{beamer} \usetheme{mytheme}  \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb}  \setbeamerfont{title}{size=\huge}  \author{Author} \title{Title} \subtitle{\small{Subtitle}}  \setbeamertemplate{itemize items}[circle] \setbeamertemplate{enumerate items}[default] \setbeamertemplate{navigation symbols}{} \setbeamertemplate{blocks}[rounded][shadow=false]  \begin{document}  \begin{frame} \titlepage \end{frame}  %\begin{frame} %\tableofcontents %\end{frame}  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%                    SLIDE                    %% \begin{frame}{Slide1}  Some text here...  \begin{itemize}     \item Item 1     \begin{itemize}         \item Sub item 1         \item Sub item 2     \end{itemize}     \item Item 2     \item Item 3 \end{itemize}  \end{frame}   \end{document}    And in the attached image there is the result of the compilation with XeLaTeX (I use custom fonts)    Does anyone has any idea how to fix this issue?  Note: if I use one of the default themes it works and displays the circles correctly.  Thanks.

This code:  \documentclass[10pt]{beamer} \setbeamertemplate{itemize item}[circle] \setbeamertemplate{itemize subitem}[triangle] \setbeamertemplate{itemize subsubitem}[square]   \begin{document} \begin{frame} \begin{itemize} \item first level     \begin{itemize}     \item second level         \begin{itemize}         \item third level         \end{itemize}     \end{itemize} \end{itemize} \end{frame} \end{document}    produces this output:    I expected the symbol of the first level item to be a circle, not a square. Is there an error in my code? The log file was too long to include in the question, so I .


I am playing a level 10 alchemist and I know that I can create poisons, as well as put them on weapons. However, there is a poison type that is inhaled and is airborne. After I read how it works, I searched "holding your breath", though all the sites show about holding your breath is about holding your breath in water and do not show how to calcuate the "fifty fifty" chance each round. So i looked on google and a lot of other sites, but didn't find an answer for this.   How do you calcuate the "fifty fifty" chance each round? How much rounds can a creature hold it's breath?

The  read as follows (emphasis mine):  Suffocation A character who has no air to breathe can hold her breath for 2 rounds per point of Constitution. [...] After this period of time, the character must make a DC 10 Constitution check in order to continue holding her breath. The check must be repeated each round, with the DC increasing by +1 for each previous success. When the character fails one of these Constitution checks, she begins to suffocate. In the first round, she falls unconscious (0 hit points). In the following round, she drops to –1 hit points and is dying. In the third round, she suffocates.  These rules are clear for when a character simply has no air to breath, such as while being strangled or underwater. But what about a character choosing to hold their breath? For example, a PC enters a room with an airborne poison and begins to hold his breath. After the number of rounds he can safely hold his breath expires, he begins to make the requisite Constitution checks. What happens on the character's first failed save? Does he...  ...fall unconscious and continue to suffocate, not breathing? ...fall unconscious and begin to breath, no longer suffocating but inhaling the poison? ...remain conscious but breath involuntarily, inhaling the poison?


How can we say that $\exp(0)=1$ when $\exp(0)=\sum_{n=0}^\infty \frac{0^n}{n!}=0^0+0+0+...$ which doesn't seem to have a defined value. Obviously $\lim_{x\to 0}\exp(x)=1$ and $e^0=1$ but I don't think the former proves that $\exp$ doesn't have a gap and the latter seems to me like an example of the tail wagging the dog.

When I first studied power series in high school, the teacher gave the following general definition:  \begin{equation} f(x)=\sum_{n=0}^{\infty}a_n (x-x_0)^n \end{equation}  He then proceeded to explain that when both $x=0$ and $x_0 =0$, the first term of the power series is defined to simply be $a_0$. How does one justify $0^0 = 1$ in this case?


I would like to check which driver is being used by the kernel for the eth0 interface. Is lspci eth0 the correct command ?

If my target has one device connected and many drivers for that device loaded, how can I understand what device is using which driver?


Is there any reason that the Facets are rendering in large dark patches,  Is it to do with the lighting, the facet pattern, the booleans.   Been having this problem for a while so any advice is appreciated.  File attached.    EXPANDED PREVIOUSLY ASKED QUESTION

Does anybody know why there are dark patches in the corners of the pear shaped diamonds in my renders? I have attached the node set up of the diamonds (which i followed from a tutorial) incase there is anything wrong in there, and also the lighting setup for the same reasons.  I have tried spinning the ring and no matter which angle it is rendered at there is still darker patches, and i have also used a boolean to make sure there are no intersecting pieces of 'metal mesh' on the 'diamond mesh'.   Is it just a lack of light behind the claws and the shadows that are cast causing the diamond to reflect the darkness or are there other problems?


I use \033[1;34m for light blue. I am using Debian and Putty and it works for me.  However, I've heard that it may not work for all users (using different distros and terminals). Is that true? Do they have different codes for light colors?  I want to add an option to the configuration file of my program to display light colors instead of regular ones.

I have a problem with colors in my terminal emulator. I am using LXTerminal as my terminal emulator and LXDE as my desktop environment.  The following command is supposed to print red text on grey background:  printf "\n\033[1;31;40m"hello"\033[00m\n\n"   but that does not work. The grey background is missing (red text is OK). On my older machine (Gnome/Gnome Terminal) everything works fine  I have tried installing several other terminal emulators, but the problem persists. I am not even sure whether this issue is related to terminal emulator, or something else. In Console (CTRL+ALT+F1) the background grey color does not work on either machine)  This problem is limited to grey background only. All other colors work OK, for instance the following prints red text on green background.  printf "\n\033[1;31;42m"hello"\033[00m\n\n"   I would appreciate any help. I don't even know where to start troubleshooting.


The energy scale of  is around $160$ GeV. But the LHC has a centre of mass energy of $7$ TeV... so do they see processes involving the $W^1, W^2, W^3$ and $B$ fields, before spontaneous symmetry breaking and mixing into the well-know massive gauge bosons + photon?

Spontaneous electroweak symmetry breaking (i.e. $SU(2)\times U(1)\to U(1)_{em}$ ) is at scale about 100 Gev. So, for , gauge bosons $Z$ & $W$ have masses about 100 GeV. But before this spontaneous symmetry breaking ( i.e. Energy > 100 GeV) the symmetry $SU(2)\times U(1)$ is not broken, and therefore gauge bosons are massless.  The same thing happens when we go around energy about $10^{16}$ GeV, where we have the Grand Unification between electroweak and strong interactions, in some bigger group ($SU(5)$, $SO(10)$ or others). So theoretically we should find gauge bosons $X$ and $Y$ with masses about $10^{16}$ GeV after GUT symmetry breaks into the Standard Model gauge group $SU(3)\times SU(2)\times U(1)$, and we should find massless X and Y bosons at bigger energies (where GUT isn't broken).  So this is what happened in the early universe: when temperature decreased, spontaneous symmetry breaking happened and firstly $X$ & $Y$ gauge bosons obtained mass and finally $Z$ & $W$ bosons obtained mass.   Now, I ask: have I understood this correctly? In other words, if we make experiments at energy above the electroweak scale (100 GeV) we are where $SU(2)\times U(1)$ isn't broken and then we should (experimentally) find $SU(2)$ and $U(1)$ massless gauge bosons, i.e. $W^1$, $W^2$, $W^3$ and $B$ with zero mass? But this is strange, because if I remember well in LHC we have just make experiments at energy about 1 TeV, but we haven't discovered any massless gauge bosons.


I'm trying to have user input stored into a string variable and then that string is tested to determine which output to give. I thought this would not be a problem and I cannot understand what is wrong here. If I type in F22 or any of the other options as my user input, it gives me the else statement so clearly it's not storing the value the same way I think that it is. My code is below.  public static void main(String[] args){     aircraft(); } public static void aircraft(){     //Give info about aircraft of their choice.     airplane Boeing787 = new airplane();                       //From here to line 17 I'm just defining variables     airplane F22 = new airplane();     airplane Gulfstream_G650 = new airplane();     Boeing787.passengers = 250;     Boeing787.price = 120000000;     F22.passengers = 2;     F22.price = 138000000;     Gulfstream_G650.passengers = 19;     Gulfstream_G650.price = 65000000;                           //TO HERE! For variables!      System.out.println("What airplane do you want to know about? \nYou can select either: Boeing787, F22, or Gulstream_G650");     Scanner user_input = new Scanner(System.in);     String plane = user_input.next();     if (plane == "Boeing787"){         System.out.println("This aircraft costs " + Boeing787.price + " and holds up to " + Boeing787.passengers + " people.");     }     else if (plane == "F22"){         System.out.println("This aircraft costs " + F22.price + " and holds up to " + F22.passengers + " people.");     }     else if (plane == "Gulfstream_G650"){         System.out.println("This aircraft costs " + Gulfstream_G650.price + " and holds up to " + Gulfstream_G650.passengers + " people.");     }     else{         System.out.println("You must have spelled it wrong, please try again. Remember to use appropriate Caps.");         aircraft();     } }   and my airplane class is simply:  public class airplane{ int price; int passengers;}   I prefer an explanation over a fix. I'm a beginner programmer so I suspect it's not a crazy mistake. My guess is something is wrong either where I take in the input or on the following line where it says "String plane = user_input.next();"

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?


Prove that the following limit is 0  $\lim\limits_{n\to\infty} \frac{1}{n} \sum_{k=1}^{n}{\frac{1}{k}}$  Please I don't know how to do it :S. The harmonic series diverges thus it requires some special trick

Show that  $$\lim \frac{1}{n} \sum_{i=1}^n \frac{1}{i} =0 $$  I've proved that this sequence converges (it is bounded and decreasing). NOW, I need to find a sequence that is bigger than this one and goes to zero. Maybe something using geometric serie of 1/2  Thanks in advance!


trigger UpdateConOppDecs on Account (after update) {          List<Contact> UpdateConList= new List<contact>();     List<Opportunity> UpdateOppList= new List<Opportunity>();     set<ID> AccountIDSet= new set<ID>();          for(Account a: trigger.new){                  for(Contact con:[select id from contact where accountID=: a.Id])         {             con.Description=a.Description;             UpdateConList.add(con);         }         for(Opportunity opp:[select id from Opportunity  where accountID=: a.Id])         {             opp.Description=a.Description;             UpdateOppList.add(opp);         }     }     update UpdateOppList;     update UpdateConList; }  OR Trigger UpdatePhoneOppAccTrigger on Contact(after update){     Set<id> setAccId = new Set<id>();     List<Opportunity> oppNewList = New List<Opportunity>();     List<Account> accNewList = New List<Account>();     Map<id,String> mapContactPhone = New Map<id,String>();      for(contact c: Trigger.New){         if(c.AssistantPhone!=null && c.AssistantPhone!=Trigger.OldMap.get(c.id).AssistantPhone && c.accountid !=null ){             setAccId.add(c.accountid);         }          List<Account> acclist = [select id,phone,(Select id,phone__c from Opportunities) from Account where Id IN: setAccId];         if (acclist.size() > 0) {             for(Account acc: acclist){                 for(Opportunity opp: acc.Opportunities){                     acc.phone = c.AssistantPhone;                     opp.phone__c = c.AssistantPhone;                     accNewList.add(acc);                     oppNewList.add(opp);                 }             }         }     }     update oppNewList;     update accNewList; }  Both of them are used to update two object field at once, ignore the objects, just want to know which trigger has more effective logic. Thanks! :)

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, navigate to the  tag. This question and answer is owned by the community! If you can improve it and make it more useful, you're welcome to edit it. I have a collection of records, like a List<sObject> or the Trigger.new context variable. I need to query other records that are related to these records either directly or indirectly, and I want to use the related data to make further updates. When I write a query in a loop, like for (Account a : Trigger.new) {     Account parent = [SELECT Name FROM Account WHERE Id = :a.ParentId];     // ... }  I keep hitting Salesforce query limits, and I know this is not best practice. What can I do to avoid this problem and bulkify my code?


I read this book which I think is from the early 2000s. I don’t know what it is called, who wrote it, or who published it, so I’m hoping a kind soul can help me out.  There’s this extra-dimensional construct call “the moment” in which a single instant of time or all of time itself can be inhabited. Characters in the book discover how to access “the moment,” and then different groups fight to control it. Their incursions into “the moment” begin to harm the future, kind of like a butterfly effect.  Has anyone read this thing before?

I remember reading a book where people figured out time travel and when they entered "Time" they could swim through it, but it would cause ripples and change things.  They would take certain time zones and physical locations as their new currency, eventually there were wars in the ocean of time.  After a while there was a hardening of the ocean of time.  I also remember that they never went to the beginning for fear of erasing Humans completely.  Characters: No main Characters  Type: A narrative history (Sci-Fi)  I read this book probably close to 12 years ago (2003?)  What book is this?


I'm receiving a null point exception when attempting to write to a file. The error is coming from the line below.  outputWriter.write(animals[p].toString());   Im assuming its because im passing null with the array. The array is previously created and is filled with objects with different values.  Here is my write file:  public void writeAquatic() {     try     {          BufferedWriter outputWriter;         String fileName = "Output.txt";         outputWriter = new BufferedWriter(new FileWriter(fileName));         for(int p = 0; p < animals.length; p++)         {             outputWriter.write(animals[p].toString());             outputWriter.newLine();         }         outputWriter.flush();         outputWriter.close();     }     catch(IOException ex)     {         System.out.println(ex.getMessage());     }     catch(NullPointerException e)     {         System.out.println("Null Pointer Exception");     } }

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 work with QGIS and I tried to convert polygon into point. I need points all over the perimeter of the polygon. I saw several answers like:    but I didn't see an answer.

I want to convert polygons into points using QGIS.   I know how it's done in ArcGIS Desktop.


$query = "SELECT * FROM fruits ORDER BY id DESC LIMIT $start, $limit"; $result = $dbh->query($query);   Is there anyway to make that SELECT statement more secure using PDO? Secure as in from SQL injections anything and everything that is possible. Thanks.

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


In the 90s I remember seeing a sci-fi series. It was a teen show with young actors and I think it was Australian. I recall some kind of high-tech shower that removed hair dye because it considered it to be dirt/a contaminant in the girl's hair. I think time travel was involved. It was broadcast in the UK.

There was this cool tv show I used to watch as a kid (in the 1990's I think). It was about a world where water was extremely rare and people used to fight over it, however there was this person who had this large 3D polyhedron shaped device (big enough to fit a few people in it) that could synthesise water.  Now, this device was either a time travel device or could just make water (not sure but I remember some time travel aspect as they could either remember the world the way it was where water was plentiful or could travel back to it on occasion).  Anyway, would love to know if this rings any bells?????  It was on in the UK (but maybe the US too, not sure).


When capitalising a proper noun that has a “the” prefix, should the “the” be capitalised?  Eg:     “This puts the Union at risk”   or:     “This puts The Union at risk”

Consider a company called:     The Association of Examples Ltd.   When you refer to this company, should you have to capitalize "the" when it's mid-sentence and would have been used even if it wasn't in the name?   It looks odd to me:     In other news, The Association of Examples announced that...      Sarah is the founder of The Association of Examples and has...   But I imagine it's the correct way.  For the grammar-conscious, why or why not?    To give you context, I am asking also when branding ones own company like that. The Economist did it (as did ) and , but I can imagine it can cause confusion.


my question may sounds kind of stupid but I thought a lot about it. I've learned not to put forms into tables for several reasons like:  - responsive design issues  - even Bootstrap suggests to use divs  - use tables for real "table-things"  - don't design with tables  In my case I want to use a table because I want to make the form better to read and to use. I want to put labels in a left column and the input fields in a right column and align the left column right and the right column left so the labels are in the same line and close to each other. I explicit don't want to have them underneath the other because its harder to read. **With my solution the table-columns would automatically take the space they need. With twitter bootstrap for example I need to use classes like "col-xs-6" to say how width a column should be. Further sometimes all labels are kind of short so I don't need as much columns, sometimes some of them are very long so I need a lot more columns. But in my case I don't want do define this. It should happen automatically.  So my question is: Is it okay to use tables in forms in order to be okay with web standards and the state of the art? For me aligning  (left column right, right column left) is very important and not to use JavaScript. And if no is there an alternative?  [EDIT] I've put a graphic in here which explains my problem pretty foot. I have to say: I'm looking for a solution without javascript

I keep hearing that div tags should be used for layout purposes and not table tags. So does that also apply to form layout? I know a form layout is still a layout, but it seems like creating form layouts with divs requires more html and css. So with that in mind, should forms layouts use div tags instead?


Let's say investor A owns a certain stock and is looking to sell 10 shares with an ask price of $1.  Investor B owns the same stock and also wants to sell 10 shares at $1.  The market maker sets the price of the stock at $1.  A buyer comes along and makes a bid of $1 for 11 shares.  How does the transaction end up taking place in detail?  How does the market facilitate this transaction?  How many shares are investors A and B each left with?  Also, would the answer be the same if the buyer only wanted 10 shares (i.e. a single seller could fulfill the entire trade)  This question is not a duplicate of the one that was marked.  That question asks about orders filling.  My question is about an order that is certain to fill, but what actual trading takes place.  This is not addressed in the answer marked as a duplicate.  My specific question is about what each of the two SELLERS in my example will find in their brokerage account after this event.

When I place my trade order in the stock exchanges, I know the price matching happens and only when there is a buyer and seller at the same price a trade happens.   But how does the quantity matching happen? For example, if I want to buy 1000 shares at $100, but there is only one seller to sell 10 shares at $100, what happens then?


I'm writing a document in Spanish with LuaTeX, and using Biber and  BiblaTeX for the bibliography. The question is every entry appears as:  JL Schafer. «Multiple Imputation, o prime Statistical Methods in Medical Research 8». En: (1999). Andrew C Titman y Linda D Sharples. «Semi-Markov models with phase-type sojourn distributions.» En: Biometrics 66 (3 sep. de 2010).  I think that "En:" is quite ugly. It means "At:" in English, but I haven't seen it before in English documents. How can I remove it? My header contains this: \usepackage[maxbibnames=3,style=numeric,backend=biber,    url=false,doi=false, isbn=false]{biblatex}  \AtEveryBibitem{\clearfield{urlyear} \clearfield{urlmonth}    \clearfield{pages} \clearfield{eprint}}  And my document: \printbibliography[heading=bibintoc,title={BIBLIOGRAFÍA}]

How do I suppress the "In: " before the journaltitle? Like so:     In: Journal of Applied Physics


Say we have a group generated by $a, b$, with the relations $(ab)^2=a^3=b^5$ (note that these are not necessarily equal to the identity). How do I show that the group has $120$ elements? Without having orders given to any of the generators, why can't there be infinitely many elements?    This problem is from Stillwell's "Mathematics and its History," after Section 22.8. I'm first asked to show that adding the relation that all $3$ equal the identity gives the icosahedral group, isomorphic to $A_5$, and then to show that this implies the group without that relation has at least $60$ elements. Then, a parenthetical after that problem says "Harder: Show that it in fact has $120$ elements".

Given the group $G = \langle a, b, c : a^2 = b^3 = c^5 = abc\rangle$, I want to show that $H = G / \langle abc\rangle$ is a finite group.   I tried to find a canonical form for elements of $H$. That didn't work. Then I tried to find a finite normal subgroup of $H$ of finite index, but this didn't work either. I'd be grateful if someone could show me a correct method to solve this problem.


Looking at Ally bank (), a 12-month CD has the same APY as a savings account.  (9-month CDs are an even lower APY).  Money in a CD is locked up for 12-months, with a penalty for early withdrawal.  Money in a Savings can be withdrawn any time, but withdrawals are limited to 6 per statement cycle.  What would be the reason for choosing a CD over a Savings Account?  About the only reason I can think of is the interest rate in a CD is locked in, while it is variable (could go down) in a Savings.  What else am I missing?

One specific (popular online) bank is offering a 9 month 1.25% CD, while it's savings account is 1.90%.  There's no way I see interest rates tumbling in the next nine months, so why should I -- why should anyone -- get a 1.25% CD when savings accounts are paying 52% more interest?  (This question is not specific to this particular bank at this particular time.  It's about the general practice of buying low-rate CDs when savings accounts have a higher rate.)


I am a beginner in Spring Security, so I coded a controller with two methods like this :  @RestController public class EtudiantRestService {      @Autowired     private EtudiantReository etudiantReository;      @Secured(value = {"ROLE_ADMIN","ROLE_SCOLARITE"})     @RequestMapping(value = "/saveEtudiant",method = RequestMethod.GET)     private Etudiant saveEtudiant(Etudiant etudiant){         System.out.println(etudiant.getNom());         System.out.println(etudiant.getPrenom());         return etudiantReository.save(etudiant);     }      @Secured(value = {"ROLE_ADMIN","ROLE_SCOLARITE","ROLE_PROF","ROLE_ETUDIANT"})     @RequestMapping(value = "/etudiants")     public Page<Etudiant> listEtudiant(int page,int size){         return etudiantReository.findAll(new PageRequest(page,size));     } }   The configurations of spring security is :  @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(securedEnabled = true) public class SecurityConfig extends WebSecurityConfigurerAdapter {      @Autowired     public void globalConfig(AuthenticationManagerBuilder auth) throws Exception{         // Type d'authentification (Base de données, LDAP, Mémoire)         auth.inMemoryAuthentication()                 .withUser("admin").password("123456")                 .roles("ADMIN","PROF");         auth.inMemoryAuthentication()                 .withUser("prof").password("123456")                 .roles("PROF");         auth.inMemoryAuthentication()                 .withUser("etudiant1").password("123456")                 .roles("ETUDIANT");         auth.inMemoryAuthentication()                 .withUser("scolaritel").password("123456")                 .roles("SCOLARITE");     }      @Override     protected void configure(HttpSecurity http) throws Exception {         // Pattern builder         http             .csrf().disable()             .authorizeRequests()                 .anyRequest()                     .authenticated()                         .and()             .formLogin()                 .loginPage("/login")                 .permitAll()             .defaultSuccessUrl("/index.html")             .failureUrl("/error.html");     } }   Mon contrôleur fonctionne bien mais lorsque j'utilise la annotation @Secured et j'authentifier j'avais l'exception :  java.lang.NullPointerException: null     at com.upsys.sec.service.EtudiantRestService.saveEtudiant(EtudiantRestService.java:29) ~[classes/:na]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_102]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_102]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_102]     at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_102]     at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]     at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]     at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapt     ....

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?


Not actually too sure what to title this question. I'm attempting to match only whats between $[( and )] each time. However the regex I'm using is matching the first $[( and last )] in the entire string instead of each individual occurrence within a string. Each occurrence could have literally anything around it. The contents could be even as complex as $[(("$[username]").substr(1))] So the contents should be possible to be anything too. You can see a demo of this regex here:  and the attached screenshot.

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


My bike's chain broke, so I have to replace it now. The question is - how can I tell what size chain do I need to buy so it fits the bike? It's a 5 gear internal-hub bike.

After learning how to break a chain and reattach it, and also how to add and remove a master link, I find that I can now do much more in the way of maintenance at home. I'll no longer need to bring my bikes into the shop simply for a new chain... if I can only figure out how to identify what size chain I'll need to order.   Is there a simple way of telling what size and type of chain I'll need to order to replace the chain on a bike? Do I measure the chain links? Count links? Count gears on the cogs?   If it helps, some of my bikes' drivetrains have internal hubs, some have derailer gears.


How do I run another program from within my C program, I need to be able to write data into STDIN(while execution of program i have to provide input through stdin more than once) of the programed launched (and  read line by line from it's STDOUT)  I need the solution to work under Linux.  while going through net i found below code:  #include <sys/types.h> #include <unistd.h> #include <stdio.h>  void error(char *s); char *data = "Some input data\n";  main() {   int in[2], out[2], n, pid;   char buf[255];    /* In a pipe, xx[0] is for reading, xx[1] is for writing */   if (pipe(in) < 0) error("pipe in");   if (pipe(out) < 0) error("pipe out");    if ((pid=fork()) == 0) {     /* This is the child process */      /* Close stdin, stdout, stderr */     close(0);     close(1);     close(2);     /* make our pipes, our new stdin,stdout and stderr */     dup2(in[0],0);     dup2(out[1],1);     dup2(out[1],2);      /* Close the other ends of the pipes that the parent will use, because if      * we leave these open in the child, the child/parent will not get an EOF      * when the parent/child closes their end of the pipe.      */     close(in[1]);     close(out[0]);      /* Over-write the child process with the hexdump binary */     execl("/usr/bin/hexdump", "hexdump", "-C", (char *)NULL);     error("Could not exec hexdump");   }    printf("Spawned 'hexdump -C' as a child process at pid %d\n", pid);    /* This is the parent process */   /* Close the pipe ends that the child uses to read from / write to so    * the when we close the others, an EOF will be transmitted properly.    */   close(in[0]);   close(out[1]);    printf("<- %s", data);   /* Write some data to the childs input */   write(in[1], data, strlen(data));    /* Because of the small amount of data, the child may block unless we    * close it's input stream. This sends an EOF to the child on it's    * stdin.    */   close(in[1]);    /* Read back any output */   n = read(out[0], buf, 250);   buf[n] = 0;   printf("-> %s",buf);   exit(0); }  void error(char *s) {   perror(s);   exit(1); }   but this code is working fine if my C program(which needs to be executed usng exec)  is reading input only once from stdin and returns output  once .but if my Cprogram(which needs to be executed usng exec) is taking input more than once(dont know exactly how many times it will read input from stdin) and display output put mork than once(while execution display output line by line on stdout) then this code is crashing. can any body suggest how to solve this problem? Actually my C program(which needs to be executed usng exec) is displaying some output line by line and depending upon output i have to provide input on stdin and number of this read/write is not constant.  Please help me resolve this issue.

How should I run another program from within my C program? I need to be able to write data into STDIN of the launched program (and maybe read from it's STDOUT)  I am not sure if this is a standard C function. I need the solution that should work under Linux.


I apologize in advance for my naive question but I'm new to Linux and eager to learn. I am experiencing the same problem already commented by others, and it is the impossibility to log-in Ubuntu 14.04 after upgrade. After entering the password, I am redirected to the log-in page again. I followed the instructions appeared in this thread but was unable to solve the issue:  It seems that I need to edit the system file /etc/fstab but once having accessed to the terminal from the log-in page and cd to the proper directory, I don't know how to edit this file.  Your valuable feedback is highly appreciated, thanks.

My Ubuntu is stuck in a login loop when trying to enter my desktop. When I login, the screen gets black and soon after that the login screen comes back.   I've read that the problem might be caused by an error depending on the graphics, here's my graphics card: ATI Radeon 7670M