![two dc voltage sources are in parllel & they are grounded.so what reading voltmeter will show? ][two dc voltage sources of different voltage are in parllel & they are grounded.so what reading voltmeter will show?]

I have a computer power supply that I'm hacking together as a bench supply. For this particular model to power on, I need a minimum load across both +5V and +12V.  "Easy," I thought, "I'll just connect both +5 and +12 to my power resistor!" And it worked, but then I started thinking, what does it mean to have these two different voltages connected in parallel? If the voltages were the same, then I would be . But what about different voltages?  Also, what if I connected +5 and +12 in series, and then put a load on that? The equivalent voltage would be +17V; what would be the difference between that and parallel?  Or am I going about this the wrong way; should I put a separate resistor on each rail? It seems like I can do better than that.


In Breaking Bad, Walt wouldn't want his son to know he was a killer at all but especially not to think he killed his uncle.  Why didn't Walt say in Ozymandias (S5/14) the Nazi gang killed Hank whenever Skyler is asking him where Hank is?  I know Walt alluded to Skyler on the phone that he killed Hank to sound even more dangerous and he told her in Felina that some men killed him but Walt Jr will still think his Dad murdered his uncle.

Why did Walt tell Skyler he killed Hank in Breaking Bad? Was Walt trying to send a message? Was he trying to protect Jack's men?


Show that, for every positive integer $n$,   $$\dfrac{1}{n+1}+\dfrac{1}{n+2}+\cdots+\dfrac{1}{2n}+\dfrac{1}{4n}>\ln{2}$$   I know this $$\lim_{n\to\infty}\dfrac{1}{n+1}+\dfrac{1}{n+2}+\cdots+\dfrac{1}{2n}=\ln2$$  and use this  $$\ln{(1+\dfrac{1}{n})}<\dfrac{1}{n}$$ is not useful  But for this inequality I can't. Thank you

$$\frac{1}{n+1} + \frac{1}{n+2} + \cdots +\frac{1}{n+n} + \frac{1}{4n} > \ln 2$$  $n$ is positive integer.  Thank you !


We see Matthew Modine (Dr Brenner) two times in Stranger Things S02 and he's first on the opening credits of the EP09.  My only theory is maybe he accept to join the casting only if he's first on the credits. Does anyone know why?

I've always been curious what decides if a credit is in the opening or closing credits.  It seems loosely that cast (in order of today's "big name" significance), directors and financiers get the front spots, and everything else appears later.  But lately I've been developing some specific curiosities about how cast members are credited on TV shows.  Opening credits seem to follow this rough outline:  Part of "opening credits" video segment   (optional) Major Actors Show Title Core Cast Actors Directors Producers (optional) Episode Title Episode Writers   Subtitles over beginning of show, after opening video   (Episode Title and Writers may appear here, instead) Special Guest Actors   I've probably missed a few things, and mis-ordered a few things.  But, as I said, my main curiosity is about actor credits.  Typically, there is little indication of which characters the core cast actors play.  Sometimes their name is edited to appear along with an image of the character as an indictator, but sometimes there is no indication.  As I've never seen anyone credited in both the opening and closing credits, that leaves the potential for core actors to never be directly associated with their character.  This seems potentially problematic; is there a reason for this?  Are viewers expected to know who's who?  Guest actors sometimes are simply credited by name (and not being part of the opening video, this means they will never be associated with their character in credits).  But often they are credited as "special guest as character name".  This is quite helpful.  The thing I find really confusing is, sometimes the last few regular cast actors will get the guest actor treatment.  I've seen opening video with "and actor as character" paired with an image of that character for an entire season.  Why does this actor get special treatment?  Finally, sometimes guest actors will be credited at the front following the opening video, sometimes they'll be credited in the closing credits.  Are there rules for deciding who get's credited early or late?  I've sometimes wondered if shows deliberately play with actor's name position to obfuscate plot arcs ("you won't think we're killing of this character if their actor is still in the opening credits", or "you won't expect this recurring guest if we place their name in the closing credits") and I've also wondered if there are thresholds for "people appearing in XX number or YY percentage of episodes get placed here."  But it's difficult to build a good sampling base for this.  And season 7 of Stargate SG-1 kinda took a shotgun to my guesses so far.  So...  Are there rules?


I want to switch to a bibliography system that will take care of me for the next 10 years.  I wish TUG clearly endorsed the future---what to deprecate, what to use.  (Without it, they are becoming irrelevant to me.)   Now, my reading is that biblatex and biber are the way forward, but this is somewhat murky.  Is this correct?  Now I need a starter document.  Not a long detailed reference manual, but document examples.  I have seen plenty of web links, but many were over 10 years old, had missing links, described no workflow, and/or did not work.  My trusty 2nd edition LaTeX companion from 2004 is about bibtex.  (I guess Tex.sx has taken over.)  I think it would be useful to have a document to which I should send PhD students who are just learning to use latex.  The manual is clearly not for them.  R calls these kinds of documents "vignettes."  So, here is a simple test.tex file  \documentclass[12pt]{article}  \usepackage{biblatex}  %% backend=biber is now the default \addbibresource{testbib.bib}  %% replaces \bibliography  \begin{document}  I am citing \cite{fama-french:2002}.  %  original had typo.  mea culpa  ----------------  \printbibliography  \end{document}   and a testbib.bib file  @article{ fama-french:2002, author = { Eugene F. Fama and Kenneth R. French }, title = { The Equity Premium }, year = 2002, volume = 57, number = 1, month = apr, journal = { The Journal of Finance } }   The workflow now would presumably be  $ pdflatex test.tex $ biber test  ## unfortunately, it still does not understand biber test.tex $ pdflatex test.tex $ pdflatex test.tex   This is a good starter workflow, thanks to help from Joseph, Ulrike, Tom, moewe and cfr.  Does someone have a vignette, preferably with more different kinds of documents and cites?  /iaw

Is there a 'biblatex in a nutshell' guide out there? I'd like if someone explained to me the essentials on how to use biblatex (what lines I have to write in my document, which files I have to have, how many times and what I have to compile), so then I can go to  to customise it further.


I have a game where I know the location and velocity of my target. I know my own location and the speed of my projectile. I want to determine either  the location of the intersection between my projectile fired and the target, or  the time taken for my projectile to intersect the target  All entities are travelling with constant speed and direction which makes life easier. I have been trying to work out the maths for some time but cannot quite get it right. I know that the predicted location of the target intersecting the projectile will be  Pp = Tp + Tv * t  Where Pp is the predicted position, Tp is the current target position, Tv is the target velocity, and t is time.  I also know that   t = |Pp - Sp| / Bs  where Sp is my (source) position and Fs is the projectile (bullet) speed. But I cannot figure out a way to solve this to get either Pp or t.  I know that all speeds are constant. I am free to aim in any direction and I know that the projectile is faster than the target therefore a hit is guaranteed  Can anyone enlighten me? Thanks  I found a website detailing one method but this doesnt seem to work (). My verification method to determine if it worked was to use the predicted position to determine the time for the target to reach it, and for the projectile to reach it. These should be very similar but in my game they are out by almost a factor of 2.

I am developing a 2D Android game and I am making an aiming algorithm for AI projectiles to hit enemies either following a path, or free moving. At the moment it just calculates where the target will be after a distance and fires a projectile to meet it at that distance. Of course this means varying the projectile speed to meet the target.  Does anyone have any tips for a simple-ish algorithm (optimal-ish) to calculate when the projectile needs to fire and where it needs to aim if it can only travel at a constant velocity? Say the projectile goes twice the speed of the target?  The only way I can think of involves searching and seems quite large.


Intro  Let $P(X=x)$ be a Probability Density Function (PDF). Assume we were to perform $n$ observations from a population that is distributed according to $P(X=x)$ (sample size = $n$). I would expect the largest observation in my sample of size $n$ to be larger than the median (as long as $n>1$).  Question  What is the PDF of the largest observation given the PDF of the population ($P(X=x)$) and the sample size ($n$)?    Note  I am interested in how performing this kind of calculation. I am therefore not suggesting any specific PDF for the population. I welcome those who want to answer to remain general and not chose any specific PDF and/or make an example of such calculation by choosing a given pdf.

If an item follows normal distribution, average also follows normal distribution. What about minimum and maximum?


Is there any difference between a 'long' and a 'medium' sized hyphen?  (I don't think so, but I am just checking to make sure)  We all know the very short line, namely, the 'dash': -  Then there is also the hyphen, which I just recently found two versions of:   A medium hyphen A long hyphen     For comparison, I added the the dash to the right.

I generally know how to use a hyphen, but when should I use an en-dash (–) instead of an em-dash, or when should I use a hyphen (-) instead of an em-dash (—)?


Suppose that $f$ is an entire function satisfying $|f(z)| \leq 1+|z|^\frac{3}{2}$ for all $z \in \mathbb{C}$. Show that f must be a linear function, that is, $f(z)=az+b$ for some $a,b \in \mathbb{C}$. I have not much insight on where to go with this, but here is what I have thought up already: As $f$ is entire it is analytic everywhere in the complex plane, this means that it is complex differentiable everywhere in $\mathbb{C}$. We also have that $|f(z)| \leq 1+|z|^\frac{3}{2}$. Allowing $z=a+bi$ we then have $|f(z)| \leq 1+|a+bi|^\frac{3}{2}$. We can also simplify $|a+bi|^\frac{3}{2}$ to be $(a^2 +b^2)^\frac{3}{4}$. But this approach seems wrong, or that it won't lead anywhere. Where can I take this? Or is where I'm starting wrong?

The problem is as follows:     Suppose $f$ entire satisfying   $$ |f(z)| \leq A + B |z|^{3/2} $$   for some fixed $A,B > 0$. Prove that $f$ is a linear polynomial.   I know I want to reduce it to a function where I can use a Cauchy bound, but I'm not sure how.


This may sound like a simple question but I have never used the || operator to check for NULL with another possible value.  Is there a difference in how C# responds to:  if (a == "Hello" || a == null)   versus:  if (a== null || a == "Hello")

I have always used || (two pipes) in OR expressions, both in C# and PHP. Occasionally I see a single pipe used: |. What is the difference between those two usages? Are there any caveats when using one over the other or are they interchangeable?


I'm trying to work with guides because I definitely see the advantage. But I'm having some issues with them snapping (and sticking) to content that I don't want them to align to.   Here's a screen cap of what I talking about.    I need these two columns to match in size, but the one on the right keeps snapping to the end of the word "upgrades".  I checked on Adobe's site, but their only advice for moving guides is to click and drag (or I guess you could type in the exact location you want when placing the guide in the first place).  Is there a method I can use that will allow me to be really precise with guides in Photoshop?  To clarify a bit more, I'm not trying to simply place guides an equal distance away from one another (although that will solve this particular issue) what I'm asking is for a way to nudge my guides pixel by pixel. Does this feature exist in photoshop or is my only option to click and drag?

Before drawing, I want to draw all guides for my layout. For example, I have a guide line named A already. After that, I want to have another guide named B  parallel with guide A and at 50px distance from it.   I have three solutions:   Draw line B and by "some way", I can see the current distance directly when I'm drawing, so I can make the distance exactly what I want it to be.  Draw line B. And then I use the Ruler tool to see the distance between the two guides. This method has disadvantages: maybe the ruler line that I draw isn't perpendicular with the guides and I'm not sure when the distance is enough. There are other clever ways, that help me get this job done fast and easily, but that I don't know yet. I think Photoshop should support this feature.   What is the best way to achieve this?


I want to let a single thread wait for another one to finish writing on a Hashmap but I always get a java.util.ConcurrentModificationException, eventhough I synchronized the method.  Here is my Code:  HashMap<Page, Integer> prebuffer = new HashMap<Page, Integer>(); Map<Page,Integer> buffer = Collections.synchronizedMap(prebuffer);  private synchronized void bufferContaining(int pageid) {     synchronized (buffer) {         if (buffer.size() > 1) {             for (Map.Entry<Page, Integer> entry : buffer.entrySet()) {                 Page page = entry.getKey();                 int taIds = entry.getValue();                 if (page.pid == pageid) {                     buffer.remove(page, new Integer(taIds));                 }             }         }     } }   Thank you very much for your help! :)

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


