I just finished a website that I designed and submitted it to  for performance reviews, and this is the results I got:    It says I need to set expiry date or a maximum age in the the HTTP headers, but I don't know how it is possible to set the expiry date for anything other than cookies/sessions, so I have no clue what this means or how to do it.
I have recently analysed my website with pagespeed addon on firebug. It suggested me to set expiration on CSS, JS and image files.  I am wondering how do i do this?
How do you assert that a certain exception is thrown in JUnit 4 tests? How can I use JUnit4 idiomatically to test that some code throws an exception?  While I can certainly do something like this:  @Test public void testFooThrowsIndexOutOfBoundsException() {   boolean thrown = false;    try {     foo.doStuff();   } catch (IndexOutOfBoundsException e) {     thrown = true;   }    assertTrue(thrown); }   I recall that there is an annotation or an Assert.xyz or something that is far less kludgy and far more in-the-spirit of JUnit for these sorts of situations. No \xrightrightarrow[a]{b}? Why does a $1/2$ appear in this simple capacitor equation? The maximum energy stored by a capacitor is when it’s (theoretically) fully charged, or just before it reaches dielectric breakdown, if you will. It seems, then, that the maximum energy ($E$) $=QV$, where $Q$ is the maximum charge attained and $V$ is the maximum ‘voltage’. However, the correct equation for the maximum energy is $E=\frac{1}{2}QV$. Why? I’m looking for a simple, intuitive explanation because my reasoning that $E=QV$ seems sound to me. I know about , but I’m looking for a reason to disprove my specific argument that $E=QV$ and not the “Oh, it comes from integration.” response. In the top left corner of the post-race menu, there is a prompt to press + to add (or remove) one star out of six. What do these stars do? How to fix broken taskbar icons in Windows 7 Backslash escaping in code regions in comments I've noticed that in comments, when you create `code region` with backticks, the backslash will still work as an escape character within that region (but it should not, IMHO).  To clarify:   In comments, `\\` will be rendered as \, but it should be rendered as \\ In the post body itself, `\\` will be rendered as \\ (i.e., correctly)   This is especially confusing when you enter regular expressions into a comment, since backslash-escaping is very common there, and confusion increases if you are dealing with a regex that is double-escaped for representation in a string.   At some point you lose track how many backslashes you must make so the comment renders correctly, or you don't notice fast enough (or at all) and the comment contains wrong code where the same markup in a question or answer would come out as perfectly correct.   It's just that comments can't be corrected anymore after the grace period, leaving you with the choice of either deleting the comment, thus crippling the conversation, or engaging in a trial-and-error game of writing another comment with even more backslashes to explain the issue.  My question is two-fold:   Will this error be corrected? If yes, existing comments should probably be searched and "fixed" by a routine that tries to do the right thing (this is probably somewhere between hard and impossible) Or, can I rest assured that never ever the behavior of the backslash in comments is going to be changed, so I can start working around this issue by hand, knowing that they won't start displaying incorrectly at some point in the future? I have unistalled and reinstalled the Ubuntu Software Center as per info I found in a similar thread and I got the same response about line 91 or something like that.  I just tried to upload a screen shot but since I'm new it won't allow me to.  I also can not figure out how to cut and paste anything so I have to hand type what the error screen says, both when I attempt to open the software center and nothing happens, when I try to enter commands into the terminal to uninstall, reinstall, whatever I get the same following:  COULD NOT INTITIALIZE THE PACKAGE INFORMATION An unresolvable problem occured while initializing the package information Please report t:his bug against the 'update-manager' package and include the following error message: 'E: Malformed line 91 in source list/etc/apt/sources.list (dist parse)  E: The list of sources could not be read.,  E: The package list of status file could not be parsed or opened.   How do I report bugs?  What can be done about this.  I have searched and everything everyone says to do leads me back to the same line error message.  So, I don't know how to get to line 91 in the source list; to tell you what it says. Sorry, I'm really new to this. That is what I need is to find out how to get there and fix what it says. I would really like to NOT have to re partition my hard drive and start from scratch, so I'm really looking forward to getting this problem solved. I need to be able to install new software. If you have such a good way to do formatting in questions/answers why isn't it used for the "about me" section on the profile page?  It looks easy to make and adds just a little bit more consistency. "He didn't know where New Jersey was" Making the bibliography appear in the table of contents Does name of sitemap file that Wordpress generates matter? Is it possible record videos of my screen? Suppose that I would like to record some video sessions of Angry Birds on my phone.   Are there any apps that I can use? I have root permissions. Both are in the present perfect, but one uses the verb 'to go' and the other 'to be'. Is there a rule for this?  Is there any chance that the differences between "I have been" vs. "I have gone", are differences in English dialect (I don't know if this is the right word).  Edit Could I say that North American English speakers use "I have gone", and maybe U.K speakers say "I've been"? Or vice versa. I have a dedicated server with 2 TB storage.   My problem is that the whole storage is allotted to the root partition.   Whenever I try to resize it using lvresize, the root partition gets corrupted and then I have to reprovision the server.   Is there any option to resize the root partition without unmounting in lvm?  I am trying to reduce the root partition to 100GB.  Vgs  root@s93079:/home/customer# vgs   VG        #PV #LV #SN Attr   VSize VFree   s93079-vg   1   2   0 wz--n- 1.82t    0   Lvs  LV     VG        Attr       LSize  Pool Origin Data%  Meta %  Move Log Cpy%Sync Convert   root   s93079-vg -wi-ao----  1.79t    swap_1 s93079-vg -wi-ao---- 32.00g   Fdisk - l  Device     Boot  Start        End    Sectors  Size Id Type /dev/sda1  *      2048     499711     497664  243M 83 Linux /dev/sda2       501758 3907028991 3906527234  1.8T  5 Extend /dev/sda5       501760 3907028991 3906527232  1.8T 8e Linux  Disk /dev/mapper/s93079--vg-root: 1.8 TiB, 1965782204416 byt es, 3839418368 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/s93079--vg-swap_1: 32 GiB, 34355544064 byte s, 67100672 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes   Vgdisplay   --- Volume group ---   VG Name               s93079-vg   System ID   Format                lvm2   Metadata Areas        1   Metadata Sequence No  3   VG Access             read/write   VG Status             resizable   MAX LV                0   Cur LV                2   Open LV               2   Max PV                0   Cur PV                1   Act PV                1   VG Size               1.82 TiB   PE Size               4.00 MiB   Total PE              476870   Alloc PE / Size       476870 / 1.82 TiB   Free  PE / Size       0 / 0   VG UUID               dPrEwA-77pM-pGai-9jZB-ldMZ-iL20-HAe9 Dj   lvdisplay /dev/s93079-vg/root   --- Logical volume ---   LV Path                /dev/s93079-vg/root   LV Name                root   VG Name                s93079-vg   LV UUID                bpGNau-XirV-P7PA-8d6k-OCOy-TAwN-HXl FVI   LV Write Access        read/write   LV Creation host, time s93079, 2016-08-27 09:22:05 -0500   LV Status              available   # open                 1   LV Size                1.79 TiB   Current LE             468679   Segments               1   Allocation             inherit   Read ahead sectors     auto   - currently set to     256   Block device           254:0   Lvdisplay /dev/s93079-vg/swap_1  --- Logical volume ---  LV Path                /dev/s93079-vg/swap_1  LV Name                swap_1  VG Name                s93079-vg  LV UUID                j74PLZ-E9gK-9Bbb-EkKq-xRJv-TuU4-FgH gm  LV Write Access        read/write  LV Creation host, time s93079, 2016-08-27 09:22:05 -0500  LV Status              available  # open                 2  LV Size                32.00 GiB  Current LE             8191  Segments               1  Allocation             inherit  Read ahead sectors     auto  - currently set to     256  Block device           254:1   Df - h  /dev/dm-0       1.8T  923M  1.7T   1% / udev             10M     0   10M   0% /dev tmpfs           3.2G  8.5M  3.2G   1% /run tmpfs           7.9G     0  7.9G   0% /dev/shm tmpfs           5.0M     0  5.0M   0% /run/lock tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup /dev/sda1       236M   33M  191M  15% /boot Help, Creating a test class for an invocable method (code coverage @ 0%) How to find and compare flights carried out by a specific type of plane? How to derive variance-covariance matrix of coefficients in linear regression Execute PowerShell Script from C# with Commandline Arguments I need to execute a PowerShell script from within C#. The script needs commandline arguments.  This is what I have done so far:  RunspaceConfiguration runspaceConfiguration = RunspaceConfiguration.Create();  Runspace runspace = RunspaceFactory.CreateRunspace(runspaceConfiguration); runspace.Open();  RunspaceInvoke scriptInvoker = new RunspaceInvoke(runspace);  Pipeline pipeline = runspace.CreatePipeline(); pipeline.Commands.Add(scriptFile);  // Execute PowerShell script results = pipeline.Invoke();   scriptFile contains something like "C:\Program Files\MyProgram\Whatever.ps1".   The script uses a commandline argument such as "-key Value" whereas Value can be something like a path that also might contain spaces.  I don't get this to work. Does anyone know how to pass commandline arguments to a PowerShell script from within C# and make sure that spaces are no problem? I am currently using 19.04 and I got "No new release found for 19.10" Based on the question , I got curious. Is there a guide or resource that describes how the price of a ticket is determined?  When you search you often see curious effects like cheaper tickets for a flight from A to B with a layover compared to a direct flight. This seems counter-intuitive from an outsider's perspective since you fly twice. Also one way tickets more expensive than 2 ways.  It can be a short set of rules. Something that helps someone to get started with finding good prices. I know these can be very complex and they probably change over time and over airline interests but there is probably a simplified set of rules that can be enunciated.