$$\cos \frac{2π}{2013} +\cos \frac{4π}{2013} +\cdots+\cos \frac{2010π}{2013} + \cos \frac{2012π}{2013}$$  How to sum it up? *Calculator is not allowed.
Possible Duplicate:          Prove $$\cos(\alpha) + \cos(\alpha + \beta) + \cos(\alpha + 2\beta) + \dots + \cos[\alpha + (n-1)\beta] = \frac{\cos(\alpha + \frac{n-1}{2}\beta) \cdot \sin\frac{n\beta}{2}}{\sin\frac{\beta}{2}} $$
XeLaTeX font rendering tend to be slightly bolder compared to PDFlatex Where can I find delay/cancelation statistics for a given airline route? My flight got canceled yesterday and I am currently waiting for the delayed next flight.   Is there any website that keeps records of airlines being delayed/canceled? I would like to know my chances. I did find some sites through google (flightaware, flightstats), but they focus on us flights only and I am currently in the azores. Everything that I have read says that iWorks/ iMovie etc should be free for Mac users after 1 September 2013.   I already bought Pages but want Numbers and iMovie. My MacBook Pro with retina is early 2015 and I am being charged.    Why is this please? Data inconsistency prohibition if a table refers to another via two many-to-many relationships I have following database design (by =&gt; foreign key constraints are depicted):   Company[id] CompanyRealm[id, company_id=>Company.id]many2many  Project[id, company_id=>Company.id] ProjectRealm[id, project_id=>Project.id, company_realm_id=>CompanyRealm.id]many2many   Problem is that provided database design allows inconsistent data. For example:   Company1(id=1) Company2(id=2) CompanyRealm(id=11, company_id=1) Project(id=33, company_id=2) ProjectRealm(id=44, project_id=33, company_realm_id=11)   (Company can have many Realms, Project belong to Company and  may concern any number of company's Realms)  ProjectRealm refers to two different companies:   Company1 (via CompanyRealm); and Company2 (via Project).    Is something wrong with my DB design? If yes - which prescriptions are violated? If no - how to prevent incorrect data insertion (via constraint? trigger with exception?) Can we decrypt in this order when the message is encrypted twice? How do I run a batch file from my Java Application? In my Java application, I want to run a batch file that calls "scons -Q implicit-deps-changed build\file_load_type export\file_load_type"  It seems that I can't even get my batch file to execute. I'm out of ideas.   This is what I have in Java:  Runtime.    getRuntime().    exec("build.bat", null, new File("."));   Previously, I had a Python Sconscript file that I wanted to run but since that didn't work I decided I would call the script via a batch file but that method has not been successful as of yet. My objective here is really simple -- I'm trying to set an NSString to some test data, then return the class, which should be NSString. Here's my code:  NSString* stringer = [NSString stringWithFormat: @"Test"]; NSLog(@"%@", [stringer class]);   The log says that the class is NSCFString, not NSString. What's going on here? What is the best way to copy text to the clipboard (multi-browser)? I have tried: function copyToClipboard(text) {     if (window.clipboardData) { // Internet Explorer         window.clipboardData.setData(&quot;Text&quot;, text);     } else {         unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege(&quot;UniversalXPConnect&quot;);         const clipboardHelper = Components.classes[&quot;@mozilla.org/widget/clipboardhelper;1&quot;].getService(Components.interfaces.nsIClipboardHelper);         clipboardHelper.copyString(text);     } }  But in Internet Explorer it gives a syntax error. In Firefox, it says unsafeWindow is not defined. A nice trick without using : give a variable to an operator For a workflow tool I made a panel in which it displays each separate library that is linked in my file. For each library I want to add some buttons that does stuff to the library in question.  So in this example I have my panel which shows for example 2 libraries and for each one it creates a "reload" button.  Now my question is.. How do I make it so the reload button only reloads the library I want to reload? I would probably have to give the button an id or something so it knows for which library it was created...  my code so far:  import bpy  libs = bpy.data.libraries  class Reloadlib(bpy.types.Operator):     """Reloads the current Library"""     bl_idname = "my.reload_lib"     bl_label = "Reload"      def execute(self, context):         libs[?????].reload()         self.report({'INFO'}, 'Reloading ' + libs[?????].name)         return {'FINISHED'}  class LibPanel(bpy.types.Panel):     """Creates a Panel in the scene context of the properties editor"""     bl_label = "Scene Libraries"     bl_idname = "SCENE_PT_layout"     bl_space_type = 'PROPERTIES'     bl_region_type = 'WINDOW'     bl_context = "scene"      def draw(self, context):         layout = self.layout         scene = context.scene         layout.label(text="Libraries:")          for i in libs:             layout.label(text= i.name.replace(".blend",""))             row = layout.row()             sub = row.row()             sub.operator("my.reload_xref", icon = "FILE_REFRESH")  def register():     bpy.utils.register_class(Reloadlib)     bpy.utils.register_class(LibPanel)  def unregister():     bpy.utils.unregister_class(Reloadlib)     bpy.utils.unregister_class(LibPanel)  if __name__ == "__main__":     register()   Where the question marks are is where I should be able to make the difference between the first [0] or second [1] library in the libs[] array.  In future I would also like to ad an 'open' and an 'unlink' button for each library so I can make changes to the other file. But this works by the same principle as the reload button. Remember last selected items per page in global search I have strange problem. My Wallch icon is huge. See the screenshot:    I removed XFCE settings and reordered items a little. How can I restore normal Wallch icon size?  Update:  My /usr/share/applications/wallch-nautilus.desktop file:  [Desktop Entry] Version=4 Name=Wallch Comment=Change desktop wallpapers automatically Exec=/usr/bin/wallch %U Icon=wallch Terminal=false Type=Application Categories=Utility;Application; MimeType=inode/directory;  Actions=Change_Wallpaper;Start;  [Desktop Action Change_Wallpaper] Name=Change Wallpaper Once Exec=/usr/bin/wallch --change TargetEnvironmet=Unity  [Desktop Action Start] Name=Start/Stop Wallpapers Exec=/usr/bin/wallch --start TargetEnvironment=Unity   And the /usr/share/pixmaps/wallch.png: I want to know if there is a way to switch to console mode from the boot menu.  I have an NVIDIA 1070 and every time there is an update, the GUI stops working. All I need to do is re-install the drivers; however, to do that I need to be in console mode. EDIT: I should have added more information to this question but I'll comment on all answers. In short: I've tried text instead of quiet splash I do see booting activity in text mode; however, I don't get a login screen and ctrl + Alt + F1 doesn't help because GDM keeps trying to restart. Previously I managed to kill GDM through multiple tries but is not working since the latest update. EDIT: After searching for runlevel, I've found  but I think it required me to have a running system to make changes -- please correct me if I'm wrong. Maximal inequality for a sequence of partial sums of independent random variables Let $X_n$, $n=1,2,3,...$ be a sequence of independent (not necessarily identically distributed) random variables, let $S_n=\sum_{i=1}^nX_i$. Prove the following maximal inequality: For all $t&gt;0$,$$\mathbb{P}\left(\max_{1\leq i\leq n}|S_i|\geq t \right)\leq 3\max_{1\leq i\leq n}\mathbb{P}\left(|S_i|\geq\frac{t}{3} \right)$$ Suppose we rotate the graph of $y = f(x)$ about the $x$-axis from $a$ to $b$.  Then (using the disk method) the volume is $$\int_a^b \pi f(x)^2 dx$$ since we approximate a little piece as a cylinder.  However, if we want to find the surface area, then we approximate it as part of a cone and the formula is $$\int_a^b 2\pi f(x)\sqrt{1+f'(x)^2} dx.$$  But if approximated it by a circle with thickness $dx$ we would get $$\int_a^b 2\pi f(x) dx.$$  So my question is how come for volume we can make the cruder approximation of a disk but for surface area we can't. How to save animation as a video format I am basically trying to make an intro for my youtube channel. I am sort of familiar with the program because I was playing around with it for a long time, getting the basics of it. With the help of youtube videos I am basically done with my project. I put my name in it and everything. I just need to know how to save the animation onto my desktop as a file that I could open and would be in a video format. I have bumped into an issue that doesn't allow me to do anything related to apt-get: install, remove, etc. Whenever I try to do something (e.g. sudo apt-get install firefox -f) it gives me the same error message:  Reading database ... dpkg: unrecoverable fatal error, aborting:  unable to open files list file for package `fontconfig-config': Input/output error E: Sub-process /usr/bin/dpkg returned an error code (2)   I have tried to deal with the package fontconfig-config without success.  I have found that the "Input/output error" is usually linked with physical problems of the hard drive, but I do not think that's the case I am using that hd without any other problem.  I have tried removing the mention to the package in /var/lib/dpkg/status as mentioned .  I have tried deleting all files related to the package in /var/lib/dpkg/info as I found somewhere.  But I still cannot do anything. The funny bit comes when I look for the file that is giving me troubles:   mecho@Ansible-MS-7680:/var/lib/dpkg/info$ ls fontconfig* ls: cannot access fontconfig-config.list: Input/output error fontconfig.list     fontconfig.postinst  fontconfig.preinst  fontconfig.triggers fontconfig.md5sums  fontconfig.postrm    fontconfig.prerm   This is done after I deleted all files ... it looks like fontconfig-config.list still exists but it doesn't show up!  Any idea about how to solve the problem?  I am on kubuntu precise, fontconfig-config_2.8.0-3ubuntu9.1    I do not have smartmontools installed nor any other programme I could use to check the hard disk. The most similar think I seem to have is KDE Partition Manager but it doesn't allow me to check anything (the option appears unavailable). However, I think the problem is not the hd.  How do you suggests me to do the fs check? fcheck is not installed and I cannot think of any other command in bash (as I do not think I have anything else installed that could perform a check).  Thank you.  Edit: I have found the command (silly me), fsck. This is what I got:  /dev/sda1: recovering journal Clearing orphaned inode 4456702 (uid=1000, gid=1000, mode=0140775, size=0) Clearing orphaned inode 4456700 (uid=1000, gid=1000, mode=0140775, size=0) Clearing orphaned inode 4456699 (uid=1000, gid=1000, mode=0140775, size=0) Clearing orphaned inode 4456697 (uid=1000, gid=1000, mode=0140775, size=0) Clearing orphaned inode 4456694 (uid=1000, gid=1000, mode=0140775, size=0) Clearing orphaned inode 4456693 (uid=1000, gid=1000, mode=0140775, size=0) Clearing orphaned inode 4456688 (uid=1000, gid=1000, mode=0140775, size=0) Clearing orphaned inode 4456481 (uid=1000, gid=1000, mode=0140775, size=0) Clearing orphaned inode 4456692 (uid=0, gid=0, mode=0100600, size=65536) Clearing orphaned inode 4456689 (uid=1000, gid=1000, mode=0140775, size=0) Clearing orphaned inode 4456709 (uid=1000, gid=1000, mode=0100600, size=714046) Clearing orphaned inode 4456469 (uid=1000, gid=1000, mode=0140775, size=0) Clearing orphaned inode 3672644 (uid=0, gid=0, mode=0100644, size=1595) Clearing orphaned inode 1324021 (uid=0, gid=0, mode=0100640, size=1980) Clearing orphaned inode 1324014 (uid=0, gid=0, mode=0100640, size=126) Clearing orphaned inode 4456499 (uid=1000, gid=1000, mode=0100600, size=0) Clearing orphaned inode 4456483 (uid=1000, gid=1000, mode=0100600, size=65536) Setting free inodes count to 7147142 (was 7147702) Setting free blocks count to 23891195 (was 23781617) /dev/sda1: clean, 151930/7299072 files, 5292549/29183744 blocks Mark a comment as the answer to a question I have a question and have seen others to which the best and most relevant answer (at least the one that solved my particular problem) is placed in the comments to the question as opposed to the answers:   I would like to recognize the commenter as the person who correctly answered the question, but there doesn't seem to be any way to do that. The only thing I could think of was to ask the commenter to repost his comment as an answer, but I cannot figure out a way to contact him. In the meantime the question is sitting unanswered and I am getting other "answers" (leading me to believe that people are not reading the comments and answers already posted before trying to answer it themselves).  How are we supposed to do this?  Note: I don't want to accept the comment as an answer (I agree completely with the answers to this question that comments are comments and answers are answers and they should stay that way). I do wonder if there should be some way to contact people in a reasonable manner (comments on their profile that they must opt in to receiving in email?). If $f:\mathbb{R}\to\mathbb{R}$ is continuous and $$\lim_{x\to\infty}f(x)=\lim_{x\to-\infty}f(x)=\infty$$  Prove that $f$ has a minimum on $\mathbb{R}$; that is, there is an $x_m\in\mathbb{R}$ such that $$f(x_m)=\inf_{x\in\mathbb{R}}f(x)&lt;\infty$$  I think the best approach would be to prove the existence of a lower bound, that is $\exists M\in\mathbb{R}:M&lt;f(x),\forall x\in\mathbb{R}$, but I don't know how to do this. I am probably supposed to use the extreme value theorem or the intermediate value theorem, but I don't know how to do that. MacBook Pro stuck in gray screen when booting I've got a Late-2011 15" MacBook Pro stuck in the gray screen when booting AFTER login. I've tried removing the drive (it's non-retina) and booting from a working bootable Yosemite installer, no luck. (it sees the startup USB drive, the progress bar progresses, but stuck at the gray screen again even without a drive.  Tried NVRAM reset (cmd option P R), it has reset (the login sound's volume changed) but nothing changed.  Tried holding D on startup, AHT doesn't start, instead, it tries to boot into the OS.  Tried Cmd V, it sometimes works and displays the verbose output, sometimes, it acts like I haven't even pressed. Again, stuck after login.  Tried booting again from USB, I select USB (after seeing both drives correctly), but no luck, it's also stuck.  I've stumbled upon this:    I've tried booting into single user mode with Cmd S, it worked ONCE, I've disabled the graphics extensions just as shown at that post, restarted, but again, nothing changed.  More weirdly, now the Cmd S doesn't work either. It just takes me to login screen without showing the terminal, just as I haven't pressed anything.  Why would this happen? Why would a Mac refuse to enter hardware test mode, single user mode, or refuse to boot from a working bootable Yosemite drive both with or without the main drive installed?  UPDATE: I've run the AHT and got an error:  4MEM/66/40000000: 0x84e0ec98  It looks like a memory issue, but I'm not sure.   UPDATE 2: I've tried reinserting the RAMs and the the problem is not reported anymore. However, the Mac still won't boot. fontawesome and pdflatex When using pdflatex and the fontawesome package the below error shows up.   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Fatal fontspec error: "cannot-use-pdftex" !  ! The fontspec package requires either XeTeX or LuaTeX to function. !  ! You must change your typesetting engine to, e.g., "xelatex" or "lualatex" ! instead of plain "latex" or "pdflatex". !  ! See the fontspec documentation for further information. !  ! For immediate help type H &lt;return&gt;. !...............................................     Wish to keep on using "pdflatex" instead of "xelatex" or "lualatex".   In fontawesome Version 4.4.0 manual it says "When using the (pdf)(LA)TEX engine, the fontawesome package doesn’t require any external package".  Tried solutions proposed for this question () without success.   MWE:  \documentclass{article} \usepackage{fontawesome} \begin{document} {\faAdjust} \end{document}