With my below debugged query, I got error as      ORA-01745: invalid host/bind variable name   Here is the query,  SELECT DISTINCT sv.mkey,   vehicle_no,   TO_CHAR (date_in, 'dd-MM-yyyy')   || ' & '   || time_in vehicleindate_time,   TO_CHAR (date_out, 'dd-MM-yyyy')   || ' & '   || time_out vehicleoutdate_time,   gate_no_in   || ' & '   || gate_no_out ingate_outgateno,   gd.good_type goods_type,   net_weight netweight,   TO_CHAR (challan_date, 'dd-MM-yyyy')   || ' & '   || challan_no challandate_no,   remark_in remarkin,   NULL receipt_no,   date_in FROM xxcus.xxgid_supinv sv,   xxcus.xx_supinv_goodtype gd,   xxcus.xxacl_xxgid_user_mst ms WHERE (gd.good_type_code(+)         = sv.good_type) AND ( sv.project_id                 = DECODE(:'  1368','0', project_id, :'1368') AND TO_CHAR (date_in, 'dd-MM-yyyy') = DECODE(:'  ', '0', date_in, :'  ') AND vehicle_no                      = DECODE(:'  GJ-06-0Z-9202', '0', vehicle_no, :'  GJ-06-0Z-9202') ))  AND sv.delete_flag = 'N'  ORDER BY date_in DESC, vehicle_no   I am using ORACLE. I don't know what's the error. I am not much into i. Kindly suggest.  UPDATE  my code of query  strquerry = "SELECT DISTINCT sv.mkey, vehicle_no, TO_CHAR (date_in, 'dd-MM-yyyy') || ' & ' || time_in vehicleindate_time, TO_CHAR (date_out, 'dd-MM-yyyy') || ' & ' " +                  "|| time_out vehicleoutdate_time, gate_no_in || ' & ' || gate_no_out ingate_outgateno, gd.good_type goods_type, net_weight netweight, TO_CHAR (challan_date, 'dd-MM-yyyy') " +                  "|| ' & ' || challan_no challandate_no,remark_in remarkin, NULL receipt_no, date_in FROM xxcus.xxgid_supinv sv, xxcus.xx_supinv_goodtype gd, " +                  "xxcus.xxacl_xxgid_user_mst ms WHERE (gd.good_type_code(+) = sv.good_type) AND ( " +                  "sv.project_id = DECODE(:'" + cmbProjectName.SelectedValue + "', 0, project_id, :'" + cmbProjectName.SelectedValue + "') " +                  "AND TO_CHAR (date_in, 'dd-MM-yyyy') = DECODE(:'" + txtdatefilter.Text + " ', '0', date_in, :'" + txtdatefilter.Text + "') " +                  "AND vehicle_no = DECODE(:'" + ddlVehicleno.SelectedValue + "', 0, vehicle_no, :'" + ddlVehicleno.SelectedValue + "') " +                  ")) AND sv.delete_flag = 'N' ORDER BY date_in DESC, vehicle_no";

My requirement wholly depends on the QUERY.  I am filtering my gridview on the basis of three parameters.   Project_name (Always required) Date (Not always) Vehicle_No (Not always)   So, what my requirement is,      With project_name either any one can be used for filtering my gridview.   Currently my debugged query works exactly fine for any two parameters.  Below is my debugged query:-  SELECT DISTINCT sv.mkey, vehicle_no,                TO_CHAR (date_in, 'dd-MM-yyyy')             || ' & '             || time_in vehicleindate_time,                TO_CHAR (date_out, 'dd-MM-yyyy')             || ' & '             || time_out vehicleoutdate_time,             gate_no_in || ' & ' || gate_no_out ingate_outgateno,             gd.good_type goods_type, net_weight netweight,                TO_CHAR (challan_date, 'dd-MM-yyyy')             || ' & '             || challan_no challandate_no,             remark_in remarkin, NULL receipt_no, date_in        FROM xxcus.xxgid_supinv sv,             xxcus.xx_supinv_goodtype gd,             xxcus.xxacl_xxgid_user_mst ms       WHERE (gd.good_type_code(+) = sv.good_type)         AND (       sv.project_id = '1368'                 AND TO_CHAR (date_in, 'dd-MM-yyyy') = '26-11-2015'              OR vehicle_no = '0'             )         AND sv.delete_flag = 'N'    ORDER BY date_in DESC, vehicle_no   The above query shows me the exact result for project_name and Date which I entered.  But when I add the third parameter say Vehicle_no it doesn't show the data for that exact vehicle_no it still shows me the same data which I looked for 2 parameters.  I am using Oracle for the database.  LATEST UPDATE WHICH IS NOT WORKING  I am confused as how to deal with the query, as Balazs' solution was working fine when I selected, Project_name, Date and then vehicle_no (not necessary). But it was not fetching proper result when I took first as Project_name, and Vehicle_no. Any guesses why?     The issue  is when I only filter with Project_name and Vehicle_no the date_column value comes as 0 so it doesn't show me any row, which is incorrect as I have data for that Project_name and Vehicle_no.   I have used Balaz's second query for the solution which is below  WHERE (gd.good_type_code(+) = sv.good_type)     AND (       sv.project_id = '1368'             AND TO_CHAR (date_in, 'dd-MM-yyyy') = '26-11-2015'          AND vehicle_no = decode(:vehicle_no, '0', vehicle_no, :vehicle_no)         )


I understand the size reported by ls corresponds with number of inodes inside the directory, not their actual size.  I have noticed peculiar behavior, when displaying directory size with ls. Here is how to quickly reproduce it:  first create empty directory, the size reported by ls is 4096 (as expected)  mkdir test ll -d test/ drwx------ 2 root root 4,096  2015-Dec-29  22:22:36  test/   create 10,000 files inside. Size reported is now 167,936   touch test/{1..9999} ll -d test/ drwx------ 2 root root 167,936  2015-Dec-29  22:23:24  test/   remove all files. Size should decrease back to 4096  rm test/* ll -d test/ drwx------ 2 root root 167,936  2015-Dec-29  22:23:59  test/   But the size is still reported as 167,936.  why?  can somebody explain this?

What does size of a directory mean in output of ls -l command?


In the picture that I drew above, I was thinking that there is definitely loss of energy when the ball rotates off of the inclined plane to the small section of horizontal plane. However, I do not know the mathematical equation to model the theoretical change in velocity. Is there a definite relation between the angle of incline and how much energy is lost?   I was thinking that the velocity at the horizontal section is $v\cos\phi$, where $v$ is the speed of ball at the bottom of the ramp while still on the ramp, and $\phi$ is the angle of incline. However after doing experiments on it, this relation seems not to hold as my final values in the experiment is larger than even the value in theory.  If this relation is correct, how can the result of my experiment be explained?

at point no. 2 in the diagram, let the object accelerates to a velocity v1 (just along the direction of the slope) due to rolling down the ramp. Now, v1 has a x-component as well as y-component.  Now, my question is:  In the diagram, In between the points no. 2 and 3, the object passes over a horzontal distance.  During this part of motion, which statement of the following is true:  i)  the magnitude of the velocity remains constant, i.e. equal to v1, and only the direction changes.  or, ii) the magnitude of the velocity changes, in such a way, that only the x-component of v1 remains still; whereas, the y-component of v1 completely vanishes,  as soon as the object leaves the ramp and gets onto the horizontal trajectory(between the points marked 2 and 3).


ive had debilitating arthritis since I was five and whilst I was younger I enjoyed riding a bike. Unfortunately due to degradation of my hip and lower back joints I am unable to use bikes with long cranks as my hips and back don't allow for the upwards movement.  There is some rotation and upward movement within my hips and back still - I'm able to climb stairs just about for instance.  As I say, would it be possible to adjust the crank length? Would this need to be specialist or would my local second hand dealer be able to do this?  Any help would be greatly appreciated!  Thanks

My father, now in his 70's, had a left knee replacement several years ago. He has limited movement in that knee - probably about 85 degrees on a good day. His knee can extend fully, but cannot bend as much as it should. As a result, he cannot pedal a bike he cannot get his left leg over the top of the pedal stroke.   He is desperate to get back onto a bike, he knows he won't be ripping up the road and winning races like the old days, but wants the freedom to go for a slow easy rides.    Does anyone have suggestions as to a solution to the problem. We don't mind spending money if we know the solution will work, but he can't afford to throw big money at wild ideas that may or may not work. If we find a solution, a new bike is likely.   We have access several mountain bikes in a range of sizes to trail ideas, and we have all the tools and skills to build bikes up from parts and rearrange things as needed.    EDIT: Thanks everyone - all great suggestions. What am am going to do is got tto the LBS and get hold of a cheap set of short cranks for around $30- probably from a kids bike, in the 120-150 size range, and see if he can ride that. Depending how he goes, I'll try a standard right crank and a short left crank. If all else fails, we will go for the Power Cranks   UPDATE: In case anyone else has similar problems. Got some 152mm cranks for $30. Set an old  mountain bike up with the seat as far back as possible. The old man is able to ride reasonably comfortably, now has a smile from ear to ear - any suggestions how to remove it - doesn't fit with the grumpy old man image :)   Has got me wondering how many people with minor knee problems would benefit from short(er) cranks.......


While visiting technical sites to do my job I'm also learning spoilers from movies I want to see. Can you fix this? Current one pertains to movies.stackexchange.com and Infinity War.

This may sound like a 'first world problem', but I am quite easily distracted by the 'Hot Network Questions' sidebar, as I find them quite amusing and some of them quite intellectual  But where the problem lies is that, even at work, if I google something up and find a solution on Stack Overflow, to some random problem I am working at, I (always) get distracted towards them (Hot Network Questions), and end up reading the whole Qs as well as As of that respective question, and this is adversely affecting my productivity.  Any suggestion would greatly help.


I am working on a problem that I can not seem to finish. Find the gcd of $f(x)=x^7+1$ and $g(x)=x^6+x^5+x^3+1$, and express it in the form $a(x)f(x)+b(x)g(x)$ using the extended euclidean algorithm. I have performed the extended euclidean algorithm to find the following $$f(x)=(x-1)g(x)+(x^5-x^4+x^3-x+2)$$ $$g(x)=(x+2)(x^5-x^4+x^3-x+2)+(x^4-x^3+x^2-3)$$ $$x^5-x^4+x^3-x+2=(x)(x^4-x^3+x^2-3)+(2x+2)$$ $$x^4-x^3+x^2-3=(\frac{1}{2}x^3-x^2+\frac{3}{2}x-\frac{3}{2})(2x+2)+0$$ This should give us the GCD as following $$\gcd(f,g)=\gcd(x^5-x^4+x^3-x+2, 2x+2)=2x+2$$ And the monic GCD then becomes $$\gcd(f,g)=x+1$$ This is where I get stuck. Now that I have this I am not sure how to algebraically get back to the form $a(x)f(x)+b(x)g(x)$ The answer as provided in the solutions is $$\gcd(f(x),g(x))=x^4+x^3+x^2+1=xf(x)+(x^2+x+1)g(x)$$ I do not understand how to proceed and get to the answer. I have tried going backward but I am not getting anywhere. How do I go from $x+1$ to the correct solution?

Suppose I know that I can find the $\gcd$ of two integers with the Euclidean algorithm. What is the 'extension' so I can use this method also for polynomials?  Edit: I found an easy answer with less rigor which is approachable without knowledge of matrices:    also the first 3 subchapters of


Just wonder if there is any shortcut in R to add the quotation mark to a vector? So it will be like c(lemon, orange, apple) to c("lemon", "orange", "apple") without manually going to each item to change it since sometimes many items can be in a vector. Thanks.

Anyone know if R has quote-like operators like Perl's qw() for generating character vectors?


I was looking for command to print only directory names in linux. I came across this novel syntax, where we can put two hyphens adjacent without any word.  ls -ld -- */   What is the meaning of this double hyphen (--) in this command and in general in linux commands?

