Under the folder /var/log/roler_t, we have the following files:  -rw-r--r-- 1 roler smike    37652 Jun 25 01:44 2018-06-23T02:KJU:00 -rw-r--r-- 1 roler smike    41742 Jun 25 01:45 2018-06-21T20:KJU:00 -rw-r--r-- 1 roler smike    36762 Jun 25 01:46 2018-06-22T08:KJU:00 -rw-r--r-- 1 roler smike    51764 Jun 25 01:47 PL-06-23T12:KJU:00 -rw-r--r-- 1 roler smike    42751 Jun 25 01:48 2018-06-21T16:KJU:00 -rw-r--r-- 1 roler smike    34627 Jun 25 01:49 2018-06-22T23:KJU:00 -rw-r--r-- 1 roler smike    59828 Jun 25 01:51 2018-06-23T05:KJU:00 -rw-r--r-- 1 roler smike    33561 Jun 25 01:52 2018-06-22T20:KJU:00 -rw-r--r-- 1 roler smike    59828 Jun 25 01:51 JFG:KJU:00 -rw-r--r-- 1 roler smike    33561 Jun 25 01:52 PL-22T20:KJU:00 -rw-r--r-- 1 roler smike    36643 Jun 25 01:53 2018-06-22T01:KJU:00   How can we remove only the files that are older than ten days and have a specific date pattern, for example 2018-06-23.  Expected results are as follows:  the following files will stay under /var/log/roler_t   -rw-r--r-- 1 roler smike    51764 Jun 25 01:47 PL-06-23T12:KJU:00 -rw-r--r-- 1 roler smike    59828 Jun 25 01:51 JFG:KJU:00 -rw-r--r-- 1 roler smike    33561 Jun 25 01:52 PL-22T20:KJU:00

I have a daily backups named like this:  yyyymmddhhmm.zip // pattern 201503200100.zip // backup from 20. 3. 2015 1:00   I'm trying to create a script that deletes all backups older than 3 days. The script should be also able to delete all other files in the folder not matching the pattern (but there would be a switch for that in the script to disable this).  To determine the file age I don't want to use backups timestamps as other programs also manipulate with the files and it can be tampered.  With the help of:  I got:  #!/bin/bash  DELETE_OTHERS=yes BACKUPS_PATH=/mnt/\!ARCHIVE/\!backups/ THRESHOLD=$(date -d "3 days ago" +%Y%m%d%H%M)  ls -1 ${BACKUPS_PATH}????????????.zip |   while read A DATE B FILE   do      [[ $DATE -le $THRESHOLD ]] && rm -v $BACKUPS_PATH$FILE   done  if [ $DELETE_OTHERS == "yes" ]; then     rm ${BACKUPS_PATH}*.* // but I don't know how to not-delete the files matching pattern fi   But it keeps saying:   rm: missing operand   Where is the problem and how to complete the script?


I try to compare two strings in Java as the following:          String a="String 1";         String b = "String 1";         if(a==b)         {             System.out.println("Equal");         }         else             System.out.println("Not Equal");         System.out.println("----------------");         if(a.equals(b))             System.out.println("Equal");         else             System.out.println("Not Equal");   I got warning message in NetBeans when I use a==b. Why it like this? But, when I use equals, it has no problem.

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I have a string like below and I want to split it and get the value before pipe (|).  var str = "110|paris";   I just want to store like below,after split  var value = 100;

I have this string  'john smith~123 Street~Apt 4~New York~NY~12345'   Using JavaScript, what is the fastest way to parse this into  var name = "john smith"; var street= "123 Street"; //etc...


I am currently implementing a simple database schema (in PostgreSQL 11.1 (Debian)), with two int columns (say col1, col2).  My goal is to prevent duplicates appearing in any of the two columns.  If (1,2) already existed, then (1,2) or (2,1) would cause a "duplicate key value violates unique constraint" error.  For a practical example.  I have created a table someTable, with col1, col2, with a unique constraint (col1, col2).  Everything is fine when I insert (1,2) a second time:  CREATE TABLE someTable (  col1 int NOT NULL,  col2 int NOT NULL,  unique (col1, col2));  - CREATE TABLE  INSERT INTO someTable (col1, col2) VALUES (1,2); - INSERT 0 1  INSERT INTO someTable (col1, col2) VALUES (1,2); - ERROR:  duplicate key value violates unique constraint "sometable_col1_col2_key" DETAIL:  Key (col1, col2)=(1, 2) already exists.  INSERT INTO someTable (col1, col2) VALUES (2,1); - INSERT 0 1   I would like the (col1, col2) unique constraint to work for swapped values (for example 2,1 is treated the same as 1,2).

I have a table in a Postgres DB where col1 and col2 are foreign keys referring to the same column. I want only unique combinations of (col1, col2), i.e. if (1,2) is entered then (2,1) should be rejected. How can I achieve that?   My table definition:  CREATE TABLE mytable (     id serial primary key,     col1 int NOT NULL,     col2 int NOT NULL,     unique (col1, col2) )


Simple problem PITA to fix.  I created a module with a custom entity and some other stuff. But there was an error during installation and the DB table did not get created.  Attempting to uninstall gives an error because it can't find the table to delete it.   [ERROR] SQLSTATE[42S02]: Base table or view not found: 1146   Table 'xxxxx.zzzzz' doesn't exist:  SELECT base_table.id AS id, base_table.id AS base_table_id                          FROM {zzzzz} base_table LIMIT 1 OFFSET 0; Array()   So I'm stuck - I've fixed the problem but can't uninstall the module to reinstall it.  How can I persuade the uninstall to work?  I have considered faking the table it's asking for, but is it going to expect the field tables to be there as well?  What I really need is for it to be less picky about the tables being missing.

In Drupal 7, I could manually edit the {system} table in the database to disable a stubbon module.  In my Drupal 8 site, this table is gone.  How can I manually disable a module in Drupal 8?


I saw this thread  and I know mine could sound a duplicate, but it is slight differen.  My example is:  List<Map<String, String>> myList = new ArrayList<Map<String, String>>();  ... for(MyClass1 c1 : c1) {   ...   for(MyClass2 c2 : c12)   {     SimpleBindings myBindindings= new SimpleBindings();     myBindindings.put(c1.getName(), c2.getName());      myList.add(myBindindings);   } } ...   Concretely I can have  {  (John, Mike)  (John, Jack)  (Sam, Jack)  (Gloria, Anna)  (Jane, Carla)  ... }   and would like that my list is sorted by the maps key:  {   (Gloria, Anna)   (Jane, Carla)   (John, Mike)   (John, Jack)   (Sam, Jack)   ... }

I am relatively new to Java, and often find that I need to sort a Map<Key, Value> on the values.  Since the values are not unique, I find myself converting the keySet into an array, and sorting that array through array sort with a custom comparator that sorts on the value associated with the key.  Is there an easier way?


$$\lim_{n\to \infty} {1\over n}\sqrt[n]{(n+1)(n+2)\cdots(2n)}$$  My attempt:  \begin{align} \lim_{n\to \infty} {1/ n}\sqrt[n]{(n+1)(n+2)\cdots(2n)} &= \lim_{n\to \infty} \sqrt[n]{(1+{1/ n})(1+{2/ n})\cdots(1+{n/ n})}\\  &= \lim_{n\to \infty}(1+{1/ n})^{n*{1/ n^2}}(1+{2/ n})^{n*{1/ n^2}}\cdots(1+{n/ n})^{n*{1/ n^2}}\\  &=\lim_{n\to \infty}e^{{1/ n^2}}e^{{2/ n^2}}\cdots e^{{n/ n^2}}\\   &= \sqrt{e} \end{align}  I know that this is wrong answer. Could you please show me where my mistake is?  EDIT  I know the right solution, I just wanted to see where my mistake is. Thanks for your answers anyway!   EDIT 2 5 beautiful answers received already, but I dont think I can accept any of them, because my question was to show mistake in my own derivations. Anyway I learnt a lot especially that $\lim_{n\to \infty} \frac{b_{n+1}}{b_n}=\lim_{n\to \infty} \sqrt[n]b_n$. Thanks for everyone!

I'd like a hint to show that:  $$\lim \frac{1}{n} \sqrt[n]{(n+1)(n+2) \cdots 2n} = \frac{4}{e} .$$  Thanks.


I have two servers  Server1 -> Static IP1  Server2 -> Static IP2   Server2's firewall allows access only from Static IP1  I can connect to Server1 via ssh from anywhere.   How can I connect to Server2 from my PC which is behind a dynamic IP via ssh in one step instead of connecting via ssh to Server1 and then doing another ssh to Server2 from within Server1s shell.

To get to my machine in my office, at the moment I am doing this:  me@home:~$ ssh unix.university.com me@unix:~$ ssh unix.department.univeristy.com me@unix.department:~$ ssh office-machine.department.university.com me@office-machine:~$ echo "This is very annoying"   Is there an easy way of automating this process, perhaps a single command that I can use at my end?


I have windows 10 (updated from windows 8.1). Yesterday I found out that there is no enough space on system disk. I deleted all restore points and unused files using windows utils. It didn't help. Then I turned on setting to show all hidden files and folders to check entire size of all folders on disk C.  It looks fine but it's not:  Could anyone give me advise how to fix it?   UPDATE: Using  tool I found out that there is a folder C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Redis with size 112Gb! As quick fix I just deleted it using command line. Thanks guys from . I wrote my question there when this post was closed.

I have a Win7 laptop with a 750Gig C: drive.  It came partitioned with 714Gig usable from manufacturer.  I installed programs, music files, etc up to 285 gigs.  As of a few weeks ago it showed 285 Gigs.  Two weeks of house guests later and it shows HD is full.  I deleted some files but it still shows 652 Gigs on this drive while there are only 285 Gigs on drive.  Relevant details:   I am Administrator on laptop and have fair knowledge of what I am doing. I did not restore from backup, restore from mirror, upgrade HD's or anything else that would have touched the partition structure.  Just daily use as imaging machine and web. I have checked partitions under disk administrator - no change, still partitioned with 714Gigs usable. Have looked through computer C drive by hand showing Hidden files and folders - no change. I have used JDisk Report to double check - it shows I have only 285 Gigs on C drive. I triple checked with TreeSize run as Administrator and it also shows 285 Gigs on C drive - yet Windows 7 still shows almost full. I used Windows 7 Utilities to Check for Disk Errors, and Defragged the drive.  No errors shown and no change after Defrag.


Why is the combination of two light waves (red, yellow) percieved as the same color as the arithmetic mean of their frequencies (orange) while we percieve two musical notes at the same time as just those two waves stacked on top, and not the mean of those frequencies?