I have a simple Ruby script that will "capitalize" titles in a text file for me.  Here's the script:  $ cat capitalize.rb #!/usr/bin/ruby -w  file = File.new( ARGV[0] , "r") while (line = file.gets)         #line.capitalize!         ine = line.split(" ").map {|word| word.capitalize}.join(" ")         puts "\t\t,\t\"#{ine}\"" end file.close   It works fine if I pass it the name of a file:  $ cat lowercase come back with me (Ep. 0301) murder will out (Ep. 0302) snake in the grass (Ep. 0308) goodbye carl erich (Ep. 0309) nightmares nest (Ep. 0310) $ capitalize.rb lowercase                 ,       "Come Back With Me (ep. 0301)"                 ,       "Murder Will Out (ep. 0302)"                 ,       "Snake In The Grass (ep. 0308)"                 ,       "Goodbye Carl Erich (ep. 0309)"                 ,       "Nightmares Nest (ep. 0310)"   But I would like to be able to run the script like this also:  $ cat lowercase | capitalize.rb   Or even this would be fine:  $ cat lowercase | capitalize.rb -   But I get these error messages:  $ cat lowercase | capitalize.rb /home/red/scripts/capitalize.rb:5:in `initialize': can't convert nil into String (TypeError)         from /home/red/scripts/capitalize.rb:5:in `new'         from /home/red/scripts/capitalize.rb:5 $ cat lowercase | capitalize.rb - /home/red/scripts/capitalize.rb:5:in `initialize': No such file or directory - - (Errno::ENOENT)         from /home/red/scripts/capitalize.rb:5:in `new'         from /home/red/scripts/capitalize.rb:5   What do I need to change in my script?  Thanks!  Edit :  Here is the script that answers this question:  $ cat scripts/capitalize.rb #!/usr/bin/ruby -w  ARGF.each do |line|         ine = line.split(" ").map {|word| word.capitalize}.join(" ")         puts "\t\t,\t\"#{ine}\"" end   Thanks and + to everyone that responded.

I want to deal with the command line input in Ruby:  > cat input.txt | myprog.rb > myprog.rb < input.txt > myprog.rb arg1 arg2 arg3 ...   What is the best way to do it? In particular I want to deal with blank STDIN, and I hope for an elegant solution.  #!/usr/bin/env ruby  STDIN.read.split("\n").each do |a|    puts a end  ARGV.each do |b|     puts b end


I'd like to give /dev/root more space on my CentOS 7.4 system.  # df -h Filesystem      Size  Used Avail Use% Mounted on /dev/root        20G   18G  302M  99% / devtmpfs        7.8G     0  7.8G   0% /dev tmpfs           7.8G   28K  7.8G   1% /dev/shm tmpfs           7.8G  826M  7.0G  11% /run tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup /dev/sda2       1.8T  2.7G  1.7T   1% /home tmpfs           1.6G     0  1.6G   0% /run/user/0   As you can see I have more than enough space mounted to /home.  # /sbin/fdisk -l Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk label type: dos Disk identifier: 0xf2e91416     Device Boot      Start         End      Blocks   Id  System /dev/sda1   *        4096    40962047    20478976   83  Linux /dev/sda2        40962048  3905974271  1932506112   83  Linux /dev/sda3      3905974272  3907020799      523264   82  Linux swap / Solaris   How can I add 500 GB to /dev/root ?  Is this possible without going into rescue mode?  If not which commands do I need to do it in a Debian based rescue environment?  Edit: Ended up reinstalling with better partitioning.

When I first installed Ubuntu (actually ElementaryOS) I didn't think that it would take up that much space, so I made the OS partition 15GB and /home 100GB. sda5 and sda6 are my Linux partitions.  Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x1b518505     Device Boot      Start         End      Blocks   Id  System /dev/sda1   *        2048      823295      410624    7  HPFS/NTFS/exFAT /dev/sda2          823296   410943487   205060096    7  HPFS/NTFS/exFAT /dev/sda3       410943488   738621439   163838976    7  HPFS/NTFS/exFAT /dev/sda4       738623486   976771071   119073793    5  Extended /dev/sda5       738623488   767918079    14647296   83  Linux /dev/sda6       767920128   976771071   104425472   83  Linux     The thing is, I don't actually have anything new installed on the OS now compared to when it was fresh. Just a browser and sublime text. Over time, installing system updates, the size just keeps on going up and up.    /usr/src has 2.2 GB of folders named linux-headers-X.XX.X-XX  /lib/modules has 3.9 GB of X.XX.X-XX-generic folders  Advice on what to do would be appreciated.   If I choose to increase the size of the 15GB partition, how do I do it? What are /usr/src and /lib/modules and how do I delete them safely?


My laptop has a motherboard issue and I can't boot up WIN10 in order to shut down correctly.  When I plug in the HDD into the USB on my linux machine I get this message:  Error mounting /dev/sdg3 at /media/ice/OS: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000" "/dev/sdg3" "/media/ice/OS"' exited with non-zero exit status 14: Windows is hibernated, refused to mount. Failed to mount '/dev/sdg3': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option.   I've tried a few commands I've found on here and no luck.  Any ideas?  I'm new to Linux but I've really enjoyed what I've seen so far.

Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount.  When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens.    Here's my partition table, if any more data is needed please let me know.     Device Boot      Start         End      Blocks   Id  System /dev/sda1            2048    20000767     9999360   83  Linux /dev/sda2        20002814   478001151   228999169    5  Extended /dev/sda3   *   478001152   622532607    72265728    7  HPFS/NTFS/exFAT /dev/sda4       622532608   625141759     1304576   82  Linux swap / Solaris /dev/sda5        20002816   478001151   228999168   83  Linux


Let's say I have an instance of a java.util.Date object.  Date date = new Date();   What is the idiomatic way to extract the year and the month?  It seems that the methods getMonth and getYear have been deprecated.  What should I use instead?

I need to determine the current year in Java as an integer. I could just use java.util.Date(), but it is deprecated.


When I browse through other questions to find my answer, sometimes I'll find answers similar to what I'm looking for, and though they don't exactly answer my question, the author might be able to do so. Could we have a feature on SO that will let me request that another user answer my question, in case I find someone who could potentially answer my question?

I thought It could be useful to create a specific user lists to notify them of a created answer.  I thought the lists could be useful for example if you ask an SQL question and you like to notify users are used to SQL problems.  Sometimes I'd like to ask specific questions to specific users because I like their approach or for any other reason. Maybe they could accept or ignore the list request (also automatically).  What do you think?


8eamer prosper produces slides like power-point. Is it possible to produce non-linear presentation like the one produced by prezi?

Prezi is a proprietary software .   I found beamer, powerdot, HA -prosper, prosper, slides and seminar. Which one or something similar should I use to create something like Prezi-style zooming dia -presentation?


How do you write something that was discussed in the past, while the issue still exists in the present?        The discussion resulted in the committee members highlighting crucial areas that need to be addressed.   The discussion resulted in the committee members highlighting crucial areas that needed to be addressed.      ......................     1'. The discussion resulted in the committee members highlighting crucial areas that need to be addressed if one is to achieve the desired outcome.      2'. The discussion resulted in the committee members highlighting   crucial areas that needed to be addressed if one were to   achieve the desired outcome.

I'm wondering whether I should use the present tense for a descriptive statement but in a past context. For example:     (1) I went to the zoo and saw a giraffe last week.       (2) A giraffe is a mammal with long neck.       (3) It is the first time I see that animal with my own eyes.   Statement (2) is a description of a giraffe in general, not the specific one in the zoo, so is it correct to use is?  Statement (3) is an event that is still true now, so should I use is and see?  I'm not native speaker so forgive me if the question is very obvious to others.


Is it safe to assume that most mobile phones and tablets today have moved to 1280x720 resolution and above and make the games in that resolution, scale down for smaller screens or is a smaller resolution like the often used 800x480 still the recommended way to do it and scale it up for larger devices?

For instance, the Motorola Droid is as wide as the G1, but has more height.  Should I try to spread the UI out across the extra height found on the Motorola Droid?  How do others handle this problem?  I'm not using OpenGL, but a SurfaceView for a 2D game.