I have seen -- used in the compgen command.  For example:  compgen -W "foo bar baz" -- b   What is the meaning of the -- in there?


I'm trying to identify why, suddenly, 100% of our disk space is in use. I have already rebooted but the issue persists.  Here are the outputs of some commands that are showing some strange (for me) results:  danny@hydrogen:~$ df -h  Filesystem            Size  Used Avail Use% Mounted on /dev/cciss/c0d0p1     130G  122G  949M 100% / none                  1.9G  196K  1.9G   1% /dev none                  2.0G     0  2.0G   0% /dev/shm none                  2.0G   40K  2.0G   1% /var/run none                  2.0G     0  2.0G   0% /var/lock none                  2.0G     0  2.0G   0% /lib/init/rw   danny@hydrogen:/$ sudo du -chs /  du: cannot access `/proc/1662/task/1662/fd/4': No such file or directory du: cannot access `/proc/1662/task/1662/fdinfo/4': No such file or directory du: cannot access `/proc/1662/fd/4': No such file or directory du: cannot access `/proc/1662/fdinfo/4': No such file or directory   danny@hydrogen:/$ df  Filesystem           1K-blocks      Used Available Use% Mounted on /dev/cciss/c0d0p1    135342296 128144108    323104 100% / none                   1991336       196   1991140   1% /dev none                   1995788         0   1995788   0% /dev/shm none                   1995788        40   1995748   1% /var/run none                   1995788         0   1995788   0% /var/lock none                   1995788         0   1995788   0% /lib/init/rw   danny@hydrogen:/$ mount  /dev/cciss/c0d0p1 on / type ext4 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) none on /sys type sysfs (rw,noexec,nosuid,nodev) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) none on /dev type devtmpfs (rw,mode=0755) none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) none on /dev/shm type tmpfs (rw,nosuid,nodev) none on /var/run type tmpfs (rw,nosuid,mode=0755) none on /var/lock type tmpfs (rw,noexec,nosuid,nodev) none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)   danny@hydrogen:/$ sudo du -h --max-depth=1  634M    ./premvet_sync 5.6M    ./etc 4.0K    ./opt 16K ./lost+found 7.4M    ./bin 623M    ./lib 196K    ./dev 0   ./sys 4.0K    ./srv 4.0K    ./cdrom 8.0K    ./media 52K ./tmp ... it hangs for ages here.....   The server is running Ubuntu 10.04.4 LTS.  System load:  2.85                Temperature:         8 C Usage of /:   94.7% of 129.07GB   Processes:           132 Memory usage: 39%                 Users logged in:     0 Swap usage:   0%                  IP address for eth0: 192.168.1.124  => / is using 94.7% of 129.07GB   I'm struggling to comprehend why this is happening! Any pointers would be appreciated.

I have only one disk in my computer, a 80 GB SSD. It is formatted as a single ext4 partition (no swap), and all the usual folders are installed on it (I keep lots of data on external media, but /home and all the rest is on the SSD).   Today I booted it and I got a message that the drive is full. I opened Disk Usage Analyzer to look at what takes up space. It insists that 67.8 GB of the disk are used, and that / is taking up 36.4 GB. Which leads to the question, where are the missing 30 GB, if not on the file system?!    Just to have a comparison, I added up all the sizes of all readable folders listed in Nautilus as subfolders of / (including the hidden ones). I got 20.9 GB. Trash was unreadable, but I know it has 16.2 GB, so the sum is 36.1 GB, around the same as what Disk Usage Analyzer is reporting. There were some system folders which were unreadable, like proc, but I doubt that they add up to 30 GB - else it wouldn't be possible to install Ubuntu on small disks, and I've seen it run on 2.5 GB. I think they must be the 0.3 GB difference between my calculation and the Disk Usage Analyzer's report.   So I'd like to know, what is eating up these 30 GB and how do I get it to free them?     Edit with answers to CYREX's questions   Booted from Ubuntu 10.10 64-bit live CD (same as my system).  fsck result:   root@ubuntu:~# fsck /dev/sda1 fsck from util-linux-ng 2.17.2 e2fsck 1.41.12 (17-May-2010) /dev/sda1: clean, 265956/4890624 files, 18073343/19537408 blocks  Booted from the SSD. Emptied the trash, and the 16 GB from there are now free. The 30 GB are still missing.    I'm not experienced enough to know what counts as weird in a log. Here are my messages log and my syslog since last boot. Maybe you can find something in them:       Here it got really strange. I plugged in an external 500 GB HDD. Disk Usage Analyzer overreported the available space, then showed space missing (76 GB used, but only 24 in folders).      Booted again from the LiveCD, started the Disk Usage Analyzer from it and got the same results as from the installed Ubuntu, within 1-2 GB.   Edit with answer to CodeMonk:  That would have been a nice solution, but the partition is really 80 GB - I mean 74 GB + marketing "error", anyway the whole disk is formatted. It also shows that over 50 GB are used, so where are the 30 GB if not in files and folders?    GParted also reports the correct size of the external HDD.


My android was working fine until one day, i saw     Error retrieving information from server. [DF-DFERH-01]   with a RETRY button.  This is happening only in the "My wishlist" menu. No errors before.  I have ZTE Blade III with android 4.0.4 Ice Cream Sandwich.  SCREENSHOT:

I have a Storex eZee Tab 702 tablet. My Google Play Store was working very well until a few weeks ago, when it started saying,     Error while retrieving information from server [DF-DFERH-01]   I tried to clear the cache, clear the data, force stop, and downloading another Google Play Store, but I'm still having the same problem.  How can I fix this issue?


I have a nuclear family consisting of dad, mom, me and my younger sister. Our birth week i.e. week in which we were born are linear according to our date of birth i.e. my father who is oldest was born on wednesday, my mom on thursday, me on friday and finally my sister(who is youngest) on saturday.   When i was small i used to think this was always the case with any family (this was my definition of being a family) but this is surely not right but actually quite rare to happen. So, i was just wondering given a size of nuclear family consisting of n members (mine is 4) what is the probability that it will have exactly this condition as mine given known number of families in the world(hypothetically).

I share the same birthdate as my boyfriend, same date but also same year, our births are seperated by merely 5 hours or so.  I know that the chances of meeting someone who was born on the same date than me is fairly high and I know a few people with whom I share my birthday although for the little I've read about the birthday paradox, it doesn't take same year into account.  We've argued before about the probabilities and I am still not satisfied. My point was that the chances are tiny if you consider the probabilities of being in a relationship (+ being successful at it for X amount of time). I find the amount of factors to take into account quite vast (up to a point, gender and age, availability, probabilities of separation in our region, etc.)  Is it even possible to calculate the probabilities on something like this? How would you go about it?


Given a short exact sequence of sheaves on $X$:  $0 \rightarrow \mathcal{A} \rightarrow \mathcal{B} \rightarrow \mathcal{C} \rightarrow 0$  Then there is an induced exact sequence on the left on global sections:  $0 \rightarrow \mathcal{A}(X) \rightarrow \mathcal{B}(X) \rightarrow \mathcal{C}(X)$  I'm studying on Bredon's book, and there the proof of this statement is said to be trivial because "look at stalks". But to me is not so trivial, because with stalks one loses all the global information about a sheaf.  So, why is this true?

I'm reading Differential Analysis on Complex Manifolds by Raymond O. Wells. It states the following in the beginning of section 3 of chapter 2 on page 51:  Consider a short exact sequence of sheaves:  $$0 \to \mathcal{A} \to \mathcal{B} \to \mathcal{C} \to 0$$  Then it is easy to verify that the induced sequence  $$0 \to \mathcal{A}(X) \to \mathcal{B}(X) \to \mathcal{C}(X) \to 0$$  is exact at $\mathcal{A}(X)$ and $\mathcal{B}(X)$ but not necessarily at $\mathcal{C}(X)$. After that they give an example of failing exactness at $\mathcal{C}(X)$.  My problem is that Ii dont see why the induced sequence has to be exact at $\mathcal{A}(X)$ and $\mathcal{B}(X)$. I tried to find an answer in other books. In the book Sheaf Theory by Bredon they make the same statement in proposition 2.2 but they also state it is easy to verify.  I tried to come up with an argument of my own and got something like this (the argument is wrong i think): If we have the zero element  $0 \in \mathcal{B}(X)$ this should induce a section $\tilde{0} $ of the stalks of $\mathcal{B}$ and should take the value of the zero element in every stalk. Then since the sequence of sheaves is exact (and thus exact in stalk level) we get that around every $x \in X$ there should be an open $V$ such that $\tilde{0}|_{V}$ is the image of the zero section in $\mathcal{A}(V)$ and since $\mathcal{A}$ is a sheaf we can patch these together to get a global zero section.  Also while i get the example that shows inexactness at $\mathcal{C}(X)$ i dont get why this should generally be the case.  Any help would be much appreciated


after installing Ubuntu 13.04 alongside with windows 7,my laptop restarted but entered to windows 7 without letting me choose between 7 & Ubuntu !!    my laptop (Lenovo G580)