In music, when two or more pitches are played together at the same time, they form a chord. If each pitch has a corresponding wave frequency (a pure, or fundamental, tone), the pitches played together make a , which is obtained by simple addition. This wave is no longer a pure sinusoidal wave.  For example, when you play a low note and a high note on a piano, the resulting sound has a wave that is the mathematical sum of the waves of each note. The same is true for light: when you shine a 500nm wavelength (green light) and a 700nm wavelength (red light) at the same spot on a white surface, the reflection will be a superposition waveform that is the sum of green and red.  My question is about our perception of these combinations. When we hear a chord on a piano, we’re able to discern the pitches that comprise that chord. We’re able to “pick out” that there are two (or three, etc) notes in the chord, and some of us who are musically inclined are even able to sing back each note, and even name it. It could be said that we’re able to decompose a Fourier Series of sound.  But it seems we cannot do this with light. When you shine green and red light together, the reflection appears to be yellow, a “pure hue” of 600nm, rather than an overlay of red and green. We can’t “pick out” the individual colors that were combined. Why is this?  Why can’t we see two hues of light in the same way we’re able to hear two pitches of sound? Is this a characteristic of human psychology? Animal physiology? Or is this due to a fundamental characteristic of electromagnetism?


I am a student pursuing a Ph.D. I am just an average student who is hard-working enough to complete the assignments and tasks on time. I have been feeling incompetent for the last so many months. I am not even focusing on a particular work. There is n support from my supervisor and he is found out to be very much manipulative. The working environment is equally not supportive. I have been feeling stuck for more than a year now but can't leave the program. But, in the back of my mind, there is an urge to leave the program. I am worried about my future as I belong to the reputed institute. It is affecting my mental as well as physical health. Please help me out.

I am a third year (starting fourth year in the fall) PhD student in mathematics. I've passed all qualifying exams and am currently doing research. As far as I can tell, I am not doing poorly. I have the good fortune of having a great advisor, being in a very supportive department, and having friends and family who genuinely care about my success.   The fact is research is hard. It appears to consist primarily of staring at a problem for days and days and days without getting anywhere. Sometimes, rarely, I do figure something out and that feels wonderful, but the overwhelming majority of my time appears to be spent banging my head against a mostly figurative wall. I am not complaining about the material being hard, and I am not averse to putting in hard work, but I get frequently discouraged when I realize the vast volumes of mathematics that I yet know nothing about (and probably never will). It's very hard to quantify progress - in particular, there are too few tangible returns after too many hours worked. I find myself thinking along the lines of "Oh, if only someone actually smart were thinking about this problem they would have solved it in moments" and so on.   I've talked about this to some number of people; here is some advice I have received:   Take a day off. Putting in hours upon hours of trying things doesn't magically lead to a solution, particularly if the brain is tired and just wants to sleep. Have a hobby. Since math research doesn't exactly provide instant gratification, a hobby might provide some instead.  Talk to other graduate students. Realize that many graduate students go through this.   I'm interested to know how other folks have dealt with being discouraged as a graduate student. Does it get better with time and experience? Is this a sign that research is not for me and that I should seriously consider a life outside academia?


Here's what I got in my Hextech Crafting loot:     9 PROJECT Cores 2 Augment Cache shards PROJECT: Zed Skin shard (Unlockable with 11 Cores)     It seems like I cannot earn PROJECT crafting stuff anymore (the event is over ?). I only need 2 cores or/and one cache to unlock that skin previously mentioned.  I've heard that those pieces of stuff are going to disappear in November. Does anyone know something about that ? Is there any way to collect more PROJECT Hextech cratfing stuff ?

During a recent League of Legends event, players could collect Project Cores to use in the crafting area of the game. But, now that I have all of the icons (pretty sure the event is over as well) what can I use the remaining 8 Project Cores I have for?


I'm trying to recall a specific (and interesting) verb, which I'm 90% sure exists. The verb means, roughly, to make someone aware of something, to open their eyes. But it's used in a particular way: in the sense of relieving someone of their prior, mistaken views (perhaps by revealing some new evidence, or pointing out something they simply hadn't considered before). Examples:  "She _______ him of [some notion he held] by pointing out [something]."   "Seeing the reality of how they lived _________ me of any [conservative/socialist/whatever] leanings I might have held."

Suppose, I want to say that you need to bust the myth that girls are not good at sports  or any other stereotype for that matter.  What's the word to prove wrong an old, established stereotype?   Is it correct to say 'break the stereotype' or 'break the cliche'?


Can I change "which" to "that" as it is a Restrictive Clause?     Catholics were aligned with Southerners in the Democratic Party at midcentury, a coalition which was exceedingly unfavorable to Catholics on the issue of public aid.    EDIT I have read the question , but "a coalition" is a modifier or additional information of "Democratic Party" so I think it is better to use "that" instead of "which" to make the sentence restrictive clause. Can I use "that" instead of "which"?

What is the difference between the words which and that?  For example I have the following sentences:   “I have a car which is blue.” “I have a car that is blue.”   Are there any rules specifying usage of which and that?


I am getting confused in between these two cases: Case 1: When we solve pulley-block problems using work-energy theorem then the work done by tension force gets cancelled out because in one block tension and displacement is in same direction while the other end these two will be in opposite direction so work done by tension +TS and -TS gets cancelled out. Case 2: Concider 2 electrons in space. These two have a repulsive electrostatic force in between them and both have work done positive (qe) (S) where S is displacement. So in case 1 when we considered a system the internal forces turned out to be zero and when we considered case 2 when the internal forces didn't get cancelled out but got added up.. So isn't it wrong to say that work done by internal forces is always 0 if we concider a system.

My Mechanics textbook claims that the sum of the work by internal forces is not generally zero.  translated to English the paragraph reads:     Notice about the work by internal forces: the work by the internal forces is in general not equal to zero although the sum of the internal forces is always equal to zero. Since the work also depends on the relative displacement of the two pointmasses in the material system, the work provided by these 2 internal forces will generally not be equal to zero.   Other sources claim that the work done by internal forces is always zero.  (answer by Mark Eichenlaub)     Then I didn't do any work on the system at all since, by definition, only external forces can do work.        the net work done by internal forces is zero since they do not cause motion of the object.   To me it would seem that these sources contradict eachother. Do they? If so, which one is correct? If not, please explain why they don't contradict eachother.


I recently found out that the Fibonacci Sequence appears in the Pascal Triangle. If it is written like so:  1  1 1  1 2 1  1 3 3 1  1 4 6 4 1  etc.  If we sum the diagonals, we get:  $1 = 1 $ $1 = 1 $ $1+1 = 2 $ $1+2 = 3 $ $1+3+1 = 5 $ etc.  Which is the Fibonacci Sequence  I realized that since Pascal's triangle can be written using the choose operation, I could find $F_n$ as such:  $F_n= \sum_{i=0}^{n/2}{{n-i}\choose{i}}$  My question is, can we prove this using induction? I tried but got stuck, here is my attempt:  For the base, when n=0, $F_0= \sum_{i=0}^{0/2}{{0-i}\choose{i}}= {0\choose0}=1$  Now, if we assume that the equation is correct for $n=k$, we must prove that the equation is true for $n=k+1$. Since we know that $F_{n+1}=F_n+F_{n-1}= \sum_{i=0}^{n/2}{{n-i}\choose{i}}+\sum_{i=0}^{{n-1}/2}{{n-1-i}\choose{i}}$.  Where do I go from here?

EDIT: Really sorry to put you through the trouble. The expression I am looking for is actually the summation of these values. Not the product. My bad  I'm looking for a condensed form of $\sum_{i=0}^{N/2}{N-i\choose i}$.  E.g. for $n=6$, I want to reduce ${6\choose0}+{5\choose1}+{4\choose2}+{3\choose3}$ into a single NCR or something that can be computed easily. Is it possible?


as shown in the screenshot below, sins I installed some add-ons I opened blender and I found that the add-ons preferences won't show up, I tried to reset preferences to factory, and I  reboot my PC and I even reinstalled it and the issue remains unsolved. what can cause this problem? and what solutions you propose? thank you blender version 2.90.1

I tried uninstalling and loading factory settings. Whenever I open my Preferences -> Addons window, I get a blank screen. Help I cant use addons on this machine anymore. It happened after installing a supposedly 2.8 compatible addon.


Is there a way to reverse search for substrings in the history? I'm aware of ctrl+r, but I can't use substrings there (for example, searching like VSCode or Sublime Text) For example, if my history contains nano /some/really/long/path/file.txt I'd like to use nno file.txt to get that command. Is there a way to do this?

I am happy and really like the Ctrl-R backward search feature of the bash shell. Some of my colleagues don't like it, since it is sometimes confusing. I understand them. If you enter the wrong characters, the current position in the history is somewhere in the past, and you won't find the recent matches. Is there a more user friendly alternative for seaching backward in the shell history? I want to stick with bash. Suggesting an alternative shell is not an answer to this question. The issue with the "lost position" is explained here: . These solutions work. That's right. But the solution there are not easy and user friendly according to my point of view. These solutions are not simple and straight forward. These are solutions of the past. In the past the human needed to learn the way the computer wanted the input. But today the tools should accept the input in a way which is easy for the user. Maybe someone knows a IDE of jetbrains like PyCharm. If you search for "foobar" you even get the lines which contain "foo_bar". That's great, that's unix :-)


For a Lagrangian written in fermionic (Grassmann) variables $\psi$ and $\bar{\psi}$, in a path integral formulation I am supposed to treat these two as independent variables with no relationship. However, if I consider transforming them under various symmetry operations (eg. parity, charge conjugation, time reversal), I am supposed to take the prescription $\bar{\psi} = \psi^\dagger \gamma^0$, where I interpret $\psi^\dagger$ to be the Hermitian adjoint of $\psi$.  How does one reconcile these seemingly paradoxical statements?

When we derive the Dirac equation from the Lagrangian, $$ \mathcal{L}=\overline{\psi}i\gamma^{\mu}\partial_{\mu}\psi-m\overline{\psi}\psi, $$ we assume $\psi$ and $\overline{\psi}=\psi^{*^{T}}\gamma^{0}$ are independent. So when we take the derivative of the Lagrangian with respect to $\overline{\psi}$, we get the Dirac equation  $$ 0=\partial_{\mu}\frac{\partial\mathcal{L}}{\partial\left(\partial_{\mu}\overline{\psi}\right)}=\frac{\partial\mathcal{L}}{\partial\overline{\psi}}=\left(i\gamma^{\mu}\partial_{\mu}-m\right)\psi. $$  Now if we include a term with charge conjugation, $\psi^{c}=-i\gamma^{2}\psi^{*}$, into the Lagrangian (like $\Delta\mathcal{L}=\overline{\psi}\psi^{c}$), does this $\psi^c$ depend on $\overline{\psi}$ or $\psi$? Why or why not?  If $\psi^{c}$ depends on $\psi$, why wouldn't the reason that $\overline{\psi}$ and $\psi$ are independent apply for $\psi^{c}$ and $\psi$?  If $\psi^{c}$ depends on $\overline{\psi}$, how should we take derivative of $\Delta\mathcal{L}$ with respect to $\overline{\psi}$?


