I checked implementation of System.out.println(), which is as follows and I have read  question.  public void println(int x) {     synchronized (this) {         print(x);         newLine();     } }   According to above implementation the lock is on this object, so what is the advantage of using synchronized block instead of synchronized method in the above case?
Can any one tell me the advantage of synchronized method over synchronized block with an example?
Suppose $f$ and $g$ are entire functions with $|f(z)|\leq|g(z)|$ for all $z$.  How can we show that $f=cg$ for some complex constant $c$?  Thanks for any help :) Get table names using SELECT statement in MySQL Catenatives followed by infinitives and gerunds Grub: reboot to specific kernel I'd like to ask for help getting grub-reboot to work.  The theory: According to  (and other sources) I should be able to choose the kernel for the next reboot, using grub-reboot. However, this does not work for me; grub always boots to the default kernel.  Here's what I tried:  $ grep GRUB_DEFAULT /etc/default/grub GRUB_DEFAULT=saved $ grep "menuentry " /boot/grub/grub.cfg  menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f3a807d1-3fd6-4970-b741-5382e9801060' {     menuentry 'Ubuntu, with Linux 4.4.0-43-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-43-generic-advanced-f3a807d1-3fd6-4970-b741-5382e9801060' {     menuentry 'Ubuntu, with Linux 4.4.0-43-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-43-generic-recovery-f3a807d1-3fd6-4970-b741-5382e9801060' {     menuentry 'Ubuntu, with Linux 4.4.0-36-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-36-generic-advanced-f3a807d1-3fd6-4970-b741-5382e9801060' {     menuentry 'Ubuntu, with Linux 4.4.0-36-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-36-generic-recovery-f3a807d1-3fd6-4970-b741-5382e9801060' {  # Version 1, using the name $ sudo grub-reboot "Ubuntu, with Linux 4.4.0-36-generic"  # Version 2, using the id $ sudo grub-reboot gnulinux-4.4.0-36-generic-advanced-f3a807d1-3fd6-4970-b741-5382e9801060  # Version 3, counting $ sudo grub-reboot 3   Neither of these commands seem to have an effect; after reboot, I always end up with the 4.4.0-43 kernel.  Note: This is on Ubuntu 16.04 Xenial. It is a server machine and I don't have access to the console during boot, so I can't look at the grub menu :( A physical explanation for negative kelvin temperatures Calculation of number density from material density Material density is given by $ \rho =m/V$, where $m$ is mass and $V$ is volume. Again number density given by $n=N/V$, where $N$ is the total number of particle. How can I calculate number density $n$ from material density $ \rho $. Comments are useful. Many, many posts need some small amount of meta discussion, and comments fulfill this need.   Comments are also noisy and distracting. Occasionally, someone will post an insightful and informative comment that complements the post its attached to... But more often, they're tangential, quickly irrelevant and in the way: stale comments show up first, making newer comments less visible.  The guidance here for a long time has been that comments are transient, . And yet, some do hang around for months or years because .   So let's fix that.   I propose that all comments older than 7 days be hidden by default unless the comment has been up-voted in the past 30 days. Hidden comments should be indicated by a note below the post ("add / show 3 more comments") and made visible to anyone who cares to click it.   This doesn't destroy anything, but it would get it out of the way of most readers - and hopefully encourage folks to edit it into the actual answers as a result.  Note: I previously suggested this . Other  have been . However, I'm not suggesting that comments be automatically deleted, and they should be hidden based purely on the age / activity of the comment itself, not of the post to which they're attached. Number of automorphisms of a direct product of two cyclic $p$-groups Is it possible to make an EXACT ISO of my system to put on other computers? In follow up to , it appears that some numbers cannot be represented by floating point at all, and instead are approximated.  How are floating point numbers stored?  Is there a common standard for the different sizes?  What kind of gotchas do I need to watch out for if I use floating point?  Are they cross-language compatible (ie, what conversions do I need to deal with to send a floating point number from a python program to a C program over TCP/IP)? How does this wiring work? I have a Trane XV90 and XL 14i. The wiring looks a little strange as in the picture bellow.                    _____________                   |           |   BK W2  W1   R  G  Y  B/C  YLO O     |___||   |__|  ||   |          |   |     ||   |_____>|----------|         |   |     ||_________>|other wire|         |   |     |           ------------         V   V     V     ---------------     |thermostat   |     ---------------  The R and G are jumpered together and the G wire is connected on the board  but is actually not connecting to the thermostat on the other end. So people told me that means the furnace fan is always on! (In my diagram above, I switched the location of Y and B/C to make diagram easier to draw. You can refer to the photo added below to see the details) My questions are the following  is the jumper between O and Y doing anything? I don't think I have heat pump I need to install Honeywell wifi thermostat and I am thinking of doing either one of the following:   remove jumper between R and G, and use G to connect B/C and then to thermostat C and put jumper between G and Y  leave jumper between R and G, and use G to connect B/C and then to thermostat C and put jumper between G and Y  remove jumper between R and G, connect G on control board to thermostat G, and finally have the spare wire to connect B/C and then thermostat C  leave jumper between R and G, does not connect G to thermostat,  and just use a spare wire to connect B/C on board to thermostat C   Can anyone comment on those plans? Thanks a lot! How to sort a list of objects based on an attribute of the objects? I've got a list of Python objects that I'd like to sort by an attribute of the objects themselves.  The list looks like:  &gt;&gt;&gt; ut [&lt;Tag: 128&gt;, &lt;Tag: 2008&gt;, &lt;Tag: &lt;&gt;, &lt;Tag: actionscript&gt;, &lt;Tag: addresses&gt;,  &lt;Tag: aes&gt;, &lt;Tag: ajax&gt; ...]   Each object has a count:  &gt;&gt;&gt; ut[1].count 1L   I need to sort the list by number of counts descending.  I've seen several methods for this, but I'm looking for best practice in Python. How can I stop using beta iOS on my iPhone? I'm currently on the beta program on my iPhone. How can I stop using the beta versions and go back to the newest version of iOS (non-beta)? I would like to clarify the differences between by value and by reference.  I drew a picture     So, for passing by value,  a copy of an identical object is created with a different reference, and the local variable is assigned the new reference, so to point to the new copy  How to understand the words: " If the function modifies that value, the modifications appear also within the scope of the calling function for both passing by value and by reference "  Thanks! What does the word treats mean in this context? I don't think it means entertainment, food, drink etc.. Maybe it is an old usage of this word? Does it mean influencing factors or something like that?  This is the first part of the title of the first chapter of the novel "Oliver Twist" by Charles Dickens. The whole title reads:     Treats of the Place Where Oliver Twist was Born and of the Circumstances Attending His Birth Given $S \hookrightarrow T$ construct $U ≈ T$ disjoint from $S$ in Z set theory? New to both Ruby and Rails but I'm book educated by now (which apparently means nothing, haha).  I've got two models, Event and User joined through a table EventUser  class User &lt; ActiveRecord::Base   has_many :event_users   has_many :events, :through =&gt; :event_users end  class EventUser &lt; ActiveRecord::Base   belongs_to :event   belongs_to :user    #For clarity's sake, EventUser also has a boolean column "active", among others end  class Event &lt; ActiveRecord::Base   has_many :event_users   has_many :users, :through =&gt; :event_users end   This project is a calendar, in which I have to keep track of people signing up and scratching their name out for a given event. I figure the many to many is a good approach, but I can't do something like this:  u = User.find :first active_events = u.events.find_by_active(true)   Because events don't actually HAVE that extra data, the EventUser model does.  And while I could do:  u = User.find :first active_events = [] u.event_users.find_by_active(true).do |eu|   active_events &lt;&lt; eu.event end   This seems to be contrary to "the rails way".  Can anyone enlighten me, this has been bugging me for a long time tonight (this morning)? How to get text in between two sections? I want to get text in between START &amp; STOP. Remaining text should be deleted, like some_text_1 and some_text_2.  some_text_1 some_text_1 . . . START --- Values that I want to get ... STOP some_text_2 some_text_2   From my findings, sed does similar job, but only oposite, like: sed '/START/,/STOP/d' file which would give me everything else then content in between START &amp; STOP.  Any idea? EntityFramework - contains query of composite key Python inheritance - how to disable a function In C++ you can disable a function in parent's class by declaring it as private in the child class. How can this be done in Python? I.E. How can I hide parent's function from child's public interface?