I'm tring to install Ubuntu 13.04 on my PC desktop but when i restart my PC, it always starts Windows 7, without asking me which OS would i like to run. I've got 3 HDD on my PC:     1: 200 GB with Win7   2: 500 GB partitioned with 4 GB of Swap, 150 GB of /home and the others GB of root (/)   3: 2 TB of various data.   I think the bootloader is on sda1, and during the installation of Ubuntu 13.04 I can't install a bootloader on that partition (fatal error). What should i do?  Here my log of fdisk:  ubuntu@ubuntu:~$ sudo fdisk -l  Disk /dev/sda: 203.9 GB, 203928109056 bytes 255 heads, 63 sectors/track, 24792 cylinders, total 398297088 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xdf56df56     Device Boot      Start         End      Blocks   Id  System /dev/sda1   *          63   398296937   199148437+   7  HPFS/NTFS/exFAT  WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't     support GPT. Use GNU Parted.   Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000     Device Boot      Start         End      Blocks   Id  System /dev/sdc1               1  3907029167  1953514583+  ee  GPT Partition 1 does not start on physical sector boundary.  Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x272196e3     Device Boot      Start         End      Blocks   Id  System /dev/sdb1            2046     7815167     3906561    5  Extended /dev/sdb2         7815168   300785663   146485248   83  Linux /dev/sdb3       300785664   976771071   337992704   83  Linux /dev/sdb5            2048     7815167     3906560   82  Linux swap / Solaris


In this what I will for Set a Default From Email Address.   Messaging.SingleEmailMessage EmailMessage = new Messaging.SingleEmailMessage();  EmailMessage.setTargetObjectId(opp.Applicant_Student_Record__c);  EmailMessage.setTemplateId(et.Id);  EmailMessage.setWhatId(opp.Id);  EmailMessage.setSaveAsActivity(false);  EmailMessage.setReplyTo('test@solution.com');  EmailMessage.setSenderDisplayName('Development');  EmailMessage.setFileAttachments(Attachment);  emails.add(EmailMessage);

I want to set a from address in a salesforce SingleEmailMessage, but can't see a way to do this and there is no standard method described in the documentation.   I want the email to be sent from doNotReply@blahblah.com, however, the email address of the user editing the record (which triggers the email send) is used as from address.  I'm using the following code:  mail.setReplyTo(fromaddress); mail.setSenderDisplayName(fromaddress);   But my code only changes the display name, not the email address.  Full code:   public static void sendSingleMail(id objId, ID templateId, string fromaddress) {      Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();     mail.setReplyTo(fromaddress);     mail.setTemplateId(templateId);     mail.setTargetObjectId(objId);     mail.saveAsActivity = false;     mail.setReplyTo(fromaddress);     mail.setSenderDisplayName(fromaddress);      ErrLogger.logger('Email being sent to :');     ErrLogger.logger('objId found:  ' + objId);     ErrLogger.logger('templateId found:  ' + templateId);     ErrLogger.logger('fromaddress found:  ' + fromaddress);      Messaging.sendEmail(new Messaging.SingleEmailmessage[] {mail}); }


I have had an issue with my PhD advisor where they were essentially attempting to coerce me into inappropriately adding them as a co-author on a paper that they had no part in. They agreed that they should not be an author according to ethical standards, but essentially threatened me that there would be "problems with my graduation" if I did not add their name to the paper. They have refused to collaborate with me on this paper as well as any future paper because they "are too busy" and "no professors really do research".  This appeared to be a very serious ethical breach to me, so I immediately went to the department chair to describe the situation, and started looking for a new PhD advisor. However, some of the reactions I got to the situation disturbed me. The chair of my department openly stated that all of my research is "owned" by my advisor (whatever that means) and implied that I was a bad student for not adding my advisor to the paper. He even went so far to suggest that I add my new advisor's name to the (finished) paper in order to start off on good terms! Another professor trivialized the problem, stating that compared to what many PhD students have to deal with gift authorship is "not that bad". A third professor stated that it was clearly unethical, but that it was unfortunately the norm.  It seems to me based on this small sample size (as well as hearing other PhD student's experiences) that gifting authorship to uninvolved PhD advisors is rampant. This is obviously a terrible practice. Is this behavior really rampant in academia? And if so, what happens to PhD students who refuse to participate in this practice?  A further point about my situation: I am in a theoretical scientific field where there is no lab, etc., so there is no complications arising from that sort of thing. Although even if I were working on a grant and using lab equipment gift authorship would be unethical.

I work in a field (Philosophy) where co-authorship is uncommon and advisors and grad students very seldomly co-author a paper. I've seen a lot of posts on Academia.se though about the ethics of co-authoring papers with mentors, such   My sense is that it must be somewhat common in the natural sciences for the head of the lab/dissertation advisor to be automatically added as a co-author to every paper that his or her graduate students produce.   My questions are:   Is this really common, and if so, in which fields? Is this really ethical?    My view is that adding your name to something that you had no part in creating is just plagiarism: it's taking credit for the work of others.   The opposite argument, that the work wouldn't have been possible without the PI's grant funding also cuts no ice. I wouldn't have been able to write my dissertation if my parents hadn't had sex, but that doesn't mean they should get credit as coauthoring my work.   That's the way it seems to me, but maybe somebody from these fields can give us a better rationale for (what seems to be) the widespread practice.  Edit: Another argument against the practice. Suppose I'm a billionaire who knows nothing about science, but I take it into my head that I want to be (regarded as) a famous scientist. Suppose I just spend billions of dollars to fund other people to do research. But, I ask each of those people to come and report to me for fifteen minutes ever week about what they've worked on, or discovered that week. Then, every time one of them finds a result, I demand that my name be added to the paper as a co-author, since we have "discussed" the work in progress and it is, after all, by my grace that the funds for the work have been provided. Suppose I just have hundreds of these postdocs, producing thousands of papers a year, all of which I am a coauthor for.   Now ask yourself if I really deserve to be regarded as a famous scientist at all? It seems to me that I don't, because I haven't done any of the science--I haven't suggested any research methods, I haven't designed any experiments, I haven't collected any data, I haven't even helped junior researchers know the shape of the existing literature. You might regard my existence as good for science in some sense--you might think of me as a beneficial patron of the sciences. But you wouldn't think of me as a scientist, right? And you wouldn't think I deserved to be considered for a Nobel Prize, or membership in the American Academy of the Arts and Sciences, or whatever. If I demanded that I be given those awards because of the thousands and thousands of papers that I have coauthored, which have been cited tens of thousands of times, you would call me an idiot, right? We give those prizes for discovery, not for being rich. The same thing is true of tenure too. You shouldn't be able to buy your role as a tenured professor. You should have to prove that you, personally, are capable of making a serious contribution to your field. And of course you demonstrate that capability by publishing papers.  So when a prof is automatically added as a coauthor to a paper that he or she did not contribute to in any way except financially, then she is trying to buy a reputation as a scholar, or the other perks like tenure or membership in the AAAS that come with that reputation in just the same kind of way that the absurd billionaire is doing.


If I have money taken from a paycheck, it comes out pre-tax. Not just state/federal, but pre-FICA too.  I am closing on a home and won't have a house payment until February. For this reason I am considering NOT contributing any HSA money through my paycheck and instead writing a check for the MAX HSA contribution in early January into my account. This contribution is simply out of a bank account hence it is post tax. So my question is: When I file taxes for this year will the amount I owe/get be offset by the same amount or is there an inherent benefit to having the payroll deduction?  The reason I want to do this is:   I have pre-spent medical for the entire year and can immediately withdraw this money back into my account, so there's no out of pocket expense here other than missing the money for a week or two. I will get a higher paycheck for the rest of the year since I am not contributing per check. This will be more helpful after starting a house payment. Although I'll pay slightly more in taxes per check (higher brackets all year), this would again work itself out at tax time.

So I know that:   Employer-sponsored HSA's allow you to deduct contributions directly from your paycheck, pre-tax With individual HSAs, you must contribute using post-tax dollars, then deduct those contributions from your taxable income when you do your taxes   Given those facts, I guess it's marginally better to use an employer-sponsored HSA because it means the government doesn't temporarily hold on to your taxed income, only to return it later after you do your taxes; you could theoretically put that money to work in an investment vehicle instead of having the government hold it hostage for a while.  But are there any other benefits (either way) that I'm not aware of? The  kind of threw me with the following statement:     The main advantage of making pre-tax contributions is the Federal Insurance Contributions Act tax (FICA) and Medicare Tax deduction, which amounts to a savings of 7.65% each to the employer and employee (subject to limits of the Social Security Wage Base).   But I'm not really sure what that's telling me.  My employer is offering an HSA, but is not offering to contribute to the HSA or match my contributions. So if it's all pretty much the same, I'd rather use the bank of my choosing and manage it privately.  Thanks.


Need MacBook keyboard command to restart computer MacBook Model A1342 (got it around 2012) I do not see a print screen button, link to keyboard layout:

I'm using the , which doesn't have the SysRq key:    What key(s) should I press for the  when I need to type ?


When I am writing a bash script like the following:  #!/bin/bash  nc localhost [pseudoport] echo "test"   it connects to the server but does not send the text "test".  It works with   #!/bin/bash  echo "test" | nc localhost [pseudoport]   The problem here is that the connection exits after something has been received.  How can I send multiple messages, in my case a fixed preamble followed by a variable data?

I am trying to use netcat to send a simple message over TCP, e.g. I want to send the digit 1.  So I understood that I write the following in the terminal, after installing netcat  netcat [ip-address] [port]  But how do I specify the message to be sent? i.e. where to I write "1" ?


I saw the following in /etc/shells -    % cat /etc/shells # /etc/shells: valid login shells /bin/sh /bin/dash /bin/bash /bin/rbash /bin/zsh /usr/bin/zsh   I want to know if there is a difference betweem /usr/bin/zsh and /bin/zsh ?  I did chose /usr/bin/zsh as it has to be interactive login and CTE skills.

The /etc/shells says it has zsh installed in /bin/zsh, but also in /usr/bin/zsh.  brgr@envy17:~$ cat /etc/shells  # /etc/shells: valid login shells /bin/sh /bin/dash /bin/bash /bin/rbash /usr/bin/tmux /usr/bin/screen /bin/zsh        <-- /usr/bin/zsh    <--   Now, the  suggests me to use the one from /usr/bin/.  My question is: why? What is the difference between these two and why is bash for example only intalled at one path (/bin/bash)?


I'm mostly reviewing stuff over at the gamedev SE. A late answer can also show up in the first posts section. If I review it in either of those two, it does not show up in the other one. If, however, I open each section in a separate tab, and the same answer shows up in both tabs, I can review it twice (no error whatsoever, it just works).  For example:  and , both on  the same answer.  Is this a known issue? Or is it an issue at all? Since a normal review under a section makes the answer disappear from the other, I'm guessing this is kind of an exploit.