DUPLICATE of    What is method for locating culprit to "full" disk?  I have nothing large on the filesystem, but "phantom files" seem to have filled up the / partition.  DU does not show where the issue is:  root@godzilla:/# du -hx --max-depth 1 4.0K    ./snap 15M     ./bin 17M     ./sbin 1.8G    ./usr 8.0K    ./media 6.4G    ./var 56K     ./tmp 167M    ./boot 4.0K    ./stuff 4.0K    ./srv 56K     ./home 118M    ./root 4.0K    ./mnt 8.2M    ./etc 856M    ./lib 4.0K    ./lib64 4.0K    ./opt 16K     ./lost+found 9.3G    .   df shows that the / partition is full!  root@godzilla:/# df -h Filesystem                         Size  Used Avail Use% Mounted on udev                               1.9G     0  1.9G   0% /dev tmpfs                              395M   12M  384M   3% /run /dev/mapper/Godzilla--PC--vg-root  225G  225G     0 100% / tmpfs                              2.0G     0  2.0G   0% /dev/shm tmpfs                              5.0M     0  5.0M   0% /run/lock tmpfs                              2.0G     0  2.0G   0% /sys/fs/cgroup tmpfs                              395M     0  395M   0% /run/user/1000 /dev/sdb                           687G  290G  363G  45% /stuff/drive2 /dev/sdc1                          699G  361G  338G  52% /stuff/drive3

df     Filesystem     1K-blocks     Used Available Use% Mounted on /dev/vda1       30830588 22454332   6787120  77% / none                   4        0         4   0% /sys/fs/cgroup udev             1014124        4   1014120   1% /dev tmpfs             204996      336    204660   1% /run none                5120        0      5120   0% /run/lock none             1024976        0   1024976   0% /run/shm none              102400        0    102400   0% /run/user   That 77% was just 60% yesterday and it will fill up to 100% in a few days.   I've been monitoring filessizes for a while now:   sudo du -sch /*   9.6M    /bin 65M     /boot 224K    /build 4.0K    /dev 6.5M    /etc 111M    /home 0       /initrd.img 0       /initrd.img.old 483M    /lib 4.0K    /lib64 16K     /lost+found 8.0K    /media 4.0K    /mnt 4.0K    /opt du: cannot access ‘/proc/21705/task/21705/fd/4’: No such file or directory du: cannot access ‘/proc/21705/task/21705/fdinfo/4’: No such file or directory du: cannot access ‘/proc/21705/fd/4’: No such file or directory du: cannot access ‘/proc/21705/fdinfo/4’: No such file or directory 0       /proc 21M     /root 336K    /run 12M     /sbin 8.0K    /srv 4.1G    /swapfile 0       /sys 4.0K    /tmp 1.1G    /usr 7.4G    /var 0       /vmlinuz 0       /vmlinuz.old 14G     total   It's been giving me (more or less) the same numbers every day. That 14G total is less than half the disk size. Where is the rest going?  My Linux knowledge does not go a lot deeper.   Is it possible for files to no show up here? Is it possible to have space allocated in any other way?


Here I have my Ubuntu OS on /dev/sda7 and I would like to allocated to the unallocated partition , but I am unable to expand my sda7 into unmounted.  How do I resolve this issue?

I have this 72 GB hard disk that I installed Ubuntu 14.02 LTS 64 bit on. Now, I want to split it and leave 50 GBs for Ubuntu and install in the to-be-created partition the server version of the OS.   The issue at hand is that GParted won't let me change the size of the partition I want to shrink. It reads : minimum size = 72222 mb , maximum size = 7222 mb and obviously doesn't allow me to edit the partition.


When I enter the following command in a Repeating Command Block (always active), nothing happens.  execute if block ~ ~1 ~ minecraft:dropper{Items:[{Slot:0,id:"minecraft:redstone",Count:1},{Slot:1,id:"minecraft:redstone",Count:1},{Slot:2,id:"minecraft:redstone",Count:1},{Slot:3,id:"minecraft:redstone",Count:1},{Slot:4,id:"minecraft:iron_axe",Count:1},{Slot:5,id:"minecraft:redstone",Count:1},{Slot:6,id:"minecraft:redstone",Count:1},{Slot:7,id:"minecraft:redstone",Count:1},{Slot:8,id:"minecraft:redstone",Count:1}]} run setblock ~ ~1 ~ minecraft:dropper{Items:[{Slot:4,id:"minecraft:iron_axe",Count:1,tag:{Unbreakable:1,display:{Name:"{\"text\":\"UnbreakableAxe\",\"italic\":\"false\",\"bold\":\"true\",\"color\":\"gold\"}"}}}]} replace   All following requirements of the command are fulfilled:   A dropper on top of the command block (fulfills relative coordinate ~ ~1 ~) Dropper contains redstones on slot 1,2,3,4,6,7,8,9 and an iron axe on slot 5. (subtract 1 for each slot for the command)   Am I doing something wrong? I'm assuming there is something wrong in the command, though, I still don't know.

I am trying to build a custom Adventure Island. At this moment I am trying to limit the allowed items on this island. I'm trying to do this by filtering on a certain enchantment which is not item-specific.  For example.   When you want to filter an wooden sword with a custom name, you use this command:  /testfor @p[r=5] {Inventory:[{tag:{display:{Name:"Custom Sword"}}}]} <   When you want to filter a wooden sword with a custom name and specific enchantement, you can use:  /testfor @p[r=5] {Inventory:[{tag:{display:{Name:"Custom Sword"},ench:[{id:16,lvl:1}]}}]} <   But how can I filter on items with a specific enchantment on ANY item? I tried:  /testfor @p[r=5] {Inventory:[{tag:{ench:[{id:16,lvl:1}]}}]} <   But this ain't work. Does anyone know how to solve this issue?


I've been struggling with this for a few days now, I was hoping I could find some help here!  I have a simple html page which has two frames. The frameset looks like :  <frameset rows=15%,*> <frame src="frTop.html" name="frTop"> <frame src="frBot.html" name="frBot"> </frameset>   The frame "frTop" has a textbox and a button. When you input a value in that box and hit the button, it loads a URL into the frame "frBot".  The page that loads has some values in it, and one of them is a dynamic value (It doesn't change unless you manually change it in the page).  What I want to do is to load the URL, and pull that dynamic value into a variable/textbox/something that I can manipulate.  The idea being, I want to specify 100-200 values, visit each of those URLs, grab the value, and store it into a spreadsheet.  My biggest problem is that the URL being loaded is an external link, ie : I am not able to access the elements of that page using the getElementById("") command. (My knowledge of HTML is limited, so I am not sure if this approach would work or not).  Additional Info : The dynamic element I want has the following segment of code in the HTML of the external page.     Thanks in Advance, Sai

I would like to manipulate the HTML inside an iframe using jQuery.  I thought I'd be able to do this by setting the context of the jQuery function to be the document of the iframe, something like:  $(function(){ //document ready     $('some selector', frames['nameOfMyIframe'].document).doStuff() });   However this doesn't seem to work. A bit of inspection shows me that the variables in frames['nameOfMyIframe'] are undefined unless I wait a while for the iframe to load. However, when the iframe loads the variables are not accessible (I get permission denied-type errors).  Does anyone know of a work-around to this?


Suppose $x,y$ are both positive real numbers. Prove that $(x^2 - y^2)(1/y - 1/x) \geq 0$  I've tried several ways but still stuck on this one, please give me some ideas, thanks a lot.

Prove $$\left(x^2 - y^2\right)\left(\frac1y - \frac1x\right) \ge 0$$ where $x$ and $y$ are positive real numbers.   Can I simplify $\frac{(x^2 - y^2)(x-y)}{xy} \ge 0$ and then $(x^2 - y^2)(x-y) \ge 0$ cancelling out the $xy$?  Is this valid because then  \begin{align} (x+y)(x-y)(x-y)&\ge  0\cdot(x-y)^2\ge 0 \end{align}  which is always true and then prove backwards from here?


My problem is one that has been posted here before, a while ago, and the main solution offered was the program "Adobe Acrobat Professional" (which, unfortuantely is too far out of my current software budget); so I though that I would re-check in and see if perhaps there are any more redent PDF editing programs that could solve this problem that would be more affordable than "Acrobat Pro".  Thanks, in advance, for any help or suggestions! Here is a good desscription of the problem:      I have a digital edition of textbook I bought. The pages are numbered   from 1 - 570.  As a result, when I search page 68, it shows page 51 as   the first pages originally in the textbook aren't numbered and there's   a whole index of some numbered as XVII. What can I do to edit this   textbook, or change the page numbers accordingly?


I updated my Ubuntu to 17.04 today and now ibus-avro prints arabic characters. It was working fine before. I tried the bn to us trick as suggested on the website but that's of no use. It still prints Arabic characters instead of Bengali.

I upgraded one of my machines to Ubuntu 17.04. May be it is related, may be it is not, but for this machine,  switched to Malay (Jawi) after upgrade.   My other two machines, running Ubuntu 16.04 are working fine.  Please see these self explanatory screenshots.      I tried removing and re-adding the keyboard, uninstalling and  the keyboard without any avail.   Whenever, I switch to Avro keyboard, I get texts in Arabic.


I need a command that plays a random mp3 from a directory. So far I have tried  ls *.mp3 | shuf -n 1 | omxplayer   Every different player just acts like it has not received a filename and spits out the help. Thanks for the help!

How can I pipe grep output as an argument to the cd command?  For example:  [root@xxx xxx]# pip install django | grep '/usr.*'   Requirement already satisfied (use --upgrade to upgrade): django in   /usr/lib64/python2.7/site-packages   Here /usr/lib64/python2.7/site-packages is highlighted and I want to pass this string to cd.


I know that reputation never turns zero or negative, i.e. below +1.  Think about this situation: When I got 4 reputation, then got downvoted and -10 reputation, and later the downvotes are reversed. How my new reputation be calculated?    4 - 3 + 4 = 4 (hit floor, reversed with 0 bonus) 4 - 3 + 10 = 11 (hit floor, reversed with 7 bonus)

was downvoted, and the downvote removed, and the user now has 3 rep, even though there are no reputation generating events on the user's page.


Why does modifying a pre-initialized string literal cause a segmentation fault? For example:   char *str = "Hello world"; str[0] = 'h';    When you initialize str to that string value, doesn't the compiler automatically allocate memory for that string constant, assign its starting location to str and free it upon program exit?

The following code receives seg fault on line 2:  char *str = "string"; str[0] = 'z';  // could be also written as *str = 'z' printf("%s\n", str);   While this works perfectly well:  char str[] = "string"; str[0] = 'z'; printf("%s\n", str);   Tested with MSVC and GCC.


