I know that in rings which are not UFDs, the GCD and LCM may not exist. However, I don't know whether it is equivalent the existence of the GCD and the LCM in one of those rings, i.e.      I am looking for an example where a couple of elements have a GCD and fail to have a LCM (or viceversa).    Can anyone help me?

On  it is written:      A GCD domain is an integral domain $R$ with the property that any two non-zero elements have a greatest common divisor (GCD). Equivalently, any two non-zero elements of $R$ have a least common multiple (LCM).   How to prove last statement that is equivalence of GCD and LCM for all elements? (I am able to prove in Bezout ring but I am not able to prove in general GCD ring.)  Does the existence of gcd of two elements implies existence of lcm and conversely in any integral domain?


Given a list of n integers, where every integer in the list exists twice, except for one element, which exist once in the list. For example,  [1 3 3 6 2 7 1 2 7]   I need to find a linear time O(n), and a constant space O(1) algorithm that returns the element which exists once in the list. In the above example, the algorithm should return 6. Note that the list is not provided by any certain order. (The order of the elements in the list is random).  I could solve this problem in O(n) linear time using a dictionary but unfortunately the dictionary requires O(n) space. Any ideas?

What would be the best algorithm for finding a number that occurs only once in a list which has all other numbers occurring exactly twice.  So, in the list of integers (lets take it as an array) each integer repeats exactly twice, except one. To find that one, what is the best algorithm.


I want to get the cpu usage. I tried this command  top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1}'   Could you confirm if this command is correct?

When I execute following command to get cpu usage , I get nice + user cpu usage.  top -b -n1 | grep "Cpu(s)" | awk '{print $2 + $4}'    Output:  14.5   Here I am getting problem is that the output depends on top command thus it doesn't change instantly as top command. So I am not getting correct cpu instantly. It gives same output and not changing.  I want to get real-time cpu usage in output. Please help me to improve my command.


What is the most common solution to getting TeX on the go.  I am looking for a way to fit everything onto a thumbdrive. (up to 8Gb?)  It needs to be able to have a text editor and a typesetting system. I tried installing my student-license WinEdt onto a thumbdrive and use , but this is not compiling things properly.  I assume that the typeset system is one of the best available, so assuming that I get the system setup correctly, what other text editors would you recommend?  P.S. some systems I work on do no have acrobat. (ie. pdf not supported)

I'm looking to treat myself to a totally portable TeX system and was wondering: is it possible to devise an installation scheme that would run on Windows, Linux and MacOS at the "same" time?  I think TeXLive is the best choice here, but I'd much rather avoid having to maintain three separate TeXLive installations. I'd like the three installations to share the package databases for instance.  I'll be using a 32Gb USB stick, in case it matters.  PS: I think I'm onto something here... will post back when I have a working prototype.  Edit: after reading  I managed to format a USB stick with UDF and have it read and written in Linux and Windows (need to perform some tests on Mac yet). This is the first step towards interoperability.  Edit 2: well, as it turns out, the previous note was useless (the partition table breaks under Windows), I've found  and it works like a charm. The only remaining step is writing a couple of scripts to set the environmental variables and we're done ;)


I'm using Kotlin to make an android app, but I keep getting a NullPointerException when trying to access a layout elements using Kotlin's android extensions. The code is a little bit complicated, so I'll try to explain the problem with a simple example. Say I have a layout second_layout.xml with a button and a textView:  <LinearLayout ...>      <TextView         android:id="@+id/textView"         ..../>     <Button         android:id="@+id/button"         android:onClick="onButtonClicked"         ... />  </LinearLayout>   In the main activity, I want to change the textView text when I click on the button:  import kotlinx.android.synthetic.main.second_layout.*  override fun onCreate(savedInstanceState: Bundle?) {     ... }  fun onButtonClicked(view: View) {     textView.text = "TextView text has changed" }   Now when I click the button, Kotlin throw a NullPointerException, apparently the textView property is null. I hope the above code is clear.  Does anyone have an idea what's going on? Did I do something wrong? Thanks.

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I have preinstalled Windows 8.1 and Ubuntu that I installed a week ago on my Laptop Lenovo E530. After my first installation of my Ubuntu 13.10 as Dual Boot, I could not to log in to Windows again, only Ubuntu.  Today I decided to fix this problem with Boot-repair. I used a bootable version of my Ubuntu on my USB to log in, then I downloaded the Boot-repair via Terminal. Then in Boot-repair I choosed the Recommended repair and followed all the instructions, including confirmation of the removing my Grub 2. After that, when I restart the computer, everything what I see now is black screen with error message:     error: file '/boot/grub/i386-pc/normal.mod' not found.      Entering rescue mode...       grub rescue>   Now I cant log in to any operating system. Probably the Grub doesn't load.  Can anyone help?

error: file '/grub/i386-pc/normal.mod' not found. grub rescue>   What can I do? I just sit and stare at it.   I found my old netbook (Dell Inspiron 1010) which I have not used for about four years. I replaced Windows XP with Ubuntu 12.10. I used my bootable USB drive. I installed and rebooted. I got the message that normal.mod is not found.   What should I do? Type exit, reboot, or quit? Should I re-install?


I have the following DateTime format that is outputted from an API.  2021-04-28T10:21:56.656Z  I want to be able to convert to the following format:  DD/MM/YYYY  I have tried using the datetime library but getting no where. Using python3 Thanks in advance

I need to parse  strings like "2008-09-03T20:56:35.450686Z" into Python's datetime type.  I have found  in the Python standard library, but it is not very convenient.  What is the best way to do this?