I appear to have earned a 'point' for a single review in two queues, by flicking quickly between queues:    and...    I don't mind much really, but this seems incorrect.


Suppose I'm reviewing a question which has been edited after being closed. Significant changes have been made, and the result does not fit the original reason for closing the question. However, IMO it should be closed - for another reason.   For example: Before the edit, the grammar was terrible, the sentences didn't make sense and the code was an off-site link. After the edit, I can read the question, but it seems off-topic to me; or maybe I don't understand why OP wants to do what s/he is asking us about.  Question: In this situation, should I Leave Closed, Reopen, or Skip?  Note: If I Leave Closed, as many suggest, the user would still see the original reason for closing. Sure, they'd have my comment, but it would be a case of mixed-messaging. Also, it might not be fair to them that "close" the question for a different reason using just my single opinion, rather than requiring multiple close votes for the new reason.

About reviewing The review queues contain posts that possibly need further action from the community, like improvement, closure or deletion. By presenting those posts for peer-review, the system aims for higher quality content. Some user actions, such as suggesting an edit, casting a flag, close vote or reopen vote, or posting for the first time, can trigger the inclusion of a post on a review queue. There are also posts included on the queues algorithmically, such as the contents of Late Answers and Low Quality Posts. General guidelines  Always read the full post you are reviewing. Don't rush. Take the necessary time to read the post carefully. If you don't care about a post, just click Skip or Not sure. When you need more context, open the post link to see the question and all answers. Most posts coming up for review can be improved. Use the Edit option, and edit thoroughly. If you're unsure how to review a post (perhaps it's outside your areas of expertise), skip it. Someone who understands it better will review it later.  Guidelines for specific review queues         (Stack Overflow only)


I've often heard as a rule of thumb that if you have both, go with fresh.  But are there exceptions to that?  Are there times when using dried herbs is preferred?

Sometimes I see a recipe call for dried herbs. If I have access to fresh herbs, should I go for fresh herbs instead? Is there any benefit in using dried herbs with some recipes?


I am trying to generate a report of which room in each branch have the highest cost_maint in Oracle RDBMS. Is it true that this can only be done by self joining table, is it possible to achieve the result by using subquery? Maintenance_Record Table: ROOM_NO    BRANCH_ID  COST_MAINT ---------- ---------  ----------          1 B001      23500          2 B001       3750          2 B001       4000          3 B001      23000          5 B001       5300          9 B001      25000         43 B002       2500         44 B002       5300         48 B002       3750         49 B002       3000         49 B002       3750         53 B003       4000         56 B003       4000         68 B003       4000         75 B003      25000         85 B004       5800         86 B004       3000        120 B005      25000  Expected Output / Report :  ROOM_NO    BRANCH_ID  COST_MAINT ---------- ---------  ----------          9 B001      25000         44 B002       5300         75 B003      25000         85 B004       5800        120 B005      25000

Table:   UserId, Value, Date.   I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle)  Update: Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date.


In how many ways can we put n indistinguishable balls into m distinguishable boxes, where m > n?

I know that the formula for counting the number of ways in which $n$ indistinguishable balls can be distributed into $k$ distinguishable boxes is $$\binom{n + k -1}{n}$$  but I am having a hard time understanding why this formula counts that. I mean, suppose we have $4$ boxes and $3$ balls, then the problem is equivalent to count the permutations of  5 vertical lines with 3 circles except that two lines have to be fixed (the first and last lines). I would appreciate if someone could help me to relate and translate this way of thinking the problem to the formula with this. Thanks in advance.


We know that if $G$ is a topological group and $C \subseteq G$ is compact and $A \subseteq G$ is closed, then $AC$ , $CA$ are closed.  Is it right to say:     The product of two closed subgroups in topological groups is  closed?

Just out of curiosity: If $G$ is a topological group and $H, K$ are closed subgroups, is $H\cdot K$ a closed subgroup?  Thanks!


I have a code that looks like this :   \[\Omega_\Lambda{}_0 = 0,6911 \tag {2}\]   in the pdf the (2) has round parentheses. I would like square brackets [] to figure instead : [2]  Can you give me the correct code.  Thanks

Does anyone knows how can I use square brackets instead of parenthesis when numbering my equations?  I used this command:  \begin{equation} y = 2x \end{equation}     The number appears on the right hand side like (1) I want to make it [1].  Does anyone have any ideas?


What does it mean that for small $x$, one has $\ln(1+x)=x$? How can you explain this thing ? Thanks in advance for your reply.

I plotted the graphs of $x$ and $\ln(x+1)$ and found they meet when $x= 0$, is there any way to show this analitically? I tried $e^x = x+1$ but its actually the same