I want to run Pulseaudio system wide, on a headless CentOS 7 server.  Pulseaudio works great if I startx but in text mode (runlevel 3 equivalent) pulse audio clients fail.  So I created a systemd service file:  [Unit] Description=PulseAudio Daemon  [Install] WantedBy=multi-user.target  [Service] Type=simple PrivateTmp=true ExecStart=/usr/bin/pulseaudio --system --realtime --disallow-exit --no-cpu-limit    which starts, but I see the following in journalctl:  Jan 19 13:31:47 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set! Jan 19 13:31:47 lserver.mydomain pulseaudio[2523]: N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode! Jan 19 13:31:47 lserver.mydomain pulseaudio[2523]: N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time! Jan 19 13:31:47 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] main.c: OK, so you are running PA in system mode. Please note that you most likely shouldn't be doing that. Jan 19 13:31:47 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] main.c: If you do it nonetheless then it's your own fault if things don't work as expected. Jan 19 13:31:47 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] main.c: Please read http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/ for an explanation why system mode is usually a bad idea. Jan 19 13:31:48 lserver.mydomain pulseaudio[2523]: N: [pulseaudio] alsa-util.c: Disabling timer-based scheduling because running inside a VM. Jan 19 13:31:48 lserver.mydomain pulseaudio[2523]: N: [pulseaudio] alsa-util.c: Disabling timer-based scheduling because running inside a VM. Jan 19 13:31:48 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] authkey.c: Failed to open cookie file '/var/run/pulse/.config/pulse/cookie': No such file or directory Jan 19 13:31:48 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] authkey.c: Failed to load authentication key '/var/run/pulse/.config/pulse/cookie': No such file or directory Jan 19 13:31:48 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] authkey.c: Failed to open cookie file '/var/run/pulse/.pulse-cookie': No such file or directory Jan 19 13:31:48 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] authkey.c: Failed to load authentication key '/var/run/pulse/.pulse-cookie': No such file or directory Jan 19 13:31:48 lserver.mydomain systemd[1]: Got message type=signal sender=org.freedesktop.DBus destination=n/a object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameOwnerChanged cookie=56 reply_cookie=0 error=n/a Jan 19 13:31:48 lserver.mydomain systemd-logind[575]: Got message type=signal sender=org.freedesktop.DBus destination=n/a object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameOwnerChanged cookie=56 reply_cookie=0 error=n/a Jan 19 13:31:48 lserver.mydomain systemd-logind[575]: Got message type=signal sender=org.freedesktop.DBus destination=n/a object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameOwnerChanged cookie=57 reply_cookie=0 error=n/a Jan 19 13:31:48 lserver.mydomain systemd[1]: Got message type=signal sender=org.freedesktop.DBus destination=n/a object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameOwnerChanged cookie=57 reply_cookie=0 error=n/a   and attempts to access audio fail:  speaker-test 1.1.1  Playback device is default Stream parameters are 48000Hz, S16_LE, 1 channels Using 16 octaves of pink noise ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Access denied  Playback open error: -111,Connection refused   And after speaker-test the log shows:  Jan 19 14:06:39 lserver.ocg.ca pulseaudio[2795]: W: [pulseaudio] protocol-native.c: Denied access to client with invalid authentication data.   User root is added to the 'audio' group.  And speaker-test is being run as root. Can someone suggest how to fix this?

Not much else to this question: I would like to know what I need to create a PulseAudio systemd service to be run with systemd --user.  I've tried a few different things, including various user services from Google, but I can't get it set up just right between dbus and everything else required for it.  Update: It seems to work ok with graphical sessions, but I'm still having some inconsistancy with dbus when logging in through console.  But PulseAudio is starting rather reliably, so I'm not overly concerned.


