HTTP request with generic class in Java
Unable to get a generic ResponseEntity where T is a generic class "SomeClass"
Strict warning: Only variables should be passed by reference I get the following error:     Strict warning: Only variables should be passed by reference in include() (line 18 of /home/sites/dev/theparce/sites/all/themes/parce/block--block--3.tpl.php).   This is the block code which is causing that error.  if ($user_gallery) {   print render(node_show($user_gallery));  // Line 18   print drupal_render ($user_gallery_edit);  } else {   print drupal_render($user_gallery_new); }   Why do I get that error, even if I get all printed as expected? Getting "Authentication is required" when trying to access the Play Store Over the past week, whenever I try  to open the Play Store/Market app on my phone, the app thinks for a while and then displays this error message:     Authentication is required. You need to sign into your Google Account.   But I am indeed signed into my Google account, as seen in other Google applications running on the phone, and as seen if I open the menu in the Market app and click the "Accounts" button.  I suspect this might be related to the fact that over the past few months I've had two different Google accounts synced to this device, and I have recently removed one of them from the phone. No other Google application has had any problems with removing one account.  Does anyone know how I can solve this issue? I can still install applications by using the market website (now "Google Play"), but this is still a big inconvenience. I also think I stopped getting updates. Why not brew wine and make beer? Non native speaker so I can't fully discern the difference.  Thanks. Linux ACL behaviour: settings the mask changes 'ls' output, but not actual permissions It might be the time of night, but this is puzzling me. Picture the following.  [root@node1 acltest]# getfacl foo/ # file: foo # owner: root # group: testuser user::rwx group::r-x other::---  [root@node1 acltest]# ls -la . total 24 drwxr-xr-x  3 root root     4096 Feb  9 21:53 . drwxr-xr-x 25 root root     4096 Feb  9 21:54 .. drwxr-x---  2 root testuser 4096 Feb  9 21:53 foo [root@node1 acltest]# setfacl -m m::rwx foo [root@node1 acltest]# getfacl foo/ # file: foo # owner: root # group: testuser user::rwx group::r-x mask::rwx other::---  [root@node1 acltest]# ls -la . total 24 drwxr-xr-x   3 root root     4096 Feb  9 21:53 . drwxr-xr-x  25 root root     4096 Feb  9 21:54 .. drwxrwx---+  2 root testuser 4096 Feb  9 21:53 foo [root@node1 acltest]# su - testuser [testuser@node1 ~]$ cd /acltest/foo/ [testuser@node1 foo]$ ls -la . total 16 drwxrwx---+ 2 root testuser 4096 Feb  9 21:53 . drwxr-xr-x  3 root root     4096 Feb  9 21:53 .. [testuser@node1 foo]$ touch bar touch: cannot touch `bar': Permission denied   In words: I create a directory foo, with mode 0750, root as owner and testuser as the group. (testuser is the private group of testuser, but that doesn't matter.)  The getfacl command correctly shows no ACL's on this directory and there is not mask yet. The mask will be set accordingly to the group permissions if I would add a named group or user now.  If I explicitly set the mask to rwx now, the group permissions as shown by ls change too. I know it happens the other way around (the mask changes when the group permissions change), but this seems puzzling.  The more puzzling because the getfacl output does not show the group permissions as rwx but - as said - ls does.  Which one is right? Apparently, the output of getfacl is right, because testuser cannot write to foo. As expected, by the way, because I did not grant the testuser group any permissions to do so.  It goes on. I cannot allow the testuser group write permissions on foo by just using chmod. I have to explicitly set an ACL using setfacl -m g:testuser:rwx foo to allow testuser to finally touch foo/bar.   Can someone explain the rationale behind the difference in the outputs of getfacl and ls? I know it can be tricky to have normal permissions go together with ACL's, but this seems plain wrong. (Though I expect to be missing something glaringly obvious ;))  I have already seen I got this $$ f=a(x-1)(x-2)...(x-101) $$ knowing a and that $1 ,2 \ldots ,101$ are it's roots ... I need the roots of $f'$ , how should I do it ? More specifc how can I derivate a polynomial like that, is there a formula or something ? I have a list with 15 numbers in, and I need to write some code that produces all 32,768 combinations of those numbers.   I've found  (by Googling) that apparently does what I'm looking for, but I found the code fairly opaque and am wary of using it. Plus I have a feeling there must be a more elegant solution.  The only thing that occurs to me would be to just loop through the decimal integers 1–32768 and convert those to binary, and use the binary representation as a filter to pick out the appropriate numbers.   Does anyone know of a better way? Using map(), maybe? At some point in (I think) the 90s, I saw an episode of something like Outer Limits or Twilight Zone where nobody was allowed to have more than average intelligence. Smarter children had to wear headsets which inhibited them from being too intelligent, administering minor electric shocks if intellectual thought was detected.  I can remember a final (or near final) scene of somebody watching his suicide and being upset but not remembering why because of the headset.  Can anybody identify the show and episode? At 12 o'clock, the hour hand and minute hand of the clock can be swapped, and the clock still gives the same time, but at 6 o'clock, it can not be swapped. So in what cases when we swap the hour and the minute hand position does a clock still give a valid time? In Harry Potter and the Philosopher's Stone, Hermione is in the toilets when Harry and Ron lock in the troll. She lies and says that she went looking for the troll. Why? She could have just said that she was in there because she needed the toilet (she was allowed to be, it's a girls' bathroom) and Harry and Ron came to save her.   Is there a reason she lied? I have some doubts regarding net run rate in the ongoing ICC world twenty 20 2014 event.It takes a while to read so please don't hesitate and give me a solution regarding this.    My doubt is that in match 12 of world twenty 20 2014(In Group Stage Last Match on march 21 2014) () Wesley Barresi of Netherlands hit a six when the team score was 187 while chasing Ireland score of 189, That take Netherlands score to 193.  If that is the case in match 17 between India and West Indies in match of super10 group (in ICC world twenty 20 2014 on march 23 2014) () while Suresh Raina (India) hit a four when the team score was 129 while chasing West Indies score of 129,That takes India Only To 130. why Only One run is added to the score in this match(match 17 on march 23 2014) while 6 runs are added to the score in match 12 on march 21 2014.  I don't understand the strategy behind this.Because if India's Score is taken as 133 then India's net run rate as of now(24 march 2014) will be 0.442(Runs Scored For 264 in 38.1 overs ) But Now it is only 0.383(Runs Scored For 261 in 38.1 overs ).As the net run rate plays an important role in the tournaments like this i am not very happy with this.  As being an Indian Fan now a days I look a lot in to net run rate as it has eliminated India in many tournaments including last ICC world twenty 20 2012.  Is There Any One who can clarify my doubts regarding the net run rate as i want to be sure of what was happening? How to compress entire drive C in Windows including locked files? Let $g(x)\in \mathbb{Z}[x]$, a nonconstant polynomial. Show that the set of primes $p$ such that $p\mid g(n)$ for some $n\in \mathbb{Z}$ is infinite.  I don't know how to start. I have tried asuming that the set is finite but i haven't reached any contradiction. Mac equivalent of Ctrl + Space to select an item on a list I want to select non-consecutive items on a list, without using a mouse/trackpad - there should be no clicks involved.  In Windows and Linux (at least Ubuntu) an item can be selected using Space/ button, which, in combination with arrows and Ctrl key allows me to select multiple items in any environment (file manager, IDE etc.) - e.g.  Enter a directory -> hold Ctrl -> down arrow twice -> press Space -> down arrow twice -> press Space.  Now I should have items 1, 3 and 5 selected. Is there a way to do the same thing in OS X?  PS. Sorry for such a verbose description, but so far every answer I encountered advices using Command + Click, and this is something I don't want to do. Consider a block cipher with a key of size 128 bits but a small block size, say 32 bits.  Is this kind of block cipher secure?  I would like to know to what extent I can use a small block cipher, like a 32 bit block cipher. What are the constraints so that the use is acceptable in a real life application.  For instance, if we use a one-time key, that is, to encrypt only one message. Besides, the message could be small.  Suppose that when we want so send one file, we perform a key agreement so that we use the key for one message. This scenario is not efficient, but the CPA find-then-guess game is not adequate in this case. Real Size Image Printing A function $f: \mathbb R \to \mathbb R$ satisfies equation $f(x+y)=f(x)f(y)$ for all $x,y\in \mathbb R $ Is linear algebra more “fully understood” than other maths disciplines? In , it was discussed how LA is a foundation to other branches of mathematics, be they pure or applied. One answer argued that linear problems are fully understood, and hence a natural target to reduce pretty much anything to.   Now, it's evident enough that such a linearisation, if possible, tends to make hard things easier. Find a Hilbert space hidden in your domain, obtain an orthonormal basis, and bam, any point/state can be described as a mere sequence of numbers, any mapping boils down to a matrix; we have some good theorems for existence of inverses / eigenvectors/exponential objects / etc..  So, LA sure is convenient.  OTOH, it seems unlikely that any nontrivial mathematical system could ever be said to be thoroughly understood. Can't we always find new questions within any such framework that haven't been answered yet? I'm not firm enough with G&ouml;del's incompleteness theorems to judge whether they are relevant here. The first incompleteness theorem says that discrete disciplines like number theory can't be both complete and consistent. Surely this is all the more true for e.g. topology.  Is LA for some reason exempt from such arguments, or does it for some other reason deserve to be called the best understood branch of mathematics? I have a issue with my Drupal installation, for example:   when I enable or disable the modules, It redirects me to a blank page, when I create a new content type and save it, redirects me to a blank page, when I add a new view and save it, it redirects me to a blank page, when I try to clear the cache, it redirects me back to a blank page, or in similar cases.   Basically all the confirmation pages redirect me to a white screen. When I refresh it again, it shows me the page. I tried to increase the PHP memory value but it doesn't help.  Are there any other solutions for this?  The error which I'm having:      Fatal error: Allowed memory size of 100663296 bytes exhausted (tried to allocate 8192 bytes) in sites/all/modules/views/plugins/views_plugin_localization_none.inc on line 1 Equaling 3 Displays Total (or 2, if the laptop display cannot be used).  I work at home on two large monitors, but at the office on a laptop with a single large monitor. Is it possible to attach two (or more?) external monitors to a laptop without having them clone each-others display? How can I model flips until N successes? You and I decide to play a game where we take turns flipping a coin. The first player to flip 10 heads in total wins the game. Naturally, there is an argument about who should go first.  Simulations of this game show that the player to flips first wins 6% more than the player who flips second (the first player wins approx 53% of the time).  I'm interested in modelling this analytically.  This isn't a binomial random variable, as there are no fixed number of trials (flip until someone gets 10 heads). How can I model this?  Is it the negative binomial distribution?    So as to be able to recreate my results, here is my python code:  import numpy as np from numba import jit   @jit def sim(N):      P1_wins = 0     P2_wins = 0      for i in range(N):          P1_heads = 0         P2_heads = 0         while True:              P1_heads += np.random.randint(0,2)              if P1_heads == 10:                 P1_wins+=1                 break              P2_heads+= np.random.randint(0,2)             if P2_heads==10:                 P2_wins+=1                 break     return P1_wins/N, P2_wins/N   a,b = sim(1000000)