Here is my data set.  public class StudentData {      public static List<Student> getData() {         //student id,name,std, and hobbies         return Arrays.asList(new Student(1, "a1", 1, Arrays.asList("cricket", "football", "basketball")),                 new Student(2, "a2", 1, Arrays.asList("chess", "football")),                 new Student(3, "a3", 2, Arrays.asList("running")),                 new Student(4, "a4", 2, Arrays.asList("throwball", "football")),                 new Student(5, "a5", 3, Arrays.asList("cricket", "basketball")),                 new Student(6, "a6", 4, Arrays.asList("cricket")), new Student(7, "a7", 5, Arrays.asList("basketball")),                 new Student(8, "a8", 6, Arrays.asList("football")),                 new Student(9, "a9", 8, Arrays.asList("tennis", "swimming")),                 new Student(10, "a10", 8, Arrays.asList("boxing", "running")),                 new Student(11, "a11", 9, Arrays.asList("cricket", "football")),                 new Student(12, "a12", 11, Arrays.asList("tennis", "shuttle")),                 new Student(13, "a13", 12, Arrays.asList("swimming")));     }  }   From data set , i am finding , how many student based on hobbies and display the value in asc/desc order. For example : cricket ,4 and swimming: 2 and so on. here is the code for group by hoppies .  Map<String, Integer> collect8 = data.stream()                 .flatMap(x -> x.getHobbies().stream().map(y -> new SimpleEntry<>(y, x)))                 .collect(Collectors.groupingBy(Entry::getKey, Collectors.mapping(entry -> entry.getValue().getId(),                         Collectors.reducing(0, (a, b) -> a + b))));   output of collect8  :{running=13, swimming=22, shuttle=12, throwball=4, basketball=13, chess=2, cricket=23, boxing=10, football=26, tennis=21}  After that i am doing  asc sorting by value .  Map<String, Integer> collect9 =                  collect8.entrySet().stream().sorted(Map.Entry.<String, Integer>comparingByValue()).                 collect(Collectors.toMap(e->e.getKey(), e->e.getValue()));         System.out.println(collect9);   output of collect9 : {running=2, swimming=2, shuttle=1, throwball=1, basketball=3, chess=1, cricket=4, boxing=1, football=5, tennis=2}  1.it is not sorted and giving the same result.any idea?  2. i am writing separate code for sorting. is it possble to do in collect8 itself?

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?


My code is supposed to read a file line by line, to put each one in a string array named: tuples, (tuples=ligne.split(" "); ) and then add this tuples to an arraylist, one line read = one element of the arraylist. Unfortunately, my code doesn't work! My buffered reader throws a   NullPointerException in my loop!  Error returned in the ExtractFile() method, line 120: tuples= ligne.split(" ");  File file = new File("Department.txt");  BufferedReader in; PrintWriter out; String ligne; int nbCols; //number of metadatas in my file.txt    String metadata[] = new String[nbCols]; String[] tuples = new String[nbCols];//1ere case indique num ligne  ArrayList<String[]> itemset = new ArrayList<String[]>();  public ArrayList ExtractionFile () {     try {         int i = 1;         in = new BufferedReader(new FileReader(file));         while ((ligne = in.readLine()) != null) {             while (ligne.charAt(0) != '1') {                 ligne = in.readLine();//browse until line 1 is found             }             tuples = ligne.split(" ");             itemset.add(tuples);             System.out.println(Arrays.toString(itemset.get(0)));             for (i = 2; i < TuplesCount(); i++) {                 ligne = in.readLine();                 tuples = ligne.split(" ");// THIS LINE THROWS THE EXCEPTION                 itemset.add(tuples);                 System.out.println(Arrays.toString(itemset.get(i)));             }         }     } catch (IOException es) {         es.printStackTrace();     } catch (ArrayIndexOutOfBoundsException exepti) {         exepti.printStackTrace();     }     return itemset; }

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


Context: I want to utilise state objects within my program to determine how the program functions during a state. I have an abstract class State that each state derives from (to keep things simple lets say we have MenuState and AboutState), The current state is stored as type State.  I want to be able to create a new instance of AboutState from within MenuState and vice versa so that I can control which program state I am currently in and change state easily (This would return a State object since that is what my current states type is)  The problem I am getting is obviously that if I first create AboutState, MenuState does not exist yet (to the compiler) and crashes on compile. I thought to fix this by forward declaring MenuState but I cannot cast MenuState in the function because I have only forward declared it rather than creating a full class.  Essentially How do I forward declare / fix this circular reference issue, so that I can create each of the objects from the other?  I primarily use Java so excuse the obvious errors below but you get the point, I can't cast temp -> IWorldState even if I forward declare. (I think)  class AboutState : public IWorldState { public:     AboutState() {};     virtual IWorldState* handleInput(std::string input) {         MainMenuState temp;                 *IWorldState state = (IWorldState)temp;         return state;         } };  class MainMenuState : public IWorldState { public:     MainMenuState() {};     virtual IWorldState* handleInput(std::string input) {                  AboutState temp;                 *IWorldState state = (IWorldState)temp;         return state;         } };   Also don't know know if It's ok to ask in the same question, but is there a more appropriate way to do this kinda functionality with objects or is there a different type of approach to moving between the different states? I considered the idea of creating all states at the start and passing the next state as a parameter to the constructor but i feel It's unnecessary if I can get this working.

I often find myself in a situation where I am facing multiple compilation/linker errors in a C++ project due to some bad design decisions (made by someone else :) ) which lead to circular dependencies between C++ classes in different header files (can happen also in the same file). But fortunately(?) this doesn't happen often enough for me to remember the solution to this problem for the next time it happens again.  So for the purposes of easy recall in the future I am going to post a representative problem and a solution along with it. Better solutions are of-course welcome.     A.h  class B; class A {     int _val;     B *_b; public:      A(int val)         :_val(val)     {     }      void SetB(B *b)     {         _b = b;         _b->Print(); // COMPILER ERROR: C2027: use of undefined type 'B'     }      void Print()     {         cout<<"Type:A val="<<_val<<endl;     } };       B.h  #include "A.h" class B {     double _val;     A* _a; public:      B(double val)         :_val(val)     {     }      void SetA(A *a)     {         _a = a;         _a->Print();     }      void Print()     {         cout<<"Type:B val="<<_val<<endl;     } };       main.cpp  #include "B.h" #include <iostream>  int main(int argc, char* argv[]) {     A a(10);     B b(3.14);     a.Print();     a.SetB(&b);     b.Print();     b.SetA(&a);     return 0; }


Can I get $\cos(x)/\!\cos(y)$ if I have $\sin(x)/\!\sin(y)$?

Is it possible to find $\displaystyle{\cos x \over \cos y}$ if $\displaystyle{\sin x\over \sin y}$ is given? If so, how would one approach this problem? Thank you in advance!


Really straight forward question here, basically I have a few doors I want to render with an alpha layer and a shadow catcher, then I want to use the compositor to add in a PURE white background ( HEX: FFFFFF ).   Even though I have a pure white selected in the compositor when I render it and use a color tester it is quite a bit less than PURE white ...   Must be missing something simple I guess ?  Here is my compositing setup ( you can see my HEX code ):   Here is my test of the result ( which is not pure white ):

I'm following  and I've set my compositor up in the exact same way as he did, except my background is like a slightly light grey and I don't know why.  In his video's he's getting a bright white as his background and I can't see where I'm going wrong.  Here's the render:   Here's the compositor window:    file.  Please help! I really want to know why it's not happening.


As you can see in the image, the selected face (on the right) is distorted. I have four questions here:  (1) Why does it happen?  (2) Does it affect the final output when rendering?  (3) How to fix it?  (4) Is it a bug? (If so, should I report it or is that already done by someone?)

I think my question relates to a fundamental of 3D modeling that I haven't picked up on yet. It's very simple:  Let's say I have a flat quad. A plane on the XY plane inserted into am empty blender file is a great example. Now let's say I start moving each of the 4 vertices around on in any direction, especially the Z axis.   At this point, there would still be one face, but its extremely unlikely that the face would be planar (I just learned this word). So blender does its best to make sense of what this should look like.  The problem I'm having is that it seems like my quads are always like this, but they never look the way I want. There are edges and seams that look like they are dangling in space, and what tends to happen is that my mesh looks great when viewed from most angles, but if you look at it from just the right angle, you notice the dangling edges or sometimes even some kind of impossible geometry. And so I might try to nudge the problematic vertices around, but this often seems to either make it worse, or just hide the bad geometry until you see it from a different angle.  For me, this always seems to happen whenever I'm trying to move vertices to add roundness to something that is originally square.   There is another question on here about how to actually flatten the quads. That's great, and I might use some of the techniques mentioned there. My question is:   Why does this happen? (Can someone explain this better?) What are some tips and tricks to avoid this situation? What are some tips and tricks to mitigate this situation?   EDIT Here is an illustration:  The overall mesh as viewed from a distance looks decent (for my skill level)    But if you get closer and look from a certain angle...    Super close up:    The "edge" that is pointed to by the arrow is not actually an edge, but some kind of artifact created when blender tries to show the quad. The way the vertices are positioned, it shouldn't actually be possible to see the sliver of the face that I marked in red, since this face is supposed to be around the corner from the edges. The edges should form the silhouette on the right side of my figure.     Here is the side view. Maybe it is the angled topology that skews the face in a funny way?  But I'm not looking for help with this one particular issue, but rather a better understanding of why this happens, and ideas to prevent this in future models.


I'm graduated now, and swear I remember this exact kind of problem coming up in my Bayesian statistics class, but I can't remember what the answer was.  The Problem  So my wife's brother is red/green colorblind (xY), but her father is not(XY), and her mother is not, so her mother must be a carrier(Xx). Red/green color-blindness is recessive on the X Chromosome(x), which means in order to have the phenotype (actually have it), all of your X chromosomes must have the gene(xx or xY). This means women must get it from both their mother and father, while men must get it from their mother.  As a result, my wife has a 50% chance of being a carrier(Xx or XX), while all of my sons have a 25% chance of being red/green colorblind(XY or xY).  What I'm trying to figure out is if my first son ends up NOT being red-green colorblind (XY), does that change the probability that my wife is a carrier, since I've now observed one datapoint that refutes that possibility? If so, by how much?  My Thoughts  I think that Frequentists would say that it remains a 50% chance due to them being Independent events, but again, I can't recall exactly how it worked. I may be spacing it, but if my memory serves, Bayesians would include the original assumption(50%) as essentially a datapoint, but would subjectively give it more or less weight. I'm wondering if there's an objective way to handle this.  Of course, I can always calculate the odds of her being a carrier and how unlikely it is that she would have X sons without color-blindness (simple Geometric Distribution), but that doesn't tell me anything about her original probability.

As we all know, if you flip a coin that has an equal chance of landing heads as it does tails, then if you flip the coin many times, half the time you will get heads and half the time you will get tails.  When discussing this with a friend, they said that if you were to flip the coin 1000 times, and lets say the first 100 times it landed heads, then the chances of landing a tail was increased (the logic being that if it is unbiased, then by the time you have flipped it 1000 times you will have roughly 500 heads and 500 tails, so tails must be more likely).  I know that to be a fallacy, as past results don't influence future results. Is there a name for that particular fallacy? Also, is there a better explanation of why this is fallacious?


I want to run Ubuntu 18.04 in my machine.  Here are my system specs:  Cpu : Intel core 2 duo Hard disk : 160 gb RAM : 2GB DDR3  Please anyone help. Thanks in advance. ..

I'm thinking about installing Ubuntu Desktop, but I don't know what flavor is the best for my system. What are the minimum and recommended hardware requirements? What kind of CPU? How much memory? Should I have Hardware Acceleration? What flavor should I use?  This is an attempt of a canonical answer. My answers have the "official  requirements", the recommended are a mix of official sources and opinion based (along with the answer it's told the source). You can comment or edit if you feel that the information is obsolete or incomplete. It is a good rule of thumb that any system capable of running Windows Vista, 7, 8, x86 (Intel) OS X will almost always be a lot faster with any Ubuntu flavor even if they are lower-spec than described below.


Whenever I run my code it returns this error message:  Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 5     at java.lang.String.charAt(Unknown Source)     at codes.Main.main(Main.java:10)   Here is my code:      package codes;  public class Main {     public static void main(String[] args) {         String cord1 = "Name: x=23 y=60 z= 600";         String cord2 = "Name: x=200 y=20 z= 300";         int c1 = cord1.length();         String mychar = String.valueOf("cord1".charAt(0));         for (int a = 0; a < c1; a++){             mychar = String.valueOf("cord1".charAt(a));             if (mychar == ":"){                 break;             }else{                 cord1.substring(a);             }         }     } }

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?


Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


DISCLOSURE:  Until this project, I hadn't coded anything since 2000.  While I am a quick study, a lot has changed.  So, go easy on me?   I'm working on tweaking the UI for my web store.  On both the cart page and on the item pages there are events (i.e.: change of quantity and add to favorites) that have to refresh elements of the DOM, like the total price.  The issue is that when it refreshes that, there are other elements like the action button or a couple of the DIV containers like the table that the quantities are in get refreshed too.   I'm using CSS and JQuery to tweak the UI since I only have front-end access to editing anything.  If I edit things through CSS I'm fine, but any JS work is thrown out.  I'm adding classes to existing elements and removing the ones I don't want.  When they are refreshed, the original classes come back and mine are gone.  For example, here's a link to the page:   the button is pink at first, but if you click on a radio button to change the quantity or click the heart at the top to add/remove from favorites the button will change to the default Bootstrap version.  I don't want that to happen.  Any ideas on what to even research to find a workaround?  Feels like if I could mark certain elements to be isolated from the refresh life would be easier.  Thanks in advance!

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


I have tried the .tex file in WinEdt in Windows too. I want to run it using the KILE editor. The problem I got is showing below as log file.  This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=pdflatex 2014.1.17)  20 JAN 2014 16:01 entering extended mode  %&-line parsing enabled. **"Thesis-Jan 20 -2013.tex" (./Thesis-Jan 20 -2013.tex LaTeX2e <2009/09/24> Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh yphenation, farsi, arabic, croatian, bulgarian, ukrainian, russian, czech, slov ak, danish, dutch, finnish, french, basque, ngerman, german, german-x-2009-06-1 9, ngerman-x-2009-06-19, ibycus, monogreek, greek, ancientgreek, hungarian, san skrit, italian, latin, latvian, lithuanian, mongolian2a, mongolian, bokmal, nyn orsk, romanian, irish, coptic, serbian, turkish, welsh, esperanto, uppersorbian , estonian, indonesian, interlingua, icelandic, kurmanji, slovenian, polish, po rtuguese, spanish, galician, catalan, swedish, ukenglish, pinyin, loaded.  ! LaTeX Error: File `thesis.cls' not found.  Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: cls)  Enter file name:  ! Emergency stop. <read *>   l.2 \usepackage                {amsmath,mathtools}\usepackage{amssymb}^^M *** (cannot \read from terminal in nonstop modes)   Here is how much of TeX's memory you used:  10 strings out of 493848  236 string characters out of 1152823  47808 words of memory out of 3000000  3384 multiletter control sequences out of 15000+50000  3640 words of font info for 14 fonts, out of 3000000 for 9000  714 hyphenation exceptions out of 8191  10i,0n,7p,94b,8s stack positions out of 5000i,500n,10000p,200000b,50000s !  ==> Fatal error occurred, no output PDF file produced!   How can I run the .tex file in KILE ?

I'm using  editor. There is no problem when I run others  .tex article in Kile. But problem is when I run a thesis article in KILE. This thesis article is running fine in      \documentclass[12pt,a4paper]{thesis}     \usepackage{amsmath}\usepackage{amssymb}     \usepackage{graphicx}   Is there anything need to add in KILE setting to run the Thesis .tex in KILE?  This is the log file:  This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=latex 2013.3.7)  25 AUG 2013 23:37 entering extended mode  %&-line parsing enabled. **Thesis-Aug24-2013.tex (./Thesis-Aug24-2013.tex LaTeX2e <2009/09/24> Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh yphenation, loaded.  ! LaTeX Error: File `thesis.cls' not found.  Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: cls)  Enter file name:  ! Emergency stop. <read *>   l.2 \usepackage                {amsmath}\usepackage{amssymb}^^M *** (cannot \read from terminal in nonstop modes)   Here is how much of TeX's memory you used:  10 strings out of 495062  226 string characters out of 1182645  45108 words of memory out of 3000000  3285 multiletter control sequences out of 15000+50000  3640 words of font info for 14 fonts, out of 3000000 for 9000  28 hyphenation exceptions out of 8191  10i,0n,7p,80b,8s stack positions out of 5000i,500n,10000p,200000b,50000s No pages of output.


I thought there was such a thing - and yes, I see that a handful of my comment flags are about "not constructive".  I wanted to use it just now - but the list of available flags only shows "rude", "obsolete", "moderator attention".  I assume that such changes are announced somewhere - so bonus question: where can one find a comprehensive list of such kind of "UI updates"?

The problem Comments are terrible; no one agrees on what they're for, or how long they should be kept. Comment flags are equally terrible, because if no one's on the same page as far as what should be posted in the first place then no one can agree on what should be removed either. On top of that, we have this confusing set of flags where two mean "noise", one means "vile", one means "moderator, help!" and one means nothing at all - the end result is that it's all but impossible to even analyze comment flagging. The solution (or, part of it) Two years ago, in a fit of rage, I . Nothing got done. As always, everyone has a different idea of how things are supposed to work, and I'd bitten off more than I could chew. So, here we are, two years later, and comment flags still suck. So let's start by just cutting the fat: if we can trim down the list of flags to a set of clearly distinct problems, we might have something we can build on. Here's what I'm proposing, based on the past two years of discussion:   Re-word the "rude or offensive" flag to read,  rude or abusive: this comment violates .   Remove the "not constructive", "obsolete" and "too chatty" flags.  Add a new comment flag:  no longer needed: this comment is obsolete, chatty or otherwise unnecessary   Re-word the "other..." flag:  in need of moderator attention: these comments require action by a moderator. Be specific and detailed!    That's it; that's all I'm proposing to start out - simplify things so that we have something to build on. See also:


I have a question in reading Harry Potter yet again.  How strong, vs. Voldemort aside, is Harry?  We see all these comparisons, like Snape and his potions book, Tom and his accomplishments, the twins and their abilities, and Dummbldor.  So, is there anything that we might base his magic level on?  I mean, it seems that he lacks a strong magic knowledge.  He mentions at the end of Goblet of knowing a boatload of hexes when giving the gold to the twins.  I reference Robert Jordan and his epic Wheel of Time where each user of the Power could sense strength, how do we know relative strengths with magic, and where would Harry stand?

Was Harry Potter an innately powerful/skillful Wizard in any way, based on canon?  It seems that whenever Harry Potter performed some unusually potent bit of magic (potent as far as require raw power AND/OR skill), most of the time we find that it wasn’t innately Harry’s skill, but a combination of:   some extraneous magic forces/rules/powers circumstance great reaction time (which is obviously extraordinary from his Quidditch playing; and is likely a larger factor in his dueling than the strength of his magic) general smartness or (the part that Harry’s detractors, including Voldemort missed) Harry’s strength of character/personality   The only two counter-examples I can think of which show him as having extraordinary or at least obviously above average magical abilities are:   His skill at flying brooms - while a part of it is pure physical skill, at least part is magical. His (corporeal) Patronus charm   As far as examples of his unusual feats being due to reasons listed above:   Obviously, surviving Avada Kedavra as an infant - due to Lily’s sacrifice Parselmouth talent - proxied via Voldemort’s piece of soul. Ability to see the Sorcerer’s Stone in the Mirror of Erised - due to purity of his character, nothing magical. Obvious lack of talent at potion making throughout all of the books (sans cheating in HBP) His win over the Basilisk - due to Hermione’s research, character traits, and as a consequence of the last one, getting Fawkes and Gryffindor’s Sword’s help.  Just to be clear, before someone flames me - what he did was obviously super extraordinary, BUT IMHO he would have achieved the same result if he was turned into a Squib for the duration of Chamber of Secrets fight. TriWizard Tournament entry - wasn’t him, it was Barty Crouch TriWizard Tournament second challenge - a combination of character and outside help (someone told him about Gillyweed) TriWizard Tournament third challenge - Mostly, Barty Crouch’s cheating  Note that I’m omitting the first challenge, since that one was the aforementioned Broom flying skills. His survival in the cemetery after Voldemort’s return - again, a combination of superior strength of character and super powerful wandlore magic that had nothing to do with his skill as a Wizard. The whole “last Horcrux” thing when surviving the second Avada Kedavra from Voldemort His ownership of the Elder Wand in the very last duel with Voldemort.   So, to paraphrase my original question, was there any canon/JKR evidence that Harry was anything but a completely average/mediocre wizard in any way, shape, or form if you take into account only his own magical abilities and skills?


Let's say user wants to execute a script test.sh but ls -l test.sh gives   -rwxrwxr-- 1 root root 96 Feb 25 21:44 test.sh   Now if user doesn't want to make a copy of test.sh (on which he does chmod +x), he can simply do  sh test.sh   to execute test.sh.  Is there an analogue way to execute binary programs which one doesn't have execute permissions?

I was wondering how to run a command as another user from a script.  I have the script's owner set as root. I also have the following command being run within the script to run the command as the hudson user:  su -c command hudson   Is this the correct syntax?


When starting a Mac computer, the option key can be held down to invoke the Startup Manager. From here, choices are given for possible boot volumes. Is there a way to make the selected volume the new default boot volume?  I wish to boot volumes other than just Windows and OS X. This was possible from OS X System Preferences before El Capitan (OS X 10.11). System Integrity Protection (SIP) now prevents this. Since the Startup Manager ignores SIP and also detects more boot volumes than System Preferences, I now desire to use the Startup Manager to set the default startup volume.

I have installed OS X 10.5, 10.6 and 10.7 on different partitions of my Mac (developer machine).   By default 10.7 is booted. Of course, I can change it at each boot time by holding the alt key, but how to, for example, change the default boot partition to the 10.6 partition?


Can any one please explain the difference between a function and a method in Functional Programming aspect.  I am asking this question with a case study of Scala  We have 2 things noted down i.e a function and a method which does the same thing  Method  def add(x:Int, y:Int):Int = x + y  Function  val addFunc:Function1[Int, Int] = (x,y) => x + y  We can see that both of them does the same thing i.e addition of 2 Integers.But we get some additional properties with a function.   As this is a function this will be treated as a first class object like Double,Float etc that can be passed as a value to any other function or a method We can probably store this function within a datastructure such as alinked List or a HashMap This is a perfect example of immutability and preserves referential transparency from the functional programming world i.e I can gaurantee that  called this function N times I will always get the same result as this do not have any side effects. This can be passed to a higher order function such as a map or a reduce and can do N no of things This is a type dependent as it clearly specifies its type i.e (Int => Int)   Can anyone explain in detail some other benefits that a function can provide as compared to a method from an imperative programming language?

Can someone provide a simple explanation of methods vs. functions in OOP context?


I'd like to use MythTV so I purchased an NVidia 610 and installed in my Ubuntu Server tower.  First boot, no issues, so I update Linux while installing NVidia drivers from "Additional Drivers".  After restart, the resolution was reduced. Once I log in and startx I see nothing but the blank desktop (resolution is correct).  No menu on left side.  I can right click or use power button to shut down.  What happened???

When I login, nothing happens.   I am presented with my desktop wallpaper.    No Dash, no Launcher, nothing.


Let A and B be subsets of a universal set U.  If $A \subseteq B,$ then $B' \subseteq A'$ For the above question I'm trying to solve it by contrapositive proof. I was suggested by some friends that it can also be solved using proof by contradiction. Can someone tell me how this could be done by proof by contradiction?

What is the difference between a "proof by contradiction" and "proving the contrapositive"? Intuitive, it feels like doing the exact same thing. And when I compare an exercise, one person proves by contradiction, and the other proves the contrapositive, the proofs look almost exactly the same.  For example, say I want to prove: $P \implies Q$ When I want to prove by contradiction, I would say assume this is not true. Assume $Q$ is not true, and $P$ is true. Blabla, but this implies $P$ is not true, which is a contradiction.  When I want to prove the contrapositive, I say. Assume $Q$ is not true. Blabla, this implies $P$ is not true.  The only difference in the proof is that I assume $P$ is true in the beginning, when I want to prove by contradiction. But this feels almost redundant, as in the end I always get that this is not true. The only other way that I could get a contradiction is by proving that $Q$ is true. But this would be the exact same things as a direct proof.   Can somebody enlighten me a little bit here ? For example: Are there proofs that can be proven by contradiction but not proven by proving the contrapositve?


move a record from posts to archive    $stmt = $db->prepare(     "insert into archive (date, art, img, vid, title, subtitle, story, tags, status, user, pos, titlex, inde)     select date, art, img, vid, title, subtitle, story, tags, status, user, pos, titlex, inde from posts     where id = :aid" );   don't tell me that there is no option like: move * except id...  id is not movable due to a possible colision with archive's ids.

I'm trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this?  EDIT: There are 53 columns in this table (NOT MY DESIGN)


If $f$ is a continuous real-valued function, show that  $$ f(1)=\lim_{n\to \infty} \int_0^1 (n+1)\,x^n \,f(x) \; dx $$  I am looking for a general hint or steps to proceed but I want to fill them in. Looking at this I see the '$n+1$' along with the $\int x^n$ makes me very suspicious.   My first thought is that $(n+1)x^nf(x)$ converges to $f(1)$ uniformly on $[0,1]$ but I feel as though this is a fools thought. I then sat and tried the case $f(x)=x$ and $f(x)=x^{n_0}$. This was a bit illuminating. I then tried the case where $f(x)$ is a general polynomial and I can show that case. But of course $f(x)$ need not be a polynomial.   To try to make this method work, I considered using Stone-Weierstrass. I can find a sequence of polynomials $p_n(x)$ such that $p_n(x) \to f(x)$ uniformly. But I am unsure of how to make it fit in with the integral. I assume it is trivial to show $x^np_n(x) \to x^nf(x)$. I know that the above limit works with $x^np_n(x)$. However, does this imply that this -- under the limit -- must be the same as $x^nf(x)$? Or is this not at all how I should go about it? Is there a better or easier way? Or perhaps a more enlightening or 'quaint' way?

Suppose $f:[0,1]\to \mathbb{R}$ is continuous. Show that   $$\lim_{n\to\infty} n\int_0^1 f(x)x^n\,dx = f(1).$$  My answer so far: First I want to assume that $f\in C^1$. Then   $$n\int_0^1f(x)x^n\,dx = \left[\frac{n}{n+1}x^{n+1}f(x)\right]_0^1 - \frac{n}{n+1}\int_0^1 x^{n+1}f'(x)\, dx\\ \frac{n}{n+1}f(1) - \frac{n}{n+1}\int_0^1 x^{n+1}f'(x)\, dx,$$  which goes to $f(1)$ because the last integral goes to zero.  But approximating $f$ by $\phi\in C^1$ won't necessarily work, because $\phi(1)$ may not equal $f(1)$... how can we finish the argument?


I know that this question asked multiple times before but I have a little bit different situation.  In Brief:  I have reverse DNS, PTR records, SPF records, DKIM 1024-bit key, IP not blacklisted, message content not spam characteristics.  Emails delivered to inbox on Yahoo and AOL. but, they go to spam / junk on Gmail and Outlook.    In details:  Reverse DNS checked:  host 12.34.56.789   Note: This IP isn't the real IP of the server.  Output:  789.56.34.12.in-addr.arpa domain name pointer mydomain.com.   SPF records:  "v=spf1 +a +mx +ip4:12.34.56.789 -all"   SPF Checked by :    DKIM Checked by :    IP blacklist test checked by : Passed All  Yahoo and AOL works fine, but Gmail and Outlook mark emails as spam.  I contacted the gmail team couple of times but they didn't respond for over 10 days.  I'm sending plain text, no html codes.  No bulk emails, no newsletter.  Does anyone have a solution for this issue? Am I missing something? Appreciate any suggestions.    Further Details (Email Header):  Delivered-To: myemail@gmail.com Received: by 10.202.86.147 with SMTP id k141dre728845oib;         Tue, 4 Nov 2014 23:26:11 -0800 (PST) X-Received: by 10.170.225.135 with SMTP id r129mr14547913ykf.104.1412359371276;         Tue, 04 Nov 2014 23:26:11 -0800 (PST) Return-Path: <sales@mydomain.com> Received: from hostname.mydomain.com (mydomain.com. [12.34.56.789])         by mx.google.com with ESMTPS id v44si1322694yhv.201.2014.11.04.23.26.10         for <myemail@gmail.com>         (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);         Tue, 04 Nov 2014 23:26:10 -0800 (PST) Received-SPF: pass (google.com: domain of sales@mydomain.com designates 12.34.56.789 as permitted sender) client-ip=12.34.56.789; Authentication-Results: mx.google.com;        spf=pass (google.com: domain of sales@mydomain.com designates 12.34.56.789 as permitted sender) smtp.mail=sales@mydomain.com;        dkim=pass header.i=@mydomain.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mydomain.com; s=default;     h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Subject:From:To:Date; bh=lr4CWwmBPE2kmCn+bQZxuDI83bEg03tG585GFUO9nbM=;     b=gsXWNQFoHVg/98V1pfGYpqCmzeKE6BK/93Zy/vT61ySaEdeLrTl9TW6Ca8C/nh+1C19vRfQbv716c+Q2gDEfAXw5/S8mEPjoBAlF96bXfLUuIpnY2OLLELAobd+VkpYaeOpAVnVMUDoie5M+m+lp98btL31BXWOKfPCCJ8UHZ5Q=; Received: from localhost ([::1]:36366 helo=www.mydomain.com)     by hostname.mydomain.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256)     (Exim 4.82)     (envelope-from <sales@mydomain.com>)     id 1Xluyo-00032t-Az     for myemail@gmail.com; Wed, 05 Nov 2014 02:26:10 -0500 Date: Wed, 5 Nov 2014 02:26:10 -0500 X-Priority: 3 MIME-Version: 1.0 Content-Type: multipart/alternative;     boundary="b1_73e9fc0155fddc64feb30693a746sd5c" Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hostname.mydomain.com X-AntiAbuse: Original Domain - gmail.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mydomain.com X-Get-Message-Sender-Via: hostname.mydomain.com: authenticated_id: sales@mydomain.com  --b1_73e9fc0155fddc64feb30693a746sd5c Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit

Complete message received by Gmail (email, server ip and host are replaced):  Delivered-To: <myemail> Received: by 10.180.24.132 with SMTP id u4cs216052wif;         Thu, 20 Oct 2011 03:22:03 -0700 (PDT) Received: by 10.14.9.165 with SMTP id 37mr1294749eet.51.1319106122223;         Thu, 20 Oct 2011 03:22:02 -0700 (PDT) Return-Path: <www-data@<serverdomain>> Received: from <serverdomain> (<serverdomain>. [<serverip>])         by mx.google.com with ESMTP id s55si2781134ees.156.2011.10.20.03.22.02;         Thu, 20 Oct 2011 03:22:02 -0700 (PDT) Received-SPF: pass (google.com: domain of www-data@<serverdomain> designates <serverip> as permitted sender) client-ip=<serverip>; Authentication-Results: mx.google.com; spf=pass (google.com: domain of www-data@<serverdomain> designates <serverip> as permitted sender) smtp.mail=www-data@<serverdomain> Received: by <serverdomain> (Postfix, from userid 33)     id AEF1F47462EE; Thu, 20 Oct 2011 10:22:00 +0000 (UTC) To: <myemail> Subject: Registration confirmation From: <sitename> mailing robot <no-reply@<serverdomain>> MIME-Version: 1.0 Content-type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Message-Id: <20111020102200.AEF1F47462EE@<serverdomain>> Date: Thu, 20 Oct 2011 10:22:00 +0000 (UTC)  Please confirm your registration on the site by clicking this link:  <A href="<confirmationlink>" target=_blank><confirmationlink>   What's wrong with this e-mail? Why does Gmail think it is spam?


I am using texstudio, a latex editor, on Ubuntu 14.04. When I start it from bash $ texstudio, and click the compile button, it works fine. However, if I start it by clicking the icon in the launcher, I receive   Error: Could not start the command: xelatex -synctex=1 -interaction=nonstopmode   I know the reason is that in the settings, the build command is set to latex -src -interaction=nonstopmode %.tex, so it can be found if texstudio is opened from bash, since it inherits the environment variables I set in .bashrc: export PATH=/my/path/to/latex:$PATH.  My question is, is there a file in which I can set the environment variables for GUI programs?

What are correct places for:   Global environment variables meant to affect all users? User-specific environment variables?


I'm trying to create a 3D textured model of a boomerang based on this image  I have a good model and have applied a wood texture to it, but I'm pretty stumped when it comes to creating the designs in a way that looks convincing. If anyone knows a good way to approach this the help would be greatly appreciated. Here's my model so far:

I am trying to create a low poly face with a face from a .png file. The issue is I already have material placed for hair and skin, as shown in the picture below.   I have created a .png file with a face which I would like to overlay over the skin material on the front of the head.    All examples I searched so far assume I also want the color of the material from the .png texture.  Update:  I added UVMapping, changed view to texture, made sure one face is on the eye but nothing is displayed..... see image... I don't know what is going on.


I read this book around 10 years ago. It is about a man who is abducted by aliens while on a boat in the middle of the ocean. He becomes a slave and then a  mercenary for the said aliens.  Another thing I remember is that the other character was a human-like looking alien woman that the main character falls in love with   Another scene I remember from the first chapter or so is when he wakes up he is shocked as he is in a cell with group of different aliens and he can understand them as had an operation and speech translator inserted in his throat.

I'm looking for a story where a small number of humans and members of alien species are abducted by alien slavers. I believe they had canine or feline characteristics. I don't recall how it happened, maybe the slavers were betrayed by their employers, but in the end the slaves and their captors were thrown into a large arena of sorts and were being hunted. It was very Hunger-Games-esque. The humans slowly formed a kind of friendship with one of their former captors, although I believe he ended up dying. I don't remember how the story ended.   Two very specific things I remember:   The food intended for the slaves aboard the spaceship was color-coded according to species.   The slaver aliens follow some strange code of honor that forbids them from using ranged weaponry in personal combat. When questioned why they carried guns aboard their ship, they explained to the humans that they did not intend to use them to kill, but considered them tools for herding cattle.


I use Safari on macOS Mojave Version 10.14  When I browse Stack Overflow, it shows a mobile version. I tried to switch to Safari private mode, it's working fine.  All other website displays a desktop version, even Stack Exchange and other sites.  Is there an account-specific option? Or site-specific maybe?  I might have to ask on ask different site since it might be caused by Safari, but since other sites are working properly, I asked here first.

I seem to have clicked on something that changed my display preferences. The main site is now very minimalistic, with fewer controls and different fonts.  I want to change it back, but where is it?


If $a$ is an odd integer, then prove that $24\mid a(a^2 - 1)$  So, I simplified $a(a^2 -1)$ to $a(a+1)(a-1)$. Now, I have seen some answers which first say that this is clearly divisible by $6$ and go on to express this as a multiple of $4$. But such answers ignore that $2$ could be a common multiple. So that they ultimately prove $12\mid a(a^2 -1)$ Now, back to my unfinished proof. I let $a = 2k+1$ and substituted this value of $a$ to get: $4(2k+1)(k)(k+1)$ And here I am stuck...

If $a$ is an odd integer, prove that $24 \mid a(a^2-1)$.  I proved in my class that $a^2=8k+1$ for some $k$, provided $a$ was odd.  So $$a(a^2-1)=(2k-1)(8k+1-1)=8k(2k-1)$$ but I can't pull a $24$ out of it.


I have been invited to an official training in Guatemala, so now I plan to go to Guatemala from Afghanistan and I will use the Morroco and Madrid airport as transit countries. So, please let me know whether I need Schengen Transit Visa or not?

I found many related questions on this site but I am still not sure about the rules. How can I decide if I need a visa to transit? Schengen members as of May 2021 are as follows:  Austria Belgium Czech Republic Denmark (excluding Greenland and the Faroe Islands - but an open border with the Schengen Area is maintained) Estonia Finland France (excluding overseas departments and collectivities) Germany Greece Hungary Iceland Italy Latvia Liechtenstein Lithuania Luxembourg Malta Netherlands (excluding Aruba, Curaçao, Sint Maarten and the Caribbean Netherlands) Norway (excluding Svalbard) Poland Portugal Slovakia Slovenia Spain (except Ceuta and Melilla) Sweden Switzerland


Looking at most sites, I noticed something a bit weird. Stack Overflow has a different layout for their upper interface (which personally I find unique and easy to use).  On most of the sites I see:  | SE logo & Sites dropdown | Inbox | Achievements | --- | Profile | Help | Searchbar | | Sitename | --- | Questions, Tags, Users, Badges, Unanswered | Ask Question |   On Stack Overflow:  | SO logo | Questions etc. | Searchbar | Profile | Achievements | Inbox | Help | Sites dropdown |   I have two questions,   Why does SO have such a format unlike the rest? Are there any other sites that have a unique upper interface?

Update:         See:       I'm the new product manager for the . I’m excited to announce that the top bar design that has been on Stack Overflow for several months is coming soon to the Stack Exchange network.   What took so long?  This was a big change and we really wanted to work out the kinks on Stack Overflow before we pushed to all sites in the network. For example, we recently released some changes to how the review queue menu works in order to address an overall drop in reviews since the new top bar shipped on SO (see  for details). We also adjusted the location of some items, such as the help link, to address feedback.  To meet the needs of the network we needed to adjust some aspects of the design to work with the full range of sites. The design is coherent with the SO design, but isn’t exactly the same. The biggest difference is that site name and Questions/Tags/Users navigation remain below the top bar. This was needed in order to work with sites with long names and/or custom skins.  Most importantly, the site switcher and other key controls will be in the same location across the entire network   New top bar on Stackoverflow.com:   New top bar on webapps.stackexchange.com:   New top bar on gaming.stackexchange.com:    New top bar on a beta site with a long site name:    New top bar for high rep member:    New top bar for moderator:   Why change the top bar?  If this change is new to you, then check out the  blog post and the meta post  for more details.


my functions have become extra strict about passing ALL of the arguments now instead of just what I need) This used to work function namedFunction($avar, $bvar, $cvar){ ....... }  echo namedFunction('a','b');  Now NOTHING works unless I pass echo namedFunction('a','b','');

In the PHP manual, to show the syntax for functions with optional parameters, they use brackets around each set of dependent optional parameter. For example, for the  function, the manual reads:  string date ( string $format [, int $timestamp = time() ] )   Where $timestamp is an optional parameter, and when left blank it defaults to the  function's return value.  How do you go about creating optional parameters like this when defining a custom function in PHP?


I have a query, people are saying that since 1989, every work which is created is automatically copyrighted. Then is it fine to use sentence  All rights reserver and copy right symbol on my website, with out registering at gov copyright office.

My website has been in development for a long time and cost a lot of money.  How do I go about securing an enforceable copyright on my website design and what is the proper way to post a copyright notice on the site so others know the work is copyrighted?


I want to know that can we have the following inequality for $x>0$, $y>0$?  $$\log(1+x/y) \leq x/y$$

I want to prove that: $\ln(x+1)< x$.  My idea is to define:  $f(x) = \ln(x+1) - x$, so:  $f'(x) = \dfrac1{1+x} - 1  = \dfrac{-x}{1+x} < 0, \text{ for }x >0$.  Which leads to $f(x)<f(0)$, so $\ln (x+1)-x<0$.  Is that a valid proof? Any other ideas?  Thanks.


I have been working on a command line tool in swift but due to excessive size of the executable(around 10 mb) I need to re-write it in objective-c.  Now I am not a fan of objective-c, thanks to it's lengthy syntax. So I have this function which I use to call my shell script and return the output. Can some please convert this into objective-c, I am having a hard time.  func shell(_ args: String) -> String {     var outstr = ""     let task = Process()     task.launchPath = "/bin/sh"     task.arguments = ["-c", args]     let pipe = Pipe()     task.standardOutput = pipe     task.launch()     let data = pipe.fileHandleForReading.readDataToEndOfFile()     if let output = NSString(data: data, encoding: String.Encoding.utf8.rawValue) {         outstr = output as String     }     task.waitUntilExit()     return outstr }   then I call this method in swift something like   let shellOutput = shell("sh \(scriptPath) \(arg1) \(arg2)")   before you mark it duplicate or post answers, I really need the shell script output in some variable.

How can I execute a terminal command (like grep) from my Objective-C Cocoa application?


How can I see how many rows were actually inserted?   engine_str = 'mysql+mysqlconnector://root:mypass@localhost/mydb' engine = sqlalchemy.create_engine(engine_str, echo=False, encoding='utf-8') connection = engine.connect() query = "INSERT INTO TEST(a,b,c)VALUES(1,2,3) ON DUPLICATE KEY UPDATE B = VALUES(B), C = VALUES(C)" try:     connection.execute(query) except Exception as e:     print(e)   SQLALCHEMY just prints out this ID.  <sqlalchemy.engine.result.ResultProxy object at 0x0000000007769E80>   P.S This question is about rows insertion not row execution. So if you use rowcount it will show the number of times the query has been executed.  Rephrasing my question: Is there any way to see how many records were inserted vs updated? Ideally, I would like to know those primary keys which were updated.

I have one question concerning Python and the sqlalchemy module. What is the equivalent for cursor.rowcount in the sqlalchemy Python?


I have seen plenty of examples for scp through an intermediate server to a second-hop server via ProxyCommand operator such that:  A:/infile.txt -> B -> C:/outfile.txt   Which looks something like the following from A:  scp -o 'ProxyCommand ssh userB@hostB nc %h %p' infile.txt userC@hostC:"~/outfile.txt"   My question, is how to scp through two intermediate servers to a third-hop server such that:   A:/infile.txt -> B -> C -> D:/outfile.txt   I'm looking for a way to do this using one-liner similar to the second-hop example provided above ...  but all answers and means are valid if that's not possible.  What I'm trying to do is not the same as  or variants thereof, which uses /etc/ssh/ssh_config file for setting up aliases.  That's not what I'm wanting to do, I'm looking for a one-liner.  I've also not seen any examples of two or more proxy hosts in between origin and destination, so I believe the question is quite valid.

describes how to SSH into a machine that can only be accessed through one or more hosts (that can also be SSH'd into).  Is there an equivalent way of using scp? That is, copy a file to my local machine from the far machine (assuming I have password or key access to all machines along the way)?


I'm trying to get rid of diacritics in my textfile. I converted a pdf to text with a tool, not made by myself. I wasn't able to understand which encoding they use. The text is written in , orthographically familiar with Spanish. I transformed the text into a list of strings. No I'm trying to do the following: # check whether there is a not-ascii character in the item def is_ascii(word):     check = string.ascii_letters + "."     if word not in check:         return False     return True  # if there is a not ascii-character encode the string  def to_ascii(word):     if is_ascii(word) == False:         newWord = word.encode("utf8")         return newWord     return word  What I want to get is a unicode-version of my string. It doesn't work so far and I tried several encodings like latin1, cp1252, iso-8859-1. What I get is  Can anybody tell me what I did wrong? How can I find out the right encoding? Thank you! EDIT: I wrote to the people that developed the converter (pdf-txt) and they said they were using unicode already. So John Machin was right with (1) in his answer. As I wrote in some comment that wasn't clear to me, because in the Eclipse debugger the list itself showed some signs in unicodes, others not. And if I looked at the items seperately they were all decoded in some way, so that I actually saw unicode. Thank you for your help!

I received some text that is encoded, but I don't know what charset was used. Is there a way to determine the encoding of a text file using Python?  deals with C#.


I'm a high school student taking IB and I'm doing my EE on Maths, more specifically on the effectiveness of Euler's totient function and Carmichael's totient function in RSA.   Am I right in thinking that Euler's and Carmichael's can be used interchangeably to generate the public key in RSA? To compare their 'effectiveness' I will first compare the amount of time it takes to generate a public key using each function based on time complexity. Secondly, I want to compare the security of the public key (meaning 'how difficult it is to guess the private key given the public key'). But how? Is there an algorithm to use to test the security of an encryption key?   Many thanks!

In textbook RSA, the Euler $\varphi$ function $$\varphi(pq) = (p-1)(q-1)$$ is used to define the private exponent $d$. On the other hand, real-world cryptographic specifications require the Carmichael lcm function $$\lambda(pq) = \operatorname{lcm}(p-1,q-1)$$ to define $d´$. It is clear that the $d´$ divides $d$, and therefore using $d´$ may be more efficient than using $d$. My question is: Are there any further reasons, e.g. regarding security, why one should not use $d$?


When I tap the "EDIT" under "Your Sites", each element in the subscription list that appears has an enormous margin at the top & bottom, which makes the list unusable.  Screenshot:         App Version: 1.0.85 Device Manufacturer: Sony Device Model: SGP771 OS Version: 6.0.1 (1994651638)

There is some unwanted extra spaces in between each site in the Your Sites section.  Steps to reproduce:   Touch the Nav Icon in the left top corner Touch the EDIT link in YOUR SITES Scroll the screen; there is unwanted spaces in between the each site   For reference I recorded the same:    Configurations:   App Version: 1.0.85 Device Manufacturer: Motorola Device Model: XT1033 OS Version: 5.1 (2)


I just updated to Ubuntu 18.04 and my Wi-Fi stopped working on my Lenovo Laptop. Wi-Fi itself is still working for other systems, but my laptop can only connect once I'm next to my router. Seems the signal is too weak, but this makes no sense as all other devices (smartphone,TV) work with greater distance.  Do you have any idea?  :~$ lspci -knn | grep Net -A3; rfkill list   02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723]       Subsystem: Lenovo RTL8723BE PCIe Wireless Network Adapter [17aa:b728]       Kernel driver in use: rtl8723be       Kernel modules: rtl8723be   0: ideapad_wlan: Wireless LAN       Soft blocked: no       Hard blocked: no   1: ideapad_bluetooth: Bluetooth       Soft blocked: yes       Hard blocked: no   2: hci0: Bluetooth       Soft blocked: no       Hard blocked: no   3: phy0: Wireless LAN       Soft blocked: no       Hard blocked: no

I have a HP 14-AN001NA laptop. It came with Windows 10 installed on which the Wi-Fi worked fine anywhere in the house.   However I removed Windows 10 and installed Ubuntu 16.04 instead and since I have had terrible Wi-Fi anywhere aside from about three foot away from the router. I don't know if it's relevant but my Wi-Fi is not called wlan0 but wlo1 for some reason (I didn't change it).  When running lspci -knn | grep Net -A3     I get the following output:  05:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723] DeviceName:   Subsystem: Hewlett-Packard Company RTL8723BE PCIe Wireless Network Adapter [103c:81c1] Kernel driver in use: rtl8723be Kernel modules: wl, rtl8723be


Why does the air circulate on a flowing airfoil, thus giving rise to increased velocity (circulation + relative airspeed) above the wing and hence decreased pressure.

I understand the common explanation of lift, which describes the airflow over the top of the wing as moving faster than the air below the wing.  However, I don't quite understand why the air moves faster.  I've read some explanations citing a circulation effect among others, but haven't found a good, clear explanation for the exact cause.  Can someone help me out?