So, I was making a text-based "shopping" program, and I came across an error that didn't quite make sense to me. The error message was this:  TypeError: can't multiply sequence by non-int of type str   Here is a code snippet of where I think the error is located (Comment above line where I believe error to be located):  def buy():     print "\nType in a store item to buy."     find_item = raw_input(prompt)     if find_item in store_items:         print "Amount?"         amount = raw_input(prompt)         if amount:                         #Error in next line?             store_rec.append(store_items[find_item] * amount)             get_buy()   If you're wondering, store_items is a dictionary containing the store items like this:  store_items = {     "carrot": "carrot",     "apple": "apple",     "pear": "pear",     "taco": "taco",     "banana": "banana",     "tomato": "tomato",     "cranberry": "cranberry",     "orange": "orange", }   Then store_rec is an empty list, like this:  store_rec = []   It contains recommendations for telling the user what to buy next time, but that's not where I think the error is located. What I was trying to do in the line where the error appears to be, is append the amount of items specified by the user to the empty store_rec list. Unfortunatly, then I get the error. It seems like it should work, but it doesn't. So, with that in mind, any help on my problem is appreciated!

I am typing to get a sale amount (by input) to be multiplied by a defined sales tax (0.08) and then have it print the total amount (sales tax times sale amount).  I run into this error. Anyone know what could be wrong or have any suggestions?   salesAmount = raw_input (["Insert sale amount here \n"]) ['Insert sale amount here \n']20.99 >>> salesTax = 0.08 >>> totalAmount = salesAmount * salesTax  Traceback (most recent call last):   File "<pyshell#57>", line 1, in <module>     totalAmount = salesAmount * salesTax TypeError: can't multiply sequence by non-int of type 'float'


Before down voting: If you down vote, leave a comment; the least you could do is prove that you care by leaving a comment of why you down voted. Down voting with no comment really only hurts the community more.. There hasn't been any good explination as to why no one is looking into this. Spam and "its a pain" just don't quite cut it. There are many ways to avoid spam, and laziness is no excuse.   The situation: This seems like a big conflict. New users are forced to gain more info on the sitautions through answers, which is something that is frowned upon. This seems good for commenting on answers, but requiring it for commenting on questions force new users to use an answer to gain more info from the OP. Now that I have enough rep to do reviews, it seems like a very common problem.  I understand that this leads to the possibility of spam, but there are ways to get around this. I think the combination of moderation of comments by people with under 50 rep and filtering comments to check for repetition, links, and any other things you feel would be good to look for (maybe relevance to tags/title; get creative). Of course it wouldnt be the easiest thing to do, but its definitely progress.

Low-rep users can't leave comments. This leads to many users   While the rationale behind this limitation is understandable, seen from the outside, it looks  inane and bureaucratic. New users often have useful information to bring to the table. That information is often enough destroyed through deletion,  or has to be manually converted to a comment by a moderator.  How about, experimentally for a month or so, removing the limitation, allowing comments from (registered) new users, and countering the threat of garbage comments with    A comment review queue for low-rep users' comments A lowered flagging threshold for low-rep users' comments (say, 2 flags instead of 3 or whatever is required right now)   After all, features like  show that there's value to be gained from the input of the countless visitors who end up on Stack Overflow through Google, but are never going to become active members of the community. So why not use it?


I would like to know if someone knows of a way to group the number of levels of a feature that has 100's (even 1000's) of levels to a smaller number of levels - also, what number levels it should reduce to e.g. should it reduce from 200 levels to 10, 15 or 20?

I have a dataset that consists of only categorical variables and a target variable. I want to predict the (binary) target variable with the categorical variables.  I am trying to do this in Python and sklearn.  The categorical variables have many different values. I was thinking to create dummy variables for each value in all the categorical variables. However, in the end this results in a sparse data set with thousands of variables.  How would you go about to reduce the number of dummy variables? Would you use Chi2 to select useful features?  Or would you not make dummy variables at all?


I have just Updated to the new Ubuntu 16.04. This is a fresh installation of this OS. Trying to install Openjdk 7 but I got this error.      Package 'openjdk-7-jre' has no installation candidate   how do I fix it?

I would like to upgrade my main system to 16.04, but I work on projects that require OpenJDK 7.   Apparently it is not available from a trivial apt-get install openjdk-7-jdk. Only versions 8 and 9 are listed in the repository.  Can anyone point me to instructions on how to install it?


If mass can be transformed into energy, and energy transformed back into mass, isn't this at odds with the law of conservation of energy?  Because this would mean, that in theory, it would be possible to let an object fall down a certain distance, performing work along the way, then you would transform the object's mass into energy, transport the energy to a higher level, and rematerialize the object, and let it fall down again, performing work along the way?  This would enable an infinite loop whereby infinite amounts of energy can be gained through the gravitational field.

I know that I cannot do this because of conservation of energy, so I am looking for an answer as to why this will not work.  So by my understanding of Einstein's whole famous $E=mc^2$ thing it is possible to turn matter into energy, and energy into matter. So what if you were to create a space station way up high and run a wire down to Earth, then pump some energy up it.  The space station would then turn that energy into matter and let it drop down to Earth. People down at Earth would harvest the kinetic energy somehow, then turn the matter back into energy, pump it back up, then repeat the process. The result would be the energy they started with plus the kinetic energy. Where is the flaw in this reasoning?  (I'm guessing it might take energy for the electrons to fight gravity up to the space station).