Requirement: I have shell script for updating security patches on Linux servers which has to run on maintenance timings/windows. What we have tried as suggested here: We are trying to edit /etc/crontab file as below: 30 13 16 * * root [[ $(date "+%Y") == 2020 ]] && /path/to/shellscript  Issues: We are not able to execute above cron job: o/p in logs: CROND[24576]: (root) CMD ([[ $(date "+)  I am sure I am missing something in syntax of the cronjob but not sure what is that. Please help me in resolving the issue.

This is a  about using cron & crontab.   You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question.  The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below.  This addresses the cron system with the crontab highlighted.


I earlier had dual-booted my MacBook Pro(2013), Catalina OS with Ubuntu 18.04 LTS. I wished to remove it, so I erased the unwanted partition in disk utility and restarted my mac, it did not show the macOS symbol in refind so I started in internet recovery mode. Afterwards, I     followed step by step till the step where I removed my third and second partitions. Since my MacBook is working on Catalina OS and the guide was given according to the Sierra, I refrained from going further. Please help me out since I'm not that terminal savvy.

On my Mac OSX Mojave machine.. I installed Ubuntu 18.04 to attempt to dual boot on the internal Apple SSD. Worked for a while, but after some updates to Ubuntu... hitting the power button boots up to a GRUB terminal, and when hitting the option key there is no 'Macintosh HD' as a startup option.  I have seen 2 similar posts on this topic, but none of them appear to exactly match as far as partitions go  and  and I am hesitant to try something that would wipe out or corrupt my OSX data that I know is still on the SSD/drive.  When booting into recovery media, I executed the following command to list disks:    I notice the partition FFFFF-FFFF...  I then do a disktuil info /dev/disk0s2 to look at the info.    I then use GPT to check...  gpt -r show /dev/disk0     What can I do to make it so that I can fix my OSX boot partition without losing any files. The disk that my OSX files are stored are on disk0s2, which is the FFFFFFF partition... how do I fix up my ability to boot into the OSX Mojave without wiping out my data or is there a way? Does APFS have anything to do with this?  At this point I don't care about the Ubuntu 18.04 partition, but I do not want to lose any data on the 900+GB partition, which is all my the Mac files are.


I'd like to change the selected option with jQuery.  <select name="nameSelect" id="idSelect">     <option value="0">Text0</option>     <option value="1">Text1</option>     <option value="2" selected>TextSelected1</option> </select>   I'm trying with $("#idSelect").val(); or similar, but it doesn't work.  Regards

I have a drop-down list with known values. What I'm trying to do is set the drop down list to a particular value that I know exists using jQuery.  Using regular JavaScript, I would do something like:  ddl = document.getElementById("ID of element goes here"); ddl.value = 2; // 2 being the value I want to set it too.   However, I need to do this with jQuery, because I'm using a CSS class for my selector (stupid  client ids...).  Here are a few things I've tried:  $("._statusDDL").val(2); // Doesn't find 2 as a value. $("._statusDDL").children("option").val(2) // Also failed.      How can I do it with jQuery?     Update  So as it turns out, I had it right the first time with:  $("._statusDDL").val(2);   When I put an alert just above it works fine, but when I remove the alert and let it run at full speed, I get the error     Could not set the selected property. Invalid Index   I'm not sure if it's a bug with jQuery or Internet Explorer 6 (I'm guessing Internet Explorer 6), but it's terribly annoying.


If I'm listing a series of proper nouns (like the names of counties) that all require the same common noun to follow (like the word 'county') should I capitalize the common noun at the end of the list?   Some examples:   "I traveled to Cook, Fulton, and Columbia Counties" or "I traveled to Cook, Fulton and Columbia counties" "I swam in the Pacific and Indian Oceans" or "I swam in the Pacific and Indian oceans"

In the following sentence, is rivers capitalized or not?  The Delaware and Potomac rivers are beautiful.


I want to change to new virtual desktop,  I use Ctrl+Alt+down to change desktop   I don't want to see previous virtual desktop application that I am using.   In Windows every Virtual desktop is individual,when I open a game in desktop1, I would not see the game opened in taskbar  OS : Ubuntu 18.04 (I'm not using VM)  First and second virtual desktops:    The brand new virtual desktop I want:

I would like my Dock to show only the windows of the current workspace. Especially in the little preview window. I find it very confusing to jump around workspaces when trying to find the right window.


I am logged in with my admin account, which is my only account on this computer. I checked under preferences and it says "admin".  I have located the file here:   /private/etc/hosts   When I go to getinfo, it looks like the file is not locked. I also added myself and for good measure everyone with r&w permissions:    Still, when I open it and try to edit it, it says I have no permission:    What am I doing wrong here?

Apple has introduced , also known as "rootless", with OS X 10.11, El Capitan. I understand this is a step for general protection against malware but as a developer I need write access to some of the files it locks away.  How do I disable this protection?


My website was indexed in the Google search engine by a company. A few days ago I changed my server hosting company and transferred my domain it.  They may have removed my site, or blocked it, or changed something in Google Search Console. I had added my website to Google Search Console like other websites (a week ago) and in Google search console I see that website is indexed but its not showing in search results (site:www.-----.com). Help!!! :)  Notes:  1) In the admin panel i can still see the performance of my website for the last year.  2) My website was developed on WordPress CMS and now its a simple website not CMS.

This is a general, community wiki  question and answer pair intended to address any questions   concerning the reasons a site or specific site contents do not appear   in search engine results.      If your question was closed as a duplicate of this question and you   feel that the information provided here does not provide a sufficient   answer, please open a discussion on .   My site (or specific pages on my site) is not appearing in search engine results.  Why isn't my content indexed and what can I do about it?


[edited based on comment and answer offered]  Note: This question is different from  as that question asks for the payoff of a slightly different game.  This question asks if there is a strategy to win. One comment gave as a strategy, "Wait until the last card is to be drawn, then predict it with 100% accuracy". A similar strategy would be to wait until more cards of one color have been overturned, then predict that the next card will be of the other color.   But is there an optimal or best number for the value of "ahead", the difference in the count of one color vs the other that have so far been dealt?   This problem feels similar in some ways to the Secretary Problem, but I can't provide reasoning for that assertion.  --  A card is drawn one by one from a shuffled deck. At each draw, you can either pass (draw the card with no prediction), or predict the color of the next card.  At the start, you can predict red with 50% chance of success. What is a strategy to make a better prediction?  My strategy is to see some draws, wait till one color is "ahead" by a certain amount, then predict the other color on the next draw.   That entails knowing how much "ahead" I should allow one color to get before the prediction.  I ran a simulation of this to discover what a reasonable amount of "ahead" to wait for would be, assigning -1 to red and +1 to black and taking a sum.   My questions are:   How do I determine the right value of "ahead" to make the prediction? In R, how do I find the location and value of that value in the cum vector     set seed(100) sim <- replicate(1000000, {cum <- cumsum(sample(c(-1,1), size=52, replace=TRUE)); max(abs(cum))}) summary(sim)  > summary(sim)    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    2.000   6.000   8.000   8.567  11.000  34.000

There are 26 red cards and 26 black cards on the table which are randomly shuffled and are facing down onto the table. The host turns up the cards one at a time. You can stop the game any time (even at the beginning of the game). Once you stops the game, the next card is turned up: if it is red, you get $1; otherwise you pay the host one dollar. What is the payoff of this game?


I can't configure forward and inverse search with TeXmaker 3.5.2 + SumatraPDF 2.2.1, i already tried all solutions given for this kind of problem in  but no one works. Can anyone help me?  Thank you in advance!

Texmaker has a Built-in pdf viewer which supports synctex forward/inverse search out of the box. This Built-in viewer can be displayed embedded or in a separate window, external viewers always have a separate window. As I have two screens, I am using the two-window layout.  Now I would like to switch to  as external viewer, but cannot find how to configure Texmaker to get Forward search working. I have filed a  to add that information to the  already. Does someone here know how to do it? Probably using some ...


Assume $f: [a,b] \to \mathbb{R}$ is a monotone function that satisfies the Intermediate Value Theorem. Prove that $f$ is continuous.   It is sort of confusing how they say it satisfies IVT. Don't only continuous functions satisfy IVT? If instead they mean the condition that if it takes any value between $[a,b]$ then it also take any value between $f(a)$ and $f(b)$, then we will need to use the definition of the monotonicity. Suppose that $x<y$ and $f(x) < f(y)$ for any $x,y \in [a,b]$.  How can we use this with IVT here to prove that $f$ is continuous?

Assume  $f : I \rightarrow \mathbb{R}$ is a non-decreasing on an open interval $I$ and that $f$ satisfies the Intermediate value property or  on $I$ (that is, for any $a < b$ in $I$ and any $L$ between $f(a)$ and $f(b)$, there exists $c \in [a, b]$ such that $ f (c) = L)$. Then, prove that $f$ is continuous.  However, I know that a function can be discontinuous and also satisfy the IVT at the same time. Could someone point me in the right direction?


I need help with my old Ubuntu server. I can't find any place or forum to ask questions about it. I only have these questions because I am trying to upgrade the server to the new version, so I can use this forum properly.  Should I upgrade my server to 16.04.6 on my own and then ask for help? Will this break my website?

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


while we jump inside a high speed train why do we fall on the exact place? as train is in high speed and we are jumping so we should fall backside. but this doesn't happen why?