I am getting the error - WhatId Is Not Available For Sending Emails To UserIds while trying to send email to user from an Apex Trigger using SingleMailMessage.  The code is working absolutely fine with a predefined standard EMail Template but the only problem is - it is unable to produce values of Merge Fields from the Custom Object that I wanted to set as whatId.  Any idea how to get rid of this error? As an alternative I might need to set the htmlBody of the mail in code but I am not sure.in that case how I can use the background layout that (it has some custom pink color and images set with company logo in the mail background)I had set in my email template?     List<Messaging.SingleEmailMessage> eMail = new List<Messaging.SingleEmailMessage>();     for (Event__c ea : eaList)    {                        Set<String> invitedBy= new Set<String>();     List<String> sendTo = new List<String>();       Messaging.SingleEmailMessage singleMail = new Messaging.SingleEmailMessage();      invitedBy.add(ea.CreatedBy.Email);       // to capture unique values     sendTo.addAll(invitedBy);     singleMail.setToAddresses(sendTo);      singleMail.setReplyTo('xxxx@gmail.com');     singleMail.setSenderDisplayName('xxxx');     singleMail.setTargetObjectId(ea.CreatedById);      //set template Id     singleMail.setTemplateId(et.Id);     singleMail.setSaveAsActivity(false);     // singleMail.setWhatId(ea.Parent_event_c);  // gives error WhatId Is Not Available For Sending Emails To UserIds     eMail.add(singleMail); } Messaging.sendEmail(eMail);   I tried to follow the link -  and changed the code...but here I ended up doing DML (inserting contact) within for loop..any idea how to avoid this ?   List<Messaging.SingleEmailMessage> eMail = new List<Messaging.SingleEmailMessage>();     for (Event__c ea : eaList)    {                        Set<String> invitedBy= new Set<String>();     List<String> sendTo = new List<String>();       Messaging.SingleEmailMessage singleMail = new Messaging.SingleEmailMessage();   // insert the mail id as a contact as suggested in the link  tc = new Contact(email = ea.CreatedBy.Email, firstName = ea.CreatedBy.Name ,lastName = ea.CreatedBy.Name);     insert tc ;     invitedBy.add(tc.Email);       // to capture unique values     sendTo.addAll(invitedBy);     singleMail.setToAddresses(sendTo);      singleMail.setReplyTo('xxxx@gmail.com');     singleMail.setSenderDisplayName('xxxx');     singleMail.setTargetObjectId(ea.CreatedById);      //set template Id     singleMail.setTemplateId(et.Id);     singleMail.setSaveAsActivity(false);     // singleMail.setWhatId(ea.Parent_event_c);  // gives error WhatId Is Not Available For Sending Emails To UserIds     eMail.add(singleMail); } Messaging.sendEmail(eMail); //delete the contact once email sent delete tc;

I am having an html email template which uses certain merge fields from a custom object. Now I am using following apex code to send certain emails to users.  Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();          mail.setTargetObjectId(t.OwnerId);          mail.setTemplateId(et.Id);         mail.setWhatId(t.Id);          mail.SaveAsActivity = false;         Messaging.sendEmail(new Messaging.singleemailMessage[] {mail});   Code is saved without error but when I run it it says "can't use whatId when sending email to users". Can anyone explain me how to overcome this error? When I use a visualforce template then same code works fine.


The problem I'm currently wrestling with is this. Haven't realised what the issue was but i have the following code  j.prototype.deleteFile = function() {    $('.deleteFile').on('click', function()   {      if(confirm('Are you sure you want to delete this file?'))     {        //delete the file      }    })  }   The purpose of this is to delete files on button click and confirmation of deletion. Since file icons are added upon uploading (appended afterwards) and this is called upon page load (since upon page load there might already be files for deletion) i need to refetch the HTML elements to have an up to date list as i understand. This creates multiple instances of the function as it is called multiple times (for each upload) and thus when trying to delete a file:   After first upload asks for confirmation once After second upload, second upload asks for confirmation once, first one twice.    The pattern is to add additional one for the ones existing before.  I assume it is because deleteFile has multiple instances and each of them triggers upon click.   I have been looking for a way to clear the old instances or maybe add/include new elements to that old instance but to now avail.   Is there a method for achieving my goal that I'm overlooking maybe?

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


I have a simple filter function in my javascript, based on an input box.  function filter(selector, query) { query   =   $.trim(query); //trim white space query = query.replace(/ /gi, '|'); //add OR for regex   $(selector).each(function() { ($(this).text().search(new RegExp(query, "i")) < 0) ? (do something here)   So, if I have a table with a list of words, eg.   Alpha Centauri, Beta Carbonate, Charly Brown, ...   and I enter 'alpha cen' into my input box, the function searches for ('alpha' or 'cen') and returns the one record as desired.  However, if I replace the '|' with a '&' to search for ('alpha' and 'cen') I get no results. Even if I enter 'alpha centauri', I get no result at all.  Why?

Obviously, you can use the | (pipe?) to represent OR, but is there a way to represent AND as well?  Specifically, I'd like to match paragraphs of text that contain ALL of a certain phrase, but in no particular order.


i am working on imageSlider,i have taken div and setting background-image of div. on Page load background page takes lots of time to load image. is there any way to load all background image first in cache and once loaded i can show main Div ..    i am reading xml file and then setting background-image of div one by one .   $('#myImageFlow').append('

'+frontDiv[k]+'

');   Any suggestion .

I'm looking for a quick and easy way to preload images with JavaScript. I'm using jQuery if that's important.  I saw this here ():  function complexLoad(config, fileNames) {   for (var x = 0; x < fileNames.length; x++) {     $("<img>").attr({       id: fileNames[x],       src: config.imgDir + fileNames[x] + config.imgFormat,       title: "The " + fileNames[x] + " nebula"     }).appendTo("#" + config.imgContainer).css({ display: "none" });   } };   But, it looks a bit over-the-top for what I want!  I know there are jQuery plugins out there that do this but they all seem a bit big (in size); I just need a quick, easy and short way of preloading images!


Many languages, such as German (and Spanish), have "Sie" (you-formal) as a formal version of you. One can say use "Mr." and "Mrs.", but in a thank-you note / email, there is no formal word for English you can use to address your speaker. How does one get around it, to sound as proper as possible?

From the top of my head, Danish "De" (practically never used), German "Sie", Chinese "您", French "vous", Spanish "usted" are a formal way of addressing someone, especially if one isn't familiar with the addressee. Did English ever have this? It sounds as though Proto-Indo-European might have had this (based on my 4 examples), but perhaps someone can enlighten me?


My question it simple: How can I go back to Mountain Lion from Mavericks?  My iMac (late 2010, Processor 3.4 GHz Core i7, Memory 8GB 1333 MHz DDR3) became EXTREMELY slow with Mavericks - It was great with Mountain Lion.  In the beginning I thought I had to do with Google Chrome, but now it get slow with pretty much every program.  Help!

I installed the developer preview of OS X Mavericks, & too many things broke. I can't stay on it & need to roll back to Mountain Lion. Any ways of doing that? Please help!  I originally installed Mountain Lion & Mavericks through the Mac App Store.


Turbo Boost Technology Monitor is EOL, and quite honestly I can't tell if it works anymore or not with Windows 8.1. Regardless, soon it will be removed since its end of life is soon upon us. What can I use to monitor Turbo Boost on my CPU instead of it?  Edit: I've tried CPU-Z. It doesn't work with monitoring the highest active core's turbo mode because it averages out all of the cores at once. I'm also looking for a free solution, like how Turbo Boost Technology Monitor is free.

I just build myself a new system with a Intel I7 860 CPU. When loading it using a single threaded application like Super PI, CPU-Z shows 2.933Ghz as speed. Now I understood that the I7 goes into turbo boost mode up to 3.46GHz for a single core.   How can I check that? Is there a utility to monitor CPU speed per core?


A friend and I are splitting a RTR Booster box, mostly with hope for some chase rares, but we also wanted to have some fun while opening.  What are some Draft modes that only require two people?

My friend and I are buying an RTR booster box mainly in hopes of getting some chase rares, but also for some fun.  What are some Draft Variants for only 2 players?


$z=f(x,y)$ where $x=rcosθ$ and $y=rsinθ$  Find $ \frac{\partial z}{\partial x}$ and $ \frac{\partial^2 z}{\partial x^2}$  I'm having big troubles with using chain rule, in particularly the second derivative. Spent 2 hours on this already. What I have...  $ \frac{\partial z}{\partial x}=\frac{\partial r}{\partial x}\frac{\partial z}{\partial r}+\frac{\partial z}{\partial θ}\frac{\partial θ}{\partial x}$. So I'm guessing that $\frac{\partial z}{\partial r}$ and $\frac{\partial z}{\partial θ}$ are unkown? And I will need to use them to differentiate again. Any help is really welcome. This is simply only part of a bigger question.   Full Question:

Consider the polar coordinates with $x=r\cos\theta$ and $y=r\sin\theta$.  I can show using the chain rule that $$\frac{\partial}{\partial x} = \frac{x}{r} \frac{\partial}{\partial r} -\frac{y}{r^2} \frac{\partial}{\partial \theta}$$   What is the method to compute $\dfrac{\partial^2}{\partial x^2}$? I don't know how to do it.


I am new to ubuntu os.I have installed aircrack successfully and trying to execute the  command  sudo airodump-ng mon0 but its not working.How to fix this issue ?  Error:  ubuntu@ubuntu:~$ sudo airmon-ng start waln0   Found 4 processes that could cause trouble. If airodump-ng, aireplay-ng or airtun-ng stops working after a short period of time, you may want to kill (some of) them! -e  PID Name 1382    avahi-daemon 1383    avahi-daemon 1433    NetworkManager 14727   wpa_supplicant   Interface   Chipset     Driver  eth2        Unknown         wl  ubuntu@ubuntu:~$ sudo airodump-ng mon0 Interface mon0:  ioctl(SIOCGIFINDEX) failed: No such device   also tried with eth2 interface but no luck!  ubuntu@ubuntu:~$ sudo airmon-ng start eth2   iwconfig  ubuntu@ubuntu:~$ iwconfig lo        no wireless extensions.  eth0      no wireless extensions.  eth2      IEEE 802.11  Access Point: Not-Associated              Link Quality:5  Signal level:0  Noise level:0           Rx invalid nwid:0  invalid crypt:0  invalid misc:0  ppp0      no wireless extensions.

I am trying to set my wireless card into monitor mode. I am working with:  description: Wireless interface product: BCM4312 802.11b/g LP-PHY vendor: Broadcom Corporation logical name: eth2   When I try to set it to monitor mode I get:  sudo iwconfig eth2 mode monitor Error for wireless request "Set Mode" (8B06) :     SET failed on device eth2 ; Invalid argument.   I also tried using:  $ sudo airmon-ng start eth2   Found 5 processes that could cause trouble. If airodump-ng, aireplay-ng or airtun-ng stops working after a short period of time, you may want to kill (some of) them!  PID    Name 1094    NetworkManager 1096    avahi-daemon 1097    avahi-daemon 1167    wpa_supplicant 1720    dhclient Process with PID 1720 (dhclient) is running on interface eth2   Interface    Chipset        Driver  eth2        Unknown         wl (monitor mode enabled)  $ sudo iwconfig lo        no wireless extensions.  eth0      no wireless extensions.  eth2      IEEE 802.11bg  ESSID:"Redacted"             Mode:Managed  Frequency:2.437 GHz             Bit Rate=54 Mb/s   Tx-Power:24 dBm             Retry min limit:7   RTS thr:off   Fragment thr:off           Power Management:off           Link Quality=4/5  Signal level=-59 dBm  Noise level=-57 dBm           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0           Tx excessive retries:24  Invalid misc:0   Missed beacon:0   I've gone through various driver tutorials, but nothing is helping. Anyone know how to get this working for this specific wireless card?


I see that I have a new category in my inventory named Personal, and it contains an item called System Logs.  What is this for?  Will I need it in the future or can I sell it to make room for other more useful items?

I found that every character has a "Personal Item" in his inventory after you start the game. My question is: What is the purpose of it? I mean yeah you could sell it for 100$ but that really is absolutely nothing. It also doesn't have any stats so what can I use it for?


I've noticed that some people use words or phrases like can, could, seems like, it's likely, some people think, etc when they're talking and this makes it harder dispute what they're saying or arguing. In a way, they're much less likely to be wrong since they're not committing that much to what they're saying. I was wondering if there is word to describe this behavior.   For example, let's say you believe in some statement A. Instead of saying "A is true", you say "A is very likely to be true". This way, if someone says "A is not true because X, Y, Z" you can say "I didn't say it was true, I said it is very likely to be true. Therefore I wasn't wrong". This way you can get the same point across and not risk being wrong.

For some reason I am convinced that such a word exists, that I've heard it used in classroom settings, and that I'll recognize it when I see it. But I have no idea what it is. I tried googling this elusive word and failed miserably; I asked a few friends, but they couldn't think of it either. Help!  Suppose someone says: "Well, I don't know much about this topic, and I could be wrong, but XYZ."  I feel there's a word to describe the opening that leads into XYZ. It's a sort of hedging: you aren't fully committing yourself; you're worried about being wrong. I can almost hear a high-school teacher saying "Don't start an answer with a _."  Any ideas?


This is an obscure bug that only can be seen by moderators. I found a flag on a few comments of a user that were just spam. When I looked at the user, it was obvious he was only created to spam, and I destroyed the user's account, as is usually done for such people. The comments are now deleted, however, the flags still remain, with the only option to dismiss them, which I believe will give the user who correctly flagged an invalid flag. This doesn't seem right.  Proposal: If a user is destroyed, any flags associated with the account should be dismissed and marked as valid.

This appears to be related to the behavior originally suggested in .  It appears to be the same issue raised in , but this post has specific steps to reproduce the issue.  Here's what happened on one site in the network earlier today:   A question was posted much earlier Someone came along, and as an unregistered, new user with no other activity, posted a spam answer to that question at 04:36:54 UTC That same user posted a comment on their own answer with the same spam link at 04:37:31 UTC The answer was deleted as spam via community votes at 07:32:07 UTC A high-rep user saw the comment and raised a custom flag on it as being spammy at 07:32:54 UTC The unregistered user account was destroyed by a moderator at 08:13:10 UTC The comment now shows as "deleted by Anonymous" with a deletion time of 08:13:10 UTC The flag on the comment remains, but the only options are "Edit" and "Decline"; there is no "Delete" action   That there is no "Delete" action possible on the flag is reasonable, since the comment is now deleted. However, the flag is/was legitimate, so to decline the flag would be wrong. There's also nothing to leave while editing out the spammy part of the comment, as the comment consists solely of the same spam URL.  There is also no undelete option on the comment, so it's not possible to undelete the comment and then mark the flag as helpful by re-deleting the comment.  Effectively, this means that while the comment itself is effectively gone, the flag on it is in limbo and there is no good choice for what to do with the flag.  When deleting comments normally, my understanding is that any flags associated with those comments are automatically marked as helpful. However, it appears that the deletion of comments when destroying the user who posted them does not do that.  Therefore, I suggest that whenever comments are deleted as part of the owning user being destroyed, any pending flags against those comments should be marked as helpful at the same time.  It would also be a nice touch if those comments showed as deleted by Community♦, instead of Anonymous, but that's less of a concern in my case.


Why is the work done by static friction in accelerated pure rolling motion along an incline actually zero?  Somewhere I am grasping the information that work done by static friction is zero as the point of contact where it is acting has zero velocity so it is at rest w.r.t ground, but why is the work done by the torque produced due to static friction zero?  In fact that is the force which rolls the body (as opposed to sliding down the incline) so why is the work done by the torque due to static friction zero?

I have read various answers , on PSE and elsewhere , and most of them explain that the point of contact of the rolling object undergoes 0 instantaneous displacement in the direction of friction, I agree , but then there is a feeling that the friction does provide a torque , so how can it do 0 work . ( The pure rolling here is under a constant external force on the object so friction does act ).


I am in abstract algebra and am currently reading on a theorem which describes equivalent conditions relating to polynomial irreducibly. Here is the theorem:  Let $\mathbb{F}$ be a field and $p(x)$ a non-constant polynomial in $\mathbb{F}[x]$. Then the following conditions are equivalent:   $p(x)$ is irreducible if $b(x)$ and $c(x)$ are any polynomials such that $p(x)|b(x)c(x)$, then $p(x)|b(x)$ or $p(x)|c(x)$ if $r(x)$ and $s(x)$ are any polynomials such that $p(x) = r(x)s(x)$, then $r(x)$ or $s(x)$ is a nonzero constant polynomial.  When the textbook proves condition $3$ by using condition $2$, they say the following: "If p(x) = r(x)s(x), then p(x)|r(x) or p(x)|s(x), by 2." It goes on to show that this will lead to either r(x) or s(x) being a unit, and thus a constant polynomial. What I'm not getting, though, is where it says that if p(x) = r(x)s(x), then p(x)|r(x) or p(x)|s(x). Condition 2 hinges on p(x)|r(x)s(x), meaning r(x)s(x) = t(x)p(x) for some t(x) in F[x]. Wouldn't p(x)=r(x)s(x) mean that r(x)|p(x) and s(x)|p(x), rather than the other way around? I had the idea that perhaps p(x)|r(x) or p(x)|s(x) when t(x)=1 in r(x)s(x)=p(x)t(x), but I'm not sure if this is the correct interpretation. Any bit of insight would be appreciated.

I am trying to understand the proof for the following theorem:     Let $R$ be an integral domain. If $x \in R$ is prime, then $x$ is irreducible.   Here is the proof:    I typed this a while ago and I don't understand the part where if $x | bc$, then $x=bc$? Is something wrong at this step?  Also, is the definition of prime elements where $p$ is prime if whenever $p|ab$, then either $p|a$ or $p|b$? Now I don't feel so sure. This could be the reason why I am not understanding the proof...


I have a Lubuntu (now 14.04) installation. Recently, I logged in to find that the Wi-Fi icon had disappeared, and there was some sort of a keyboard icon in it's place. I have restarted multiple times, but it doesn't fix it. I can't find the same applet in the panel settings, and resetting the panel didn't help. When I try to manually start nm-applet, it starts, but prints a bunch of warnings to the console:  nm-applet-Message: using fallback from indicator to GtkStatusIcon   It then starts, using ugly icons for the Wi-Fi connectivity symbol.  What do I need to do to make it start correctly? Once it starts, why isn't it using the right icons?

I just upgraded to Lubuntu 14.04 from 13.10 successufully, via do-release-upgrade.  But after reboot, I found that the network indicator has been disappeared, so I cannot switch different network connection as before in 13.10 or 12.04, and cannot use VPN by clicking.  I tried:   add item with name containing 'network' for indicator bar right below open item in menu with name containing 'network'   But none of these is the network indicator (switcher) that we use in 13.10.  Does 14.04 change to another network indicator?   Is there alternative indicator for this, or any command for network switch.


I use osx ( currently 10.11 ) and i don't want iTunes. I've so far been unable to remove it permanently. It just reappears whatever i do. sudo rm -rf /Applications/iTunes.app will delete it, but it will just be reinstalled after a while. Right now i have a cron job to check if it is there and remove it, but this seems very dirty.   Does anyone know of a better and more permanent solution?

iTunes is always popping up on my HTPC Mac Mini and I don't use it. It is running Snow Leopard if that makes any difference to the solution


I’m reasonably sure we all have that love/hate relationships with grids or tables when it comes to nested data.   Over the years I have grown intolerant of anything below one level down, and work diligently to keep it simple. Early on I found going any deeper just made data hard to display, and often difficult for the user to understand. I work diligently to maintain my ‘rule of one level down’ by coming at the problem whatever way I can; changing navigation, breaking the data into smaller chunks, and sometimes even working to change expectations in the product owner.    How does everyone here feel about nested data in grids or tables? Do you have a rule of thumb that keeps things manageable?    Any and all input would be great – I’m curious what you think.

We're building a web-based platform where the main dashboard shows a table of data for users to view and analyze. As we're growing this tool, we seem to be adding more and more columns and are running out of horizontal space on smaller screen resolutions (we're seeing some data wrap). It is important to the user to view all columns at once, so column hiding is somewhat out of the question, as is horizontal scrolling (per the boss's request and because horizontal scrolling sucks anyways). I was wondering if anyone knew of a clever UI for tables with many columns.  EDIT  Below is a screen capture of the layout of the table. Unfortunately for security purposes I had to blur out the column titles. This example has rows with practically no data in them, but in use they will have lots of data that will expand wider than their respective column titles. In response to some of the answers, it is imperative that the user see all the columns, as they are all necessary to analyze the data to make certain decisions. All the data is numeric aside from the first three columns. Thanks again for any feedback.    Ok so I see that uploading this image doesn't really do it justice... it takes up the full width of the screen at 1680x1050 resolution (22") and as data fills in the columns, the left column w/the text shrinks down a bit.  EDIT 2 I just wanted to say thank you to everyone's awesome ideas. I can only select one answer, but a lot of your ideas have proven very useful and may end up in the final product. Thanks again!


I recently found this thing called a . I think it is what I have been trying to express for quite some time, but it's definition makes it mildly hard for me to prove the following (which is probably quite trivial... or not):     Let $f$ and $g$ be continuous functions and $x'$ denote the weak derivative, then $\forall_{x \in R} f(\lfloor g(x) \rfloor)'=0$.   I am not real sure how to prove it if it is true. The form I gave is my definition of piecewise constant. Mostly, I am concerned on whether or not it is what has this property as I've been trying for quite some time to formally define such a 'derivative'. If it does, then my next thing to ask is whether or not there is an associated weak integral as that is more what I care about.

I have to prove that the Heaviside function $$ H(x):=\begin{cases} 1 &\mbox{if } x \in [0,+\infty) \\  0 &\mbox{otherwise}\end{cases} $$ doesn't admit weak derivative in $L^1_{loc}(\mathbb{R})$.  Is it correct the following solution?  Let's suppose by contradiction that $\exists w\in L^1_{loc}(\mathbb{R})$ such that $$\int_{\mathbb{R}}H(x)v'(x)dx=\int_{\mathbb{R}}w(x)v(x)dx\qquad\forall v\in C^{\infty}_c(\mathbb{R}) $$ By the Fundamental Theorem of Calculus we have that $$\int_0^{+\infty}w(x)v(x)dx=v(0)\qquad\forall v\in C^{\infty}_c(\mathbb{R}) $$ By the Lebesgue Dominated Convergence Theorem we have that  $$\lim_{r\to 0}\int_{-r}^{r}|w(x)|dx=0 $$ Then there exists $\delta>0$ such that $\int_{-\delta}^{\delta}|w(x)|dx\le 1/2$.  Let $v\in C^{\infty}_c(\mathbb{R})$ such that $\operatorname{supp}(v)\subset [-\delta,\delta]$ and $\max (v)=v(0)=1$.  Then  $$1=v(0)=\int_0^{+\infty}w(x)v(x)dx=\int_{-\delta}^{\delta}w(x)v(x)dx \le \max(v)\int_{-\delta}^{\delta}|w(x)|dx\le 1/2$$  Contradiction!!!


I downloaded Ubuntu (I think version 14 point something, but not sure how to check the version), afterward I checked my download directory and I have an application file and an ISO file. I burned a DVD with the ISO file and loaded Ubuntu from the DVD. During the installation I gave Ubuntu much more space on the drive than required because I didn't know how much to give it- I think I gave it 88GB. I was asked to click on something that would allow my computer to boot from disk and agreed so that I wouldn't have to worry with going into the BIOS. Afterward, I was able to boot Ubuntu and was happy until I discovered that Windows Vista needed repair in order to boot. I did have the screen that asked which operating system to use. I repaired the Windows boot by going to a microsoft site that explained options to type into the command line. After repairing Windows boot, Ubuntu won't boot. Please advise!

I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu.   How can I get Ubuntu back?


Let $m$ be an integer. The set $\{r_1, r_2, \dots, r_s\}$  is a complete residue system module $m$ if  $r_i \not\equiv r_j (\text{mod } m)$ for all $i \neq j$ and  for all $n \in \mathbb{N}$, there is $r_i \in \{r_1, r_2, \dots, r_s\}$ such that $n \equiv r_i (\text{mod }m)$.   Given $p$ a prime number, the question I am trying to answer is whether it is possible to find a complete residue system composed only by prime numbers. I know that if $p = 7$, this is possible. Indeed, $\{1, 2, 3, 5, 7, 11, 13\}$ is a complete residue system. I constructed this complete residue system from the "trivial" one, which is given by $\{0, 1, 2, 3, 4, 5, 6, 7\}$, then I disregarded the ones that are not prime, but I noticed that if I summed $7$ in each one of this, I would obtain a prime number. This seems to specific to me, so that I think I cannot do the same construction for a general prime number. On the other hand, I am not sure if this is the only way to do this. Thank you in advance!

Prove that for any prime p, there is a complete set of mod p residues {q1, . . . , qp}, where each qi is prime. I used the theorem {a, a+n, a+ 2n, . . .} contains infinitely many primes if gcd(a, n) = 1 but haven't got much progress. Any comment will be helpful!


Suddenly Google stopped indexing my AMP pages though they are valid for AMP. What could be the reasons? Considering that I didn't make any changes to my code or content.

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?


I need to write in my document some greek letter (outside any formulas). What do you suggest me? Thanks a lot

I want to write a sentence like "physics (from ancient greek φύσις)". But I don't know how to typeset the character "ύ" properly. Also I am not sure, if it is a good idea simply to use math-mode here to typeset the greek letters. So, what's the best way to typeset the ancient greek word φύσις?  Edit: I should add that I just copied the word from wikipedia in this case, so the xelatex or babel solutions work very well since I can just copy the greek word into my latex source. But I don't know how I can insert those greek letters directly with my normal german keyboard layout.


I am new to asp.net. what is the difference between the Gridview and Datagrid in Asp.net  Thanks sivakumar

I've been doing ASP.NET development for a little while now, and I've used both the GridView and the DataGrid controls before for various things, but I never could find a really good reason to use one or the other. I'd like to know:  What is the difference between these 2 ASP.NET controls? What are the advantages or disadvantages of both? Is one any faster? Newer? Easier to maintain?  The intellisense summary for the controls doesn't seem to describe any difference between the two. They both can view, edit, and sort data and automatically generate columns at runtime.  Edit: Visual Studio 2008 no longer lists DataGrid as an available control in the toolbox. It is still available (for legacy support I assume) if you type it in by hand though.


How to escape curly braces in a dynamic string variable, which is used in String.Format?   Edit 1  I am aware of how this can be handled when the value of the string is known. for e.g.  string someStringVar = "This is a random string {0}. Blah {{ Blah {{ Blah }}"   But how to handle it when I am not aware of the strings value. for e.g.  string someStringVar = GetValueFromXmlFile();   In the above code, GetValueFromXmlFile method could return a string with a valid placeholder like {0} but could also contain characters like { or } which are not placeholders? In such a case should one escape { or } without escaping valid placeholder like {0}?

How can brackets be escaped in using string.Format? For example: String val = "1,2,3" String.Format(" foo {{0}}", val);  This example doesn't throw an exception, but it outputs the string foo {0}. Is there a way to escape the brackets?


so I have a 2019 MacBook Pro 16" on Catalina 10.15.5.  I recently got it back from the shop - upper case replacement for bad keyboard that included replacing the battery as part of the repair.  Now I've noticed that while its plugged in and 100% charge and I'm using it, the battery charge actually decreases.  For instance last night I opened it, it was plugged in at 100%. I used it to make an email and print a few pages for 15 minutes and the charge actually decreased to 93%.  The icon shows when plugged in. I have looked at  but Battery Health Management is not turned on so it seems to be something else in my case. How can I diagnose and solve this issue? PS: I'm using an OEM 96W power adapter.

I've been experiencing a very annoying problem lately. Often, I've got my MacBook Pro connected to  power when I'm working from the office. At home, I often leave it unplugged until the battery is too low to continue at which point I plug it in. The problem occurs when my device is connected to a power supply. My battery indicator shows 100% charge which is fine. But sometimes the battery starts draining and the menu bar icon says "Battery not charging," even when it's connected to a wall socket, and it keeps draining until absolutely dry. It doesn't even warn me the battery is running low because it shows "Power source: Power adapter" which I guess disables the Operating system low-battery warning. This has happened on multiple occasions. I've already tried several things, I've swapped chargers, swapped wall sockets, started with as few tools/apps running as possible. But the problem comes back. I also can't really tie this to a specific app or behavior,  AFAIK. Does anyone know what might be causing this behavior and what to possibly do about it?


I am trying to convert base64 to Binary in SQL, but I am not getting the proper results I need. The string I am testing is QQ==.  I can convert to varbinary fine, but I need the actual binary output.  Using the following code I get the value 0x41 but I need the value 01000001.  Select CAST(N'' as xml).value('xs:base64Binary("QQ==")','varbinary(20)')   Is it possible to get the exact Binary from base64?

I was wondering if there was an easy way in SQL to convert an integer to its binary representation and then store it as a varchar.  For example 5 would be converted to "101" and stored as a varchar.


I have a mathematical problem about building a gigantic gift package of Finnish chocolate. The goal is to include same amount of each brand in the package. However, the bar sizes between the brands differ ( Goodio 48g, Chjoko 80g, Panda 145g, Brunberg 150g, Fazer 200g ). How do I determine the amount of packages I need to buy from each brand to get the total amount of chocolate from each brand to be equal?

If there is recipe to find this - I would like to find the first common number divisible by the following six numbers- 260, 380, 460,560,760 and 960. How does one calculate the numbers I need? Any direction would be useful.


Issue:  My  shows that I have one answer and all of that answer's current tags show in the Tag section, however the points of the answer do not align with the points of (all) the tags.  An image just in case it does resolve itself over time to show what I am referring to specifically:    What I have looked at:  First I thought perhaps my answer was answered before the tags were added and thus incorrectly tallied, explaining that one of the tags shows the correct value but the other tags don't.  It does appear that all of the tags that were added after are incorrectly tallied, but they were all added before my answer.   discussion Tag (Question Asked): 2020-02-04 00:43:22Z stack-exchange and community Tags: 2020-02-04 00:53:34Z featured Tag: 2020-02-04 00:54:08Z welcoming Tag: 2020-02-04 17:06:42Z My Answer: 2020-02-05 00:34:49Z   I've cleared caches, checked with multiple browsers (Firefox and Chrome), and the results show the same metric.  I thought perhaps caching on SO server side, but that would be odd because the tags were all added same day and all nearly a day before my answer besides one (and the numbers don't show that one differently than the other added tags).  As for the reason I am posting this here as opposed to there:  I have only noticed this issue on SO Meta specifically, however I do not have very many data points to say that this could not be an issue elsewhere.  A similar question was asked  (I like that the similar questions was able to pick that out), but the status has been marked completed. It also appears to be an ongoing issue that keeps surfacing without any additional word.  I don't think it is the same because one of the five tags in question is actually the correct value.  Is this something that will resolve itself given time, or is this a bug that needs to be revisited?

I've posted an answer on Meta Stack Overflow four hours ago. Appears it was my twentieth answer with the  tag, so I got the  tag badge. I was surprised because the tag badges are usually awarded around UTC 3:00 AM. Well I thought, maybe the script was too late.  Then it got downvoted, and to my greater surprise, my tag scores soon went down too. Again, I'd expect it to happen at UTC 3:00 AM.   Has something changed recently?    The tag scores have already updated twice since (), which seems to be inline with the downvotes I was getting. Now I've removed the answer, let's see if I get the badge revoked and the scores updated again.    The score of the  tag . Strangely enough,  isn't updating inline with  and the tag badge is still here.  , after a delay,  (the badge is still here...).  So yes, the score definitely updates now more often.


In my rather limited experience, I have not across DEFAULT(i.e.no modifier) access modifier being used for top level Class definition at my job projects. Is it a good practice to use DEFAULT access modifier(where ever applicable) Or is public class with access control on variable and method level a better approach?

I know how package level protection in java works. I read a lot of code (including lots of open source stuff) and no-one seem to be using it. The whole protection level seems slightly faulty to me (I'd have c#'s internal any day of the week).   Are there any legit real-world use-cases that are in common use ?  Edit: A little too late after asking this question I realized I'd forgotten to exclude the "standard" pattern of package protected implementation classes, possibly providing implementations of public interfaces. Everyone uses those, as has been noted several times in the replies. I still think there are a large number of nice replies to this question.


I've been searching all over the web and couldn't find a simple answer to my question. Partially because I'm no electrical engineer, so I really need a simple and direct answer.  My question is if you have a portable battery with the same output voltage as the input voltage on your device, does the amp matter?  A little more background. I'm trying to power a PAM8403. I was wondering if this battery can be used   Would any portable batteries used to charge android phones work, for example?  Thanks a lot

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


I'm trying to create a new field, but Drupal came up with the well-known error:     The machine-readable name is already in use. It must be unique   I'm sure that the field doesn't exist anymore (I checked the fields' list and it doesn't show up). I want to use that specific machine name because I already have developed some functions that are using that name.  So I guess the name is still saved in the database, there is a way to delete it without screw everything up?  Thank you for your time!

I tried creating a field, but my server crapped out halfway with an Internal Server Error due to some spambot attack...  Now, when I try to add the field again, I am getting:     The machine-readable name is already in use. It must be unique.   I guess some tables were populated in the db. How can I remove these easily?


If a hollow disc made of brass is heated at the same time the circular hole is kept at a constant temperature, would the circular hole still show a change in shape?  Also, does the position of the circular hole in the disc dictate how much it expands / contracts ?   Ps. Any mathematical proof would be really appreciated.

Take a metal disc and cut a small, circular hole in the center. When you heat the whole thing, will the hole's diameter increase or decrease? and why?  What will happen to the  diameter of disc?


I want to run some software that was extensively tested against 14.04.2 and don't want to take the risk that 14.04.3 might be incompatible at some level.  So, How can I upgrade My machine form 14.04.01 to 14.04.02?

I wanted to upgrade to 14.04.2 point release from 14.04.  What I did was:  sudo apt-get update && sudo apt-get upgrade &&  sudo apt-get dist-upgrade -y   Then I wanted to upgrade to 3.16 kernel, since it wasn't done with the the above command, so what I did was:  sudo apt-get install linux-generic-lts-utopic xserver-xorg-lts-utopic libegl1-mesa-drivers-lts-utopic xserver-xorg-video-all-lts-utopic xserver-xorg-input-all-lts-utopic sudo apt-get install linux-signed-generic-lts-utopic   Now when I do:   uname -a I get   Linux Y500 3.16.0-33-generic #44~14.04.1-Ubuntu SMP Fri Mar 13 10:33:29 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux  cat /etc/os-release | grep VERSION= I get  VERSION="14.04.2 LTS, Trusty Tahr"   And when I do lsb_release -a I get  Distributor ID: Ubuntu Description:    Ubuntu 14.04.2 LTS Release:    14.04 Codename:   trusty   I know that uname -a and lsb_release -a both refer to different info, but why does  cat /etc/os-release | grep VERSION= show different version?


This code given is a part of my program. Here I want to reduce the 3 functions to just 1 as they are exactly similar except 1 line. I read about passing function(let this function be Bar) and its arguments as arguments in another function(let this function be called Foo ).   But in this scenario, I can't change the function Foo. Here my Foo function is .clicked.connect() and addXMin is my function Bar. I want to pass Bar and its argument num into Foo, where I can't change whats going on in Foo. Is there a way I can reduce the 3 functions into 1 and pass 15, 10 and 5 as arguments to that single function?  self.add15m.clicked.connect(self.add15Min) self.add10m.clicked.connect(self.add10Min) self.add5m.clicked.connect(self.add5Min)  def add15Min(self):     global mins, secs, time     time = self.lineEdit.text()     mins = int((time.split(':'))[0])     mins+=15         #The only different line     secs = int((time.split(':'))[1])     time = str(mins).zfill(2) + ":" + str(secs).zfill(2)     self.lineEdit.setText(time)  def add10Min(self):     global mins, secs, time     time = self.lineEdit.text()     mins = int((time.split(':'))[0])     mins+=10         #The only different line     secs = int((time.split(':'))[1])     time = str(mins).zfill(2) + ":" + str(secs).zfill(2)     self.lineEdit.setText(time)  def add5Min(self):     global mins, secs, time     time = self.lineEdit.text()     mins = int((time.split(':'))[0])     secs = int((time.split(':'))[1])     mins+=5         #The only different line     time = str(mins).zfill(2) + ":" + str(secs).zfill(2)     self.lineEdit.setText(time)

How can I bind arguments to a Python method to store a nullary functor for later invocation?  Similar to C++'s boost::bind.  For example:  def add(x, y):     return x + y  add_5 = magic_function(add, 5) assert add_5(3) == 8


If by eleminating $x$ between the equation $x² + ax + b = 0$ & $xy + l  (x + y) + m = 0$, a quadratic in $y$ is formed whose roots are the   same as those of the original quadratic in $x$. Then prove either $a =  2l$ & $b = m$ or $b + m = al$.   Today while we were solving this sum in class our professor told us that rather than directly eliminating $x$ from both the equations there is a shortcut method too.Since the equation after eliminating $x$ in $y$ is same as the the original quadratic in $x$ we can simply replace $y$ by $x$ in the second equation to form another quadratic. Then we can apply the condition for one root common or both roots common between this new quadratic and the original quadratic to reach final result.  But I didn't get why we can replace $y$ by $x$ in the second equation.Can someone please explain in detail?Thanks.

If by eliminating $x$ between the equation $x^2 + ax + b = 0$ and $xy+  l(x + y) + m = 0$, a quadratic in $y$ is formed whose roots are the    same as those of the original quadratic in $x$. Then prove either $a =  2l$ & $b = m$ or $b + m = al$.   Initially, I thought of eliminating $x$ but that method seems to be very lengthy. Is there any trick that can help to solve the problem faster?


I have set a global line spacing of 1.5 but I want to have a different line spacing for all my code blocks written with the \begin{minted}{<lang>} syntax. \documentclass{article} \usepackage{minted} \linespread{1.5}  \begin{document} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.  \begin{minted}{javascript}     let var = document.getElementById("anchor");     var.style.color = "blue";     var.style.width = "100px"; \end{minted}  \end{document}  I didn't find anything  and tried to find an option for the \setminted{}, but without luck... How can I define a custom line spacing for all my minted code blocks?

I'm using minted package. My problem is \usepackage[nodisplayskipstretch]{setspace} \setstretch{1.5} line. I do need this line stretch, but I don't want it to affect code sources generated by minted. How can this be done? Also, I would like to be able to change font size used by code listings independently from rest of document. I think I want 10 or 11pts for code listings and 12pt for rest of the text.  \documentclass[12pt,a4paper]{mwrep} \usepackage{minted} \usepackage[nodisplayskipstretch]{setspace} \setstretch{1.5} \begin{document} \begin{minted}{java} public class Foo {   public static void main(String[] args)   {     for(int i=0; i<10; i++)     {       System.out.println(i);     }   } } \end{minted} \end{document}


What does it mean to have 'half' spin? I have looked on Wikipedia and a few youtube videos on spin but they don't explain what it means to have $1/2$ spin. I am 18 and only starting to learning about quantum mechanics not so long ago, so please keep the vocabulary to a minimal.

I often hear about subatomic particles having a property called "spin" but also that it doesn't actually relate to spinning about an axis like you would think. Which particles have spin? What does spin mean if not an actual spinning motion?


I tested the following python code which reverses a string  >> s = 'abcd' >> s[::-1] >> 'dcba'   But I am confused, what exactly the two comma and negative one does it the code ?

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


I have the following code below. If I comment out the stringList.add(row); I can get it to print the lines of the document (5 lines of text with spaces). If I don't comment it out, I get one line printed and the null. I have looked up everything I could online but I am not understanding why this is happening!   package examples.files;  import java.io.File; import java.util.ArrayList; import java.util.Scanner;  /**  * @author   *  */ public class ReadFileUsingScanner {     static ArrayList<String> stringList = null;     /**      * @param args      * @throws Exception       */     public static void main(String[] args) {         Scanner scanner = null;          try {             scanner = new Scanner(new File("customers.txt"));              while (scanner.hasNext()) {                 String row = scanner.nextLine();                 System.out.println(row);                 stringList.add(row);             }         } catch(Exception e) {             System.out.println(e.getMessage());         } finally {             if (scanner != null) {                 try {                     scanner.close();                 } catch (Exception e) {}             }         }     }  }   You don't have to solve the code but I want to understand the fundamentals as to why it doesn't work.

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I have recently upgraded Ubuntu from 19.10 to 20.04. Since updating dash to dock behaves abnormally. It works normal initially, later when i lock the screen then the problem starts.    When I logout and log in again it works fine until I lock the screen.

What's going on here? I've installed the  on Ubuntu 17.10. Everything was cool, and as I was trying to hone and tweak the look of my desktop, at some point the shortcuts bar (dock?) on the left is duplicated.  (Click image to enlarge) The default, which normally disappears with Dash to Dock, is there underneath the one that usually shows up when I install Dash to Dock. Why? I've tried to go through the options for Dash to Dock, the GNOME Tweak Tool, and the regular Ubuntu settings, but I can't figure it out.


I have an idea for a small game which would generate random 3D planets.   I already have found a way to create a random heightmap in XNA ().   How would I be able to wrap the heightmap around a sphere and then render it on the sphere, creating a planet-like terrain?  Also, would I be able to do something similiar with the .NET port of libnoise (XNA port: )?  I'm not asking for code or anything, just some ideas on how to do something like that.   Thanks.

I am using a standard heightmapped procedural terrain in my project.  However, I want the terrain to appear spherical when the user zooms out.  This is an attempt to simulate the appearance of a spherical planet.  Here is my current algorithm:          //get the direction from the "planet" center to this vert         Vector3 sphereCentertoVertPosition = vert.Position - SphereCenter;         sphereCentertoVertPosition.Normalize();          //our rotation axis is the cross between the direction from this vert to the planet center and the root (center of the terrain) to the planet center         RotationAxis = Vector3.Cross(sphereCentertoVertPosition, sphereCenterToRootPosition);          //the amount we rotate is based on the distance of this vert from the center of the terrain         Vector3 fromCenter = vert.Position - Root.Position;         float amount = (fromCenter.Length() / ((myTextureWidth / Scale) / 2)) * (float)Math.PI;          Quaternion rot = Quaternion.CreateFromAxisAngle(RotationAxis, amount);          Vector3.Transform(ref vert.Position, ref rot, out vert.Position);   My main concern is that the rotation axis is not correct.  Theoretically, should it be the cross between the vert-to-planet-center and the terrain-center-to-planet-center?


I need to send 2 files to an external system  in multipart/form-data using REST API. I'm able to do it using postman.  I have 2 attachments stored in Attachments object. I need to send both files (as shown in attached screenshot) in single request. Can you please help me to compose the same request using APEX? I took reference from this post:  My Code: //  Compose the form string form64 = '';  form64 += vNHttpFormBuilder.WriteBoundary();  //file 1 vNHttpFormBuilder.WriteFileResult result1 = vNHttpFormBuilder.WriteFile('file', fileName, fileMimeType, fileBlob); form64 += result1.Content; form64 += vNHttpFormBuilder.WriteBoundary(result1.EndingType);  //file 2 vNHttpFormBuilder.WriteFileResult result2 = vNHttpFormBuilder.WriteFile('file', fileName, fileMimeType, fileBlob); form64 += result2.Content; form64 += vNHttpFormBuilder.WriteBoundary(result2.EndingType);  blob formBlob = EncodingUtil.base64Decode(form64); string contentLength = string.valueOf(formBlob.size());   //  Compose the http request HttpRequest httpRequest = new HttpRequest();  httpRequest.setBodyAsBlob(formBlob); httpRequest.setEndpoint(url); httpRequest.setHeader('Connection', 'keep-alive'); httpRequest.setHeader('Content-Length', contentLength); httpRequest.setHeader('Content-Type', contentType); httpRequest.setMethod('POST'); httpRequest.setTimeout(120000);

I'm trying to integrate Kraken.io into our org so I can have Salesforce queue up image optimization jobs that our employees upload. Kraken.io requires that the requests post a multipart/form-data body which contains a JSON parameter and the file. I'm porting code from C# where I could just write to the request stream, but in APEX with the HttpRequest class this doesn't seem to be possible. How can I go about creating a request that can do this?


Can anyone help me develop some intuition for the idea of avoided crossing in QM. To explain what confuses me consider a two-level system given by  $ M=   \begin{bmatrix}     E1 & 0  \\     0 & E2 \\   \end{bmatrix} $  Let us denote its eigenvectors as $\lvert 1 \rangle$ and $\lvert 2 \rangle$ and assume we set $E1=1$ and want to plot $E2$ along with the eigenstate that follows this energy as a function of $E1$. What is now the correct way to make this plot? Is it that the state $\lvert 2 \rangle$ follows $E2$ as it crosses $E1$ or should I switch around my states when passing the degeneracy point. The reason why I ask is that when you have a small perturbation on the off-diagonal terms you will have an avoided crossing where the lower level avoids the upper one at the degeneracy point and somehow it makes sense that the states should then be switched around at the degeneracy point. Hope it is clear what I mean.

Suppose we have a Hamiltonian that depends on various real parameters.  When tuning the values of these parameters, the energy eigenvalues will often avoid crossing each other.  Why?  Is there a physically intuitive justification for  and ?  It would be nice to see a general argument.


I am new here, but I’ve noticed  that downvoting on this site tends to be quite virulent with respect to off-topic questions or questions which probably  are  poorly formulated.   Though I understand the therapeutic nature of up/downvoting in motivating users in doing better, I really wonder if an excessive use of this feature actually makes  it less effective in the end.   A few examples in the last couple of days:     -8  -10  -13  -10

Upvotes are easy on both Main and Meta sites. You like something, you vote it up.  Downvotes are trickier.   On Main down-voting a question means that the question is a poor one. Poor meaning badly written or really annoying for some reason (e.g. give-me-da-codez).  Downvoting an answer usually means it's plain wrong.  On Meta, however, many questions revolve around matters of taste (e.g. ). When voting on answers to such questions, I want to be able to push down the suggestions that I disagree with and promote the ones that I think are correct. But I don't want to hurt people's reputation by doing so.   Downvoting on Meta isn't really saying "your answer is stupid and wrong"; it's more like "I prefer we do it the other way". The whole site is basically meant to discuss matters of social preference, etiquette, do's and dont's, etc.  In Main most people wouldn't downvote an answer just because some other answer is better. People generally accept that there may be different solutions to a problem and feel comfortable in letting upvotes alone decide on the most popular one.  In Meta, on the other hand, there might be groups that really care about some issue and would like to see it solved in a particular way. And, in case , voting on answers would really be voting on preference more than correctness.   Should downvote semantics on Meta be different than on Main?   Perhaps the system should not deduct reputation points if your answer gets downvoted, thereby allowing/encouraging more free downvoting.


I have the following PageViewModel class:  public class PageViewModel : ViewModel<Page> {  public PageViewModel ()         {             Kywords = new List<Keyword>();             AnswserKeywordDictionary = new Dictionary<string, Answer>();         }         public Company Company { get; set; }         public List<Keyword> Kywords { get; set; }         public Dictionary<string, Answer> AnswserKeywordDictionary { get; set; } }   In my view i'm using the property AnswserKeywordDictionary  like that:  @Html.DisplayAffirmativeAnswer(Model.AnswserKeywordDictionary["myKey"])   my question is : how can i return a default value if "myKey" is not in the dictionary.  Thanks in advance

The indexer into Dictionary throws an exception if the key is missing.  Is there an implementation of IDictionary that instead will return default(T)? I know about the TryGetValue() method, but that's impossible to use with LINQ. Would this efficiently do what I need?: myDict.FirstOrDefault(a => a.Key == someKeyKalue);  I don't think it will as I think it will iterate the keys instead of using a Hash lookup.


I read this sci-fi short story a while back - here's what I remember of the plot:   People could live 'forever' by buying themselves new host-bodies for a certain amount of money (a million dollars, I think). For some reason everybody was rich or at least they could afford a host body every X or so years so virtually everybody lived forever. People are spending their lives learning new skills, like playing the piano, science, sports, etc... The protagonist lives many lives and becomes an expert at 'everything'; after a while he gets tired of 'living-to-learn' and decides to transfer his mind into the body of an infant (who never ages?), thereby living a life of complete ignorance (and bliss).   The story is part of a 3-story 'series' written by a not-so-famous American author. It was quoted in an article in the New Yorker - a couple of years ago, perhaps.

There's a story I listened to some time ago. I know it was narrated by Harlan Ellison, but I don't know for a fact it was written by him. It was a collection of three very short stories centered on the subject of immortality.  In the first, you can live forever as long as you have enough money. Eventually the planet devolves into fighting, with the entire planet being renamed "Death Valley".  In the second, people can sell their hard-earned skills for youth, then spend more time gaining more skills, and so on. At the end, everyone decides to revert to infancy, being taken care of by machines.  In the third, you can live forever as long as you find at least one person to love you. The story follows the efforts of a profoundly unlovable man trying to achieve just that.


Christopher Columbus discovered America and was the Indians' best friend. He helped the Indians win their war against Frederick Douglass and freed the Hebrews from Napoleon…   This is a part from the famous surrealistic speech by Mr. Garrison from the TV series South Park (quoted according the comic version). I would like to ask why "to" is omitted before the verb "win". Does it have dealings with the differences between American English and British English?

Which one of this two sentences is correct?   I need you to help me do this job I need you to help me to do this job   Can you also provide me some explanation?


In python I want to take a list and break it into a list of lists. If I have a list that is 20 numbers long, I want to turn it into a list of two lists, each 5 numbers long.  Input  nums = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]  Output  new_nums = [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 19]]

I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question:


I've seen a few questions I'd like to comment on or give a different answer, but seeing how I don't have 50 reputation (I've been a lurker for years, finally decided to participate) do I really need to ask a few questions before I can comment/answer other people's stuff? Or am I missing something here?  Sorry if this has been answered before, but with a few search tries I couldn't find any similar stuff, even tried google just for "50 reputation stackoverflow" but that didn't give me anything either.

I recently posted an "answer" to a self-asked and answered question with basically no votes. I was hoping to ask the poster a specific question about his code, but a moderator deleted it basically saying that it wasn't an answer and I should follow the rules.   This happened to me twice now, except the first time I wasn't deleted, just down-voted into oblivion. How am I supposed to ask questions and participate to earn reputation if I don't have any reputation to ask questions/participate within the guidelines? I came very close to 50 reputation points and then people went through and voted down my discussions with the OP.  This is almost akin to the "you can't get a job without experience" conundrum, and I feel an easy solution would be to lower the amount of reputation points required to comment on posts. It's ridiculous that this community is so hostile to someone who is only trying to contribute instead of just taking without giving back.  EDIT: Thanks, to whomever went through and voted up enough things to get me to 50 reputation points!


Hardware    Neewer TT560 SpeedLite Cannon T6i   Shutter Speed   1/200 shows full photo 1/400 shows 90% photo 1/640 shows 50% photo 1/1000 shows 10% photo   From what I can tell, the shutter is faster than the flash. I tried modifying the external flash settings but I get this message:  Flash Control > External flash func. setting  This menu cannot be displayed. Incompatible flash or flash's power is turned off.  Question  How can I get the shutter to time better with the flash if I'm not able to modify the settings? I've tried modifying the settings when the flash is powered on and attached to the hotshoe as well as when it's not attached.

When referring to flash exposure, what does "max sync speed" mean?


I tried to build the node object with a arraylist element for adding child node, and initialized successfully. However when i tried to add nodes into the arraylist the exception happened. How to solve the problem?  public class nodes{  int value=-2;  boolean root=false;  nodes parent;  ArrayList<nodes>Children;  public nodes(int value,ArrayList Children) {      this.value=value;      this.Children=Children;  }  public void setParent(nodes parent) {      this.parent=parent;  }  public void Add(nodes child) {     this.Children.add(child);  }    }     public class TreeHeight {                  int n;         int parent[];                  nodes Nodes[];         void read() throws IOException {             FastScanner in = new FastScanner();             n = in.nextInt();             ArrayList[]Children=new ArrayList[n];             parent = new int[n];//parent is an array that contains all elements                                   Nodes=new nodes [n];             for (int i = 0; i < n; i++) {                 //parent[i]= ;                 //index[i]=i;                 Nodes[i]=new nodes(in.nextInt(),Children[i]);                                           }             //Nodes[0].Add(Nodes[1]);             for (int vertex = 0; vertex < n; vertex++) {                 if(Nodes[vertex].value==-1) {Nodes[vertex].root=true;                 } for(int j=0;j<n;j++) {     if(Nodes[j].value==vertex) {         Nodes[j].setParent(Nodes[vertex]);         Nodes[vertex].Add(Nodes[j]);      } }                 }         }

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I have some embedded youtube videos that has pesky youtube-added attributes to the title bar that I would like to get rid of (if it's even possible). Upon publishing, a nested HTML document is generated inside the  tag that contains the youtube video. How do I get at the CSS for that nested document? I'd appreciate an answer in CSS if possible but if the only way to get at it is JS or JQuery then I would be able to implement that.  Example of code generated. How would I get at class ytp-gradient-top and override it, presumably with my own class on the iframe youtube-video (doesn't have to be that, just assuming that's what I would need to do)?:  <iframe class="youtube-video" src="https://..."     #document

 //all the closing divs, body, html, etc

I have a simple page that has some iframe sections (to display RSS links). How can I apply the same CSS format from the main page to the page displayed in the iframe?


I met this one sugar daddy today and he is trying to access my Bank account with asking my passwords and everything. Then I checked where I met him from (Instagram) and I’m already blocked before Even giving him access to anything. I told him all he needs is my 8 digit code and he’s trying to say no he doesn’t I asked for it to be cashapped and he’s saying he doesn’t want to because he’s been scammed! I called the number I was also texting him on and it says say your name to be Connected to someone or something !!

Someone is offering to pay me in a sort of sugar daddy/sugar baby arrangement. They want to make online deposits to me, and they're asking me for my online banking username and password. Is that information alone enough for them to be able to take my money out of my account, or am I safe?


My question reads:  If   c^2=ab and (a,b)=1, prove that a and b are perfect squares.  I began my proof by $a=p_1 p_2 \cdots p_n$ and $b=q_1 q_2\cdots q_m$. Then I gave $c$ its own decomposition as well and said $c=s_1 s_2\cdots s_t$.  From there I squares the c and just got the same except now with 2 in the exponent for each s.   I am not too sure how to continue on from there. Would I need to re-index? Also, I am not too sure when to bring in the fact that their gcd is 1.

If $a$ and $b$ are two relatively prime positive integers such that $ab$ is a square, then $a$ and $b$ are squares.   I need to prove this statement, so I would like someone to critique my proof. Thanks  Since $ab$ is a square, the exponent of every prime in the prime factorization of $ab$ must be even.   Since $a$ and $b$ are coprime, they share no prime factors.   Therefore, the exponent of every prime in the factorization of $a$ (and $b$) are even, which means $a$ and $b$ are squares.


In the question  asked about the problems I encountered due to an update of my MiKTeX distribution, but didn't take the time (at that moment) to create a MWE, so it didn't attract much response. I have the directory structure:  main  manual.tex   group  group__group2.tex refman_doc.tex    manual.tex \documentclass{book} \usepackage{import} \usepackage{hyperref}  \begin{document} \subinputfrom{../group}{refman_doc} \end{document}  group__group2.tex \hypertarget{group__group2}{}{The Second Group}  refman_doc.tex {Module Documentation} \include{group__group2}  When running in the directory main the command pdflatex manual.tex I get the error: ... (../group/../group/refman_doc.tex [1{C:/Users/User/AppData/Local/MiKTeX/2.9/pdf tex/config/pdftex.map}] ! I can't write on file `../group//group__group2.aux'. \@include ...mmediate \openout \@partaux "#1.aux"                                                   \immediate \write \@partau... l.2 \include{group__group2}  Please type another output file name:  but in a non interactive mode (the usual way to run. i.e. with \batchmode) one doesn't get an opportunity to specify the file and the generation crashes. As written in the original question adding options like -shell-escape and / or -enable-write18 didn't help. Is theer a solution for this problem?

Upon the risk of being down voted as no MWE is present, but at the moment just trying to get some pointers. I updated my MiKTeX installation to the newest available version at the moment (MiKTeX-pdfTeX 4.1 (MiKTeX 20.12)) and now I get an error while building my documentation: Appendix D. (../html/examples/group/latex/refman_doc.tex (../html/examples/group/latex//gro up__group1.tex) [243] ! I can't write on file `../html/examples/group/latex//group__group2.aux'. \@include ...mmediate \openout \@partaux "#1.aux"                                                   \immediate \write \@partau... l.3 \include{group__group2}  Please type another output file name ! Emergency stop. \@include ...mmediate \openout \@partaux "#1.aux"                                                   \immediate \write \@partau... l.3 \include{group__group2}  *** (job aborted, file error in nonstop mode)  some small background:  Started normally with pdflatex doxygen_manual.tex in here is the statement: \subinputfrom{../html/examples/group/latex/}{refman_doc} and in this file again: \include{group__group2} as far as I know the disk is not full and the protections of the files and directories are OK as well  It looks like that now an attempt is made to write to the directory ../html/examples/group/latex/ whilst in the past the file was written to the current directory. I already tried -shell-escape and -enable-write18 (as well as --shell-escape and --enable-write18) but to no avail.  Any known changes in respect to writing the aux file? Any hints  edit I asked another question () with the details and MWE but that was closed with the reason that it was a duplicate of this one ... So I'm adding the information now here: In the question  asked about the problems I encountered due to an update of my MiKTeX distribution, but didn't take the time (at that moment) to create a MWE, so it didn't attract much response. I have the directory structure:  main  manual.tex   group  group__group2.tex refman_doc.tex    manual.tex \documentclass{book} \usepackage{import} \usepackage{hyperref}  \begin{document} \subinputfrom{../group}{refman_doc} \end{document}  group__group2.tex \hypertarget{group__group2}{}{The Second Group}  refman_doc.tex {Module Documentation} \include{group__group2}  When running in the directory main the command pdflatex manual.tex I get the error: ... (../group/../group/refman_doc.tex [1{C:/Users/User/AppData/Local/MiKTeX/2.9/pdf tex/config/pdftex.map}] ! I can't write on file `../group//group__group2.aux'. \@include ...mmediate \openout \@partaux "#1.aux"                                                   \immediate \write \@partau... l.2 \include{group__group2}  Please type another output file name:  but in a non interactive mode (the usual way to run. i.e. with \batchmode) one doesn't get an opportunity to specify the file and the generation crashes. As written in the original question adding options like -shell-escape and / or -enable-write18 didn't help.  Is there a solution for this problem?  edit 2 I did some further test. I replaced the \subinputfrom with an \input statement, although this worked for the limited example above it didn't work for my larger codebase as here (again just a limited view) we have in the refman_doc.tex {Module Documentation} \input{group__group1} \include{group__group2}  with the contents of group_group1.tex similar to group__group2.tex and the file is also parallel to group__group2.tex. This results in the error: (manual.out) (manual.out) (../group/refman_doc.tex  ! LaTeX Error: File `group__group1.tex' not found.  Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: tex)  Enter file name: ! Emergency stop. <read *>  l.2 \input{group__group1}  !  ==> Fatal error occurred, no output PDF file produced!


Let $(E,d), (E',d')$ be two metric space, and $f:E\rightarrow E'$ an injective function such that the image of any compact set from $E$ is compact in $E'$.   How can I prove that $f$ is continuous?  Thank you.

Let $X$ and $Y$ metric spaces, $f$ is an injective from $X$ to $Y$, and $f$ sets every compact set in $X$ to compact set in $Y$. How to prove $f$ is continuous map?  Any comments and advice will be appreciated.


I apparently failed too many First Post-review audits, and have been banned for two days.  I would like to have a list of audits I failed, so I can try and find some pattern in what I'm doing wrong.  It can be linked from the profile page or the review page.

I completed recently a few review audits, some of them I passed, some I failed.  Is there a place I could (easily) find these results?


No compilation and runtime errors  Is 2019 is kind of variable or anything? Explain this please  #include <stdio.h>  int main() {     int a, b;     a= b = 2020, 2019;     printf("%d %d", a, b);      return 0; }

How does the comma operator work in C++?  For instance, if I do:  a = b, c;     Does a end up equaling b or c?   (Yes, I know this is easy to test - just documenting on here for someone to find the answer quickly.)  Update:  This question has exposed a nuance when using the comma operator.  Just to document this:  a = b, c;    // a is set to the value of b!  a = (b, c);  // a is set to the value of c!   This question was actually inspired by a typo in code.  What was intended to be  a = b; c = d;   Turned into  a = b,    //  <-  Note comma typo! c = d;


Which one of the following is correct/preferred?     This process is devised in such a way that it works automatically   while always revealing to the user the fact of it/its being   intact.   Both "the fact of it being ..." and "the fact of its being ..." can be frequently found on the web. But perhaps one should be correct/preferred.

I have a problem analysing this sentence from the point of finite/nonfinite clauses, clause elements and their functions:     He does not want to destroy his parents' dream of him achieving a Cambridge degree.   I am especially interested in the: dream of him achieving a Cambridge degree.  I know that 'achieving a Cambridge degree' is a non-finite -ing participle clause. However what is its function? And what is the function of 'of him'? Is it a postmodification?


I'm planning on uninstalling Windows, which I have currently installed in dual boot with Ubuntu 16.04 LTS. For that I will probably proceed with this method:   The two operating systems are installed on different drives. My question is, after permanently removing Windows and having that drive empty as unallocated space, how can I enlarge the Ubuntu partition to also include that empty drive and be able to use the space of both as one?  Edit:

I am about to set up box to basically be a file server. I plan on having multiple drives in the box, and would like to set them all up so that they appear to be a single drive. So I could essentially have it mounted at say /media and not really care which drive gets used. I am not sure what the correct terminology for doing this is, so my Google fu is useless in this situation.   So how do I set up multiple hard drives to appear as one single drive?


I got some filenames containing characters that are regex special control ones.  I need to prepare a regex that considers all these characters literally.    Simplified test case:  strFilenameOnDB="some ( file ) name +.ok"; strFilenameToCheck="$strFilenameOnDB"; #code simplification strRegex=".*${strFilenameToCheck}.*"; if [[ "$strFilenameOnDB" =~ $strRegex ]];then echo OK;fi   the above will (of course) fail.  in perl we can use /Q /E () to turn the expanded $strRegex into literal, is there anything like that for bash?  Obs.: I will post what I am already doing, but I wonder if there is a better way?

I have a script that reads a text stream and generates a file of sed commands that is later run with sed -f. The generated sed commands are like:  s/cid:image002\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1922/g s/cid:image003\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1923/g s/cid:image004\.jpg@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1924/g   Assume the script which generates the sed commands is something like:  while read cid fileid do     cidpat="$(echo $cid | sed -e s/\\./\\\\./g)"     echo 's/'"$cidpat"'/https:\/\/mysite.com\/files\/'"$fileid"'/g' >> sedscr done   How can I improve the script to ensure all regex metacharacters in the cid string are escaped and interpolated properly?


Obviously the earth's oceans have mass and therefore they have an attractive force upon the moon.  However, let's say that we were to cover most of earth with tidal power generators that extract some of this energy from the ocean. Could this affect the moon?  How about if we were to otherwise freeze the earth's oceans, or lock them in with a layer of cement to prevent them from being tidal?

Are tidal power plants slowing down Earth's rotation to the speed of the orbiting moon? (1 rotation per 28 cca days)   Are they vice versa increasing the speed of moon orbiting by generating some waves in gravitation field?  If yes, can you calculate how much energy must be produced by how many tidal power plants (compare it to average nuclear plant please) to slow down the Earth's rotation to 25 hours / day?


So I was running around some places, and I had done lots and lots of things without saving. And then I noticed Frea was gone missing. She's carrying a lot of my stuff and I don't know her ref ID. How can i get her back?  I have all the DLC's.

I had parked my follower at an inn with a bunch of valuable items that I didn't want to carry. I guess I have been out a bit too long as this message appears:      Your follower tires of waiting and leaves.    There have been other situations where my follower has mysteriously disappeared as well.  How can I find my follower when they get up and leave or disappear into thin air?


(a) Prove that $\operatorname{gcd}(a, b) | \operatorname{gcd}\left(3 a+b, a^{3}\right)$  Since say $d = gcd(a,b)$ then $d|a$ and $d|b$ this will imply $d|(3a+b)$ and $d|a^3$ and therfore $d$ is divisor of those two.But how to show it is greatest common divisor.

I know that the definition of gcd of two numbers $ a, b $ is $G$ ,where  $G\mid a$, $\;G\mid b  $ and  If $d\mid a$, $\;d\mid b $, then $ d\mid G.$  Now, using this how do I prove that in $\mathbb Z$, this definition coincides with the definition that $G$ is the GREATEST (w.r.t. usual ordering) common divisor?  So to prove that I write, say $G=dq+ r,\;  0\le r<d$. My aim is to show that $ r$ is $0$. So I have to construct some $G+x $ which is also a divisor of both $ a$ and $b$, to get a contradiction. How do I get $ x$?


How can I round a number to the nearest ten with no if statements? For example, 98 to 100.  int num = 87; double t; double d = 1.0 * num; // d = 87.0 t = d/100; System.out.println(t);

What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next number. This is the standard method of rounding most people expect in most situations.  I also would like only significant digits to be displayed - i.e. there should not be any trailing zeroes.  I know one method of doing this is to use the String.format method:  String.format("%.5g%n", 0.912385);   returns:  0.91239   which is great, however it always displays numbers with 5 decimal places even if they are not significant:   String.format("%.5g%n", 0.912300);   returns:  0.91230   Another method is to use the DecimalFormatter:  DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385);   returns:  0.91238   However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this:  0.912385 -> 0.91239 0.912300 -> 0.9123   What is the best way to achieve this in Java?


After playing any video...following msg is shown:  Required plugin could not be found  Videos requires to install plugins to play files of the following types:  • MPEG-4 AAC decoder  • H.264 (Main Profile) decoder

i am unable to perform the task though i followed the instruction. how to handel Unable to locate package ubuntu-restricted-extras?


I want to run multiple servers on 1 single ip, that can be accessed by its requested domain.  Example:  Server 1: A Synology nas, runs on local ip 192.168.178.100 Server 2: A ESXI server, runs on local ip 192.168.178.200  Both servers go out on the same ip. As example 84.24.82.97  When you go to myExampleDomainName.com you will end up on my Synology nas And when you go to anotherExampleDomainName.com you will end up on the ESXI server.  And also when you go to server1.example.com you will end up on server 1 and the same for server 2.  If the solution means I need to add a virtual machine to the ESXI server, then thats possible.

I am running multiple web servers in my house, each of which is plugged into my router.  Server A Server B Server C  I currently can only use one server since my IP (xx.xxx.xx.xx) port 80 is pointing towards server A. However some domains point to server A, some to B, etc.  With my one IP address, how do I point to each server? For example my A(host) records all point to just my IP address.  Sorry if I sound confusing. Let me know if I am not being clear.  Each server is running Ubuntu Server 12.04.02 and is using Apache (if that helps). My router is also a Netgear and my ISP is Time Warner Cable.


Looking for a simple script I can install on a password protected page that basically detects and display the viewers IP address.  So that when my client logs on the page to review a design mock up --I want a pop up dialog that displays his IP address to HIM, with maybe a message "Thank you. This IP Address Was Recorded" and an "OK" button to close the dialog box.    This way he's aware (or under the impression) his visit was "recorded".  Nice to have would be if it were actually recorded for me as well, maybe via an email message or in an IP log/time of visit text file (although that seems like it might be getting in over my head code wise)  The ABSOLUTE ULTIMATE solution would be also if I got notified real time when he accesses the password protected page.

I need to somehow retrieve the client's IP address using JavaScript; no server side code, not even SSI.  However, I'm not against using a free 3rd party script/service.


I would like someone to clarify this because I don't understand it. Here is a sample code, that tests an argument if it is numeric or not (integer) #/bin/env bash pattern="^[+|-]?[0-9]+$" [[ "$1" =~ "$pattern" ]] && echo "1:number" || echo "1:NOT number" [[ "$1" =~ $pattern ]] && echo "1:number" || echo "1:NOT number"  it is advisable to quote always the variables, but here, if you make the test with this simple script with various inputs, you will see that if you enter a number, the quoted pattern variable returns an erroneous result (first test) Why is that? thanks in advance for anyone who will take the trouble to explain this to me. Finally, sorry if that is already answered but I haven't found that particular one.

The following code  number=1 if [[ $number =~ [0-9] ]] then   echo matched fi   works. If I try to use quotes in the regex, however, it stops:  number=1 if [[ $number =~ "[0-9]" ]] then   echo matched fi   I tried "\[0-9\]", too. What am I missing?  Funnily enough,  suggests this should work.  Bash version 3.2.39.


I have a folder with 300 txt files. lets say the .txt names are a, b, c, d etc. I need to compare each pair with a python script. I need to compare a-b, a-c,a-d, b-c, b-d. I do not want to have a-a and also i don't want to have both a-b and b-a. My guess was something like  for x in ['a', 'b', 'c', 'd']:      for y in ['a', 'b', 'c', 'd']:           if x != y:             print(x , y)   but i am getting both a-b and b-a etc. If i scale it at the 300 file names i will get a few thousands duplicate outputs.   Any suggestions?

I have a list with 15 numbers in, and I need to write some code that produces all 32,768 combinations of those numbers.   I've found  (by Googling) that apparently does what I'm looking for, but I found the code fairly opaque and am wary of using it. Plus I have a feeling there must be a more elegant solution.  The only thing that occurs to me would be to just loop through the decimal integers 1–32768 and convert those to binary, and use the binary representation as a filter to pick out the appropriate numbers.   Does anyone know of a better way? Using map(), maybe?


I have installed matplotlib but still when I run the program it shows:  Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure. plt.show()  How to resolve this issue?

I'm using Ubuntu 20.04 LTS. I've recently installed Matplotlib for Python 3.9 and when I try to plot a graph it gives me the error: Matplotlib is currently using agg, which is non-GUI backend, so cannot show the figure.  Do I have to install something else for it to work?


I am trying to add in PHP the string "0" to a one-digit-number, which is a string as well e.g."1" if it is less then ten in order to always have two digits.  I then want to get the string "01" for example in a new variable.  Defining all three variables with either strval() or (string) just returns the result variable as an int again nevertheless.  Any ideas? That is the code I tried: $zero = "0"; $number = "1"; $zero = strval($zero); $number = strval($number); if ($number < 10) {     global $zero;     global $number;     $result = strval($result);     $result = $zero + $number; } echo var_dump($result);  Unfortenately it always returns int(1) An alternate approach would be to do the same with int and convert it to str in the end, but I have no idea how 0 + 1 could result in 01 instead of 1

I need to cast single figures (1 to 9) to (01 to 09). I can think of a way but its big and ugly and cumbersome. I'm sure there must be some concise way. Any Suggestions


How to obtain "equation environment's size" for integral sign in caption? The one using inline math mode is too small (see caption):    I've tried using equation environment inside caption but seems not allowed. Any idea? Is there not an equivalent of \dfrac for integral?  MWE:  \documentclass{article} \usepackage{amsmath} \usepackage{pgfplots}  \begin{document}  \begin{figure}[t]     \centering     \begin{tikzpicture}     \begin{axis}     \addplot[mark=none,black,thick] coordinates {(0, 0) (1, 1)};                                     \end{axis}     \end{tikzpicture}     \caption{$T = \int_{0}^{1}f(x)dx$} \end{figure}  \end{document}

I'm very familiar with how symbols display differently in inline mode (with $ ... $) vs. how display math shows them (with \[ ... \] or $$ ... $$).  Two examples would be with limits  $\lim_{n\rightarrow \infty}f(x)$   vs.  \[ \lim_{n\rightarrow \infty}f(x) \]   and with sums  $\sum_{n=1}^{x} n^2$   vs.  \[ \sum_{n=1}^{x} n^2 \]   My Question is:     How do you display these things in inline mode (with all the nice inline formatting) as if they were in display mode ?   The inverse -- how to display things in display mode as if they were in inline mode -- is also of interest.


I'm new to command line and using vim. Suppose you’re editing a file named exampleFile.txt using vim editor. How do you switch to another file named exampleFile2.txt without exiting vim? What command do you use? Thanks.

I've started using Vim to develop Perl scripts and am starting to find it very powerful.   One thing I like is to be able to open multiple files at once with:  vi main.pl maintenance.pl   and then hop between them with:  :n :prev   and see which file are open with:  :args   And to add a file, I can say:   :n test.pl   which I expect would then be added to my list of files, but instead it wipes out my current file list and when I type :args I only have test.pl open.  So how can I add and remove files in my args list?


How to decide, based on data exploration and data visualisation, between a GAM and a GLM.  Linear Models (LM) assume that the relationship between the response and the predictor are linear. Generalized Linear Models (GLM) assume linearity on the link scale, which means we can work with non-linear relationship between the response and the predictor, but this relationship still needs to be monotonic (i.e. either going upwards on downwards). Generalized Additive Models (GAM) do not assume any particular relationship, which means this relationship can go up and down (i.e. it is curved or wiggly). I hope I correctly summarized it up to here.  The issue of difference between GLM and GAM, or when to use GAMs as opposed to GLMs has been covered elsewhere (e.g. ) - this is not what my question is about.  My primary question is what kind of data exploration or data visualisation tools would you typically use in order to determine if GAMs are an appropriate tool as opposed to GLM. What would be a good guidelines to follow for a typical practice on deciding that.  Sub-questions:  1) If the response is continuous, I suppose you could just do a scatterplot for the response and each of the predictors, which should likely give you a hint. Correct?  2a) But if the response is presence/absence (1/0), you would need a binomial model, whether GLM or GAM. How would you decide (based on data exploration and visualisation) on which one to use?   2b) If data are presence/absence, would it make sense to run simple GAMs for the response and each of the potential predictors in turn, plot them to see the relationships, and then either use GAMs if the relationships are curvy, or a GLM if they are not? Would this be considered a good practice to guide your analytical decisions?

I realize this may be a potentially broad question, but I was wondering whether there are assumptions that indicate the use of a GAM (Generalized additive model) over a GLM (Generalized linear model)? Someone recently told me that GAMs should only be used when I assume the data structure to be "additive", i.e. I expect additions of x to predict y. Another person pointed out that a GAM does a different type of regression analysis than a GLM, and that a GLM is preferred when linearity can be assumed. In the past I have been using a GAM for ecological data, e.g.:  continuous time-series when the data did not have a linear shape I had multiple x to predict my y that I thought to have some nonlinear interaction that I could visualize using "surface plots" together with a statistical test  I obviously don't have a great understanding of what a GAM does different than a GLM. I believe it's a valid statistical test, (and I see an increase in the use GAMs, at least in ecological journals), but I need to know better when its use is indicated over other regression analyses.