While as far as I know no clear details are given, in the Lord of the Rings Sauron seems to command huge numbers of humans as well as the Orcs - definitely the Haradrim and the Variags of Khand fight for him.  But how? Do those people know they are working for Sauron, and if so, why do they do it?   I suppose he could offer the local leaders power, but what could he actually offer them, and how would he keep control when they tried to run things for themselves? In the 2nd Age he presumably handled things through the kings wearing the Nine Rings, but at this point they're Nazgul (creepy even when they don't actually have the supernatural fear "turned on") and thus not very good at ruling humans.  Sauron doesn't seem to travel around personally and demonstrate his supernatural powers.  The Orcs don't have any supernatural abilities to demonstrate 'divine sanction', are obviously unpleasant, and are individually weaker than humans.   So Sauron doesn't really seem to have an ability to 'show the flag' far from Mordor.  Does he just send the Nazgul to scare leaders into doing what he wants? But there are only 9 of them and until well into LOTR they have no special transportation - 9 guys really shouldn't be able to keep control of millions of square miles of land with pre-modern communications and transportation (and Sauron has only one Palantir, so he can't use them as magical cell phones).

Why were the people of Rhun and Harad allied with Sauron?  Did they join him out of fear, or did Sauron say he would give them something if they joined him?  I know the men of Dunland were angry at Rohan; did Rhun and Harad have something against Gondor?


Is there any reason regarding performance issue or security to make button edit in feature add comment has timeout?  I got problem to edit my comment when the button edit disappear, so for now what I'm doing is:    Copy the comment And then delete the comment And then add new comment Paste the previous comment and post.   Can the feature edit on comment become like edit on question or answer?


Salesforce bills Marketing Cloud on total number of Contacts within the system. I'd like to know what exactly is used to count these? Is this the Email Studio > All Subscribers list or the Contact Builder > All Contacts list?  When we have Marketing Cloud connector and synchronise the Contacts object, is this counted towards that number? (or only when they have been inserted into the All Subscribers / All Contacts list, as they are not done so automatically)

We synced contacts from Salesforce to Marketing Cloud.  Data sources and it's related entities display 118,704 contacts got synced from Salesforce.   But in Contact builder it is showing 9,34,276 contacts.   We are assuming of possible duplicates. Attched are the screenshots for reference. How do we know the source of sync of 9L contacts?


Today I did something extremely dumb. I found that I barely use Linux and decided to delete it. To do so, I deleted the partition with the plan to use it as some free space for storing backups while working with my Windows. I installed Ubuntu via unetbootin and it was dual-booted with Windows 10. The problem is, now I am redirected to the grud rescue screen everytime I power on the computer and I get some text, saying that the file system is unknown and the device cannot be found. I made a Windows 10 bootable USB to repair the Windows Bootloader but I can't load it for some reason. When I turn on the computer, I press F11 (as instructed) and I get a screen with some options. I pick the bootable USB but I get a message saying that the system disk is invalid, giving me the advice to replace it and press any key after doing it. I'm not really sure what all of this means, I would love to get some help!

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


I want to replace a string "#security" with "security\n\tauthorization : enabled" in a file file.txt. Here \n represents a new line and \t for tab. How can I do this using sed command.

How can I find and replace specific words in a text file using command line?


Let me try to explain what Im trying to achieve  Consider the info below:  public class RootObj {    public string id { get; set; }    public List<string> infoList { get; set; } }   I want to perform just one query a db function that returns to me a list of RootObj Something like this:  public List<RootObj> getContactListAddContacts() {    ... //get db stuff    List<RootObj> list = new List<RootObj>();    dr = cmd.ExecuteReader();    while (dr.Read())    {       RootObj obj = new RootObj();       obj.id = (int)dr["table1_id"];       obj.infoList = ...;//NEED HELP HERE list of table2_id        list.add(obj);    }    return list; }   and in SQL consider this table  +-----+-----------+-----------+ | id  | table1_id | table2_id | +-----+-----------+-----------+ | 1   | 1         | a         | +-----+-----------+-----------+ | 2   | 1         | b         | +-----+-----------+-----------+ | 3   | 2         | c         | +-----+-----------+-----------+ | 4   | 3         | c         | +-----+-----------+-----------+ | 5   | 3         | d         | +-----+-----------+-----------+   The expected Result has to be this one below:  list = [           {              id:1,              infoList = {a, b}           },           {              id:2,              infoList = {c}           },           {              id:3,              infoList = {c,d}           }        ]   (Put like json because its easy to see)  How my procedure should looks like to make that happen?  So far cant think better than   select table1_id, table2_id from table1_table2   but cant think how I will add this to my object just like I want  Thanks in advance.

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)


I know this is a basic question, but I didn't know where else to find the answer.   I  want to extrude the top face of this rail straight downward, but when I do this it leaves 2 extra faces.   I want a result similar to what I have now, but without the faces that I marked.   Is there a way to do this? Any help would be greatly appreciated!

Here is the image to explain what i want    left box shows how i have set loopcuts (green is the face that i am extruding and moving). Middle one is what i want to get. The right is the issue with blender. the red faces will remain. (i have removed doubles on those faces) So is it possible to extrude inwards so that you dont have those faces hanging ? I know i could just delete those faces and thats it. but if you have lot of elements with similar idea it will get time consuming.  Thanks


I would like to read Lucifer's story from the very beginning which I know started in a Sandman comic book issue. Which are the Sandman comics that involve Lucifer and after that do I read the books?? A little guidance would be helpful

Do I read the Sandman stuff, or do I jump right into the main comics? Because I really want to maintain continuity, what's the right sequence to ensure that I get every bit of the story?


I want to incorporate something like:    for f in */*; do mv "$f" "${f%/*}/foo.${f##*.}"; done     Into my find x -exec y {} \;-style workflow.     The for loop construct & "$f" variable will likely be omitted; the loop will be substituted by standard -exec iterating behaviour, and the variable (containing the filename of the current iteration), by {}. But it seems like these two different syntaxes are incompatible/problematic. Especially because of the conflicting braces and semicolons, etc.

How to recursively rename all the files in several layers of subdirectories without changing their extensions?  Below's a toned down version (to save room) of what I've got.  For argument's sake, I want all the files to have the same title, yet retain their original extension. There's never more than a single file per directory, so there's no chance of doubling up.  For simplicity, we'll just call them all foo, followed by their current extension.    So just to clarify: Asset\ 1.pdf, Asset\ 1.png, Asset\ 1@4x.png, Asset\ 1.svg Will become: foo.pdf, foo.png, foo.png, foo.svg And so on in that fashion.    I would typically use parameter expansion and a for loop, like:    for f in */*; do mv "$f" "${f%/*}/foo.${f##*.}"; done     But it's not recursive. So I would prefer to use something with find..-exec or similar.    ~/Desktop/Project/Graphics/ ├── Huge │   ├── PDF │   │   └── Asset\ 1.pdf │   ├── PNG │   │   ├── 1x │   │   │   └── Asset\ 1.png │   │   └── 4x │   │       └── Asset\ 1@4x.png │   └── SVG │       └── Asset\ 1.svg ├── Large │   ├── PDF │   │   └── ProjectAsset\ 2.pdf │   ├── PNG │   │   ├── 1x │   │   │   └── ProjectAsset\ 2.png │   │   └── 4x │   │       └── ProjectAsset\ 2@4x.png │   └── SVG │       └── ProjectAsset\ 2.svg ├── Medium │   ├── PDF │   │   └── ProjectAsset\ 3.pdf │   ├── PNG │   │   ├── 1x │   │   │   └── ProjectAsset\ 3.png │   │   └── 4x │   │       └── ProjectAsset\ 3@4x.png │   └── SVG │       └── ProjectAsset\ 3.svg ├── Small │   ├── PDF │   │   └── ProjectAsset\ 4.pdf │   ├── PNG │   │   ├── 1x │   │   │   └── ProjectAsset\ 4.png │   │   └── 4x │   │       └── ProjectAsset\ 4@4x.png │   └── SVG │       └── ProjectAsset\ 4.svg └── Tiny     ├── PDF     │   └── Asset\ 5.pdf     ├── PNG     │   ├── 1x     │   │   └── Asset\ 5.png     │   └── 4x     │       └── Asset\ 5@4x.png     └── SVG         └── Asset\ 5.svg  30 directories, 20 files


I want to get all elements that class contains a number, how can I do that? I haven't tried anything because I don't really know how to think about it.

I am after documentation on using wildcard or regular expressions (not sure on the exact terminology) with a jQuery selector.  I have looked for this myself but have been unable to find information on the syntax and how to use it. Does anyone know where the documentation for the syntax is?  EDIT: The attribute filters allow you to select based on patterns of an attribute value.


If $\sum_{i=1}^\infty a_i$ diverges, then prove that $\sum_{i=1}^\infty ia_i$ diverges.   My English is too bad to express the question clearly. Thank you for your answer.

Is there a (real) sequence such that $\sum{a_n}$ diverges but $\sum{na_n}$converges?


Does anyone know how I can get my Canon Pixma MX452 running on Ubuntu 13.04, either via USB or 802.11? I tried to install in 13.04 via USB, but it used a generic text-only driver which didn't work at all. No scanner functionality either.  Thanks in advance!

I tried to install the MP190 drivers, but appeared a message show me that requires to have libcupsys2. I understand that libcup2 is an update of libcupsys2.   How do I solve this? Are there proprietary drivers for my Canon printer or scanner?


The question is simple:  is there a word or phrase that means "both literally and figuratively", aside from the one I just used?

Say, for example, you and a group of people were all sailing out in the ocean and something happens...then you say,  "I guess we are all in the same boat"  You are literally in the same boat with everyone else, and your current situation is the same as everyone else.  Now such a phrase can be applied literally and figuratively. I was wondering if there was a word that would mean both literally and figuratively. I know this is a tad bit of an oxymoron, but I was curious to see if there was such an "all encompassing" word for this.


Most of the statistics material suggest that when the interaction term is significant, even though the main effect term is not significant, we still keep the main effect term.  For example: $$z = a + b\cdot x + c\cdot y + d\cdot xy$$  $x$ is continuous while $y$ is categorical (two levels, $y_1$ and $y_2$). $z$ is continuous. The linear model fitted has a significant $xy$ term, intercept term and $x$ term but non-significant $y$ term.   Can I reduce the model to $z = a' + b'\cdot x + d'\cdot xy$ ? Interpretation is that for level $y_1$ and level $y_2$, they have the same intercept but different slope.   Thank you!

Is it ever valid to include a two-way interaction in a model without including the main effects?  What if your hypothesis is only about the interaction, do you still need to include the main effects?


I am using Spring boot with PostgreSql. I created entities,controller,DTO and DAO package. I find  NullPointerException at ConvertToEntity() method.  Client.class   @Entity public class Client { @Id @GeneratedValue private Long id_client;  @Column(unique=true) private Long num_client;   @Pattern(regexp="^[A-Za-z ]+$") @Size(max = 60) private String nom_client;   @ManyToMany   @JoinTable(       name="CLIENT_PACK",       joinColumns=@JoinColumn(name="CLIENT_ID", referencedColumnName="id_client"),       inverseJoinColumns=@JoinColumn(name="PACK_ID", referencedColumnName="id_pack")) private List<Pack> packs;   Pack.class  @Id @GeneratedValue private Long id_pack;   @NotNull @Pattern(regexp="^[A-Za-z ]+$") @Size(max = 60) private String nom_pack; @Size(max = 2000) private String description; @Min(0) @Max(99) private int nbre_max_service; @Min(0) @Max(9999) private int kilometrage_max;  @ManyToMany(mappedBy="packs") private List<Client>clients;   ClientDTO.class  public class ClientDTO {  private Long id_client; private Long num_client; private String nom_client; private List<PackDTO> packs; }   PackDTO.class  public class PackDTO {   private Long id_pack; private String nom_pack; private String description; private int nbre_max_service; private int kilometrage_max;}   ClientServiceImpl  @Transactional @Service public class ClientServiceImpl implements ClientService {  @Autowired private PackService packService;  @Autowired private ClientRepository clientRepository;   @Bean public ModelMapper modelMapper() {     return new ModelMapper(); } private ModelMapper modelMapper = new ModelMapper();   @Override public Client convertToEntity(ClientDTO clientDTO) {      //Client client = modelMapper.map(clientDTO, Client.class);     Client client =new Client(clientDTO.getNum_client(),clientDTO.getNom_client());     List<Pack> l =new ArrayList<Pack>();     for (PackDTO r: clientDTO.getPacks())      {     Pack rdto=packService.convertToEntity(r);      l.add(rdto);     }     client.setPacks(l);      return client; }  @Override public ClientDTO saveClient(Client c) {       clientRepository.save(c);       return convertToDTO(c);    }          }   CLientController.class  @RestController @RequestMapping(value = "/clients") public class ClientController {      @Autowired     private ClientService clientService;      @RequestMapping(value="/add",method = RequestMethod.POST)     public ClientDTO addClient(@RequestBody ClientDTO ud) {         Client u= clientService.convertToEntity(ud);          return clientService.saveClient(u);     } }   When I enter this URL :   It show this error :   java.lang.NullPointerException: null at com.gaConnecte.assistAuto.service.impl.ClientServiceImpl.convertToEntity...   any idea

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 want to make a very wide table that must span across two columns, like this:  1 Test text etc etc see this table:   3 The page text wraps over ---------------------------------------------------------------- | Very                 | Wide               | Table            | ---------------------------------------------------------------- 2 Because the table is so wide...     4 and around it!    does not answer the question because the solution shunts the table onto the next page instead of integrating it with the text.

[i am trying to insert a table into a two column document. but i was unable to do it. i have tried many things but not able to get the correct way. I want the table to be in center of the page even the document is two column oriented  \lipsum[1]   \begin{table*}     \centering       \begin{tabular}[b]{l l l l l l l l}      &   2011 &  2012 &  2013 &  2014 &  2015 &  2016 &  2017        \\ \hline Networking &    0.15 &  0.23 &  0.42 &  0.65 &  0.85 &  1.01 &  1.15        \\ NoSQL &     0.07 &  0.13 &  0.29 &  0.5 &   0.8 &   1 &     1.2     \\ Infrastructure Software  &  0.14 &  0.44 &  0.83 &  1.08 &  1.25 &  1.6 &   1.9     \\ SQL &   0.62 &  0.88 &  1.31 &  1.75 &  2.25 &  2.45 &  2.7     \\ Cloud  &    0.36 &  0.62 &  1.19 &  1.82 &  2.52 &  3.05 &  3.65        \\ Storage &   1.1 &   1.75 &  3.09 &  4.2 &   5.5 &   6.4 &   6.95        \\ Computation &   1.53 &  2.29 &  3.65 &  4.92 &  6.4 &   7.1 &   7.6     \\ Apps \& Analytics       &   0.52 &  0.99 &  1.69 &  3.45 &  5.29 &  6.65 &  7.75        \\ Professional Services         &     2.8 &   4.42 &  6.15 &  10.1 &  13.5 &  16 &    17.2        \\       \end{tabular}     \caption{This is the caption for complicated table}     \label{tab:1} \end{table*}   \lipsum[1]


I am under the impression that Einstein never explains in his General Theory of Relativity, why matter curves spacetime; could explanations please be given?

According to general relativity, inertial mass and gravitational mass are the same, and all accelerated reference frames (such as a uniformly rotating reference frame with its proper time dilation) are physically equivalent to a gravitational field of the same strength.  Refer: Einstein's thought experiment of a Physicist in an Accelerated Box.  I find that the 'How' part of this question is somewhat easy to understand Mathematically but hard to visualize physically and on the 'Why' part I am totally blank.


That is, ignoring speculative concepts like Dark Matter and just summing across stars and gas clouds etc

I'm sorry if this was asked before but with all the stars and dark matter and all the other stuff, curently in the Universe, what's the avarage temperature of the Universe? Is it like extremely high or extremely low?


In Star Trek: Enterprise, season 1 at least, the opening credits show a bunch of aircraft and spacecraft.  Just before the Enterprise shows up, there is another ship of similar configuration.     Is there any information on that ship and what it could do?  It is shown after the Phoenix, and since the progression seems to show craft from more primitive to more advanced once would presume that it is a precursor to the Enterprise itself.

In the Star Trek: Enterprise opening credits it seems to step through starship history up to the Enterprise NX-01.  After Cochran's Phoenix, there is a ship that we see almost only from behind, and then the Enterprise. Do we know what that ship is?


It's a question I find a bit difficult to solve, and the question is:  $$3^x+x^3=17.$$

Find $x$ in the following equation: $$3^x+x^3=17$$


I hope this is not a duplicate, if it is I apologize.  Edit: this is a duplicate, in the sense that a similar question has been asked before.  The answers to that question don't quite fit.  To get a better sense of the subtlety I am trying to get at, read my comment about uninitialized memory.  End of edit.  My question is about whether the C code below is in some sense legal.  Even if it were, I wouldn't use it, since it generates a warning and warnings annoy me.  Still, I'm curious.  But enough of the rambling introduction, the question itself is rambling enough as it is.  The setup is as follows.  Suppose you want to sort an array of integers.  Instead of implementing your own sort, you decide to use qsort, which wants a comparison function which takes two void*.  Inside the function, you cast the void* into int*, and then compare them.  In an ideal world, I'd like to pass a function that takes two int* instead.  The compiler warns if you try this, for obvious reasons: for all it knows, qsort will try to call your function with a short* and a double*, and havoc will ensue.  If the C type system were more expressive, then the declaration of qsort could give the compiler enough information to deduce that this will never happen.  But even with the type system we have, a Sufficiently Smart Compiler (tm) knows exactly how qsort works, and thus it knows that your comparison function will always get pointers to integers.  Unfortunately, even then, the compiler must warn, because if the compiler is truly portable, it may have to support platforms where the size of a void* is not the same as the size of an int*.  But such platforms are very rare, bordering on non-existent.  Far more common are platforms where an int is only 2 bytes, and on those platforms the expression 123*456 is undefined behavior.  But most platforms today have a larger int, and on those the expression is well defined.  If a compiler with 4 byte integers were to assume that 123*456 is unreachable, then that compiler is not standard compliant.  In other words, once the implementation makes some promise (large int), the standard forbids it from doing things that are in general allowed (treating some expressions as if they overflowed).  Let's take another example.  In most operating systems, dereferencing a null pointer will crash your program.  But even if you don't mind crashing, you must still check the return value of malloc, because dereferencing null is undefined behavior according to the standard, and very few compilers make stronger guarantees in this case.  My question is thus:  where does the function pointer cast fall on this continuum?  I'm pretty sure that most platforms in common use today do in fact guarantee that all pointers have the same representation, are passed using the same calling convention, etc.  If I only care about those platforms, can I then pass a comparison function that takes int* instead of void*, just like I can fearlessly multiply 3-digit numbers, or is it more like the situation with dereferencing null, where this particular behavior is undefined unless the documentation explicitly says otherwise?

Let's say I have a function that accepts a void (*)(void*) function pointer for use as a callback:  void do_stuff(void (*callback_fp)(void*), void* callback_arg);   Now, if I have a function like this:  void my_callback_function(struct my_struct* arg);   Can I do this safely?  do_stuff((void (*)(void*)) &my_callback_function, NULL);   I've looked at  and I've looked at some C standards which say you can cast to 'compatible function pointers', but I cannot find a definition of what 'compatible function pointer' means.


Recently when trying to find out why my computer was slowing down, I saw on Task Manager (which is taking several seconds to open, if it opens correctly at all) that there were thousands of entries under the Processes tab named "ls":  How can I track down what is causing this many "ls" processes to open? As a temporary fix, my computer goes back to normal after a reset. Currently I have no reason to believe it is any kind of malware. Windows' Virus and Thread protection didn't find anything after running a full scan.

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


I have been given a short task to make a program that is supposed to have an applet that functions basically as a login screen, and that it gets disabled whenever 3 tries have been made. The problem is it always shows that the input is not equal to the username and password that I have pre-set, and I don't know why. x.getText() turns the input into a String, right? But it seems that it is not so. The If-else conditional statement does not seem to be the problem, but it is where the problem happens. The flow of the program skips to the else statement.  I think I have made this work earlier, I can't remember what I did to make it work and to make it not work. LOL. I am using eclipse, JDK 8. (Applets seem to work only on JDK8 and below). Previously, I was using JDK14 but changed it to JDK8 in my compiler and build path, so now Applets work. But could a step in that change have been the cause of the problem?  import java.applet.Applet; import java.awt.*; import java.awt.event.*; import javax.swing.JOptionPane;  public class easy extends Applet implements ActionListener {     Label labelusername = new Label ("Username");     TextField inputusername = new TextField ("", 20);     Label labelpassword = new Label ("Password");     TextField inputpassword = new TextField ("", 20);     Button buttonlogin = new Button ("Ok");     int ntries = 0;     String username, password; public void init(){     inputusername.setText("hello");     inputpassword.setText("there");     inputpassword.setEchoChar('*');     add(labelusername);     add(inputusername);     add(labelpassword);     add(inputpassword);     add(buttonlogin);     buttonlogin.addActionListener(this); }  public void actionPerformed(ActionEvent x) {     if(x.getSource() == buttonlogin) {         ntries++;         System.out.println(inputusername.getText());         System.out.println(inputpassword.getText());         System.out.println(inputusername.getText() + inputpassword.getText());         username = inputusername.getText();         password = inputpassword.getText();                  if(ntries != 3) {             System.out.println("yow");             if((inputusername.getText() == "hello") && (inputpassword.getText() == "there")) {                 JOptionPane.showMessageDialog(null, "Password Accepted");             }else {                 JOptionPane.showMessageDialog(null, "Invalid Password");             }         }else {             JOptionPane.showMessageDialog(null, "no more tries");             inputusername.setEditable(false);             inputpassword.setEditable(false);             buttonlogin.setEnabled(false);         }     } } }  EDIT: okay sorry, apparently you have to use .equals when comparing strings.

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?


Whenever i type sudo apt-get install vlc. it comes with an error saying that unable to locate the package this is happening with all other installs too, am i making any mistake, it is my first hour with kubuntu.

When I try to install any package through the command line, I get an error.   $ sudo apt-get install <package> Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package <package>   Can anyone help me on this?


It is well known that $$ \sum_{k=1}^{n} k = \frac{n(n+1)}{2} .$$ As the story goes, Gauss notices that there are $n/2$ pairs of numbers that add up to $n+1$, hence the formula above. But obviously the right hand side is ${n+1 \choose 2}$, namely $$ \sum_{k=1}^{n} k = {n+1 \choose 2} .$$ Is there a "combinatorial proof" of this second equation? I am trying to see the connection between the sum (and Gauss' method) to the problem of choosing $2$ objects from $n+1$ objects.

The triangular numbers count the number of items in a triangle with $n$ items on a side, like this:    This can be calculated exactly by the formula $T_n = \sum_{k=1}^n k = \frac{n(n+1)}{2} = {n+1 \choose 2} = {n+1 \choose n-1}$.  Is there any combinatorial interpretation to that formula, as in some way to interpret arranging objects in a triangle with $n$ on a side as the number of ways to choose 2 or $n-1$ objects out of a collection of $n+1$ objects?


I'm using a Spotlight on one of my scenes, first I planned to make the effect of the lightrays on other editing software, but maybe it's possible on Blender. It is possible to make a spotlight look like the image below? (also, I'm using cycles)  Thanks in regard! :)

(a.k.a. "god rays" and many other names) can be created in Blender Internal by checking the Halo checkbox in the lamp properties box.  How can I create a similar effect using Cycles?


$e^{\pi}$ or  $\pi^e$, Can we find which one is bigger by using calculus?  Thanks.

How can I  compare (without calculator or similar device) the values of $\pi^e$ and $e^\pi$ ?


I need to prove that, it's clearly obvius, but i dont know how to prove that:  $$ \lim_{n\to \infty}n^\frac 1n = 1 $$

I've spent the better part of this day trying to show from first principles that this sequence tends to 1. Could anyone give me an idea of how I can approach this problem?  $$ \lim_{n \to +\infty} n^{\frac{1}{n}} $$


How can I see which files apt-get purge will remove from my system before executing the command?

Given a set of apt commands and packages to apply (e.g. install foo bar baz, autoremove quux blerg bang), is there a way to calculate the diff of the system state that will be produced if I run the commands?  By "system state" I don't merely mean whether a given package will install/remove other packages, but what kinds of actual changes get produced -- files being deleted or moved, scripts getting run, et cetera.


I want to talk about several categories. Each category has only one URL.  Which one is correct and why?   Category URLs Categories URL Categories URLs

Is it correct to say user accounts or users account when referring to the accounts any user has on a site like this one?  In general, in the case of a noun that is used as adjective for the noun that follows, is it better to use <plural-noun> <singular-noun> or <singular-noun> <plural-noun>?


I am trying to create a regex that will give me everything that appears between [start-flashcards] and [end-flashcards]  I am using \[start-flashcards\](.*?)\[end-flashcards\] but this doesn't match. I must be missing something?
[start-flashcards]

[London|This is the capital city of the United Kingdom]

[Paris|This is the capital city of France]

[Madrid|This is the capital city of Spain]

[Tokyo|This is the capital city of Japan]

[Moscow|This is the capital city of Russia]

[end-flashcards]

For example, this regex  (.*)<FooBar>   will match:  abcde<FooBar>   But how do I get it to match across multiple lines?  abcde fghij<FooBar>


Several acronyms that are not used (but are defined in the Acronym file) in my text are not shown in the List of Acronyms. How can I print all acronyms even if they are not used in the text. You can find related code lines that I used below:  \usepackage[nonumberlist, acronym]{glossaries}  \loadglsentries{acronyms}  %----- List of Acronyms -----% \cleardoublepage        %\newpage \phantomsection     \addcontentsline{toc}{chapter}{List of Acronyms} \printglossary[type=acronym, title=List of Acronyms] %----------------------------%   By the way, I'm using pdflatex to build the pdf file.  Thanks in advance

Is there a command so that the glossary will also display elements without links (an equivalent of \nocite in BibTeX)?


If two bodies are moving towards each other along a straight line at a speed of $0.6c$ ($c=$ speed of light) w.r.t an inertial observer, then w.r.t each body, the other body is moving faster than light ($1.2c$). If each frame of reference is equally valid, how can the two bodies explain the velocity of approach of the other? (since velocity is always relative and hence the body cannot assume that it has absolute velocity in space)

Let's say I fire a bus through space at (almost) the speed of light in vacuum. If I'm inside the bus (sitting on the back seat) and I run up the aisle of the bus toward the front, does that mean I'm traveling faster than the speed of light? (Relative to Earth that I just took off from.)


I have an empty div, like this:

   When user login in I call getPhotos(); function, and this function add some data inside albums div, like this:  $('

').appendTo($('.albums'));   adding data successfull.  I see images but I think jQuery doesnt see.  I cant select images.  $('.photoimg').click(function(){         alert(); });   any other solution?

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.


Here is my code which is generating the error:   $query =" INSERT INTO clients (client_id,name,surname,tel1,tel2,id_num,address,zip_code) VALUES  ($updating_id,$updatedName1,$updatedSurname1,$updatedTel1,$updatedTel2,$updatedAddress1,'0111')                   ON DUPLICATE KEY UPDATE (name='$updatedName1',surname='$updatedSurname1',tel1=$updatedTel1,tel2=$updatedTel2,id_num=$updatedId_num1 address=$updatedAddress1,zip_code='0111')";   and here's the 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 '455 4885, 011 5558 556,132 heeldon str borrowdale,'0111') ' at line 1

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'm struggling with understanding the logic behind this query i need to do for a batch job. i am querying the contentdocumentlink object because i need to capture files (potentially multiple) related to specific campaigns. since its a batch i want to query all campaigns that had files added to it each day and store the URLs of the files for each campaign. i have: final ID campId; List<Campaign> campList = [Select Name, Content_Link__c FROM Campaign];  global String soqlQuery = 'Select ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId=:campId';     any help means a lot, thanks!

Can some one correct my soql? I need to export records in data loader like:  WHERE Id IN ('123123123','123123fsdf')   But this following query does not work for me:  SELECT Id, Syndication_Documents__c FROM ContentVersion  WHERE Syndication_Documents__c in : 'a4fa0000000KzbV','a4fa0000000KzbW'


Although there are many attempts to the problem but I wasn't really able to understand those so I took some idea from examples and attempted it. Can someone just go through it please. My attempt: Let $\sigma:\mathbb{Z}_{m}\to \mathbb{Z}_{n}$. The kernel $\ker(\sigma)$ is a normal subgroup of $\mathbb{Z}_{m}$. So $\ker(\sigma)=\langle\frac{m}{d}\rangle$, where $d|m$. Now $\operatorname{im}(\sigma$) is a subgroup of $\mathbb{Z}_n$. So, now the order of the image should be $d$ so $d|n$. Now the number of homomorphisms when the kernel is of order $d$ will be $\sum_{d|m,d|n}\varphi(d)$. From here we can conclude that the no of homomorphisms should be $\gcd(m,n)$. Is this OK? Where am I making mistakes?

Is it true that the number of homomorphisms between any two finite cyclic groups of order $m\,\&\,n$ is $\gcd(m,n)$?  I have posted an answer which I believe is true, just wanted to know different approaches to this problem.


Sam - Near Crith Ungol:  Sam puts on ring and " Sam hurled himself against the bolted brazen plates and fell senseless to the ground. He was out in the darkness"  He put the ring on before he goes unconscious. He woke up with the ring and The Dark Lord did not detect him.  Already the Ring tempted him, gnawing at his will and reason. Wild fantasies arose in his mind; and he saw Samwise the Strong, Hero of the Age, striding with a flaming sword across the darkened land, and armies flocking to his call as he marched to the overthrow of Barad-dûr. And then all the clouds rolled away, and the white sun shone, and at his command the vale of Gorgoroth became a garden of flowers and trees and brought forth fruit. He had only to put on the Ring and claim it for his own, and all this could be.  Frodo - At Mount Doom:  ‘I have come,’ he said. ‘But I do not choose now to do what I came to do. I will not do this deed. The Ring is mine!’ And suddenly, as he set it on his finger, he vanished from Sam’s sight. Sam gasped, but he had no chance to cry out, for at that moment many things happened.  Something struck Sam violently in the back, his legs were knocked from under him and he was flung aside, striking his head against the stony floor, as a dark shape sprang over him. He lay still and for a moment all went black.  And far away, as Frodo put on the Ring and claimed it for his own, even in Sammath Naur the very heart of his realm, the Power in Barad-dûr was shaken, and the Tower trembled from its foundations to its proud and bitter crown. The Dark Lord was suddenly aware of him...

When Frodo put on the One Ring, both the Nazgul and Sauron himself found Frodo. However when Bilbo had the ring and possibly used it many times, Sauron sought Gollum to get a hint on where to look for the ring and send the Nazgul after it.   Sauron sought Gollum before Bilbo wore the ring at his birthday party, slightly after that time, he was very effective at locating Frodo when Frodo put on the ring. So I guess it's not a matter of Sauron gaining any extra powers with time.  Also Bilbo seemed to use the ring without it bothering him at any point, unlike Frodo who seemed to be very troubled when using the ring. How is that possible?


With the announcement of the Ubuntu Phone OS I'd like to know what phone (and tablet) models are supported at this time.  Note from foss & Oli: We are making this the master question for all future "Will this work on <insert random tablet/phone/device here>?!" questions


I don't understand why I get ClassCastException on below code in line:  for(int i = 0; i < k.t.length; i++)   So problem is that in method addElement I make replacing of array elements by objects with type T. In my opinion in array should be objects with type T. And compiler doesn't protest for that.  But in run-time JVM cannot cast despite in array is really objects with type T (in case below String), why JVM cannot use polymorphism?  But when I change the  T[] t; to Object[] t;  and remove cast in constructor it run correctly without any errors, why?  public class MyCollection<T> {      T[] t;      MyCollection( int size){         t = (T[]) new Object[size];     }      boolean addElement(T e, int i){                 if(i < t.length){             t[i] = e;             return true;         }         return false;                 }      public static void main(String[] ss){          MyCollection<String> k = new MyCollection<String>(3);          k.addElement("a",0);         k.addElement("b",1);         k.addElement("c",2);          for(int i = 0; i < k.t.length; i++)             System.out.println(k.t[i]);               //for(String s : (String[])k.t)         //    System.out.println(s);             } }

Due to the implementation of Java generics, you can't have code like this:   public class GenSet<E> {     private E a[];      public GenSet() {         a = new E[INITIAL_ARRAY_LENGTH]; // error: generic array creation     } }   How can I implement this while maintaining type safety?  I saw a solution on the Java forums that goes like this:  import java.lang.reflect.Array;  class Stack<T> {     public Stack(Class<T> clazz, int capacity) {         array = (T[])Array.newInstance(clazz, capacity);     }      private final T[] array; }   But I really don't get what's going on.


Rs. 100 have been returned to your child.   Rs. 100 has been returned to your child.      Which one of the above sentences is correct and why?

I've always said "$100 were taken" not "$100 was taken" because I thought $100 is plural. Could you explain why "was" not "were"? Any other helpful notes about the issue would be appreciated.     Nearly £20 was taken from my bank account


How can I solve this integral  $$\int_{-\infty}^{+\infty}\mathrm{e}^{-(\alpha +\beta i)x^{2}}\,\mathrm{d}x$$  knowing that  $$\int_{-\infty}^{+\infty}\mathrm{e}^{ix^{2}}\,\mathrm{d}x=\sqrt{\pi }\mathrm{e}^{i\pi /4}?$$  I have to use Cauchy's integral theorem and integrate over a circular section of $ \pi/4 $ rad.

$$ \int_{-\infty}^\infty e^{-(x+ia)^2} \text{d}x $$  where $a\in \mathbb{R}$.  I don't know where to start but have reasons to believe the answer is $\sqrt{\pi}$. Namely $\int_{-\infty}^\infty e^{-x^2} \text{d}x$. Problem is I feel insecure performing changes of variables when suddenly the variables range in $\mathbb{C}$. I don't even know if this can be done properly, least of all how.


I'm trying to install gimp 2.7.3 from the repository of launchpad ppa:matthaeus123/mrw-gimp-svn, but when I try to install, it installs the package gimp with the 2.6 version instead of the 2.7, but the others libraries are installed with 2.7.3. There's an error? How I can install it?

I just reinstalled my Ubuntu system with 11.10, but ran into a problem when I tried to install Gimp 2.7.  I always get unmet dependencies (it's german, so I can't tell you the exact english translation):     Needs gimp-data (<= 2.6.11-z) but 2.7.3-2011082002~oo should be installed   I already read the follow post, but the answers didn't really help me.  When I type in     sudo apt-get install gimp=2.6   it just says that there is no version 2.6 found. I get the same with 2.7.  I really need Gimp. But installing Gimp 2.6 isn't possible as well.  When I remove the repos for 2.7, I still get the same error.


I have the following MWE, and I get the output I wish, but for a single trick: i need to have some extra '\' in front of the worrysome characters '├─ ', '│', ecc.. Without the '\' in front, things are rendered all messed up.  Questions are: why so?  is there a quick fix?   \documentclass[titlepage,a4paper,12pt]{article} \usepackage{xcolor} \usepackage{listings} % \usepackage{listingsutf8}  <--- Not needed \usepackage[utf8]{inputenc}  \usepackage{pmboxdraw}  <--- Needed  \lstset{     language=bash,     basicstyle=\ttfamily\small,     numberstyle=\footnotesize,     numbers=left,     backgroundcolor=\color{gray!10},     frame=single,     tabsize=2,     rulecolor=\color{black!30},     literate= {│}{\textSFxi}1% {┐}{\textSFiii}1% {└}{\textSFii}1% {┴}{\textSFvii}1% {┬}{\textSFvi}1% {├}{\textSFviii}{1}% {─}{\textSFx}1% {┼}{\textSFv}1,      title="My Folder",     escapeinside={\%*}{*)}, %   breaklines=true, %   breakatwhitespace=true,     framextopmargin=2pt,     framexbottommargin=2pt,     extendedchars=false, %   inputencoding=utf8     commentstyle=\mycommentstyle,     escapechar=\$, } \newcommand{\mycommentstyle}[1]{\normalfont\rmshape{ $\leftarrow $ #1}}  \begin{document} \begin{lstlisting} \ ├── jsdom_demo-master       $\mycommentstyle{I need normal font here}$ \ │   ├── dummy.html \ │   ├── jquery-1.7.1.min.js \ │   ├── README.md \ │   └── transform.js 1 directories, 4 files \end{lstlisting} \end{document}   EDIT ABOVE FIXEX IT! THANKS TO WHOEVER MADE A COMMENT

When using extended ASCII characters inside the lstlisting environment, i.e. those corresponding to codes 191 - 197 (literally: ┐, └, ┴, ┬, ├, ─, ┼), latex produces the following error:  Package inputenc Error: Unicode char �\lst@EC�\lst@EC� (U+2832C0)(inputenc) not set up for use with LaTeX. ├──   Is there any way to enable the use of such characters inside lstlisting? Using \usepackage[utf8x]{inputenc} instead of \usepackage[utf8]{inputenc} does not solve the problem.


I understand how to do modular arithmetic on numbers with large exponents (like $8^{202}$). However, I am having trouble understanding how to calculate something like:  $ 3^{3^{3^{3^3}}}$ mod 5  (that's 5 3's there). Can anyone help me understand how to get this started?

How do I efficiently compute $a^b\bmod c$:  When $b$ is huge, for instance $5^{844325}\bmod 21$? When $b$ is less than $c$ but it would still be a lot of work to multiply $a$ by itself $b$ times, for instance $5^{69}\bmod 101$? When $(a,c)\ne1$, for instance $6^{103}\bmod 14$?  Are there any other tricks for evaluating exponents in modular arithmetic?  This is being asked in an effort to cut down on duplicates, see  and .


My computer sometimes runs at 100% CPU and gets real slow. When I start task manager to see which process is causing it, there is a process named "1347142115.exe" and it uses 99% of the CPU. When I end it, CPU usage goes back to normal. I don't know which application causes this process so I can't uninstall it. Is this a virus? How do I get rid of it? Is a format necessary?

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


TestTempB.h  #ifndef TESTTEMPB_H_ #define TESTTEMPB_H_ #include <string> using namespace std; namespace ddl_lib {  class TestTempB { public:     TestTempB();     virtual ~TestTempB();     template<class ... Args>     void callCommandB(const string&, const uint32_t*, Args ...);     template<class ... Args>     void callCommandA(const string&, Args ...); };  } /* namespace ddl_lib */  #endif /* TESTTEMPB_H_ */   TestTempB.cpp  #include "TestTempB.h" #include "TestTempA.h" #include "stdint.h" #include <iostream> namespace ddl_lib {  TestTempB::TestTempB() {     // TODO Auto-generated constructor stub  }  TestTempB::~TestTempB() {     // TODO Auto-generated destructor stub }  template<class ... Args> void TestTempB::callCommandB(const string& cmdName, const uint32_t* cmdSn, Args ... params) {     cout << cmdName << endl; } template<class ... Args> void TestTempB::callCommandA(const string& cmdName, Args ... params) {     callCommandB(cmdName, NULL, params...); } } /* namespace ddl_lib */   main  #include <iostream> #include "TestTempB.h" using namespace std; using namespace ddl_lib;  int main() {     string aa="15615";     bool ccc=false;     TestTempB b;     b.callCommandA("name", &aa, &ccc);//undefined reference to `void ddl_lib::TestTempB::callCommandA<std::string*, bool*>(std::string const&, std::string*, bool*)' }   I'm using the  variadic-template. Why the gcc can't deduced the real func? When the callCommandA and callCommandB in the main file,it works just fine.  #include <iostream> #include "TestTempB.h" using namespace std; using namespace ddl_lib; template<class ... Args> void callCommandB(const string& cmdName, const uint32_t* cmdSn, Args ... params) {     cout << cmdName << endl; } template<class ... Args> void callCommandA(const string& cmdName, Args ... params) {     callCommandB(cmdName, NULL, params...); } int main() {     string aa = "15615";     bool ccc = false;     callCommandA("name", &aa, &ccc); //no erro }   Why and how could I fix it? Thanks!!!

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


I am trying to get a grasp or concept understanding what how trinomials answer questions other than answering questions in an algebra class. I. Looking for the practical application. What does the first term generally represent? I believe it's called the quadratic, but I'm unsure what that means beyond that it's the definition. I know the third term is my constant, which I assume leaves the second as my variable. Sorry if my question seems I ignorant. But I'm really wanting to understand what I'm doing, beyond following formulas and delivering an answer.

I know that the first term is a quadratic and I suppose that lets us know we are dealing with identifying a curve, and the third term is our constant. I just can't quite put it all together as how they are actually working together. Such as what relationship that have to each other.. Help.


I am new to Game Development, All I have developed is some 2d Games, using Game Maker by . There game development is much more easy, just as simple as Drag and Drop. But, Now I wish to evolve in Game Development, and wanna try some hands with the common programming languages like, Java, C++ or C. In order to achieve this, I came around the first topic, Game Engine. So, What is Game Engine.? That is a broad question, with various answers. I came out with some conclusion after reading various links,  Wikipedia: A game engine is a system designed for the creation and development of video games. The core functionality typically provided by a game engine includes a rendering engine for 2D or 3D graphics, a physics engine or collision detection (and collision response), sound, scripting, animation, artificial intelligence, networking, streaming, memory management, threading, localization support, and a scene graph.  It exists to abstract the (sometime platform-dependent) details of doing common game-related tasks, like rendering, physics, and input, so that developers (artists, designers, scripters and, yes, even other programmers) can focus on the details that make their games unique. Engines offer reusable components that can be manipulated to bring a game to life. Loading, displaying, and animating models, collision detection between objects, physics, input, graphical user interfaces, and even portions of a game's artificial intelligence can all be components that make up the engine.  Now what I understand is, Game Engine takes care of all the common work, like physics, loading etc... As far my question is concerned, what is a Game Engine (Programmatically)? Is it a Library? With pre-defined functions and classes, which can be inherited? Or what so ever, what is it?

What is the difference between a game framework (for example, XNA with C#, SDL for c++) and a game engine?  Do game frameworks use engines? Does a game engine encapsulate sub-engines like physics engines, particle engines etc? Should they be used together, or are they mutually exclusively?  I take it there are separate engines for both 2D and 3D?


I have never changed this setting for an AlwasyOn setup. What is the best practise to do this? Should I change the setting on the Secondary node first and then the primary? Please suggest . The current setting is set to the default max value and that is something not which I want. Each of the server has 24gb of memory. The total size of the databases on each node is 105gb  Thanks

I'm trying to come up with a sane way to understand if the max server memory (mb) setting is appropriate (either should be lower, or higher, or stay the way it is).  I am aware that max server memory (mb) should always be low enough to leave room for the operating system itself, etc.    The environment I'm looking at has several hundred servers; I need a reliable formula I can use to determine if the present size of the buffer pool is appropriate since RAM is costed per GB allocated to each server.  The entire environment is virtualized, and "physical" RAM allocated to a VM can easily be changed up or down.  I have a particular SQL Server Instance I'm looking at now with a PLE of 1,100,052 seconds, which equates to 12.7 days (the amount of time the server has been up).  The server has a max server memory setting of 2560MB (2.5GB), of which only 1380MB (1.3GB) is actually committed.    I've read several items including one by Jonathan Keheyias () and another by Paul Randal (), and several others.  Jonathan advocates monitoring for a PLE below 300 per 4GB of buffer pool as being too low.  For the SQL Server Instance above, 300 * (2.5 / 4) = 187 results in a really really low target PLE below 300.  This instance has 290GB of SQL Server data (not including log files), and is only used for integration testing.  Assuming the last 12 days is representative of typical usage for this server, I'd say the max server memory (mb) setting could be lowered.  At the other end of the scale, I have another integration-test server with a PLE of 294, that has a max server memory (mb) setting of only 1GB.  This server has only 224MB of SQL Server data not including logs, and is running some BizFlow databases.  This server might benefit from a higher max server memory (mb) setting.  I'm thinking a good starting place for targets that might be assigned too much memory could include looking at:  SELECT      RamMB = physical_memory_in_bytes / 1048576     , BufferPoolCommittedMB = bpool_committed * 8192E0 / 1048576     , BufferPoolCommitTargetMB = bpool_commit_target * 8192E0 / 1048576     , PercentOfDesiredSizeMB = CONVERT(INT,(CONVERT(DECIMAL(18,2),bpool_committed)                              / bpool_commit_target) * 100) FROM sys.dm_os_sys_info;   If BufferPoolCommitTargetMB / BufferPoolCommittedMB is greater than 1, the server is not using the entire buffer pool.  If the machine in question also has a PLE of greater than "x" then it might be a good candidate for a decrease in max server memory (mb).  Since the Buffer Manager:Lazy writes/sec performance counter tracks the number of times SQLOS has written pages out to disk between checkpoints due to memory pressure, this might be another good thing to look at.  DECLARE @WaitTime DATETIME; SET @WaitTime = '00:00:15'; DECLARE @NumSeconds INT; SET @NumSeconds = DATEDIFF(SECOND, 0, @WaitTime); DECLARE @LazyWrites1 BIGINT; DECLARE @LazyWrites2 BIGINT;  SELECT @LazyWrites1 = cntr_value  FROM sys.dm_os_performance_counters dopc WHERE (         dopc.counter_name LIKE 'Lazy writes/sec%' COLLATE SQL_Latin1_General_CP1_CI_AS     )     AND dopc.object_name = 'MSSQL$' + CONVERT(VARCHAR(255),                SERVERPROPERTY('InstanceName')) + ':Buffer Manager';  WAITFOR DELAY @WaitTime;  SELECT @LazyWrites2 = cntr_value  FROM sys.dm_os_performance_counters dopc WHERE (         dopc.counter_name LIKE 'Lazy writes/sec%' COLLATE SQL_Latin1_General_CP1_CI_AS     )     AND dopc.object_name = 'MSSQL$' + CONVERT(VARCHAR(255),                SERVERPROPERTY('InstanceName')) + ':Buffer Manager';  SELECT LazyWritesPerSecond = (@LazyWrites2 - @LazyWrites1) / @NumSeconds;   The above code assumes the server is under load during the 15 seconds it takes to run, otherwise it will report 0; which might be a misleading false-negative.  Should I also look at PAGELATCHIO_* wait stats or some other wait type as an indicator of memory pressure, or lack thereof?   My question is, how can I reliably determine a "good" target value for PLE and max server memory (mb)?


since a couple of days iam facing the problem with internal memory of my apple iphone 4s device so can you help me to find a solution for this. my ios software is 7.1.2 and not the jailbroken piece

My iPhone 3G is currently showing 3.1GB of 'Other' disk space in iTunes, and this amount seems to be growing by about 0.1GB every couple of days.  I can't find any good references for what this space could actually be getting used for.    I've heard of doing a restore to clear it up, which works, for about a day, but then the 'Other' space starts to quickly accumulate again.  I've also done all the Internet history clearing, turning off of indexing and removing of disabled mail accounts, still no success.  I'd love to know how to either clear this stuff up, or see a decent explanation for why my phone is using all this extra space.  Here's a snapshot of what my disk usage bar in iTunes looks like:   UPDATE: My phone is not jailbroken.  It is stock IOS 4.2.1.


I have a LG Android.  How do I change language settings on the phone itself?  Sometime today, the language on the phone displays changed from English.  I'd like to return to English.  I suspect it'd be in settings, but where? Thank you.

How can I set the keyboard and language in Android, and how can I add more languages to the device?


There are a lot of answers on how to log in as a specific user. But I can't find any answer on how to check if the username and password is valid without logging in. I want to be able to do something like this:  $username = "bla@bla.com" $password = "blablabla"  $valid = checkIfValidDetails($username, $password);   I simply want $valid = true if the username and password is correct, and false if not.   How can I do that?

I am allowing users to register an account on my site. They get a specific role using user_save().  When they log in for the first time, I have to verify the login credentials.   Is there a function to verify the login credentials? Is there a function to get the user roles?


How do I recover delete files with just with just the .jpg extension in Ubuntu?  I already tried "photorec", but it recovered all the files.

I have a Toshiba satellite A-200 laptop with a Vista OS on it with 4 NTFS partitions  (C:) Vista  (D:) Entertainment  (E:) Work  (F:) Sources   and I wanted to start using Ubuntu instead. So I tried it first from the live CD and everything was OK and all the partitions were shown and working and so I decided to install Ubuntu to replace Vista on the (C:) drive. After I did that I can no longer find my folders and files on the (D:), (E:), (F:) partitions and the only file system that is shown is one 198 GB although my HDD is 320 GB.  I can't access the lost data on the remaining 120 GB which I hope is still there and not totally lost  I am now working from the live CD but I am unable to install testdisk. Can I recover the Vista partitions by the product recovery CD to get my laptop back to the factory settings? Can I recover the NTFS partitions using a recovery program for Windows or will that make the problem worse?   I need these data badly as I don't have a backup for them.


I currently have Do Not Disturb on my iPhone (iOS 9) scheduled to run while I am at college. The only issue is that I am not at college every day.   Is there a way I can schedule Do Not Disturb for certain days? (For example: Tuesday-Thursday)

I have the Do Not Disturb feature scheduled to work from Midnight to 7 am.  This works great.    However, on the weekend I like to sleep in and would like the Do Not Disturb feature to go until 9 am.  But I do not see this feature.  It's like all or nothing.  Am I missing something simple?


As we approach the age of artificial intelligence, I was curious about whole brain emulation. If a brain and consciousnesses is uploaded to a computer, is it still the same person, even if it was programmed to be the same person. I.e. if a personality is uploaded to a computer and trained to think it is the same brain, is it?

I think the answer is yes but I know a lot of people disagree. So, I would like to ask these people when exactly does it stop being me.  Let's say I want to upload my brain into a computer using the following procedure:  I have each of my neurons replaced by electronic neurons. By electronic neurons I mean chips with the necessary hardware and software to perform the exact same function that the neuron being replaced was performing. This means that given the same inputs that the biological neuron was given it would produce the same outputs. Then I connect that electronic neuron to all the neurons that former biological neuron was connected to.   At the end of this process is it still me? If not when did it stop being me? When one neuron was replaced? When 1,000 were replaced? When 1,000,000 were replaced?  (assuming it is still me)  Then, I divide these electronic neurons into groups and for each group I perform the following:   Write software to simulate the group of electrical neurons in my computer such that given the same inputs that go into the group of electronic neurons in my brain, it will produce the same outputs. Replace each group of neurons with another chip that communicates with my computer. Each of the chips will communicate to the corresponding software module in order to determine how to transform its inputs into the necessary outputs. Connect all of the inputs and outputs of the group of electronic neurons to that new chip.   At the end of this process is it still me? If not when did it stop being me? When one group was replaced? When 1,000 were replaced? When 1,000,000 were replaced?  (assuming it is still me) Now, what I have is a bunch of these new chips in my head, connected to each other and for each of these chips I have a small neural network software module in my computer. So, now for each pair of chip/software module I do this:   Transfer all connections going into and out of the chip into the computer version (i.e. connect the software module to the other software modules that represent the other chips that this chip is connected to) Disconnect the chip from the other chips and remove it   At the end of this process is it still me? If not when did it stop being me? When one of the new chips was replaced? When 1,000 were replaced? When 1,000,000 were replaced?  If it is still me then I have successfully moved my brain into a computer without ceasing being myself.  So, again the question is if at the end it is not me anymore when exactly does it stop being me and why does it stop being me?  EDIT: This question assumes that our universe and everything in it (including ourselves) follows the (testable) laws of physics. As it stands it also assumes that neuroscience is mostly right, although the question could also be considered without that requirement if instead of neural simulations we were to implement physics simulation of the brain. Of course this is a lot less practical. However, if your view is that our minds have a supernatural component then the question does not make any sense.  It was also pointed out that this is related to the Ship of Theseus, i.e. is something still the same if all its parts have been changed. With regards to that I think it is useful to consider that most of the cells in our body (not including brain cells) are regularly replaced anyway and some people even get entire organs replaced. Yet, we don't say that they stopped being themselves. Note, however, that if you are assuming a supernatural component of the mind that this explanation is not really adequate or relevant.


by monitoring of a batch job, we saw that this job started outside the scheduled time. For example, we scheduled the batch job to run at 9:00 am. However, when we checked the list of apex batch jobs, we saw the job started one at 3:00 am, although we haven't started it at that time.   How can this happen, even when you have scheduled a batch job to run at a specif time, it ran once at another time, and again at the scheduled time?.  I would appreciate your answers, guy, because there are some things in Salesforce which are not documented and no idea what't going on here.  Another point: at the same time another batch job was running, but the parallel running job has to do with Accounts. Our job has to do with a child object, Account vouchers.  It seems to be both collide causing the errors UNABLE_LOCK_ROW.  Does anybody have an idea

we are facing a serious issue. We have a batch APEX job running daily which makes updates on records fulfilling certain conditions. There is another job running parallel to this, in some cases updating or accessing to the same records than the batch job and hence, causing the error:     Update failed. First exception on row 400 with id XXX; first error:    UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or 200    records:   So, I had then read that in order to fix this kind of error you should use FOR_UPDATE in your select statement (records that have to be updated). The problem is, that you can not use FOR UPDATE for batch jobs. We tested this and effectively, we get the error:     System.QueryException: Locking is implied for each batch execution and   therefore FOR UPDATE should not be specified      It will however lock the records within each execution of execute. See   QueryLocator.getQuery()usage:      You cannot use the FOR UPDATE keywords with a getQueryLocator query to   lock  a set of records. The start method automatically locks the set   of records in  the batch.   Could you find a solution to this?. We would like to handle this in the code itself, because we don't have the permission to schedule the batch job for another time as the another job.


This is probably a pretty basic question but I'm an applied math guy trying to understand these basics: If a nonzero element of a finite ring does not have a multiplicative inverse, must that element be a zero divisor?    I've tried proving this to myself to no avail, and searches have only turned up some deep pure math stuff (as far as I'm concerned, anyways).  Thanks in advance!

If a nonzero element $a$ of a ring $\mathbb{D}$ does not have a multiplicative inverse, then $a$ must be a zero divisor.   If $\mathbb{D}$ has finitely many elements, then the statement is true. However, I don't see why, as for the infinite case, 7 isn't a zero divisor only because every element $a > 0$ when multiplied by a $b > 0$ gives you $ab > 0$ which has nothing to do with infinity or finite amounts of elements.


Find the limit of the sequence $x_{n+1}=x_n-x_n^{n+1}$ where $0<x_1<1$.   I think zero is the limit but how do I  prove that? I prove that sequence is monotone decreasing and bounded so convergent.

Let $0 < x_1 < 1$ and $x_{n + 1} = x_n - x_n^{n + 1}$ for $n \geqslant 1$.      Prove that the limit exists and find the limit in terms of $x_1$.   I have proved the existence but cannot manage the other part.  Thanks for any help.


I need to maintain last 4 recent ids (It may not be in sequence). So I have added below code.      long timeStamp = System.currentTimeMillis();     Queue<Integer> autoIds = new LinkedList<Integer>(Arrays.asList(-1,-1,-1,-1));      for(int i =1;i<2147483647;i++){         autoIds.add(i);         autoIds.poll();     }     System.out.println(System.currentTimeMillis()-timeStamp);      // 25436 or 26771... little different numbers but more then 24500     System.out.println(recentUnregisteredModuleIds);   Later I thought removing size check in if condition, may increase performance so I removed and initialize queue with some dummy 4 values.      long timeStamp = System.currentTimeMillis();     Queue<Integer> autoIds = new LinkedList<Integer>();      for(int i =1;i<2147483647;i++){         autoIds.add(i);         if(autoIds.size()>4){             autoIds.poll();         }     }     System.out.println(System.currentTimeMillis()-timeStamp);      // 19949 or 20425 ... less then 21000 in different times     System.out.println(recentUnregisteredModuleIds);   But when I compare the execution time adding additional if condition to check queue size before poll is better in performance. I thought adding one additional condition will decrease the performance, here that's not true how ?

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


I was asked to write a program that encrypts a file by adding 5 to every byte of it and then write another program to decrypt the file. And here is the program I wrote. But it doesn't work. It encrypted a file successfully but then could not restore it back to the origin. The result of the decryption is just a file with some weird symbols in it.  import java.io.EOFException; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException;   public class CryptingFile  {     public static void main(String[] args)     {                        if(args.length != 3 || (args[2].compareTo("-en") != 0 && args[2].compareTo("-de") != 0))         {             System.out.println("Usage: sourceFile targetFile -<option>");             System.out.println("<option>: ");             System.out.println("    en :            encrypt");             System.out.println("    de:             decrypt");             System.exit(0);         }          try          {             File fileInput = new File(args[0]);             File fileOutput = new File(args[1]);              FileInputStream input = new FileInputStream(fileInput);             FileOutputStream output = new FileOutputStream(fileOutput);              if(args[2] == "-en")             {                 int value;                  while((value = input.read()) != -1)                     output.write(value + 5);              }             else             {                int value;                 while((value =  input.read()) != -1)                     output.write(value - 5);               }               input.close();             output.close();           }          catch (FileNotFoundException ex)          {             System.out.println("Error " + args[0] + " not found");         } catch (IOException ex)          {             System.out.println("Error reading file");         }       } }   This is a result it should look like:     This is a test file.   But it looks something like this:     J^_i_iWj[ij_b[$

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?


$2^{3^n}$ must be 2 mod 3, which it must be since it is 0 mod 2. However, for certain cases, this does not hold, and I have trouble showing why.

Prove that $2^{2\cdot 3^{n-1}}\equiv 1+3^n\pmod{3^{n+1}}$ for every natural $n$   Of course, should be done by induction. Base case ($n=1$) is easy.  I got stuck with the step:  Let's assume that it's right for $n$. Then,  $$2^{2\cdot 3^{n-1}} = 1 + 3^n \pmod{3^{n+1}}$$  We want to evaluate $$2^{2 \cdot 3^n} \pmod {3^{n+2}}$$  I think we can somehow utilize the fact that $2,3$ are coprime and reduce $3^{n+2}$ to $3^{n+1}$.   I'd be glad for help on that.  Thanks!


I have run a server with 2vcpu and 4 GB of ram. my software setup is apache2+php7.0+drupal-7. I'm facing 100% CPU utilization due to the un-named process called [] and is owned by www-data. (screenshot FYR). looking for solution..

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


If $0< a < 1$; show that $\lim na^n$ goes to $0$ as $n$ goes to $\infty$   I know that when $0< a < 1$, $\lim a^n$ goes to $0$ and $\lim n$ goes to $\infty$  $|a^n| <\epsilon$ take $\epsilon_0 = \epsilon/|n|$ then $|a^n| < \epsilon_0 = \epsilon/|n|$, then $|n||a^n|< \epsilon$, and since $|na^n|\le|n||a^n|< \epsilon$, then $|na^n|< \epsilon$   Is this kind of argument sufficient for this case?

Prove that if $|a|<1$ ($a$ is real) so $\lim_{n\to \infty}na^n=0$.  I know that I need to use squeeze theory (because I have $-1<a<1$) but I dont see how.  thanks


I have a staff member with a Win8 Asus Laptop.  They have decided they want to wipe it clean and install Windows7. There is no data on the computer they want to preserve.  So, I have a new copy of Win7 Home Premium to install on it. I've tried using custom install and selected the partition and everything seems to go fine. However, when it comes to reboot after installation, it hangs at 'starting windows'. Safemode hangs as disk.sys.   I'm leaning towards deleting all the partitions as I think there is some issue with the Win8 partitions.  What is the best way to replace Win8 with Win7 on a clean computer where there isn't any data or settings to worry about? Should I partition or wipe the whole drive? What is the best way to tackle this problem?

I recently purchased an ASUS K55A. Like all Windows 8 machines, it come with a UEFI feature called Secure Boot. This basically makes sure that the laptop won't load anything other than the Windows 8 OEM version that came with it.  However the Asus UEFI allows for me to disable Secure Boot, and therefore I should be able to revert to Windows 7, Linux, etc. (drivers may or may not be supported). When I insert my Linux Mint boot disc and try to boot from it, though, nothing happens. There isn't even a boot priority list in the UEFI settings (I can provide screenshots later). It just says "Windows 8 Bootloader" and also on the other tab it says "WINDOWS 8 BOOT OVERRIDE".  Has anybody purchased a Windows 8 machine and successfully installed Windows 7 or Linux on it?


I know that $\sum_{n\geq 1} \frac{1}{n^2}=\pi^2/6$, is there a simple way to get an explicit closed form $\sum \frac{1}{an^2+bn+c}$, where $a,b,c$ are integers, $a\neq 0$?

I would like to evaluate the sum  $$\sum_{n=0}^\infty \frac{1}{an^2+bn+c}$$  Here is my attempt:    Letting    $$f(z)=\frac{1}{az^2+bz+c}$$  The poles of $f(z)$ are located at   $$z_0 = \frac{-b+\sqrt{b^2-4ac}}{2a}$$  and  $$z_1 = \frac{-b-\sqrt{b^2-4ac}}{2a}$$  Then  $$ b_0=\operatorname*{Res}_{z=z_0}\,\pi \cot (\pi z)f(z)= \lim_{z \to z_0} \frac{(z-z_0)\pi\cot (\pi z)}{az^2+bz+c}= \lim_{z \to z_0} \frac{\pi\cot (\pi z)+(z_0-z)\pi^2\csc^2 (\pi z)}{2az+b} $$  Using L'Hopital's rule. Continuing, we have the limit is  $$ \lim_{z \to z_0} \frac{\pi\cot (\pi z)+(z_0-z)\pi^2\csc^2 (\pi z)}{2az+b}= \frac{\pi\cot (\pi z_0)}{2az_0+b} $$  For $z_0 \ne 0$  Similarly, we find  $$b_1=\operatorname*{Res}_{z=z_1}\,\pi \cot (\pi z)f(z)=\frac{\pi\cot (\pi z_1)}{2az_1+b}$$  Then   $$\sum_{n=-\infty}^\infty \frac{1}{an^2+bn+c} = -(b_0+b_1)=\\ -\pi\left( \frac{\cot (\pi z_0)}{2az_0+b} + \frac{\cot (\pi z_1)}{2az_1+b}\right)=  -\pi\left( \frac{\cot (\pi z_0)}{\sqrt{b^2-4ac}} + \frac{\cot (\pi z_1)}{-\sqrt{b^2-4ac}}\right)= \frac{-\pi(\cot (\pi z_0)-\cot (\pi z_1))}{\sqrt{b^2-4ac}}= \frac{\pi(\cot (\pi z_1)-\cot (\pi z_0))}{\sqrt{b^2-4ac}} $$  Then we have  $$\sum_{n=0}^\infty \frac{1}{an^2+bn+c} = \frac{\pi(\cot (\pi z_1)-\cot (\pi z_0))}{2\sqrt{b^2-4ac}}$$    Is this correct?  I feel like I made a mistake somewhere.  Could someone correct me?  Is there an easier way to evaluate this sum?


How to compute the value of $\sum\limits_{n= 0}^\infty \frac{n^2}{n!}$ ?   I started with the ratio test which told me that it converges but I don't know to what value it converges. I realized I only know how to calculate the limit of a power/geometric series.

For some series, it is easy to say whether it is convergent or not by the "convergence test", e.g., ratio test. However, it is nontrivial to calculate the value of the sum when the series converges. The question is motivated from the simple exercise to determining whether the series $\sum\limits_{k=1}^{\infty}\frac{k^2}{k!}$ is convergent. One may immediately get that it is convergent by the ratio test. So here is my question:     What's the value of $$\sum_{k=1}^{\infty}\frac{k^2}{k!}?$$


I get this message everytime I log in:     Failure to download extra data files      The following packages requested additional data downloads after   package installation, but the data could not be downloaded or could   not be processed.      ttf-mscorefonts-installer      The download will be attempted again later, or you can try the   download again now.  Running this command requires an active Internet   connection.   When I try to reinstall the package, I get this error:  $ sudo apt-get install --reinstall ttf-mscorefonts-installer             Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded. Need to get 0 B/29,5 kB of archives. After this operation, 0 B of additional disk space will be used. Preconfiguring packages ... (Reading database ... 322478 files and directories currently installed.) Preparing to unpack .../ttf-mscorefonts-installer_3.4+nmu1ubuntu2_all.deb ... mscorefonts-eula license has already been accepted Unpacking ttf-mscorefonts-installer (3.4+nmu1ubuntu2) over (3.4+nmu1ubuntu2) ... Processing triggers for fontconfig (2.11.94-0ubuntu1.1) ... Processing triggers for update-notifier-common (3.168.2) ... ttf-mscorefonts-installer: processing... ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/andale32.exe Err:1 http://downloads.sourceforge.net/corefonts/andale32.exe   The HTTP server sent an invalid Content-Range header Bad header data [IP: 78.35.24.46 80] W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/andale32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) E: Failed to fetch http://netcologne.dl.sourceforge.net/project/corefonts/the fonts/final/andale32.exe  The HTTP server sent an invalid Content-Range header Bad header data [IP: 78.35.24.46 80]  E: Download Failed Setting up ttf-mscorefonts-installer (3.4+nmu1ubuntu2) ...   What could I do?  UPDATE  Seems like there is a bug about this topic:

This is an old problem that deserves a bugfix, but it's getting beyond a joke now and I can't seem to work around it.  I keep getting the dreaded failed To download extra data files error in relation to ttf-mscorefonts-installer:    Repeatedly asking it to try again doesn't help, additionally, repeatedly trying-  sudo rm -rf /var/lib/update-notifier/package-data-downloads/partial/* sudo apt-get --purge --reinstall install ttf-mscorefonts-installer   Isn't working either.  I just get at least one 404 error from one of the sourceforge links that stops it working-  Reading package lists... Done Building dependency tree        Reading state information... Done 0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 20 not to upgrade. Need to get 0 B/29.5 kB of archives. After this operation, 0 B of additional disk space will be used. Preconfiguring packages ... (Reading database ... 352049 files and directories currently installed.) Preparing to unpack .../ttf-mscorefonts-installer_3.4+nmu1ubuntu2_all.deb ... mscorefonts-eula license has already been accepted Unpacking ttf-mscorefonts-installer (3.4+nmu1ubuntu2) over (3.4+nmu1ubuntu2) ... Processing triggers for fontconfig (2.11.94-0ubuntu1.1) ... Processing triggers for update-notifier-common (3.168.2) ... ttf-mscorefonts-installer: processing... ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/andale32.exe Get:1 http://downloads.sourceforge.net/corefonts/andale32.exe [198 kB] Fetched 198 kB in 0s (339 kB/s)                                                 W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/andale32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/arial32.exe Get:1 http://downloads.sourceforge.net/corefonts/arial32.exe [554 kB] Fetched 554 kB in 0s (575 kB/s)                                                 W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/arial32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/arialb32.exe Get:1 http://downloads.sourceforge.net/corefonts/arialb32.exe [168 kB] Fetched 168 kB in 0s (306 kB/s)                                                 W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/arialb32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/comic32.exe Err:1 http://downloads.sourceforge.net/corefonts/comic32.exe   404  Not Found W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/comic32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) E: Failed to fetch https://netix.dl.sourceforge.net/project/corefonts/the fonts/final/comic32.exe  404  Not Found  E: Download Failed Setting up ttf-mscorefonts-installer (3.4+nmu1ubuntu2) ...   The specific point at which it fails to download changed - it seems to be a sourceforge reliability problem, but this has now been going on weeks and results in annoying popups as above all the time.  How do we get this fixed and/or how can I work around it for now.


How do i fix this problem without using null space matrix?   $$4NH_3 + Cl_2 \rightarrow N_2 H_4 + 2NH_4Cl$$  Also before that, I need to learn how to find vectors. If someome show me it, it would be great.

I know there are already plenty of questions on this site regarding this topic but I am having difficulty with a particular chemical equation.  I am trying to balance the following:  $$ { C }_{ 2 }{ H }_{ 2 }{ Cl }_{ 4 }\quad +\quad { C }a{ { (OH }) }_{ 2 }\quad \xrightarrow [  ]{  } \quad { C }_{ 2 }{ H }{ Cl }_{ 3 }\quad +\quad Ca{ Cl }_{ 2 }\quad +\quad { H }_{ 2 }{ O } $$  The system of linear equations produces the following augmented matrix:  $$ \begin{pmatrix} 2 & 0 & -2 & 0 & 0 & 0 \\ 2 & 2 & -1 & 0 & -2 & 0 \\ 4 & 0 & -3 & -2 & 0 & 0 \\ 0 & 1 & 0 & 1 & 0 & 0 \\ 0 & 2 & 0 & 0 & -1 & 0 \end{pmatrix} $$  With the rows in the following order: Carbon Hydrogen Chlorine Calcium Oxygen  In row echelon form this reduces to:  $$ \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 \end{pmatrix} $$  Which would indicate that: x1 = 0; x2 = 0; x3 = 0; x4 = 0; x5 = 0 which is obviously not correct. What have I done wrong?


Accidentally, I closed the terminal in the middle of the process of   sudo apt-get upgrade firefox   Is this dangerous? If any one has this experience then please share your problems and errors which you have got.

so i use computer for unknown time. sometimes i use it for more than 3 hr. and sometimes lesss than half hour. what will happen if i will stop the update from the terminal when the packages are being  Q1- Downloaded? Q2- Installed?


Whenever I try to connect to a server (only in the modpack SkyFactory 3, usually Minecraft connects ok) the game gives me this error: "Failed to login: Invalid Session (Try restarting your game)".

When I try to connect to servers or join up on lan worlds in Minecraft it says "Failed to Login : Invalid session (Try restarting your game)". Multiplayer used to work fine but now keeps coming up with this error. Can anybody help?


I'm a freelancer and I work for customers from Europe (mostly, but no other customer is from US or any related territories). Is it legal for me to work remotely for such customers, during my stay on a B1/B2 visa?  The purpose of the visit would be tourism only, but as I intend to stay for quite a time, I would need to earn some extra money (and prevent my existing business relationships).  I think B visas prohibit working/receiving money from US-based companies only, is that correct?  EDIT: Please note that this is about freelancing - running your own company/self-employment and having business relations with customers rather then working for home company you are permanent employee of.

I would like to travel in the USA for a period of 3 - 6 months. But I want to spend some time working for my employer (remote work) and getting paid by the employer. Is this possible under a tourist visa (B1/B2)?  I hope this is OK since I will not be getting paid by a US employer. I am in the IT trade so all that I will be needing is my own laptop and a connection to the internet. The money I earn would actually help me pay for the expenses I get during the holiday.


I have to do an app for the university ( and I'm not allowed to use express or other similar modules ) and I was wondering how do you specify the route on which you write a cookie. Why ?  So far I've noticed that cookies are stored mainly on domains, but if u set a cookie on localhost:3000/ the cookie will be on the subroutes too, however if you set a cookie on localhost:3000/someroute, then that cookie won't be on "/" .      So how do you set a cookie on "/" when you are on "/someRoute" and as   well how can you delete a cookie ?   This is how I've been writing on cookies so far  res.writeHead(302, { 'Set-Cookie': 'session='+sessionID });         Please Note that I ask how you edit those cookies on specific routes, and not how they work

Let say I have a website with domain: www.example.com  If I set a cookie with path '/' the cookie will be accessible via all pages in the domain, eg:   www.example.com/page1.html www.example.com/subfolder1/page1.html www.example.com/subfolder1/moresubfolder1/page1.html, etc.   What if we set the cookie to path '/subfolder1', will the cookie will be made available to any page or subfolder beneath the folder? Eg:   www.example.com/subfolder1/moresubfolder/page1.html   So, if not, I guess, I have no choice but to use path '/' for those cookies, right?


I have just acquired a laptop which is running Ubuntu. I have no experience with Ubuntu so I want to uninstall it and install Windows instead. I have no idea how to do this so if anyone can help, I would appreciate it.

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


Please refer to the following image:    I have the real height of the building which is $12.5 \text{ m}$ (red line).  I have the blue lines in the image (pixels) as well as the red line.  I have the vanishing point - the intersection of the blue lines.  Is it possible to calculate the real length of the blue line either in the world or in the image? Or what else do I need for calculating that?

If I have a photograph of a rectangular object whose image recedes with perspective, is it possible to work out the scale of measurements along that object?  For example: I have a photograph of a (metric) ruler.  The ruler is graduated in centimetres as shown, 30 cms.  Is it possible to work out the distance between each centimetre?  The screenshot shows the photograph.  The representation on the Picture Plane shows the nearest edge of the ruler to be 50mm and the farthest edge to be 15mm. By measuring the photo, I see that the distance between 0 and 1 is 7.5mm and the distance between 27 and 28 is 0.9mm.  Is there a way to get these results from a formula?  It doesn't need to be 100% accurate: it's for photometric software I'm writing, so it's only going to be used as a rough guide.