I created a custom block module my_block. Inside modules/custom/my_block/src/Plugin/Block/MyBlock.php I have this code:  <?php     namespace Drupal\my_block\Plugin\Block;     use Drupal\Core\Block\BlockBase;     /**      * Provides'My Block' Block.      *      * @Block(      *  id = "my_block",      *  admin_label = @Translation("MyBlock block"),      *  category = @Translation("Our Example block"),      * )      */      class MyBlock extends BlockBase {        /**        * {@inheritdoc}        */        public function build() {          $build = [];           for ($day = 1; $day <= 100; $day++) {            if ($day % 15 == 0) {                echo $foo . $bar
;            } elseif ($day % 3 == 0) {                echo $foo '
';            } elseif ($day % 5 == 0) {                echo $bar . '
';            } else {                echo $day . '
';            }          }       $block = [        '#theme' => 'my_template',        '#cache' => [          'max-age' => strtotime('01/01/'.(date('Y')+1)) - time(),        ],      ];       $build = $block;       return $build;   }  }   I also created a template file modules/custom/my_block/templates/my-template.html.twig and attached it to my custom module.  I have another file modules/custom/my_block/my_block.module:  <?php /**  * Implements hook_theme().  */  function fizzbuzz_block_theme($existing, $type, $theme, $path) {    return [      'my_template' => [        //'variables' => ['markup' => NULL, 'test_var' => NULL],        'variables' => [          'test_var' => '',        ],      ],    ];  }   How do I output the values from the if/else conditions from modules/custom/my_block/src/Plugin/Block/MyBlock.php, into my custom block and so I am able to render them in my twig file modules/custom/my_block/templates/my-template.html.twig. E.g. Show: {{ result }}   Do I somehow have to parse some variables inside the public function build() function?

I'm trying to create a block that will pass a variable to its template. For now just some text but it will be an array later.  The default block variables such as label are working but I'm unable to get the value to show up in template.  Any ideas ?  FrontAppsBlock.php  namespace Drupal\custom_blocks\Plugin\Block;  use Drupal\Core\Block\BlockBase; use Drupal\Core\Block\BlockPluginInterface; /**  * @Block(  *   id = "front_apps_block",  *   admin_label = @Translation("Front Apps Block"),  * )  */ class FrontAppsBlock extends BlockBase implements BlockPluginInterface {    public function build() {     return array(       '#theme' => 'front_apps_block',       '#app' => 'test value',     );   }  }   custom_blocks.module  function custom_blocks_theme($existing, $type, $theme, $path) {   return [     'front_apps_block' => [       'variables' => [         'app' => null       ]     ]   ]; }   block--front-apps-block.html.twig
test: {{ app }}

label: {{ label }}


If I have the following 2 files and 1 folder:  someuser@computer:~/Desktop/test$ ls -l total 340 -rw-r--r-- 1 someuser someuser  45082 ago  5 09:56 file1.pdf -rw-r--r-- 1 someuser someuser 291836 ago  5 09:56 file2.pdf drwxrwxr-x 2 someuser someuser   4096 ago  5 09:56 this_is_a_folder.pdf   And I run the following command (notice that I ommit the destination):  cp *.pdf   file1.pdf and file2.pdf are copied into the this_is_a_folder.pdf folder.  someuser@computer00:~/Desktop/test$ ls this_is_a_folder.pdf/ file1.pdf  file2.pdf   Obviously *.pdf is expanding into matching items, so it's equivalent to  cp file1.pdf file2.pdf this_is_a_folder.pdf   ... and as this_is_a_folder.pdf is a folder, then the two files are copied to it.  Is this a bug ?  It's obviously a side effect of wildcard expansion and it's not what I would expect to happen.  I would have expected a missing destination file error.

I accidentally forgot to specify destination before hitting the Return key. Where does mv ./* without specifying destination move the files and directories under current directory to?


Why when I insert list of figure, there are something error like  Bad math environment delimiter. ...ikel hijau dan lingkaran merah\relax }}{14}?

I'm working on my thesis, and I've realized that, any time I try to use \( \)-type inline delimiters in captions, that pdflatex breaks. While I can weasel out of actually \needing\ math in my captions, it's very inconvenient. I'm pretty perplexed.  Here's a (relatively) minimal example that breaks for me:  \documentclass{uafthesis}  \usepackage{amsmath} \usepackage{graphicx} % Graphics stuff  \begin{document}  \listoffigures  \begin{figure}[h] \centering \includegraphics[width=0.3\textwidth]{angle.png} \caption{\(\theta \)} \end{figure}   \end{document}   Here's a sample of the output:     ! LaTeX Error: Bad math environment delimiter.      See the LaTeX manual or LaTeX Companion for explanation.   Type  H   for immediate help.    ...                                                    l.1 ...k or  to continue without it.}}}{2}      ?    ! Extra }, or forgotten $.    ...r  to continue without it.}}      l.1 ...k or  to continue without it.}}}{2}      ?    Some things:   uafthesis is the unofficial official document class for my university. It has been written mostly by physics grad students by hacking at other document classes. My fork is . This only happens if I include amsmath. The minimal example and the resulting log file are gisted .   I'm defending tomorrow, and I have to turn in my thesis pretty soon, so hopefully we can figure this out within a day or so! If not, I understand, and thanks anyway.


I always thought about this whenever I saw Harry Potter movies or read books, that where exactly magic lies? Is it in wizards or wands? As mentioned in , Harry is able to make the glass disappear. Then in  he blows away his aunt without even touching the wand. So if magic is possible without wands why do they need it in the first place? Also, Ollivander tells Harry that wand chooses the wizards, so does wand actually have magic? Kindly help.

So in the first 5 or 6 books, it was very clear that the wand chooses the wizard and the power/level of the spells the wizard produces is based on the knowledge and skill of the wizard.  This is referenced by people constantly being telling Harry that he wasn't skilled enough to perform certain spells, or Bellatrix telling Harry that he needed to mean the Cruciatus curse for it to be effective.  However, in the 7th book, this entire idea is changed to the wand being the thing that's powerful and regardless of the wizard's/witch's skill or knowledge, he/she could still perform a very advanced spell if it's something the wand could handle.  Goyle accidentally creating a fire serpent is something that instantly comes to mind from the movies(I don't remember if that happened in the book).  So, my question is, what actually holds the power, the wizard/witch, or the wand?


$A^\mathrm{o}$, the interior of $A$, is the union of all open subsets of $A$.  If $H=\Bbb Q$ and $K=\Bbb R \backslash \Bbb Q$ then $H^\mathrm{o}=K^\mathrm{o}=\emptyset$ but $(H\cup K)^\mathrm{o}=\Bbb R^\mathrm{o}=\Bbb R$  I don't understand why $H^\mathrm{o}=K^\mathrm{o}=\emptyset$  Could somebody explain why this is the case?

I don't understand why the interior of $\mathbb{Q}$ in $\mathbb{R}$ is empty, since, for every ball with the center being a rational number, given an $\epsilon>0$, I can find an infinite sequence of rational numbers that approach this point. For example, take $\frac{1}{2}$. The sequence $\frac{1}{2}+\frac{1}{n}$ can be made as close as I want to the number $\frac{1}{2}$, therefore I can always have open balls with center $\frac{1}{2}$ such that there are rationals inside it.


Is there a paradox that doesn't require self-reference and negation?   The set of all sets that do not contain themselves uses both, for example. Same with This sentence is false.

Most paradoxes involves self-reference, the only exception known to me is Yablo's paradox, however it is still debated if it is really without self-reference. So, I was wondering, are there other known paradoxes that works without self-reference?


Whoever saw the trailer is able to see that Kowalski plays a major role in the Fantastic Beasts: The Crimes of Grindelwald.      But at the end of the end of Fantastic Beasts and Where to Find Them, every Muggle was obliviated. So how does it come, that he remembers what happened?   In Fantatic Beasts II there was one explanation for it:      According to Kowalski, he could remember everything, because the magic Newt did only erased bad memories. So he kept most of his memories - and Queenie Goldstein helped with the rest of the memories. But I don't buy it. At the end of Fantastic Beasts I, he couldn't remember Queenie at all - he only had some weird memories and baked weird bread. Is that a plothole?

At the end of Fantastic Beasts and Where to Find Them,      Newt send up the  with the short-term memory eraser.   After they do that,      Jacob Kowalski goes out into the rain to forget what happened.   But then      Queenie goes out and conjures up an umbrella, in addition to the fact that he was under cover for most of the time.   Then Jacob goes and wanders off, bumping into Newt along the way.  But when     Queenie goes into his new bakery, he appears to recognize her.   This is in addition to that     His confections are magical-beasts shaped.   This would imply that he still remembers things.  So, the question is:  Did Jacob not lose all of his memories? If he did, what happened at the end with Queenie?


I have a node named "reviews" and a custom field named "field_rating". I created a field template named field--node--field_rating--reviews.html.twig.  I want inside the node to change the color with an if statement.  I try to do something like that:  {% for item in items %}   {% if item.content > 5 %}
{{ item.content }}
   {% endif %} {% endfor %}   but it doesn't work.  Any suggestions?  Drupal Version 8.6.1

myfield is a plain text field. {{ content.field_myfield }} renders the field with HTML markup and the field label.  How do I render the raw value of the field? {{ content.field_myfield.value }} doesn't work.


I have two fullHD monitors, one of which is a 15" Laptop screen. How can I change the DPI of only that particular screen, to read text more comfortably?

I'm using Ubuntu 12.04.3 with NVidia drivers (319) for my Quadro K2100M graphic card, and when I switch my main 3200x1800 laptop screen to mode 1920x1080 (using nvidia-settings), the display goes blurry...  I am using two screens:    My main screen is a LCD with max resolution 1920x1200. My laptop screen (original resolution 3200x1800) is sitting to the right of that.   The main problem is that, on Ubuntu, the font is far too small on my laptop screen. Because of that, I wanted to change the resolution of my laptop to 1920x1080.  Reading , I tried to  and here is the DPI configuration which I should have:   94x94 for my main LCD screen 1920x1200 235x236 for my 3200x1800 laptop screen   Is there a way to have dual DPI resolutions with an extended desktop?


specifies a ChaCha20/Poly1305 based AEAD cipher scheme; pseudocode:  pad16(x):      if (len(x) % 16)==0         then return NULL         else return copies(0, 16-(len(x)%16))      end  chacha20_aead_encrypt(aad, key, iv, constant, plaintext):      nonce = constant | iv      otk = poly1305_key_gen(key, nonce)      ciphertext = chacha20_encrypt(key, 1, nonce, plaintext)      mac_data = aad | pad16(aad)                // <- Here      mac_data |= ciphertext | pad16(ciphertext) // <- Here      mac_data |= num_to_4_le_bytes(aad.length)      mac_data |= num_to_4_le_bytes(ciphertext.length)      tag = poly1305_mac(mac_data, otk)      return (ciphertext, tag)   Why do they require to pad the ciphertext/additional data during MAC-computation? Are there any cryptographical advantages over a similar algorithm without padding (as used by libsodium)?

The AEAD construction for chacha20-poly1305 described in the  encodes message lengths into the text that is to be hashed. The  goes further and pads associated data and plaintext to multiples of 16 bytes.  Can anyone explain what the purpose of that is? The chacha20-poly1305 implementation found in OpenSSH doesn't do anything like that, and as far as I can see, neither does NaCl. Those are still considered secure so I wonder what's going on.


time seq 100 | xargs -i bash -c 'echo {}'   ; 2.530s  time seq 100 | xargs -i sh -c 'echo {}'   ; 0.223s  why?  PS: The title of mine for this post is more intuitive to be discovered or searched by google or any sort of search engines.

I am wondering what the point of sh being symbolic linked to dash is? I understand that dash is supposed to be faster than bash, but I am uncertain why the original sh shell isn't present in sh.   Or if anything why isn't sh linked to bash?


I have bought a Macbook Pro Early 2011 17 inch (A1297) with the known AMD GPU problem. I'd like to fix that in the near future using the Demux or Tiresias solution.  Now, before doing that, I tried to bypass the AMD GPU with software, so I did this tutorial:   I've succesfully done the tutorial before on a A1286 late 2011, so I figured it would work on my 17 inch Macbook Pro early 2011 (A1297). The weird colours and stripes dissapeared... except for a vertical white bar. (as seen on the picture)   Does anyone know a solution for this? Might this be the intel GPU? Do I need to look somewhere else? I'm pretty sure it's not the display itself (as it does not have any crack or damage).  Thanks! Lorenzo

This is on an Early 2011 Macbook Pro 17" with i7 2.2ghz and the Intel + Radeon HD6750:     If it is a screen error then I don't mind fixing it myself, but if the GPU is the problem, I'm worried I might have to buy a new logic board assuming I can't use the GPU.


Let $u$ be a real-valued harmonic function in the complex plane such that $$ u(z) \leq b + a \log{|z|} $$ whenever $|z| \geq 1$(for some constants $a > 0$ and $b$). Show that $u$ is constant. I know that harmonic functions satisfy: $$\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} = 0 $$ But, how do I use this to show that $u$ is constant?

In a question paper I got the following two questions.   $u(z)=u(x,y)$ be a harmonic function in $\mathbb{C}$ satisfying $u(z)\le a|\ln|z||+b$ for some positive constants $a,b$ and for all complex numbers. Show that $u$ is constant. If for all complex numbers, $u(z)\le |z|^n$ for some $n\in \mathbb{N}$, then $u$ is a polynomial in $x,y$.   I am completely stuck with this one.


In how many ways can 5 letter words be formed with 2 letters - Y and N. Ex - YYYNN, NNNYY etc.

I was trying with L choose W, but then I don't know if that is enough.


Trying to install CNTK, I received a message saying that I should upgrade pip command  This one is another question related to the upgrading of pip. After the installation with the command pip install cntk  I received another error message as shown in the attached image.

Vineeth Sai indicated in  that with the following code:  pip install cntk    the problem is solved. However, I am getting the error shown in attached image:


I have a question about how the verb LOOK below should be conjugated:  1.There are neatly-dug beds filled with what look like carrots, chard and kale...    There are neatly-dug beds filled with what looks like carrots, chard and kale...    Should LOOK agree with WHAT or with the vegetables?  Thank you.

Which sentence is more grammatically correct?     He is being tried on what look like trumped-up charges.   He is being tried on what looks like trumped-up charges.


In A New Hope it's clear that the Death Star has an atmosphere around it. Explosions near its surface result in fireballs indicating oxygen, and ships show clear signs of being affected by drag (air resistance). They need to keep their engines running to maintain speed and when hit immediately fall back.  The Death Star is too small to maintain an atmosphere through gravity, much like a similarly sized moon. So how is it possible that it has an atmosphere?  Note: I have read  and all  the answers explain why it couldn't have an atmosphere, yet it clearly does so this is a different question.

The Death Star is the size of a small moon. Endor being a moon (not sure if it's small or not) has a rich atmosphere.  Could the Death Star hold a nitrogen/oxygen based atmosphere with its gravity?  (Now re-reading my question, I suppose this sounds a lot like the plot of SpaceBalls... that was not my intention)


I am fresh out of university and landed a good graduate job with a decent acceptance bonus. I would like to start investing and not lose any time in doing so, however, it can be intimidating to not only risk all the money being invested at a young age but also to sign paperwork without any legal endurance or knowledge.  Would it be a good idea to start opening an investment account in places like JP Morgan or BlackRock and start growing individual wealth?

I am young, just started my career, and looking to begin investing so I can make my money work for me. I'm still living like I did in college (occasional purchase on myself, but most of it goes into savings) and I would like to take the extra money and invest it.   What would you suggest are the best options for me to begin? I was considering getting a personal investor [a financial advisor] for perhaps a year or so, but I've heard that they really are not worth the money. I wanted to get the input of the great minds here.


How do I remove all repositories which don’t exist for one reason or another? I am wondering if there is a command to do this, so that I can remove all such repositories at once. I am running Ubuntu 14.04.

PPA seems to be constantly offline. Whenever I use sudo apt-get update, this error is shown:  W: Failed to fetch http://ppa.launchpad.net/ 404  Not Found   How do I fix these errors?


Does the wash sale rule apply to options expired worthless? for example, my BA Aug 18 call expired worthless (Just expired not sold) will this loss be considered a wash sale if I purchase BA long call option again today? Thanks, Prashantha

A similar question recently asked about stock sales and option buys triggering wash sale rules.  If an option expires, is that considered a buy/sale ?  What I mean is: let's assume I have a call option with a target date of August 16. Now I sell the underlying stock somewhere before that (after July 16th). Does that trigger wash sale rules (if the option expires in the money, exercised by default) ?  Is an option expiring out of the money considered a sale ?


I have used the Area51 Proposal shares and also the flairs of profile but they don't target new tab or window I tried to add the target="_blank" but that doesn't seems to be work With Target   WithOut Target

Stack Exchange sites use  for questions and answers. Per the Markdown specification, intermixing HTML and Markdown tags is allowed, but not all the HTML tags are allowed, to avoid . Which HTML tags are allowed on Stack Exchange sites?


So I log into my minecraft as normal. then I get into a single player world so I can get lag out of the way to get into a normal multiplayer server. so I get mst of the lag out then I go in f5 to check my skin and punch in air. my player doesn't punch. I check the mouse settings. there normal. then im like its just for sp. I got to a server same thing. so please if you know if its my client or is it mouse settings because I cant play my game if I cant destroy blocks.

I'm playing on a Survival world with cheats on, "easy" difficulty, and at night in-game. I didn't have a sword or anything to make a sword with, and I was starving, so I switched to Creative to give myself a stack of food and a bed to set my spawn point. When I switched back to Survival, I couldn't destroy or place blocks. I'm on single player, and my Internet is fine, and I can destroy blocks still if I switch to creative. I've tried resetting the button one, and reloading the map, and it still doesn't work. I've even tried deleting everything I gave myself in Creative. This happened before on a different world and I ended up deleting it.  This only happens on this world. How do I fix it?  If I know I'm in the correct game mode, what else can cause this?  Are there different causes in multiplayer?


Ubuntu 18.04 final beta came out a few days back. Ubuntu 18.04 will be released soon and I have recently upgraded RAM on my computer. I previously had less RAM so I started using Xubuntu, but now I want to move back to Ubuntu (although it's no longer the same, with GNOME desktop and all).   What would be the best way to do it? I don't want to lose data and would like to keep the applications I have installed on my Xubuntu 16.04 system. So in summary: I want to know if there's a way to move from Xubuntu 16.04 to Ubuntu 18.04 (with the GNOME desktop, not Xubuntu 18.04) and if yes, how reliable it is. Or would I have to just clean install?

So, today is July 21st and . gives me an option to download 16.04.1 LTS. However, attempting to upgrade gets me this message -  $ sudo do-release-upgrade Checking for a new Ubuntu release No new release found   What is wrong? Does it matter that I am running apt-get update behind apt-cacher-ng?  Note: Commenting out the files in apt.conf.d that used apt-cacher-ng did not make a difference.  Edit: Explanation for possible duplicates:  deals with upgrade from 12.04LTS to 14.04LTS. My question is specific to 14.04 LTS to 16.04.1 LTS upgrade. Old answers, while good for archival purposes are less relevant in a fast changing package like ubuntu. Moreover none of the answers answer what is wrong. The link  pointed out is mentioned in one of the comments. This Q & A is more helpful for people upgrading today than the work around mentioned in "".


Hey guys I have Ubuntu 16.04 installed on my laptop now I really wanna install Windows 7 because there is always that one software that doesn't run on Ubuntu, HELP ASAP  Edit: I recently upgraded to Ubuntu 16.10 with software centre  Second Edit: My question is different because I have Ubuntu 16.10 and before I followed a Ubuntu 14.10 tutorial and it did not work and I could not boot into Ubuntu! So I had to delete Windows and Ubuntu and reinstall Ubuntu!  Third Edit:

I have Ubuntu on my laptop. Now I want install Windows 7 in a dual-boot. How can I do this? I can't lose my Ubuntu files, and I'm afraid that I might break . Go  for UEFI only!


I read a sentence in a book, as following:     This feature is useful when constructing Boolean expressions in which we first test that a certain condition holds (such as reference not being None), and then test a condition that could have otherwise generated an error condition had the prior test not succeeded.   I could not understand the bold in the sentence in the way of grammar. I think it should be " an error condition that can have the prior test not succeeded", am I right?

Were I rich, I would live on Long Island.   If I were rich, I would live on Long Island.   Is the first sentence still used, or is used in particular contexts (in example, to give emphasis to the sentence)?


I hope somebody is going t help me out with this. I am a student, so it is my need at present

I have a 2gb chromebook with 64-bit ubuntu 12.04 and it runs extremly slow and often crashes so how to I downgrade it to 32-bit or is their another solution?


I have to find in mytextmap the closest value to keymap, for all keymap's elements and attach it to each other in a new map <char, char> called key(key of key is key of keymap, value is key of mytextmap).    Here my attempt:   for (auto i = keymap.begin(); i != keymap.end();){     int j = ((i->second) / sumkey)*sum;     auto tmp = find_value(mytextmap.begin(), mytextmap.end(), j);     while (tmp->second != j)     {         j--;         tmp = find_value(mytextmap.begin(), mytextmap.end(), j);     }     key[(*tmp).second] = i->second;     i=keymap.erase(i);     mytextmap.erase(tmp); }   find_value - returns an itterator for element in (map.begin(), map.end()) with value(like j in my code).   There is an error, somewhere. Crash error: "expression map/set iterator not dereferencable. Problem is not in erase(already fixed).  On while-line it crahes. Sting before works, string after - no.

In the following code I loop through a map and test if an element needs to be erased.  Is it safe to erase the element and keep iterating or do I need to collect the keys in another container and do a second loop to call the erase()?  map<string, SerialdMsg::SerialFunction_t>::iterator pm_it; for (pm_it = port_map.begin(); pm_it != port_map.end(); pm_it++) {     if (pm_it->second == delete_this_id) {         port_map.erase(pm_it->first);     } }   UPDATE: Of course, I then  which I didn't think would be related but answers my question.


My sister and I both have iPhones and whenever someone texts her, I get those messages sent to my MacBook Air. It's really annoying and I haven't been able to figure out how to fix it!

Ok, so at my school, everybody was supplied with a Macbook Pro. I set up the Messages app and it was all great until the county decided to block it. Now, instead of receiving text messages on my phone they go to my Mac. I have no idea how to fix this because I can't open the Messages app. Please help?!


Hi all,   Love how this look, and was wondering what sort of gradient effects may've been used in the image...    Thanks so much for your help!

I'm a novice photoshop user, i stumbled upon the designs of the awesome mike of creativemints, and i noticed how his backgrounds are really beautiful and smooth, i tried to recreate it and failed miserably so my question is, how do you achieve such effect??     and thank you so much!!


I found hints that the location might be "Android/data/com.google.android.apps.books". I don't have that folder. I have searched every file in my system looking for the book file.  I have folders: "...apps.magazines"   and "....apps.maps", but no "...apps.books".  Also what does the thumbtack mean on the books page cover under library view... Is there a manual somewhere?

In the Google Play Books Android application, there is an option to keep an ebook on a device if the user wants to do it. So when you decide to do such a thing, the ebook may be stored somewhere on the Android device. I would like to know where the ebook is stored. I searched in /mnt/storage and I only found Aldiko ebooks (in the /mnt/storage/eBooks folder), not the Google Play eBooks.  Thanks for your answsers.  PS : if it can help, I do this on an Archos G9 101 tablet.


Is it a theorem that "the area under a curve i.e., basically the integration is an inverse process of slope at a point on curve i.e., the derivative" ?How does one intuitively visualize it. Is there some lucid explanation, if possible in a form of proving this theorem. thanks.

Why do you get a function's (changing) slope when you take its derivative and why do you get the area under the function when you take its integral? What is the easiest reasoning behind this?


Those symbols represent the argument: $p$: both rabbits and turtles are mammals $c$: Rabbits are mammals. On the one hand, I don't think it's an argument because it's a tautology, but on the other hand there's no way for $p$ to be false if $p\wedge q$ is true. Lastly, is it sound?

we recently got the statement that $(P \land Q) \to P$ is a tautology, but i do not get why it is one, since it is wrong for certain cases of P and Q.


PCA gives me loadings with different signs. I understand that I may simply revert them (), but I need an explanation (my boss insists) of why Matlab implementation gives me these signs, but not reverted.  UPDATE I found empirically, that in Matlab the loading with highest absolute value is always positive.

I performed principal component analysis (PCA) with R using two different functions (prcomp and princomp) and observed that the PCA scores differed in sign. How can it be?  Consider this:  set.seed(999) prcomp(data.frame(1:10,rnorm(10)))$x              PC1        PC2  [1,] -4.508620 -0.2567655  [2,] -3.373772 -1.1369417  [3,] -2.679669  1.0903445  [4,] -1.615837  0.7108631  [5,] -0.548879  0.3093389  [6,]  0.481756  0.1639112  [7,]  1.656178 -0.9952875  [8,]  2.560345 -0.2490548  [9,]  3.508442  0.1874520 [10,]  4.520055  0.1761397  set.seed(999) princomp(data.frame(1:10,rnorm(10)))$scores          Comp.1     Comp.2  [1,]  4.508620  0.2567655  [2,]  3.373772  1.1369417  [3,]  2.679669 -1.0903445  [4,]  1.615837 -0.7108631  [5,]  0.548879 -0.3093389  [6,] -0.481756 -0.1639112  [7,] -1.656178  0.9952875  [8,] -2.560345  0.2490548  [9,] -3.508442 -0.1874520 [10,] -4.520055 -0.1761397   Why do the signs (+/-) differ for the two analyses? If I was then using principal components PC1 and PC2 as predictors in a regression, i.e. lm(y ~ PC1 + PC2), this would completely change my understanding of the effect of the two variables on y depending on which method I used! How could I then say that PC1 has e.g. a positive effect on y and PC2 has e.g. a negative effect on y?    In addition: If the sign of PCA components is meaningless, is this true for factor analysis (FA) as well? Is it acceptable to flip (reverse) the sign of individual PCA/FA component scores (or of loadings, as a column of loading matrix)?


I struggle to prove this using the definition only. I can prove it by using some limit laws, but I wanted to use only the definition out of curiosity. I would appreciate some hints.  Q: Prove that the sequnece below converges to $\sqrt{2}$: $$x_{n+1}=\frac{1}{2}x_n+\frac{1}{x_n},$$ where $x_1 = 2$.

Suppose that $S_0$ and A are positive numbers, let $$S_{n+1} = \frac{1}{2}\left(S_n +\frac{A}{S_n}\right)$$ with $n \geq 0 $.      (a)Show that $S_{n+1} \geq \sqrt{A} $ if $n \geq 0$       (b)Show that $S_{n+1} \leq S_n $ , if $n \geq 1$      (c) Show that $s= \lim\limits_{n \rightarrow \infty} S_n$ exists      (d) find s   (a) Show that $S_{n+1} \geq \sqrt{A} $ if $n \geq 0$  Given $$P_n:  S_{n+1} = \frac{1}{2}\left(S_n +\frac{A}{S_n}\right) \geq \sqrt{A}$$  $$P_0: S_{1} = \frac{1}{2}\left(S_0 +\frac{A}{S_0}\right) \geq \sqrt{A}  $$  We assume that $P_n$ is true  $$P_{n+1}: S_{n+2}= \frac{1}{2}\left(S_{n+1} +\frac{A}{S_{n+1}}\right)$$ by assumption $$S_{n+2}= \frac{1}{2}\left(S_{n+1}\left(1 +\frac{A}{(S_{n+1})^2}\right)\right) \geq \frac{1}{2}\left(\sqrt{A}\left(1 +\frac{A}{(\sqrt{A})^2}\right)\right)$$ $$ S_{n+2}= \frac{1}{2}\left(S_{n+1} +\frac{A}{S_{n+1}}\right) \geq \sqrt{A}  $$  It follows that $S_{n+1} \geq \sqrt{A} $    (b) Show that $S_{n+1} \leq S_n $ , if $n \geq 1$  $$S_{n+1} \leq S_n$$ $$\frac{1}{2}\left(S_n +\frac{A}{S_n}\right) \leq S_n $$ Dividing by $S_n$ $$\frac{1}{2}\left(1 +\frac{A}{S_n^2}\right) \leq 1 $$ $$\frac{A}{2S_n^2} \leq \frac{1}{2}$$ $$A \leq S_n^2$$ $$S_n \geq \sqrt{A}$$ As  $S_{n+1} \leq S_n$ yields a true statement, it follows $S_{n+1} \leq S_n$ is true.    (c) Show that $s= \lim\limits_{n \rightarrow \infty} S_n$ exists  Since $S_{n+1} \leq S_n$, the sequence is non-increasing,   using the non-increasing theorem stating that      if $\{S_n\}$ is non-increasing then $$\lim\limits_{n \rightarrow > \infty} S_n = \inf\{S_n\} $$     (d) find s    Is the argumentation in (a) and (b) appropriate? Also, I have to admit I m getting less confident in my argumentation (c) and (d). How to proceed in (c) and (d)?  Much appreciated for your input or help.


Which one is correct:  I and my father are going to the market.  Me and my father are going to the market.

I've always been taught to put myself last when referring to myself in the same sentence as others but the usage of "me and..." seems to be everywhere these days. The misuse of the word "me" instead of "I" aside, is there some new rule I haven't heard of? Shouldn't we put ourselves last regardless of the "me"/"I" usage?  Examples of "correct" usage:      My friends and I went for some ice   cream. Did you see my friends and me   at the ice cream stand?   Examples of "incorrect" usage:     Me and my friends went for some ice   cream. Did you see me and my friends   at the ice cream stand?   Note: I was also taught that the only person who could put themselves first was the queen.


I have searched "GIMP" on my Ubuntu 16.10(64bit) Ubuntu Software, but it was not there, so i tried to install it with this simple Command :  sudo apt-get install gimp   and after typing my password the result was :   The following packages have unmet dependencies:  gimp : Depends: libgegl-0.3-0 (>= 0.3.0) but it is not going to be installed E: Unable to correct problems, you have held broken packages.   so how can i install gimp on my Ubuntu 16.10 ?   Edit : I've treid to install vlc and i got a similar error but about another package and on the last line it mentioned some of my packages are broken , i'm searching to solve that. As it is maybe visible I'm somewhat new to linux , so i mentioned that similar problem , but i don't know is it really related or not.

I am trying to install GIMP through the terminal.. But The following error is showing..  The following packages have unmet dependencies:  gimp : Depends: libgegl-0.3-0 (>= 0.3.0) but it is not going to be installed E: Unable to correct problems, you have held broken packages.   Help is appreciated.


I am trying to print the void* memory address inside void**, like this:  #include <stdio.h> #include <stdlib.h>  int main(){      void** MyArray = malloc(500 * sizeof(void*));     printf("Last pointer: %p\n", *MyArray[499]);     free(MyArray);     return 0;  }   But when i try to compile I get a warning and an error:        Line: 6   Col: 31 in D:\C\test.c  [Warning] dereferencing 'void *' pointer   Line: 6 Col: 2 in D:\C\test.c [Error] invalid use of void expression      What I'm doing wrong? Thanks

I was trying to understand something with pointers, so I wrote this code:  #include <stdio.h>  int main(void) {     char s[] = "asd";     char **p = &s;      printf("The value of s is: %p\n", s);     printf("The direction of s is: %p\n", &s);      printf("The value of p is: %p\n", p);     printf("The direction of p is: %p\n", &p);      printf("The direction of s[0] is: %p\n", &s[0]);     printf("The direction of s[1] is: %p\n", &s[1]);     printf("The direction of s[2] is: %p\n", &s[2]);      return 0; }   When compiling it with gcc I get these warnings:  $ gcc main.c -o main-bin -ansi -pedantic -Wall -lm main.c: In function ‘main’: main.c:6: warning: initialization from incompatible pointer type main.c:9: warning: format ‘%p’ expects type ‘void *’, but argument 2 has type ‘char (*)[4]’ main.c:11: warning: format ‘%p’ expects type ‘void *’, but argument 2 has type ‘char **’ main.c:12: warning: format ‘%p’ expects type ‘void *’, but argument 2 has type ‘char ***’   (The flags for gcc are because I must be C89)  Why incompatible types of pointer? Isn't the name of an array a pointer to it's first element? So if s is a pointer to 'a', &s must be a char **, no? And why do I get the other warnings? Do I have to cast the pointers with (void *) in order to print them?   And when running I get something like this:  $ ./main-bin The value of s is: 0xbfb7c860 The direction of s is: 0xbfb7c860 The value of p is: 0xbfb7c860 The direction of p is: 0xbfb7c85c The direction of s[0] is: 0xbfb7c860 The direction of s[1] is: 0xbfb7c861 The direction of s[2] is: 0xbfb7c862   How can the value of s and it's direction (and of course the value of p) be the same?


I have a model (v2.69) that renders smoke in the viewport. However while the model appears in the jpg output the smoke does not.  Every thing is in the same blender layer.  I have recently re-built the machine to Ubuntu 14.04 and the problem persists.  6mths ago it was fine, the hardware has not changed and the example files are in   GIMP works fine, the machine works fine and so this is looking like a Blender setting and something that is stopping the smoke from getting to the output file.  Stuart

When I try to run the smoke simulator in Blender 2.62 I get no smoke at all. When I attempt to render, the only output is a black screen. What am I doing wrong here that is making the smoke simulation not render?  Is it a mistake I made, or a problem with Blender version 2.62?


I've been trying to find a solution for a while and decided to ask here for more help. I've noticed that my CPU usage is pretty high when idle, even after a cold reboot of the computer:  Task Manager View showing "System" and "System interrupts" causing a high CPU load:   I've tried to dig deeper and used Processor Explorer to get more information, which, strangely enough, shows that "System interrupts" uses up more % of the CPU than the "System" process:  Process Explorer showing that "Interrupts" is taking up 20% of the CPU load:   Next I've tried to narrow down the causes of the interrupts by using the Windows Performance Recorder and analyze the graph using the Windows Performance Analyzer (can't post the screenshot due to not having enough rep, but it looks like hal.dll is causing the most interrupts, but less than the 20% seen with Process Explorer)  Any suggestions how to proceed?  Information about my computer:   Windows 10 Intel Core i5-4790k AMD R390 GPU 8 GB Ram   I've updated the GPU and sound drivers and Windows is up to date.

I have a laptop, which was running Windows 8.1 x64 without any problems. Now with Windows 10 x64 installed, Task Manager constantly shows unusual CPU usage by "System" and "System interrupts". To solve this, I already tried the following, without success:   Disabling and uninstalling all non-essential drivers. Installing newer drivers than the ones that were automagically installed (if available). Disabling/enabling fast boot option. Disabling all of the non-essential services. Sysprep. Resetting BIOS to defaults and various combinations of settings. Flashing BIOS to the latest available version. Clean install from the same media that I use for other PCs. Installing all of the updates offered in Windows Update to this day. Windows Performance Recorder / Analyzer.   I'm not very familiar with Windows Performance Analyzer, so I'm hoping someone here can point me in the right direction - what exactly should I look for, to figure out which device/driver is the culprit. Or, if there's any other approach to figuring out this problem?  For the brave souls, here's my  and a screenshot of the problem:


I read that story in the 90's or early 2000's. I'm quite sure it was a series, but I read only the first book. It was the French translation, so it is very possible that the story dates from earlier.  What I remember so far:   The aliens had created a vast network of underground tunnels under the surface of Mars. The tunnels had been scrubbed spotless way before the humans arrived. The humans found a sort of warehouse, not sure if it was in orbit or not, with a huge number of ships belonging to the aliens. The aliens have been nicknamed the 'Eechees' because that's the sound made by their ships. Based on the way the ship's are built and the internal arrangements like chairs, it was determined that the aliens look quite different than humans, though they are bipedal (not 100% sure on that one). The humans managed to activate the alien ships, but they are pre-programmed with specific destinations and the humans never found a way to change the programmed destination. One scene I remember is a ship with 3 or 4 people being sent near a globular cluster, which wasn't that impressive or interesting, and wouldn't fetch the crew much money when they come back, only to discover that there was a black hole nearby when the light from the cluster began to get heavily distorted. I remember one sentence that made me smile at the time: 'Something is eating the cluster!' The book ends on a sort of teaser/cliffhanger where it is revealed that the 'Eechees' took refuge in the black hole at the centre of the galaxy to escape some danger. It is heavily hinted that, while eons passed in the galaxy, due to time dilation caused by the black hole, the aliens living inside it where alive when their whole civilisation took refuge in the black hole.

I am looking for a novel that I'd love to re-read it with my wife (my 13-year old self must be proud of me I guess). Key Plot points The plot was about humanity finding an alien station on an orbit of Earth. (I'm not sure if it wasn't Moon itself). On this station there were thousands of ships ready to travel so there rose a company that paid people to get on those ships and explore the galaxy. The problem was humans didn't understand how to steer those ships so they had to rely on preset targets. Of course there was no telling where particular ship was to go and fair amount of them never returned. Chronology and other relevant information I read it as an early teenager back in early 2000s. It was Polish translation of a foreign (possibly English) story. I think (not sure) that the book wasn't new at the time. It was just one of those books you dig out in a library and take to see if it's good. I don't recall cover either and even if I did it'd be of the Polish version. Additional information could be that the narration was led along the psychoanalytics of the main protagonists where he relives his memories from inside the station and his journeys.


typedef struct {   double *x;   int points; } Polygon;    polygon[cc].points = readobject(polygon[cc].file); //lets say equals 15 polygon[cc].x = (double *) malloc(polygon[cc].points * sizeof(double));  printf("%d\n", sizeof(polygon[cc].x) / sizeof(polygon[cc].x[0])); //This prints out on 1   I've test initializing x as x[100] and it works then, but shouldn't the malloc() call set the struct's array at x[15]? Is it just measuring the bytes of two doubles?

First off, here is some code:  int main()  {     int days[] = {1,2,3,4,5};     int *ptr = days;     printf("%u\n", sizeof(days));     printf("%u\n", sizeof(ptr));      return 0; }   Is there a way to find out the size of the array that ptr is pointing to (instead of just giving its size, which is four bytes on a 32-bit system)?


I hope this question is not too vague, but coming from java, I can not think of any reason why I would use non-virtual functions in C++.  Is there a nice example which demonstrates the benefit of non-virtual functions in C++.

Is there any real reason not to make a member function virtual in C++?  Of course, there's always the performance argument, but that doesn't seem to stick in most situations since the overhead of virtual functions is fairly low.  On the other hand, I've been bitten a couple of times with forgetting to make a function virtual that should be virtual.  And that seems to be a bigger argument than the performance one.  So is there any reason not to make member functions virtual by default?


Need to know when EasyJet flight EJU8872 leaving Amsterdam May 1, 2019 at 13:30 arrived at Gatwick?

Where can I find historical data on flights, specifically Delta international flights?  I need to find out about cancellations, diversions and any other flight data pertaining on particular route at a given time.  This source has to be official and stand up to legal scrutiny.


I am trying to create an array of functions to pass to a method:  private void test(Function<?,?>... fns) {         return;     }   In order to do so, I can create the array, and add objects one by one with:  Function<A, B>[] fnArr = new Function[10]; fnArr[0] = Class1::staticMethod1; fnArr[1] = Class1::staticMethod2; fnArr[2] = Class1::staticMethod3; ...   But when I try to to this while initializing array:  Function<A, B>[] fnArr = new Function<A, B>[] { Class1::staticMethod1}   I get following error:     Cannot create a generic array of Function   Why is this? How can I avoid having a lot of lines to initialize the array by adding objects 1 by 1?  Note I need a solution for java8

Due to the implementation of Java generics, you can't have code like this:   public class GenSet<E> {     private E a[];      public GenSet() {         a = new E[INITIAL_ARRAY_LENGTH]; // error: generic array creation     } }   How can I implement this while maintaining type safety?  I saw a solution on the Java forums that goes like this:  import java.lang.reflect.Array;  class Stack<T> {     public Stack(Class<T> clazz, int capacity) {         array = (T[])Array.newInstance(clazz, capacity);     }      private final T[] array; }   But I really don't get what's going on.


I noticed I have two Facebook account but I would like to know how to delete one of them.

I don't trust Facebook's new privacy settings and have decided to delete my account, but I can't find the kill switch.  Does anyone know how I can delete my Facebook account?


I have used the substitution $u= x+1  $ then $du =dx$ to evaluate the following integral in closed form and since $\arctan$ is connected to $x^2+1$ as it is a derivative of it. $$\int_{1}^{\infty} \frac{\arctan (x+1)}{x^2+4} dx$$  But i didn't come up to it's closed form the  me the closed form for it , and all my attempts gives me this approach : $$\int_{1}^{\infty} \frac{\arctan (x+1)}{x^2+4} dx=\frac{\pi^2}{8}-\frac{3\pi}{8}\arctan \left(\frac{1}{2}\right)$$ But this is not the same result with , Any way ?

I was playing around with some integrals and noticed that some integrals of the form:  $$I(a,b,c)=\int_a^\infty \frac{\arctan(x+b)}{x^2+c}dx$$ Does have a closed form. I am trying to find for what constant $c$ will this work. In case you wonder why only $c$ is problematic, I will try to show by an example.  $$I=I(1,3,16)=\int_1^\infty \frac{\arctan(x+3)}{x^2+16}dx$$ Let's start by letting $x-1=t\,$ thus: $$I=\int_0^\infty \frac{{\arctan(\color{blue}{t+4})}}{t^2+2t+17}dt$$ With $\displaystyle{t=\frac{17}{y}\rightarrow dt=-\frac{17}{y^2}dy}$ $$I=\int_0^\infty \frac{{\arctan\left(\color{red}{\frac{17}{y}+4}\right)}}{\left(\frac{17}{y}\right)^2 +\frac{34}{y}+17 }\frac{17}{y^2}dy\overset{y=t}=\int_0^\infty \frac{{\arctan\left(\color{red}{\frac{17}{t}+4}\right)}}{t^2+2t+17}dt$$ $$2I=\int_0^\infty \frac{{\arctan(\color{blue}{t+4})+{\arctan\left(\color{red}{\frac{17}{t}+4}\right)}}}{t^2+2t+17}dt$$ $${\arctan(\color{blue}{t+4})+{\arctan\left(\color{red}{\frac{17}{t}+4}\right)}}=\arctan\left(\frac{\color{blue}{t+4}+\color{red}{\frac{17}{t}+4}}{1-(\color{blue}{t+4})\left(\color{red}{\frac{17}{t}+4}\right)}\right)$$ $$=\arctan\left(\frac{x^2+8x+17}{x}\frac{x}{-4(x^2+8x+17}\right)=\pi-\arctan\left(\frac14\right)$$ Above follows since the original integral is positive so we take $\arctan(-x)$ as $\pi-\arctan x $ and therefore getting a negative answer will not be an issue. $$I=\frac12 \left(\pi -\arctan\left(\frac14\right)\right)\int_0^\infty \frac{1}{t^2+2t+17}dt$$ Well, now the inner integral is not hard to compute and the final answer happens to be: $$I=\frac12 \left(\pi -\arctan\left(\frac14\right)\right)\frac14\arctan\left(\frac{t+1}{4}\right)\bigg|_0^\infty =\frac{\pi^2}{16}-\frac{3\pi}{16}\arctan\left(\frac14\right)+\frac18\arctan^2\left(\frac14\right) $$ There are more examples that I found by checking and try such as:  $$I(1,2,9)=\int_1^\infty \frac{\arctan(x+2)}{x^2+9}dx$$ $$I(2,1,6)=\int_2^\infty \frac{\arctan(x+1)}{x^2+6}dx$$ $$I(2,2,13)=\int_2^\infty \frac{\arctan(x+2)}{x^2+13}dx$$ And so on... All those can be solved by the same method: First substitute $x-a=t$, then let $t=\frac{\alpha}{y}$, where $\alpha$ is the "free of x" coefficient from the denominator.   The problem is that I tried more than $100$ combinations to get those integrals which is not that nice. How can we "smartly" find $c$ so that $I(a,b,c)$ is evaluable by symmetry? Or put in other word what should be $c$ if one wants to compute by symmetry $I(7,13,c)$?


Why is the formula $\lim\limits_{h\rightarrow 0}\frac{\sin h}{h}=1$ not valid when $h$ is measured in degrees?

I'm still struggling to understand why the derivative of sine only works for radians. I had always thought that radians and degrees were both arbitrary units of measurement, and just now I'm discovering that I've been wrong all along! I'm guessing that when you differentiate sine, the step that only works for radians is when you replace $\sin(dx)$ with just $dx$, because as $dx$ approaches $0$ then $\sin(dx)$ equals $dx$ because $\sin(\theta)$ equals $\theta$. But isn't the same true for degrees? As $dx$ approaches $\theta$ degrees then $\sin(dx \,\text{degrees})$ still approaches $0$. But I've come to the understanding that $\sin(dx \,\text{degrees})$ approaches $0$ almost $60$ times slower, so if $\sin(dx \,\text{radians})$ can be replaced with $dx$ then $\sin(dx \,\text{degrees})$ would have to be replaced with $(\pi/180)$ times $dx$ degrees.  But the question remains of why it works perfectly for radians. How do we know that we can replace $\sin(dx)$ with just $dx$ without any kind of conversion applied like we need for degrees? It's not good enough to just say that we can see that $\sin(dx)$ approaches $dx$ as $dx$ gets very small.  Mathematically we can see that $\sin(.00001)$ is pretty darn close to $0.00001$ when we're using radians. But let's say we had a unit of measurement "sixths" where there are $6$ of them in a full circle, pretty close to radians. It would also look like $\sin(dx \,\text{sixths})$ approaches $dx$ when it gets very small, but we know we'd have to replace $\sin(dx \,\text{sixths})$  with $(\pi/3) \,dx$ sixths when differentiating. So how do we know that radians work out so magically, and why do they?  I've read the answers to  and followed the links, and no, they don't answer my question.


I have a list of names:  Joe Bob Carl Seth Smith II Doug IV   I am trying to write a regex expression that will return the names, but not the roman numerals.  So my result set should look like:  Joe Bob Carl Seth Smith Doug   I've been looking at negative look aheads, but am pretty new to this so I'm not sure if I'm on the right track.  Thank you!

Thinking about , i decided I can't even create a regular expression that will match roman numerals (let alone a context-free grammar that will generate them)  The problem is matching only valid roman numerals.  Eg, 990 is NOT "XM", it's "CMXC"  My problem in making the regex for this is that in order to allow or not allow certain characters, I need to look back. Let's take thousands and hundreds, for example.  I can allow M{0,2}C?M (to allow for 900, 1000, 1900, 2000, 2900 and 3000). However, If the match is on CM, I can't allow following characters to be C or D (because I'm already at 900).  How can I express this in a regex? If it's simply not expressible in a regex, is it expressible in a context-free grammar?


I have a WCF client class that I would like to run in another thread - the thing is there are events occurring in the client that I would like to handle. Specifically How to Subscribe to them. - the Event itself and invoke of the UI - I have a great InvokeEx example that came form stack..  So for example some quick pseudo code :  class WinFormExample : Form {    public WinFormExample() {    Task.Run(client => client.Start() , TaskOption.LongRunning);  // How Do I subscribe to the events that are occurring in the client // Would I need to create an Instance of InstanceContext in winforms and pass that to the client.Start(instanceContext) method ?  // would it be this way. InstanceContext myInstanceContext = new MyCallbackInstanceContext();    Task.Run(client => client.Start(myInstanceContext ) , TaskOption.LongRunning); myInstanceContext.SomeEvent += MySomeEventHandler(); }   }  class WCFDuplexClient  {  public DuplexClient MyClient  = new DuplexClient(MyinstanceContext, binding, endpoint);  public Start() {  MyinstanceContext.SomeEvent();  }  OR   public Start(InstanceContext myContext, binding, endpoint) {  MyClient  = new DuplexClient(MyinstanceContext, binding, endpoint);   } }   EDIT 11-23-2015  I am not asking about invoking controls on the UI thread; ie How to marshall a subscribed event using Invoke to ensure the UI gets updated.  I am asking about SUBSCRIBING to events that occur in a context that is passed into a Client Class that is running on a different thread. Maybe I just do not understand well enough that my question is not appropriately formed - or I am asking because of my ignorance of a concept here: please I don't know it all I am learning - hence my question. I would like to know the answer before I go about converting my code completely to do this.  I have a WCF Duplex CLIENT class it is continually running receiving data from a process via myContext which is the callback channel. myContext has events. one such is SomeEvent - do I subscribe to that event the same way as subscribing to events that are on the same thread. For example with a Button_Click event it is on the form - I simply Subscribe  Button.Click += myButtonClickHandler;   With a Class running in a different thread my InstanceContext - myContext is a callback channel the client is in another thread executing the instance context is passed into that thread when it is started.  Do I subscribe to it the same way as I subscribed to the button  like this:   myContext.SomeEvent += myContextSomeEventHandler;    or must I perform another manner of capturing the data that the callback myContext receives? - I know some things use a async progress report , some use a backgroundworker - I simply want to capture the data through an event and subscribe to the events.  END of EDIT 11-23-2015

I have a scenario. (Windows Forms, C#, .NET)   There is a main form which hosts some user control. The user control does some heavy data operation, such that if I directly call the UserControl_Load method the UI become nonresponsive for the duration for load method execution. To overcome this I load data on different thread (trying to change existing code as little as I can)   I used a background worker thread which will be loading the data and when done will notify the application that it has done its work.   Now came a real problem. All the UI (main form and its child usercontrols) was created on the primary main thread. In the LOAD method of the usercontrol I'm fetching data based on the values of some control (like textbox) on userControl.    The pseudocode would look like this:  CODE 1  UserContrl1_LoadDataMethod() {     if (textbox1.text == "MyName") // This gives exception     {         //Load data corresponding to "MyName".         //Populate a globale variable List<string> which will be binded to grid at some later stage.     } }   The Exception it gave was     Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on.   To know more about this I did some googling and a suggestion came up like using the following code  CODE 2  UserContrl1_LoadDataMethod() {     if (InvokeRequired) // Line #1     {         this.Invoke(new MethodInvoker(UserContrl1_LoadDataMethod));         return;     }      if (textbox1.text == "MyName") // Now it wont give an exception     {     //Load data correspondin to "MyName"         //Populate a globale variable List<string> which will be binded to grid at some later stage     } }   BUT BUT BUT... it seems I'm back to square one. The Application again  become nonresponsive. It seems to be due to the execution of line #1 if condition. The loading task is again done by the parent thread and not the third that I spawned.  I don't know whether I perceived this right or wrong. I'm new to threading.  How do I resolve this and also what is the effect of execution of Line#1 if block?  The situation is this: I want to load data into a global variable based on the value of a control. I don't want to change the value of a control from the child thread. I'm not going to do it ever from a child thread.   So only accessing the value so that the corresponding data can be fetched from the database.


so when I installed Ubuntu I followed a tutorial that suggested allocating 10-20gb for the / partition so I did. Well I ran out of that space on the first day and I've been struggling a LOT with getting these damn nvidia drivers/cuda drivers to work properly so I don't want to reinstall... So my question is, is it possible, and if so how, to shrink (or delete it completely and just create a new one?) my 200gb /home partition and then allocate about half of that to the root partition? I have 20gb swap, 20gb for root and 200gb for home and that's the whole disk.   I was able to downsize home...   but I can't increase the size of root.

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


I am new to php and stuff like that. But i decided to create my very simple insert page with PDO , so is PDO secure enough against SQL Injection attacks?  Here is my code:   <?php //Database settings  $host = 'localhost'; $dbname= 'akar'; $user = 'akar'; $pass = 'raparen';  //Setting up the PDO $dsn = "mysql:host=$host;dbname=$dbname"; $pdo = new PDO($dsn,$user,$pass);   //Check if user entered something, otherwise set the username variable string to nothing. $username = isset($_POST['username']) ? $_POST['username'] : ''; $password = isset($_POST['password']) ? $_POST['password'] : '';  //Inserting the values to the database using named placeholders  $query = "INSERT INTO users (username,password)  VALUES(:username,:password)"; $statement = $pdo->prepare($query); $statement->execute(array(     ':username'=> $username,     ':password'=> $password ));  ?>   My form:       <input type='text' placeholder='Enter Username here!' name='username' /> <input type='password' placeholder='Enter Password here!' name='password' /> <input type='submit' value='Submit' />  </form>

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


My windows 8.1 pro system has been running great, and I should have left everything alone, but after installing a new graphics card, I thought I'd go ahead and update other drivers.  I made system restore points and updated the USB 3.0 drivers, then restarted.  System restarts fine, but keyboard and mouse are not responsive.  RDP is disabled. PC is on LAN, but I don't know it's IP.  All I'm able to do is hard restart with the reset button. Keyboard works until Windows starts, so I can do whatever until then...  How do I get into system restore mode (before the new USB drivers kick in and disable keyboard and mouse) to roll back to the restore point?

I accidentally installed some USB drivers to my Windows 7 system, they were the wrong ones and now my keyboard and mouse won't work. A system restore would get rid of them, but obviously I can't control my computer to make that happen.  Keyboard and mouse still work before windows has loaded, in the BIOS and boot system, so can I do anything from there? I've already tried booting into another OS, accessing my windows filesystem and deleting the Program Files entry, but it didnt work so they must go deeper than that. Or could i launch it from a remote machine? I've got some VNC server insalled so if i could get that running that could work.


I am making a program that will generate a random number from 1 to 10 in main and store it in specific fields but we are instructed to use Random.java. What codes shall I put in Random.java ?

How do I generate a random int value in a specific range? I have tried the following, but those do not work: Attempt 1: randomNum = minimum + (int)(Math.random() * maximum);  Bug: randomNum can be bigger than maximum. Attempt 2: Random rn = new Random(); int n = maximum - minimum + 1; int i = rn.nextInt() % n; randomNum =  minimum + i;  Bug: randomNum can be smaller than minimum.


I am learning C++ and in my teacher's course, he explained that polymorphism is not compatible with passing by value.   He explained that when you pass an object by value to a method, the compiler generates a copy of the object in the stack, and for optimization reasons he chooses to create a copy of the type of the parent class.   For instance, say I have a class called A, and the class B is a child class of A.  If I pass by value an object of type B, the compiler create a copy of it on the stack but of type A.   My questions are :    Is it always the case? Say I created a Copy Constructer for the class B, does the compiler then use it when I pass an object of type B by value to a method? Or does it still copies a B as an A (object slicing)? If not, why?   Thanks!  Edit : example  // in headers file // for A class A {      public :         virtual void Display() const          { cout << "A::Display() was called << endl; } };  // for B class B : public A {      public :         void Display() const          { cout << "B::Display() was called << endl; } };   Now 3 possibles cases in another file called main.cpp:  case 1:  void f( const A & anA) {     anA.Display(); }  int main()  {     B anB;     f (anB);     return 0; }   case 2:  void f( const A * anA) {     anA->Display(); }  int main()  {     A * anB = new B;      f ( anB );     return 0; }   case 3:  void f( A anA) {     anA.Display(); }  int main()  {     B anB;      f ( anB );     return 0; }   From what I've understood, case 1 and case 2 will display the wanted output (meaning "B::Display() was called"), while case 3 won't (it will output  : "A::Display() was called") even though the Display method was specified as virtual in the A class.

Someone mentioned it in the IRC as the slicing problem.


I would like to insert a page from another presentation (saved as pdf) into another presentation, but i don't want this page to occupy a whole slide, as i want to write something underneath.  Any suggestions?  Thanks

I have a PDF file with multiple figures; each figure is a separate page in the PDF file.  I am using pdflatex, and I would like to use \includegraphics or equivalent to include some of the figures.  Of course I could use an external tool to split the PDF file into multiple one-page PDF files. Then I could use \includegraphics as usual. However, I would have a much simpler workflow if I could avoid this extra step. Hence the question:  How can I include, e.g., page 3 of foo.pdf as a figure?  I am aware that there is a Latex package called pdfpages, but it seems to be designed for something else: with pdfpages, each page in the input file will produce a full page in the final document, not just a box.


For number b :  The order of the median is $13$ , then it lies in the first class $0-1$  Now i do not know what is the lower bound of this class ?  Is it $-0.5$ ?


$n$ divides $2^{2^n+1}+1$ $\implies n$ divides $2^{2^{2^n+1}+1}+1$?  There are two ways to try to prove this. One is above, the other is its de Morgan counterpart: $n$ doesn't divide $2^{2^{2^n+1}+1}+1 \implies$  $n$ doesn't divide $2^{2^n+1}+1$. Disproving it requires only one example of course.  Tried using $\gcd(2^a+1, 2^b+1) = 2^{\gcd(a, b)}+1$ (where $a$ and $b$ are odd positive integers), stuck on both ends. I figured out that if $n$ divides $2^n+1$ then n divides both $2^{2^n+1}+1$ and $2^{2^{2^n+1}+1}+1$ but this implication doesn't work backwards (e.g. $n=57$).  Would appreciate some help.

There are two ways to try to prove this. One is in the title, the other is its de Morgan counterpart: $n \nmid 2^{2^{2^n+1}+1}+1 \implies n \nmid 2^{2^n+1}+1$. Disproving it requires only one example of course.  Tried using $\gcd(2^a+1, 2^b+1) = 2^{\gcd(a, b)}+1$ (where $a$ and $b$ are odd positive integers), stuck on both ends. I figured out that if $n$ divides $2^n+1$ then n divides both $2^{2^n+1}+1$ and $2^{2^{2^n+1}+1}+1$ but this implication doesn't work backwards (e.g. $n=57$).  Would appreciate some help.  EDIT1 Eric's pointer wasn't enough for me. Trying to bump by editing instead of reposting (sorry, not sure how to).  EDIT2 This is not much but might save some time for someone. Using user101140's notation and the $a^n+b^n$ identity  $f(n) = 2^n+1 = 3 \sum\limits_{k=0}^{n-1} (-2)^k$  $f(f(n)) = 3 \sum\limits_{k=0}^{2^n} (-2)^k$  $f(f(f(n))) = 3 \sum\limits_{k=0}^{2^{2^n+1}} (-2)^k$  Also, $n \mid f(n) \implies n \mid f(f(n))$ is due to $n \mid f(n) \implies f(n) \mid f(f(n))$ so the proof might be something along the lines of $n \mid f(f(n)) \implies f(f(n)) \mid f(f(f(n)))$. (Please don't bash me if that's stupid.)


I' m looking at books that take the historical aproach (like  "A Radical Approach to Real Analysis" by David M. Bressoud does for calculus) but with all of the formalism. i.e most of the math should be there but also the history (the failures and the experiments) and the philosophy (justifications)  of the great thinkers/founders of the subject. Of course such a book would have to be enormous if it contained everything! so a curated connected path through major achivements with plenty of references for what's left out is also required. In short: something not for the layman but for someone that already has some exposure to the subject and needs some encompassing view of its devellopment . The level of the math could be at least of graduate engineer level.

I learned thermodynamics and the basics of statistical mechanics but I'd like to sit through a good advanced book/books. Mainly I just want it to be thorough and to include all the math. And of course, it's always good to give as much intuition about the material.  Some things I'd be happy if it includes (but again, it mostly just needs to be a clear book even if it doesn't contain these) are:   As much justifications for the postulates if possible, I'm very interested in reading more about how Liouville's theorem connects to the postulates. Have examples of calculating partition functions, hopefully not just the partition function for the ideal gas.


I have to keep the bootable usb inserted in order to load Ubuntu even after installation in the hard drive, and when it opens up it is the initial try or install menu which existed before installation. While working with partitions, I formatted the windows seven loader partition accidently. Once, after restart, the screen showed 'Missing Operating system' message, though that isn't the case now.

I had Ubuntu 12.04 Beta installed on my computer. When 12.04 was finally released, I made a bootable USB Flash Drive using Startup Disk Creator.  Then I decided to check if this drive works properly and to reinstall the system on my desktop. I must add, my desktop behaves a bit strange when it comes to bootable USB's, it recognizes them as HDD.  In BIOS I changed priority of boot so USB Flash Drive (recognized as HDD) was first. Successfully booted, I installed Ubuntu. Everything worked fine, but...  Now I cannot boot from my real HDD. Every time I want to boot, I put the USB Flash Drive into my computer, boot, safely remove it and everything works.  What do I need to do to repair boot?


I have this block of code here (java):  void findDistance() {                 String name1 = new String();                Scanner s = new Scanner(System.in);                System.out.print("Enter the name of Starting Location: ");                name1 = s.next();                name1 = name1.toLowerCase();                for (int i = 0; i < numCities; i++) {                    System.out.println(name1);                    System.out.println(cityNames[i]);                    if (name1 == cityNames[0]){                    //    int x = i;                        System.out.print("x");                     }                     else {                     //     System.out.println(name1);                     //     System.out.println(cityNames[i]);                           System.out.println("y");                        }                   }                 }   for some reason, even though name1 and cityNames[0] are equal, the if statement doesnt think so. I have a couple of print statements to return the value in there to test it, and it does print as equal.  Anyone have any idea why this is happening?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


How can I define a neighborhood (not only $\delta$ neighborhood) of a point in $\mathbb R$.  without using metric concept.  According to rudin's definition which must be a open set.

I am a Physics undergrad, and just started studying Topology. How do you define neighborhood and open set in Topology.Wikipedia gives a circular definition.   An  is defined as follows.      In topology, a set  is called an open set if it is a neighborhood of every point    While a  is defined as follows:     If $X$ is a topological space and $p$ is a point in $X$, a neighbourhood of $p$ is a subset $V$ of $X$, which includes an open set $U$ containing $p$   which itself contains the term open set.  How do you define it exactly?


Is it because the values in the inverse matrix will have the same positive/negative values?

Let K be nonsingular symmetric matrix, prove that if K is a positive   definite so is $K^{-1}$ .   My attempt:  I have that $K = K^T$ so $x^TKx = x^TK^Tx = (xK)^Tx = (xIK)^Tx$ and then I don't know what to do next.