I have a question that came up in a discussion with friends.  If I throw a ball straight up in an enclosed train car moving with constant velocity, I believe the basic physics books say it will land in the same spot.  But will it really?  I think I can say that the answer is "not in the real world".  Trivially, a train car is never enclosed.  Fresh air is being allowed into the carriage or the passengers would all die.  Thus there's currents of air that would affect the ball, agreed? If we remove the passengers and have a trusty robot (who does not need oxygen) throw the ball up in a carriage that really is completely air-tight, I'm still not sure it will land in the same spot.  I would imagine that there must still be air circulation.  The train had to start from a stop.  It's true the floor and the roof will drag the air right at the boundary along with it, but just as an open convertible car does not drag all the air in the world with it, I assume that the air in the middle of the car will not be dragged along at the same speed.  The air in the middle will remain stationary with respect to earth and pile up at the back of the car. Then it will be forced along.  I further imagine that this "pile of air" will try to redistribute itself uniformally. Won't all this set up currents?  Will the air come to be completely still in the reference frame of the car? [I'm guessing the answer is yet] How long would this take?    Bonus question:  I believe if I'm sitting in a convertible car and throw a ball straight up it will land back in my hand as long as I don't throw it too far up.  At some point, I'll throw it to high and will lose the ball out the back of the car.  What's the relevant equation covering this in a car travelling at X miles per hour in still air?  Put another way, I'm trying to get a feel for how extensive the "boundary" layer of air around the car is and how it dissipates with distance.


My ubuntu is running on windows 7 using VMWARE player. I was try to install tree command . but it failed. could you help me why?  I am using "sudo app-get install tree" command and it is failing with   E: unable to locate package tree   Ubuntu version is 14.04 LTS (GNU/Linux 3.13.0-24 generic x86_64)  Regards, Koushik

There are many  about Unable to locate package.  For example : if user try to install package by using apt-get then the following error shown. (Here package is used only as example for displaying error message):  sudo apt-get install package Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package package   What does this error mean? How do I solve it?    provided General solution to understand and how to solve such type of error (which is helpful for new users that may unaware of repository-apt install mechanism)  Note : For resolving unmet-dependencies, visit: .


So I posted a similar question previously () which was just about general gameplay; the outcome of which was that is just how the die rolls, which is fair enough.  However, now that we have reached our "final quest", phrases like "some of you may die" and "I am going to kill some of you" have started floating around.  Now, this dungeon was designed for five level 5 characters. Our group consists of four level 5 characters, and one level 4 character, so the dungeon is already over-leveled. Additionally, we played one session with one player missing, and we took a hefty blow in that session, due to his absence. (Not blaming the DM for that one, that's on us).  Additionally, the DM has stated that resting is out of the equation. If we rested for even 20 minutes, the bad guy would send more minions our way, or even take a rest himself.  So - our current situation:   One character is unconscious, and has spent all of his abilities, plus has a "permanent injury" waiting for him when/if he regains consciousness (Fighter - Battle Master) Two characters are at half-health, with 3/4 of their abilities spent (Rogue - Assassin and Fighter - Eldritch Knight) One character is at minimal health, with most of their abilities remaining (Barbarian) One character is mostly fine (the perks of missing a session) (Barbarian)   We're halfway through the Dungeon, resting is out of the question, and the Boss is holding the surrounding area under siege with a doomsday death laser.  Apart from an all out retreat (where we would still have to take our chances trying to avoid the death laser), there seems to be little chance of survival, but none of us really want to die, especially when we're only at level 5!  What could we do to attempt to prevent this from happening?

We have been playing a game for a while now, and while the game itself is quite enjoyable, the only problem is that the DM seems to be aiming to kill us. Sort of.  For example, there have been three situations where a player has been caught in a fight that there was no way they could manage:   One PC (a Rogue with incredibly low AC and HP) was targeted by an enemy forcing everyone to leave the room, and locking them out, then grappling the PC and slowly draining the life from him (dealing HP and CON damage). Another PC was forcibly injected with Bugbear blood (being an elf, started to turn)*, and the time between being infected and finding a cure effectively turned him into one. It got to the point where the player was still in control of the character, but he was attempting to kill the rest of the party. We did finally manage to restrain him and force the cure on him. A third PC, while having decided to go ahead of the party, was attacked by a mimic. This player had worse AC and HP than the Rogue, and was quickly downed. In the same situation, my character nearly fell to his death (though I believe that was due to a misunderstanding, rather than the intent of the DM himself).   We all agreed (while not directly to the DM) that the third situation was incredibly harsh. There was no way the player could deal with that situation on his own, and it would have been better if he had removed the monster completely, or moved it to a situation where more players could have been involved.  The DM is not inexperienced (he has been DMing for almost 30 years), so we believe that this is his aim. 90% of the time, even if we get good rolls, we all end up a lot more worse for wear, and the other 10%, one or more of us is incapacitated, and needs to be revived. It's starting to have an effect on the group.  How can we talk to the DM, and what might we suggest in hopes of changing his attitude toward “killing” player characters?    *Turns out this is plot device devised by our DM alone, I don't think there's anything in the rules about this.


I wrote the following JAVA code in eclipse,  String s1 = "a"; String s2 = s1 + "b"; String s3 = "a" + "b"; System.out.println(s2 == "ab"); System.out.println(s3 == "ab");   The output is   false  true   why the result is like that, can some explain it to me? as I understand, both of them should be true.

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?


I've searched the other similar answer but still no luck. I have content type Station with field Province and City. Form alter: function mymodule_form_alter(&$form, FormStateInterface $form_state, $form_id) {   if ($form_id === 'node_station_form') { //    kint($form);     $form['field_province']['widget']['#ajax'] = [       'event' => 'change',       'callback' => 'mymodule_callback_example',       'wrapper' => 'edit-field-city-wrapper',       'method' => 'replace',     ];      $form['field_city']['#attributes']['id'] = 'edit-field-city-wrapper';      $options = ['_none' => '- None -'];      $user_input = $form_state->getUserInput();     $province = $user_input["field_province"] ?? NULL;      if ($province) {       if ($province === 'province_a') {         $cities = [           'province-a-city-1' => 'Province A City 1',           'province-a-city-2' => 'Province A City 2',           'province-a-city-3' => 'Province A City 3',         ];       }       else {         $cities = [           'province-b-city-1' => 'Province B City 1',           'province-b-city-2' => 'Province B City 2',           'province-b-city-3' => 'Province B City 3',         ];       }       $options += $cities;     }      $form['field_city']['widget']['#options'] = $options;   } }  function mymodule_callback_example($form, FormStateInterface $form_state) {   return $form['field_city']; }  The dropdown City successfully populate based on Province, but when I click submit form, there are error "The value you selected is not a valid choice"  What did I miss? Update Solved by following this . It add allowed_values_function to the field storage. Added to field storage allowed_values_function: 'mymodule_allowed_values_function'  and default_value_callback: 'mymodule_default_value_callback'  to field field.field.node.station.field_city.yml. The callback function: function mymodule_allowed_values_function(FieldStorageConfig $definition, ContentEntityInterface $entity = NULL, $cacheable) {   $empty = ['_none' => t('- None -')];   $cities = [];   if (!$entity->get('field_province')->isEmpty()) {     $province = $entity->get('field_province')->value;     if ($province === 'province_a') {       $cities = [         'province-a-city-1' => 'Province A City 1',         'province-a-city-2' => 'Province A City 2',         'province-a-city-3' => 'Province A City 3',       ];     }     else {       $cities = [         'province-b-city-1' => 'Province B City 1',         'province-b-city-2' => 'Province B City 2',         'province-b-city-3' => 'Province B City 3',       ];     }   }   return $empty + $cities; }  function mymodule_default_value_callback(ContentEntityInterface $entity, FieldDefinitionInterface $definition) {   return [     ['value' => '_none'],   ]; }

I have created a field_time_zone field for the Article content type. I want to set the allowed values for that field to the values returned from system_time_zones(). For this, I implemented hook_form_alter() using the following code. $zones = system_time_zones(); $entityManager = \Drupal::service('entity_field.manager'); $fields = $entityManager->getFieldStorageDefinitions('node', 'local_market'); $options = options_allowed_values($fields['field_time_zone']);  if(empty($options)) { $options =  $zones; $form['field_time_zone']['widget']['#options'] = $options; }  The code adds the desired values, but the node cannot be saved, as it throws the following error.  The value you selected is not a valid choice.  How can I set the allowed values for a text (list) field?


How (and where) do I upload wallpapers for our Ubuntu community?  I have prepared some and would like to share.

I take photos from time to time, and if I take an exceptionally beautiful one, I'd like to submit it for inclusion in Ubuntu. Where do I send/upload it?


Sometimes I need to make a union with a long subscript specifier at the bottom like so:  \documentclass{article} \begin{document}   \begin{equation*}     \bigcup_{a \in \{\text{set that is very wide}\}} S_a   \end{equation*} \end{document}   The problem is that this produces:   How do I move the S_a over to the left?

I want to get the following:    I tried the following  \[    a(i,k) \leftarrow     \min\Big\{0, r(k,k) + \sum_{i^{'} | i^{'}\notin \{i,k\}}\max\{0, r(i{'},k)\}\Big\} \]   and got    How can I make the part under the summation extend to left and right without making a space between plus and max as in the first figure?


I just switched over from Windows 7 to Ubuntu and am completly new to how Ubuntu works, is there a walkthrough that i havnt found for properly installing Tera Online for Ubuntu? If not could someone tell me how to get a working Tera game going :)

Can .exe and .msi files (Windows software) be installed in Ubuntu?


I have previously learnt that increasing the  will decrease the width of the  and vice-versa. However, I am unable to understand this. Does it have some relation with force of repulsion?

I've read that if there is very low doping in a pn-junction diode, the depletion region will be large because a large volume of depleted semiconductor is needed to generate enough electric field to balance the diffusion current. I have trouble understanding this.  How is it that a large volume of depleted semiconductor is needed to generate enough electric field to balance the diffusion current in case of low doping?


I have declared attackers and tapped them as stated in the rules. After the defending player has declared blockers, I cast  ("Creatures you control get +1/+1 and gain lifelink until end of turn. Untap those creatures.") Can I now Untap them while they remain being attackers? Or do they stop being attackers? While the mechanics of this spell are clear when cast as a defending player before declaring blockers, the attacking side confuses me. I have been unable to find an answer over the internet.

If someone declares an attacker and that creature does not have vigilance, if I untap that creature, for example with , does it stop the creature from attacking?


on topic of duplicate claims - I tested  - "solution" it resulted in LaTeX displaying "?" rather than "⌀".  Thanks to people who provided high quality and very useful answers.    I added ⌀ to text and now pdflatex is crashing with     Package inputenc Error: Unicode char \u8:⌀ not set up for use with LaTeX.   I know that I can use \DeclareUnicodeCharacter or similar to introduce special handling of this character but doing it every time that new UTF-8 character appears in the input is not acceptable.  It needs to work in pdflatex (or other pdf-generating latex compiler) as I use latex solely as pdf generator (LaTeX is generated from input, pdflatex generates pdf output).  MWE:  \begin{document} ⌀ \end{document}   MWE with my document declarations present  \documentclass{article} \usepackage[a4paper, total={6.5in, 10.5in}]{geometry} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{cprotect} \usepackage{fvextra} \usepackage{textcomp}  % make TOC work correctly \makeatletter \def\l@section{\@dottedtocline{1}{1em}{2em}} \makeatother \usepackage{index} \makeindex  \DeclareUnicodeCharacter{00A0}{~}  \DefineVerbatimEnvironment{escape}   {Verbatim}   {fontfamily=\rmdefault,breaklines,breaksymbolleft={}} \CustomVerbatimCommand\escapeinline{Verb}{fontfamily=\rmdefault,breaklines,breaksymbolleft={}}  \begin{document} ⌀ \end{document}

How do I enter Unicode characters in LaTeX?  What packages do I need to install and what escape sequence do I type to specify Unicode characters in an ASCII source file?


Is there an Ubuntu 16.04 counterpart to  ? I need to create a bootable Windows Server 2016 USB drive; since it contains file larger than 2Gb, mkusb and similar tools, which try to format the target as FAT32, fail.  unetbootin refuses to accept NTFS-formatted USB drive, either.  As far as I understand, the problem is in finding Linux counterpart for "bootsect /nt60" command, to copy Bootmgr boot sector to target USB drive.  Is it possible without actually using a Windows computer?

I'd like to create a Windows bootable USB stick, but I don't have a Windows machine with me at the moment to do so. How could I achieve the same using Ubuntu?


When $\lim_{n\to\infty} x_n = a$, prove $$\lim_{n\to\infty} \frac{nx_1 + (n-1)x_2 + \cdots + 2x_{n-1} + x_n}{n^2} = \frac{a}{2}.$$

When $\lim_{n\to\infty} x_n = a$, and $\lim_{n\to\infty} y_n = b$, find the limit, $$\lim_{n\to\infty} \frac{x_1 y_n + x_2 y_{n-1} + \cdots + x_n y_1}{n}.$$ Thank you for your help in advance.


Is there a word for a person who believes themselves to be smarter than others, but  frequently betrays that the opposite is true. For example, when dumb-shaming someone, this person uses their big words incorrectly, but confidently. Know-it all isn't quite right, because there's a chance a know-it-all  might actually know quite a lot.

What is a word to describe an individual who acts like an expert in a subject area, constantly stating facts and correcting people, but who actually has very little knowledge on the subject?


I want to clarify a confusion I am having in shell variable vs environment variable. I did the following test, where I have a shell variable abc and export it to an environment variable.  $  $ abc="shell var" $ env | grep abc $ echo $abc shell var $ export abc="env var" $ env | grep abc abc=env var $ echo $abc env var $ unset abc $ env | grep abc $ echo $abc $    After the export is done, I try to echo $abc.  Questions:   Does export move the variable abc from shell to the environment OR does it create a copy in the environment and assign it a new value ? When the second echo is done after the export, does echo check if abc is in environment and then print it, OR has abc been completely removed from the shell and is only present in the environment which is why echo prints its value ?

Bash seems to differentiate between variables which have been exported and those which have not.  example:  $ FOO=BAR $ env | grep FOO $ set | grep FOO FOO=BAR   set sees the variable but env does not.  $ export BAR=FOO $ env | grep FOO BAR=FOO $ set | grep FOO BAR=FOO FOO=BAR   set sees both variables but env sees only the exported variable.  I know that set is a bash builtin and env is not.  What are the differences between variables which are exported and those which are not?


Im going to China soon and want to bring my Xbox One. How will I connect it to the outlets there? Is there a way to connect it to the outlets there?

I have a US Xbox 360 (E series, for inquiring minds). From what I've read on , the 360 does NOT have a universal switching supply, but rather a 100-127V supply for US consoles (and presumably Japan, Canada, etc), and 220-240V supply for other countries using the appropriate voltage.  I'm looking at using a 220-110 step-down converter but have three concerns:  1) Power in Beijing is 220V/50Hz, correct? Will the Xbox 360 power supply care about the 50Hz/60Hz difference?  2) Will a 200W converter be sufficient? That should give 67% built-in overhead (the E series power supply is rated at 120W) but I want to be sure.  3) I will be staying in an apartment (not a motel/hotel); do most homes/apartments in Beijing have a universal outlet like , or only the AU/CN type outlets like ? Most converters I can find online that are grounded (the 360 power supply complains if it's not properly grounded, and I feel more comfortable having such a setup properly grounded anyways) have either a US/NEMA plug or a Euro/Schuko plug and I need to know whether I might need an outlet adapter.  Has anyone successfully used a US console in a 220V/50Hz country with a converter? I know the games are region-specific, but will have US games with me so that's not a concern.


I am currently working on a technical report using pdflatex and noticed that I overuse the term "w.r.t." (at least I wrote a command for it).  Is there a way to write a macro that randomly chooses "x", where "x in {with respect to; concerning; with regard to; ...}" such that I do not have to replace each instance of my command \wrt manually in the document?  PS: I tried using the search function, but did not find anything suitable. If there is, I am fine with a polite redirection. :)

I try to find a way to make a  \newcommand   so that it has different outputs, that it chooses randomly. In the best case the macro should also avoid word repetitions (something like, only choose this word if it hasnt been used for 50 words).  In this macro I want to group similar words, I use a lot in the document. For example if I often write the same name, it should sometimes just print the family name and other times the full name.  Edit another example: the macro should print "the group" or "the group of people" or any different synonym, so that I just have one macro for this pool of words.


I come across following :       Enabling this behaviour may reduce performance and increase stream state requirements in streaming mode.   I am confused with "reduce performance" is in parallel with "increase stream state requirements in streaming mode", or "increase stream state requirements".  If "reduce performance" is in parallel with "increase stream state requirements in streaming mode", it means "reduce performance" can occur in any mode, not only streaming mode.    If "reduce performance" is in parallel with "increase stream state requirements", it means "reduce performance" only occur in streaming mode.    Which one is correct?

Can you grab the blue shirts and socks?   Is the above sentence stating that both the shirts and the socks are blue? Or only the shirts?  At this stage, I am leaning towards the earlier (only the shirts) — though writing "Can you grab the blue shirts and blue socks?" seems redundant.


The listings in SQL containing -- style comments come across as −− when pasted from PDF (if lmodern is used, otherwise as ??). I looked at these answers but do not see how I could use them with the listings (which I mostly load from the external files (if that matters):   \documentclass[11pt,letterpaper]{memoir} \usepackage{lmodern} \usepackage{listings} \lstloadlanguages{SQL}  \lstset {     frameround=fttt     ,language=SQL     ,numbers=left     ,breaklines=true     ,showstringspaces=false     ,columns=flexible     ,keepspaces=true }  \begin{document}  \begin{lstlisting} select 1 -- This is just a comment select 2 \end{lstlisting}  \end{document}   The results look as follows in Sql Studio after pasting from PDF (third line is what they should look like):    EDIT:  I tried using the method proposed in  and it worked fine for just the common SQL comment lines (ex: -- This is a comment), but it had a side effect on the output listings, where the field names are separated from data with the lines containing multiple dashes:  field1 -------------- 1.33333333   These have an extra space after the first 2 dashes and look as follows:    MWE with the linked suggestion implemented:  \documentclass[11pt,letterpaper]{memoir} \usepackage{listings}  \makeatletter \lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}} \@empty\z@\@empty \makeatother  \lstset {     frameround=fttt     ,language=SQL     ,breaklines=true     ,columns=flexible }  \begin{document}  \begin{lstlisting}[caption={extra spaces},label={lst:sp},nolol=true,numbers=none] field1 -------------- 1.3333333  field1    field2 --------- -------------- 9.66667   9.66667 \end{lstlisting}  \end{document}

The  package transforms source-code hyphens (-, U+002D) into minus signs (−, U+2212) when using the default proportional fonts, though not when using the default monospaced typewriter font.  A minimal working example:  \documentclass{article} \usepackage{listings} \lstset{language=C}  \begin{document}   \lstinline[basicstyle=\rmfamily]{--x} \textrm{-{}-x} \par   \lstinline[basicstyle=\sffamily]{--x} \textsf{-{}-x} \par   \lstinline[basicstyle=\ttfamily]{--x} \texttt{-{}-x} \end{document}   The first two rendered lines clearly show the difference between the long minus signs and the short hyphens:    This is not just an aesthetic problem.  The listing is genuinely no longer correct code.  A minus sign is not a hyphen, and the syntax of C (and most other languages) does not treat them as interchangeable.  --x is valid C code, but −−x is not.  If a non-Unicode-savvy person tries to copy and paste the code from such a listing, she may find that it does not compile but be baffled as to the problem.  How can I prevent listings from turning hyphens into minus signs?


Why are malign and malignant pronounced differently?  What is the rule that separates that pattern from, say, sign and signage?

Both reigning and regnant are related to the same Latin noun, regnum.  Why is the ‹gn› spelling pronounced [n] in the first word but [gn] in the second?


We are running a transaction program that uses MS SQL Server. Lately as our number of users and locations have grown, speed/response seems to be an issue.  When looking at *sys.dm_exec_sql_text*, I see a lot of queries starting with "CREATE PROCEDURE", of which some are over 1000 lines of code. Is the application creating stored procedures on the fly or is it merely executing these stored procedures? I thought executing a stored procedure is started using "EXEC"?  If the application is constantly (re)creating the procedures, is it likely that this causes performance issues?

If i run the following query on our production server:  SELECT DISTINCT TOP 10 t.TEXT QueryName, s.execution_count AS ExecutionCount, s.max_elapsed_time / 100000 AS MaxElapsedTime, ISNULL(s.total_elapsed_time / s.execution_count, 0) / 100000 AS AvgElapsedTime, s.creation_time AS LogCreatedOn, ISNULL(s.execution_count / DATEDIFF(s, s.creation_time, GETDATE()), 0) AS FrequencyPerSec ,s.plan_handle, s.plan_generation_num FROM sys.dm_exec_query_stats s CROSS APPLY sys.dm_exec_sql_text( s.sql_handle ) t ORDER BY s.max_elapsed_time / 100000 DESC   My top queries are "create procedure ......." does this mean the sql server recompiles this stored procedure more then once?


Running SQL Server Express 2019. Have a complicated stored procedure containing 11 sql statements (when selected from sys.dm_exec_query_stats by plan_handle). 9 of those statements are simple variable setting based on passed-in parameters, the last 2 statements (IF/ELSE) do all the work and return data (e.g. query_hash 0x111... and 0x222...). There's quite a variability in data volume based on input parameters, so I "prime" the stored procedure with optimal values to ensure quick execution. I've noticed that every few days (sometimes more often), my last 2 statements (query_hash 0x111... and 0x222...) get dumped from sys.dm_exec_query_stats and then re-generated based on whatever parameters come from the users on the next stored procedure call. I know this by looking at creation_time column, and it's reflecting the time of "priming" for first 9 queries, and a later time for query_hash 0x111... and 0x222... . From what I understand, cached plans get cleared under memory pressure, and less used plans get cleared first. My queries are being used a lot, and I have a lot of other cached plans with 1 execution that stick around for a while. Question: why are my most used queries get dumped form cache and how do I stop it from happening?

[Salutations]  (check one)  [ ] Well trained professional, [ ] Casual reader, [ ] Hapless wanderer,   I have a (check all that apply)  [ ] query [ ] stored procedure [ ] database thing maybe     that was running fine (if applicable)   [ ] yesterday [ ] in recent memory [ ] at some point    but is suddenly slower now.  I've already checked to make sure it's not being blocked, and that it's not the victim of some long running maintenance task, report, or other out of band process.  What is the problem, what should I do, and what information can I provide to get some help?  [*Insert appropriate closing remarks*]


Exactly what it says in the Title;  not much development from there :/

The equation is $(x!)(y!) = x!+y!+z! $  where $x,y,z$ are natural numbers.  How to find out them all?


I've rooted my phone running 4.2.2 jb through computer (I tried all mobile rooting apps but nothing worked for me)  I want to know what's the difference rooting program did?has it switched me to root user? To do that something has to be changed. Then what is it?

This is a common question by those who have just rooted their phones.  What apps, ROMs, benefits, etc. do I get from rooting?  What should I be doing now?


Today I got what I presume was the update that should take care of Spectre and Meltdown. That didn't go very well. What do I do now? See screen photo.    I can't boot the 4.4.0-108-generic kernel because of a kernel panic. I'm running 16.04 on an Intel Core i5-4670K CPU @ 3.40GHz × 4.


My book says that in  $$\mathbb{Z}_4\times\mathbb{Z}_6/\langle(0,1)\rangle$$  since we're setting everything in $\langle(0,1)\rangle$ to $0$, it's like. That is, the whole second factor $\mathbb{Z}_6$ of $\mathbb{Z}_4\times\mathbb{Z}_6$ is collapsed, leaving just the factor $\mathbb{Z}_4$.  Then, for   $$\mathbb{Z}_4\times\mathbb{Z}_6/\langle(0,2)\rangle$$  It says that the same thing happens, but now $\mathbb{Z}_6$ is collapsed by a subgroup of order $3$, therefore givinf a group in the second factor of order $2$, so it's isomorphic to $\mathbb{Z}_4\times\mathbb{Z}_2$ I tried to visualize the cosets for both groups, here they are:  $$\mathbb{Z}_4\times\mathbb{Z}_6/\langle(0,1)\rangle$$  $$H = \{(0,0),(0,1),(0,2),(0,3),(0,4),(0,5)\}$$ $$H_1 = \{(1,0),(1,1),(1,2),(1,3),(1,4),(1,5)\}$$ $$H_2 = \{(2,0),(2,1),(2,2),(2,3),(2,4),(2,5)\}$$ $$H_3 = \{(3,0),(3,1),(3,2),(3,3),(3,4),(3,5)\}$$  And   $$\mathbb{Z}_4\times\mathbb{Z}_6/\langle(0,2)\rangle$$  $$H = \{(0,0),(0,2),(0,4)\}$$ $$H_1 = \{(1,0),(1,2),(1,4)\}$$ $$H_2 = \{(2,0),(2,2),(2,4)\}$$ $$H_3 = \{(3,0),(3,2),(3,4)\}$$  But I cannot visualize this 'collapse' thing

I am attempting to understand and compute: $(\mathbb{Z}_4 \times \mathbb{Z}_6)/\langle(0,2)\rangle$   I know $(0,2)$ generates $H = \{(0,0),(0,2),(0,4)\}$, which has  order 3 because there are 3 elements. Now, I must find all the cosets  which there should be 8. The reason there should be 8 is because $4\cdot 6/3 = 8$.  This is where I run into the issue. I have a hard time generating the cosets, but furthermore, once I actually do get the cosets, I have a hard time analyzing them and knowing what it means. If someone could walk me through a step-by-step solution that would be great.  The answer is that the factor group is isomorphic to $\mathbb{Z}_4 \times \mathbb{Z}_2$.   Reference: Fraleigh, A First  Course in Abstract Algebra, p. 147, Example 15.10.


I run a cron job (perl script) which fetches the PHP-version from servers and stores them in a database. This has always worked with CentOS PHP versions. I had to modify it a little in order to make it work with Debian. So far all is good. However it's getting the wrong version / information with Ubtuntu PHP.  This is the code snippet:  @temp = `/usr/sbin/vzctl exec $server 'php -v 2>/dev/null | /bin/grep "built\\|cgi\\|cli" 2>&1'`; chomp(@temp); @temp = split /\s+/,$temp[0]; $php = $temp[1]; $php =~ s/^.*(\d+\.\d+\.\d+).*$/$1/;   Below are 3 examples from different PHP-versions on different operating systems:  CentOS 7  php -v outputs: PHP 7.0.33 (cli) (built: Oct 22 2019 10:24:41) ( NTS ) Result in database: 7.0.33 (= correct)   Debian 9  php -v outputs: PHP 7.3.10-1+0~20191008.45+debian9~1.gbp365209 (cli) (built: Oct  8 2019 05:48:14) ( NTS ) Result in database: 7.3.10 (= correct)   Ubuntu 18.04  php -v outputs: PHP 7.2.19-0ubuntu0.18.04.2 (cli) (built: Aug 12 2019 19:34:28) ( NTS ) Result in database: 8.04.2 (= incorrect)   I think the current regex expression is considering the last part as the PHP version, hence it's storing 8.04.2 in the database.  How can the current code:  $php =~ s/^.*(\d+\.\d+\.\d+).*$/$1/;   Be modified so it reads the correct PHP version for all operating systems?  I checked a few older servers with dates operating systems, but they don't differ much from the above 3 examples. So I am guessing if the current code can be tweaked to also work with Ubuntu, I am set for now and the near future.  Please keep in mind that I want to be able to use the current code (as displayed above) but with a modified regex obviously.  So two questions (both also for learning):   Is it possible to adjust the current regex to match PHP versions for all OS as shown above? isn't it better to make the regex search the text PHP and then grab the version somehow?   I know the code is old, but it's from our technician who unfortunately is not amongst us anymore.  Maybe someone cares to take a look and come up with a working solution based on it's current form?  Thanks!

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


Sometimes the profile picture thumbnail that appears below an answer is converted into a larger picture and description, sort of a tooltip, upon mouseover, while other pictures don't display that behavior.  Below I just took a random profile to show the described behaviour.  Before mouseover:    During mouseover:     Is that intentional? If yes, what are the criteria used to differentiate whether to display the enlarged version or not?

Meta already has a page with same title as this question: , but it doesn't answer its own question.  So, to repeat, what is an "Established user"?  Secondary question (if permitted): Of course this is a peer-reviewed site, but is it possible, on Meta Stack Overflow, to get some adult supervision? My motivation is my seven-word naive question , which got hammered.


I've been making a sum of a column containing about 500.000 records of double precision numbers. All numbers in the database should normally be of two ciphers behind the period. However when making the sum I get 6 numbers after the period: 123123123.549977  Either I have bad data in my database where there are records with more numbers after the period or there is something I'm missing about the sum function.  So my questions are:   Does the sum function have any rounding properties which may cause this? Is there a way to select all records containing more than two numbers after the period?


I need a non-static instance method to return multiple values. For the sake of a simple example let's say these are boolean success and Object obj - but in the general case there could be more and they could be unrelated to each other. Can think of a few different ways of doing this:  Solution 1  private boolean aMethod(int aParam, Object obj) { ...set obj parameter & return value... }   Solution 2  private Pair<Boolean, Object> aMethod(int aParam) { ...set return pair values... }   Solution 3  private Object obj; ... private boolean aMethod(int aParam) { ...set obj field & return value... }   Solution 4  private class MethodReturn { // Nested class - could be a separate class instead     boolean success;     Object obj;     // ... Getters and setters omitted for brevity }  private MethodReturn aMethod(int aParam) { ...set return object values... }   Are there any more possibilities I might have missed? And could anyone comment as to the pros and cons of each (and ideally, which might be the best to use under most circumstances)?

I want to return two objects from a Java method and was wondering what could be a good way of doing so?  The possible ways I can think of are: return a HashMap (since the two Objects are related) or return an ArrayList of Object objects.  To be more precise, the two objects I want to return are (a) List of objects and (b) comma separated names of the same.  I want to return these two Objects from one method because I dont want to iterate through the list of objects to get the comma separated names (which I can do in the same loop in this method).  Somehow, returning a HashMap does not look a very elegant way of doing so.


I've installed Ubuntu on a friend's laptop, completely replacing Windows 8. He has a backup ntfs partition that I left untouched after the operating system was replaced. I get an error in Nautilus when I try to mount; it's because of Windows hibernation from what I've read. The problem is, I didn't keep the Windows partition.  Is there a way to mount and unlock the partition without booting to Windows 8?  I thought to post this question even when I'm well aware of that one referred to as the original because there it assumes that dual boot is still available. The top answer shows that, and closes off responses for my situation. I needed an answer for when the Windows boot is no longer available.

Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount.  When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens.    Here's my partition table, if any more data is needed please let me know.     Device Boot      Start         End      Blocks   Id  System /dev/sda1            2048    20000767     9999360   83  Linux /dev/sda2        20002814   478001151   228999169    5  Extended /dev/sda3   *   478001152   622532607    72265728    7  HPFS/NTFS/exFAT /dev/sda4       622532608   625141759     1304576   82  Linux swap / Solaris /dev/sda5        20002816   478001151   228999168   83  Linux


I'm raising this again because I now have a question I would dearly like to find an answer to, with one totally wrong answer awarded a bounty. I would prefer to be able to delete the entire question rather than leave this wrong answer as the only thing users will see if they visit it. Relating to  which is marked [status-complete] and  which is marked [status-declined]. The answers to the latter do not answer the question as asked. They are all essentially frame challenges, or reasons why variations on this theme have not worked in the past.  E.g., a bounty is a payment for advertising. That is not an answer. The payment has been made, and the advertising has been gained. If I paid for an advert for a job opportunity I would certainly not be bound to offer the job to the least worst candidate. I could choose… none. Therefore this is a new question with a clear goal. I want to decide if no one deserves the bounty. It should not be tied to votes, accepted check marks or who answered at what time. There is no gain for the user who offered the bounty. That's already gone, given away at the start. If no satisfactory answer is received, the bounty should not be awarded automatically without giving the initiator the chance to say no. If no action is taken you can assume lack of interest and auto-award. If a definitive action is taken, that should be the right of the one whose reputation was staked on receiving a satisfactory solution. A decade later and this is still badly broken, IMO. I should have the right to decide no one deserves the bounty. The bounty should not be a reward for effort but a reward for getting the answer right! I offered a 500-point bounty on a new question right from the start, to pull some attention to an issue I knew was going to be tough to answer.  As expected, no one even got close, though one answer received three upvotes… perhaps for effort. The answer went through three major revisions, none of which were salient and after a comment thread 22 deep trying to clarify, the last version was still totally wide of the mark. Two answers were deleted, for not even leaving the starting blocks. This question itself also went through some major revisions, reducing some initial guesswork as my endeavour to find a single underlying symptom/cause was honed. Also, in each revision was an attempt to clarify what was confusing the answerers and commenters… not that it seemed to make any real difference to misinterpretations. The end result, however, was there was no answer anywhere near. This means, in my mind, no one deserves the bounty. I want the option to declare specifically that no one gets the bounty. However, the system automatically gave half points to the one remaining answer, with little regard as to how well it actually answered the question. I have already given up the points. I don't want them back; I just feel no one deserved them. I should have been given that choice. I didn't upvote any of the answers. None of them were more than misreadings of the question, or very poor guesses. I didn't downvote anyone either - I decided the users should decide, until and unless I got a working solution, which would then have been marked accepted and also awarded the bounty. I have in the past awarded bounties without accepting, for answers which showed good research and working method, or a good path towards a 'fix' even if it didn't work in my particular case.

Shouldn't there be a way to prevent automatic awarding of a bounty? For example, if someone provides an answer that sounds good but is totally wrong, it may happen that it gets a score of +2, but doesn't deserve the bounty. If no one else answers, half the bounty will automatically go to this person. Automatic awarding is good if an inactive user offers a bounty, but I think there should be a button that basically means "I know the bounty should now be awarded, but I have read the answers and none of them deserve the bounty".  The button should obviously not refund the bounty, just let it go to /dev/null instead of awarding it to someone who doesn't deserve it.


My game-loop looks like this:          public void run() {             init();              final double amountOfTicks = 60.0;             double ns = 1000000000.0 / amountOfTicks;             long time = System.currentTimeMillis();             long lastTime = System.nanoTime();             long now = 0;             double delta = 0;             int tickCount = 0;             int renderCount = 0;              while(running) {                  now = System.nanoTime();                 delta += (now - lastTime) / ns;                 lastTime = now;                  if(delta >= 1) {                     tick();                     tickCount++;                     delta--;                     render();                     renderCount++;                 }                   if(System.currentTimeMillis() - time >= 1000) {                     time += 1000;                     System.out.println(tickCount + " Ticks, " + renderCount + " FPS");                     tickCount = 0;                     renderCount = 0;                 }               }             stop();          }   In the variable "amountOfTicks" i can set how many ticks i want per second. The amountOfTicks are here the same as the fps which i have. With this solution my console prints "60Ticks, 60 FPS", but the problem is, that the CPU-performance with this method is too low. I have only 60 Ticks and only 60 FPS, but the whole while-loop is still running through as fast as my pc can.  The only thing how i can improve the cpu-performance is, if i let the thread for 1ms or so sleeping. But is this solution not dirty? This solution will maybe work on my (relative good pc), but on a other with with less CPU-performance the 1ms sleep maybe are waste, because of this the game maybe can not reach the 60FPS of this?

I implemented my game-loop as described in , using the last approach with an unlimited FPS and a constant game-speed.  My problem is, that the unlimited FPS cranks up my CPU usage to nearly 100%. I understand that this is desired (as the hardware does as much as it can), but for my game, it's not really necessary (it's pretty simple). So I'd like to limit the FPS to some upper bound.  Consider my game-loop:  private static final int UPDATES_PER_SECOND = 25; private static final int WAIT_TICKS = 1000 / UPDATES_PER_SECOND; private static final int MAX_FRAMESKIP = 5;  long next_update = System.currentTimeMillis(); int frames_skipped; float interpolation;  // Start the loop: while (isRunning){     // Update game:     frames_skipped = 0;     while (System.currentTimeMillis() > next_update             && frames_skipped < MAX_FRAMESKIP){         // Update input, move objects, do collision detection...         // Schedule next update:         next_update += WAIT_TICKS;         frames_skipped++;     }     // Calculate interpolation for smooth animation between states:     interpolation = ((float)(System.currentTimeMillis() + WAIT_TICKS - next_update)) / ((float)WAIT_TICKS);     // Render-events:     repaint(interpolation); }   How would I implement a maximum FPS?  If i implement the repaint the way I implemented the update (or use a sleep instead of "do-nothing-cycles"), then the FPS is locked, right? That is not what I want. I want the game to be able to work with lower FPS (just as it does now), but limit the FPS to a maximum of, say 250.


I have problems with the startup from a USB flash. It asks for a login and a password and I don't know the login or password can anyone help? It writes ubuntu 16.04 LTS ubuntu tty1 in a prompt.

When I boot Ubuntu 10.04.3 from a live CD, it asks me to enter a username and password. I have not booted before, and I haven't created an account.


A couple days ago I started having this annoying issue: After about 30 seconds of inactivity, my laptop screen goes blank. Like a screensaver.  Under System Settings, under "Brightness and Lock", I have unchecked the "Dim" option and the "Turn screen off if inactive for" to "Never". So my screen should not ever go blank.  I found a similar thread here:  . But the solution there is to turn off "dpms". Well, my dpms is turned off and is still happening.   See below the output of the xset -q command:       Keyboard Control:   auto repeat:  on    key click percent:  0    LED mask:  00000000   XKB indicators:     00: Caps Lock:   off    01: Num Lock:    off    02: Scroll Lock: off     03: Compose:     off    04: Kana:        off    05: Sleep:       off     06: Suspend:     off    07: Mute:        off    08: Misc:        off     09: Mail:        off    10: Charging:    off    11: Shift Lock:  off     12: Group 2:     off    13: Mouse Keys:  off   auto repeat delay:  500    repeat rate:  33   auto repeating keys:  00ffffffdffffbbf                         fadfffefffedffff                         9fffffffffffffff                         fff7ffffffffffff   bell percent:  50    bell pitch:  400    bell duration:  100 Pointer Control:   acceleration:  5/1    threshold:  5 Screen Saver:   prefer blanking:  no    allow exposures:  yes   timeout:  0    cycle:  0 Colors:   default colormap:  0x6e    BlackPixel:  0x0    WhitePixel:  0xffffff Font Path:   /usr/share/fonts/X11/misc,/usr/share/fonts/X11/Type1,built-ins DPMS (Energy Star):   Standby: 0    Suspend: 0    Off: 0   DPMS is Disabled   Anyone have any suggestion?   Thanks a lot!

I have tried as following:  1. Turn off: export DISPLAY=:0.0 && xset dpms force off  2. Turn on: export DISPLAY=:0.0 && xset -dpms   Which works but that is a temporary solution, which does not fix my problem yet. When i reboot system it start again and again the same auto turn off mode.   How can i now remotely using SSH turn it off forever?  IMPORTANT:  - KIOSK (ATM machine will use this option) - 24/7 advertising display/slides will use this   Optional Note: this guide i followed   , but permanent solution did not worked.


I'm creating a 2D game in C++ that uses levels made out of tiles. The world class has an add(WorldObject* o) function that can both accept a tile or an entity such as an enemy. Both the Tile and the Entity class are derived from WorldObject. In every case, the object should be added to the entities list; but if it is a tile, it should also be added to the tiles list.  World.h  class World { private:     list<WorldObject*> content;     list<Tile*> tiles; public:     void add(WorldObject*); }   World.cpp  void World::add(WorldObject* o) {     content.push_back(o);     if(*o instanceof Tile) //What do I need to put here?         tiles.push_back(o); }   How do I check whether an object has a specific type in C++? It's nothing about typecasting and virtual functions and things like that because I don't want to invoke functions to the object at this time; I just need to add it to a separate list if it has a certain type. In Java, I can do if(instance instanceof Class). How can I do this in C++?

What is the preferred method to achieve the C++ equivalent of java's instanceof?


Let $(X,d)$ be a metric space. We say that $X$ is separable if $X$ contains a countable dense subset. We say that $X$ is second countable if $X$ has a countable base. The following .  Fact: If $X$ is a separable metric space, then any subset $Y$ of $X$ is also separable.  One main idea to prove above fact is that subset of a second countable space is again second countable.  Question: Let $X=\mathbb{R}$ and $d$ be euclidean norm(that is, absolute value $|\cdot|$). Is $\mathbb{R}\setminus\mathbb{Q}$ separable?  If we use the above fact, then $\mathbb{R}\setminus\mathbb{Q}$ should be separable as $\mathbb{R}$ contains $\mathbb{Q},$ which is a countable dense subset of $\mathbb{R},$ and $\mathbb{R}\setminus\mathbb{Q}$ is a subset of $\mathbb{R}.$ However, I do not see immediately a countable dense subset of $\mathbb{R}\setminus \mathbb{Q},$ as $\mathbb{R}\setminus\mathbb{Q}$ is uncountable, though it is dense in $\mathbb{R}.$ Any hint would be appreciated.

I am trying to find an example of a separable Hausdorff space which has a non-separable subspace.  This led me to ask the question in the title: is the set of irrationals, regarded as a subspace of the real line, separable or  non-separable?  A space is separable if it contains a countable dense subset.  A subset $A$ of a space $X$ is dense in $X$ if $\bar{A}=X$.  It's easy to come up with a dense set and a countable set in $\mathbb{R}\setminus\mathbb{Q}$, since (trivially) $\overline{\mathbb{R}\setminus\mathbb{Q}}=\mathbb{R}\setminus\mathbb{Q}$ in the subspace topology, and as a countable set we can take something like $\{k\pi \mid k \in \mathbb{Z}\}$.  But is there a subset that is both dense AND countable?  And of course, how do we prove the result?


While I know that both addition and multiplication are commutative operations, I can easily visualize that, e.g. 3 + 4 = 4 + 3 = 7 by thinking of seven objects in a row and separating them into two heaps of three and four objects, respectively. Now it's trivial to conclude that commutativity of addition amounts to labeling which one of the heaps is first and whics one is the second. This is arbitrary, therefore addition is commutative.  However, I cannot find a similar visualization to help me see why 3 x 4 = 4 x 3 = 12. I'm sure there must be a way.

It's easy for natural numbers: $3\times 5=5\times 3$   ***** ***** *****  but how do you explain that $x.y=y.x$ for any real numbers $x$ and $y$.  Moreover, in $\Bbb{N}$, do you prefer to define $n\times m=\underbrace{n+n+\cdots+n}_{m\text{ times}}$ or $n\times m=\underbrace{m+m+\cdots+m}_{n\text{ times}}$.