#include <stdio.h> #include <conio.h>  void test(char *p) {      p = p + 1;      *p = 'a'; }  int main() {     char *str = "Hello";     test(str);     printf("%s", str);     getch();     return 0; }   When I run this code it gives segmentation error ? why is this happening. The const theory is not clear to me... whereas if I declare str as char str[], it does the job. Are they not both basically the same things ?

The following code receives seg fault on line 2:  char *str = "string"; str[0] = 'z';  // could be also written as *str = 'z' printf("%s\n", str);   While this works perfectly well:  char str[] = "string"; str[0] = 'z'; printf("%s\n", str);   Tested with MSVC and GCC.


Why don't dense gas elements sink to the ground and dense gas elements drift to the sky? Why don't we have layers of oxygen, nitrogen, carbon dioxide, etc.

As we all know, air consists of many gases including oxygen and carbon dioxide. I found that carbon dioxide is heavier than O2. Does the volume difference neglect the mass difference? Is it same for all other gases in air or is there another force that keeps all of these gases together?  If I take a breath of a fresh air, will the exhaled air be heavier because of its higher CO2 content? Will it fall on the floor?


I'm trying to remember the name of a short story in which a criminal was being prosecuted for a crime by a zealous prosecutor.  Somehow, the criminal is able to travel back in time and reshape society, perhaps by forming a new religious order.  By the time he arrives back at the present, the laws are such that even though the prosecutor and criminal are the same people, roles are reversed, and it is now the prosecutor who is the criminal and is convicted.  In my recollection this was by Asimov but I can't find any of his stories that match.

I was recently reminded of sci-fi short story which I read quite some time ago (several decades, possibly) which was entirely a monologue.  The narrator is talking to two professors and it's revealed that they stole something technical from him.  Either the secret to time travel directly or something that could be extended into time travel.  During the story it becomes clear that the narrator has learned to manipulate time travel to such an extent that he was able to alter events so that he could not only win over his rivals, but in such a way that they'd be psychologically identical, so he could gloat over their downfall.  The resolution, according to my memory, was the narrator had taken over the religious order the rivals had created, and done so in such a way that the rivals were now seen as heretics and the story ends with the populace showing up with torches and pitchforks to take down the rivals.


I have an HP laptop with preinstalled Windows 7. I have another PC where I want to install Windows 7.   I want to know how to create a bootable disc or flash drive from the laptop to install the Windows 7 to the PC.  I have the product key from the laptop.   Is this possible?

I just bought a serial for Windows 7 on-line from the Microsoft store (the most painful shopping experience EVER!). I selected that I wanted to download my version of Windows 7 after purchase. After payment, I have listed a Product Key but no download link in sight.   Where do I download my Windows 7 ISO to burn to disk?  Note: I'm not a Technet or MSDN subscriber.


In The Flash 4x04 “Elongated Journey Into Night”, there is a scene in the final act when Joe arrives at Star Labs and shows a box of cigars to Team Flash, handing them out to everyone. The scene is silent except for some music, so we can’t hear anybody. However, they seem super excited in a way that I wouldn’t expect for people who don’t appear to be smokers.  Why did Joe give cigars to the team? And why were they so happy about it?

In Flash Season 4 Episode 3 , at the end of the episode Joe tells Flash that Cecile is pregnant.  And in next scene everyone is happy and Joe giving them Cigars.  Why is that? Is that any kind of tradition?


Basically what i'm trying to do is take every 5 elements from an existing list and then add those elements as a string into another list. For example the below list would output ['12345', '54321']... My attempts so far are below i'm new to coding and would appreciate help best regards Jake  string = ['1', '2', '3', '4', '5', '5', '4', '3', '2', '1'] counter = len(string) holder = '' final = []  while counter > 0:     for i in string:         if len(holder) >= 5:             final.append(holder)             holder = ''             counter -= 1         else:             holder += i             counter -= 1   Current output gives me this ['12345'] with holder containing '4321' and counter equaling 0 i guess the fact that the '5' is missing has caused the if statement not to trigger but where has the missing '5' Gone

I have a Python script which takes as input a list of integers, which I need to work with four integers at a time.  Unfortunately, I don't have control of the input, or I'd have it passed in as a list of four-element tuples.  Currently, I'm iterating over it this way: for i in range(0, len(ints), 4):     # dummy op for example code     foo += ints[i] * ints[i + 1] + ints[i + 2] * ints[i + 3]  It looks a lot like "C-think", though, which makes me suspect there's a more pythonic way of dealing with this situation.  The list is discarded after iterating, so it needn't be preserved.  Perhaps something like this would be better? while ints:     foo += ints[0] * ints[1] + ints[2] * ints[3]     ints[0:4] = []  Still doesn't quite "feel" right, though.  :-/ Related question:


Here is the setup:  I play a sorcerer and got blinded and deafened at the start of the combat I use my action to use my familiar's senses, which leaves me blinded and deafened, which I already am My familiar (an owl) uses his movement and lands on my head I am 10 ft away from my ally, and I want to use quickened spell to cast haste as a bonus action.  Haste states: "Choose a willing creature that you can see within range". Technically, I can't see him with my own eyes, but I can with my familiar's eyes which are on top of my head. In a real-world scenario, I don't believe this would be a problem for a caster. However, my DM ruled that I can't cast it since it strictly states that you need to see the target. Should this be allowed?

I am thinking about a wizard who has a rat familiar (from the  spell), and has the  spell prepared. Can he use his familiar's senses to teleport into another room (where the familiar is hiding) by looking through the eyes of the rat and casting misty step?  The wizard could use his action to switch to the familiar's senses and then use his bonus action to cast the spell. This would greatly reduce the "blind and deaf" time he experiences from doing this.


I want to convert a pdf file to eps using windows file has mathematical symbols and I want to make then unaltered. Getting help from here, I have made a bat file and placed the bat file (pdf2eps) in say D drive rem pdf2eps <page number> <pdf file without ext> echo off pdfcrop "%2.pdf" "%2-temp.pdf" pdftops -f %1 -l %1 -eps "%2-temp.pdf" "%2.eps" del  "%2-temp.pdf"   What will be the next steps. Please write the full steps to get an eps from a pdf. Edit: Changing directory to the path of pdf2eps.bat in cmd.exe, I have tried with  pdf2eps 1 oldfile (without pdf extension). Also tried with pdftoeps -eps <PDF file with .pdf> But not get any result by both process. What to do?

I can't find a tool to convert PDF to EPS, neither in MikTeX nor in TeXLive. Is there such a tool actually?    Update:  Based on Herbert's accepted answer, I simplify his batch as follows:  #!/bin/sh # $Id: pdf2eps,v 0.01 2005/10/28 00:55:46 Herbert Voss Exp $ # Convert PDF to encapsulated PostScript. # usage: # pdf2eps <page number> <pdf file without ext>  pdfcrop "$2.pdf" "$2-temp.pdf" pdftops -f $1 -l $1 -eps "$2-temp.pdf" "$2.eps" rm  "$2-temp.pdf"   For Windows users, create a batch file, name it pdf2eps.bat as follows:  rem pdf2eps <page number> <pdf file without ext> echo off pdfcrop "%2.pdf" "%2-temp.pdf" pdftops -f %1 -l %1 -eps "%2-temp.pdf" "%2.eps" del  "%2-temp.pdf"


I know that St. Mungo's treats illness and injuries caused by magic. What about those injuries or illness that are not caused by magic? Do they go to a Muggle doctor or hospital for treatment? Example Dumbledore and Harry wear glasses where do they go have their eyes examined? I would think wizards/witches being part human would get Muggle related illnesses also.

I remember in an interview, or during a Q&A, Rowling stating that Wizards live longer than Muggles. This got me thinking about Wizard deaths in general, and then deaths being attributed to illness.  So, I ask, has there ever been a Wizard, that has died from something like cancer? Is there anything, even briefly mentioning a Wizard becoming ill?  And finally, are there any illnesses that are exclusive to Wizards?


According to the Theory of relativity More the gravitational field slower the time because of more bending in spacetime fabric. Earth orbit is not completely elliptical it means distance from sun is not same throughout the year. When the earth far from sun will the time move faster on earth because of lesser gravitational field of Sun?

Is there any measurable time dilation when Earth reaches perihelion? Can we measure such a phenomena relative to the motion of the outer planets?


I am writing notes for self-lecture on a computer screen on a daily basis (attending math courses). I never intend to print these notes on paper, so the concept of "pages" is quite annoying ; I am always having issues with page breaks because of my big diagrams and self-made environments. Is it possible to have the equivalent of the article class "without pages"? In other words, the equivalent of  without the "being online" part. I want a file that I can read the entire text just by scrolling without any pages. Does that exist?

Does anybody know of a documentclass that produces a page that has a fixed width and a variable length, depending on the actual content that needs to fit on the sheet? I'm trying to get something like a kind of scroll if possible.


I know that java stores String Literals in Common Pool and two string literals having the same text will refer to the same place in Common Pool. take below code:  String str1 = "Amir"; String str2 = "Amir";   now both str1 and str2refer to the same place in the Common Pool. so from what all we know we must use equals() to properly compare these two strings and obviously str1.equals(str2) will be true.   now from what i read   it says that the str1 == str2 will be true becuase the strings both have the same address (sounds pretty logical) but it also states that its a logical error to do so.  my question is what is that special case that may cuase trouble and inconsistency to my code if I use str1 == str2 ?

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?


From my MainWindow the user can open a custom dialog using the menu. This custom dialog offers the possibility to select a path using the CommonFileDialog.   The CommonFileDialog opens as it should, however, at the same time the custom dialog is moved behind the MainWindow. Now when the user exits this CommonFileDialog by either selecting or cancelling, the MainWindow is shown on top while the custom dialog is in the background.   This is really unintuive. What I want is that the windows behave like a normal stack, meaning that they spawn on top of each other and one exits them in reverse order.  Does anyone have an idea why the windows behave the way they do and how I could fix it?

If I have a Xaml Window, how does one open it as a child window, and then have the parent window wait for the child to close before the parent window continues executing?


I have a virtual joystick to rotate the player and this piece of code works nice and smooth for the rotation of the players view.  public void rotatePlayer(Vector3 newPosition){   transform.Rotate(new Vector3(-newPosition.y,newPosition.x,0)*Time.deltaTime); }   I pass a Vector3 with the position of the joystick in relation of his parrent's(the joystick border) anchor.That gives me the rotation direction.Which means that if I set the rotation of the camera direclty it will just flip to that point and not move progresively to that point.  Even though z is set to 0 in the vector3, it changes the z axis angle of the camera. How can I clamp it to 0 without using many resources?   I tried other methods but they just switch the camera's rotation directly when the joystick is touched like I already said.Flip and stop.  I guess I could just set the z axis rotation to 0 every time but that just seems like double work.

My goal is to program a camera to point towards the mouse cursor. I attached the following script to the Main Camera.   using UnityEngine; using System.Collections;  public class CameraController : MonoBehaviour {      public float sensitivity;      // Update is called once per frame     void Update () {         transform.Rotate (Input.GetAxis ("Mouse Y") * -1 * sensitivity, Input.GetAxis ("Mouse X") * sensitivity, 0);     } }   I "told" the camera to rotate around the x and y axes. Whenever it does this, the camera tilts sideways. When I checked the rotation of Main Camera, I saw that the z rotation had changed. Why is it rotating around the z axis when I left it at 0?


Does being in the area of effect of a spell at the time of casting count as "entering"?  For example when casting Web:     Each creature that starts its turn in the webs or that enters them during its turn must make a Dexterity saving throw. On a failed save, the creature is Restrained as long as it remains in the webs or until it breaks free.   If it did not count it would imply that if you cast web on someone next to you, you would not get the chance to move the same turn with the benefit of them being restrained.

The description of the moonbeam spell (PHB pg. 261) says:  When a creature enters the spell's area for the first time on a turn or starts its turn there, it is engulfed in ghostly flames that cause searing pain... On each of your turns after you cast this spell, you can use an action to move the beam 60 feet in any direction.  We read this to mean a creature takes damage from moonbeam when any of the following conditions are met:  It begins its turn inside the moonbeam It enters the moonbeam on its turn The creature finds itself inside the beam on another character's turn, no matter how it got there  The creature will not take damage in the following instances:  A creature moves from one part of the beam to another (obviously it had to take damage, but it won't take more damage) A creature is in the beam after having been inside the beam already on that turn.  Following these assumptions, our druid cast a moonbeam and did damage to two enemies, Bob and Frank. On their turn, they took damage again, killing Bob. Frank left the beam. On the druid's next turn, she moved the beam in a circular motion, not exceeding 60 total feet of movement, and in the process the beam came in contact with a dozen enemies and ended on Frank. All dozen enemies received damage, as they were inside the beam at some point during the turn. On Frank's next turn, he again took damage for the fourth time and died. On each of the druid's turns, she moved the moonbeam around like this until the fight ended (it did not exceed the time limit and she made all concentration checks). Is this a legitimate use of moonbeam? It seems awfully powerful for a level 2 spell.


Two table employee and department each table has id and name column. Assume there are numerous content with both field populated and department id reference in each employee table record. Question is How to find all the department names with no related employees in them?


Hi I was going through some examples in C# and came across some code similar to below : private void WriteData(string filePath) {     using var writer = new System.IO.StreamWriter(filePath);      //Logic to write data here }  I want to know what is the use and significance of using in variable declaration. Also how is it different from simple variable declaration : var writer = new System.IO.StreamWriter(filePath);

User  answered the wonderful  question by mentioning the using keyword. Can you elaborate on that? What are the uses of using?


I just entered a question titled: "What’s the best way to serialize / deserialize a Dictionary<String,String> in .Net 2.0?"  And the system told me: "The question you're asking appears subjective and is likely to be closed."  How is that working currently? What are you looking for in the title to flag something as "potentially subjective"? Is it because I asked for "the best way" to do something?

I was asking a question in serverfault.com and this message warned me (correctly!):     The question you're asking appears   subjective and is likely to be closed   So, I'm curious if there any classifier or machine learning technique behind, or if it is just some heuristics on keywords.  Do you know?


I have to find the integral:  $$\int_1^3 \dfrac{\ln x}{x^2 + 3} dx$$  I tried integration by parts, but I can't find the next necessary integral, that being:  $$\int_1^3 \dfrac {\arctan (x/\sqrt3)}{x}$$  So I thought that maybe integration by parts is not the way to go. But I can't come with any solution.

I stumbled upon this integral $$I=\int_1^3 \frac{\log x}{x^2+3}dx$$ Since the answer given by Wolfram-Alpha is $I=\frac{\pi \log 3}{12\sqrt3}$ I tried to work near the bounds of the integral because as a indefinite integral it will involve some polylogarythms which I want to avoid. But not a single substitution  like $x=\frac{1}{y}$ or $x-2=u$ gave any better look to this integral. And when integrated by parts I feel like it got worse. Could you perhaps help me on this?


In the same way that \min and \max work, is there a version for "ave" meaning the average?  Thanks.

Mathematical operators, such as function names, should be set in roman type, not italics. Latex already has commands for some operators, including \max, \min, and \log.  How can I define additional such commands?


I am a sophomore in high school and have discovered the joys of mathematics.  However,due to sheer irony, at times I find the subject difficult. I am what one could label "lopsided" in my faculties, excelling in languages but always floundering with numbers. This may be biological, for I was psychologically tested and found that my linguistic skills were abnormally high but my spatial reasoning...wasn't (I was diagnosed with Asperger's Syndrome). I do not want this to deter me from pursuing a degree in physics/math and finding work in the field. On the other hand, what if I just don't have the ability and fail? I see the mathematics geniuses at my school (or other students who are just better than me) and I feel horribly discouraged. Recently, I took a math test and felt completely lost, even though I studied diligently and received high scores on other assignments, which may be due to the anxiety I felt as I received the exam. The mere thought of that test kills me, as if it is a reminder that I shall never succeed in the subject no matter how hard I try (I was given a B last semester).  I was wondering if those in advanced mathematics have had the same experiences, and somehow overcame their struggles. Is it optimal I should just study a humanities subject even though this is what I like, or is there some way I could find a path in the field? Also, as an aside, what gives you your passion for math? What is the best thing you find about this subject? Perhaps that can force my motivation to the point where I become proficient...  P.S. If you could point me in the direction of some math/physics related extra-curricular/summer activities and programs, it'd be much appreciated.

For a high school student interested in majoring in math and learning more about math, what kinds of mathematical research can a student in high school get involved in? How can a high school student get involved? If a high school student does conduct research, what mathematical journals would be willing to publish their work? Also, what other ways are there for a high schooler to get involved in more complex mathematics?


What does it mean the squared norm $\|R\|^2$ of the Riemann curvature tensor or the squared norm $\|\operatorname{Ric}\|^2$ of the Ricci curvature tensor. Though the squared norm of a vector or a matrix is a clear concept to me. I met these tensors in the book of "Marcel Berger" entitled "A panoramic view of Riemannian geometry" at the page 422 Eq (9.23).

I am teaching myself Riemannian Geometry in order to studying Mean Curvature flow. I was reading Lecture Notes on Mean Curvature Flow by Carlo Mantegazza and I'm trying understand the following definition:  The metric $g$ of $M$ extended to tensors is given by $$g(T,S) = g_{i_1s_1} \cdots g_{i_ks_k}g^{j_1z_1} \cdots g^{j_lz_l} T^{i_1 \cdots i_k}_{j_1 \cdots j_l} S^{s_1 \cdots s_k}_{z_1 \cdots z_l},$$ where $g_{ij}$ is the matrix of coefficients of $g$ in local coordinates and $g^{ij}$ is its inverse. Clearly, the norm of a tensor is $$|T| = \sqrt{g(T,T)}.$$  My doubt is why make sense define $g(T,S)$ as defined? I would like to know too if my thoughts below are lead me to the definition of $g(T,S)$ and how can I conclude my thoughts.  $\textbf{My attempt in order to understand the definition:}$ Firstly, I know that the squared norm of the second fundamental form is $$|A|^2 = g^{mn}g^{st}h_{ms}h_{nt}$$ by  and I know that the second fundamental form $A$ is a $(0,2)$- tensor. This lead me to think that I would be able to understand the definition given by Mantegazza if I understand how define $g(T,S)$ when $T$ and $S$ are $(0,2)$- tensors, because if $T$ and $S$ are $(k,l)$- tensors, then I can see them as $(0,2)-$ tensors just fixing the $k$ coordinates and the $l - 2$ coordinates. I know that there is an isomorphism between the space of endomorphisms of a finite-dimensional vector space $V$ and the space of $(1,1)-$ tensors defined on $V$, then I thought to raise an index of the tensor $A = (h_{ij})$ in order to obtain a $(1,1)-$ tensor $(g^{ik}h_{kj})$ and I thought define the squared norm of $A$ using  of the endomorphism associated to $(g^{ik}h_{kj})$ by the isomorphism quoted previously.  I'm stuck here in understand how use the operator norm in order to define the squared norm of $A$. Is it the way to understand the definition of $g(T,S)$? If so how can I proceed in order to conclude that $|A|^2 = g^{mn}g^{st}h_{ms}h_{nt}$? Thanks in advance!


I have to write a dissertation about a charity named "St Anthony's trust".  I was puzzled about the title. Do you think that I should write    "Community-supported agriculture. St Anthony's trust" or  "Community-supported agriculture. The St Anthony's Trust"?    Sorry for my bad English but I have been started to write in this language.

In an English language textbook for Italian middle school students, there is a reading exercise where students have to fill in the gaps. Here is a completed excerpt     The International Red Cross/Red Crescent is a global charity and humanitarian organisation. It believes that people everywhere have a right to life and health. …blah, blah, blah… The Red Cross / Red Crescent began its work in 1863. Today, it operates in 186 countries and every year it gives help to about 250 million people.    My two private students had to write a paragraph about a charitable institution of their own choice. We came up with 1. Médecins Sans Frontières (in Italian Medici Senza Frontiere) which is also known as Doctors Without Borders 2.  and 3. Amnesty International. They each chose an institution and they all started their paragraphs with the definite article "the" just like in the textbook.         The Doctors Without Borders is a global charity and humanitarian…   The Greenpeace is a global charity and pacific organisation…      I crossed out the articles and said they weren't needed. Samuele asked me why–good for him–but I didn't know what to say, so I promised I would look into it.  While I can explain that the definite article is needed when we mention the  because it is a collection of states/nations, and it is omitted when it is shortened to UNICEF. I don't know why the article is needed for the  but not for  or .   I'm also aware that if the name of a company or band starts with "The" e.g. The Beatles,  The Leathersellers’ Company, and The Body Shop  the article is always obligatory and always capitalised. However, the charity's name used in the book name is , and yet the article is needed.    Is there a reason? Why is the definite article necessary in the International Red Cross, but not for Greenpeace or Amnesty International?


I need to format a text file (a Fortran source code) and change some keywords from small letters to capitals or vice versa. I've made an array of possible keywords and have the following piece of the script:  for ((i=0; i<$nwords; i++ )); do     word=${words[$i]}     small=${word,,}     cap=${word^^}     sed -i "s/$small/$cap/gI" $filein   done  It works as it should. The problem is the following: Suppose one of the keywords is "use", and somewhere in the test I have a word "uselog". The script changes it to "USErlog" and I want to avoid it anyhow. My idea is to put spaces in the keywords, but somehow they are automatically trimmed. I mean, I try "use " or 'use ' instead of 'use', but the result is the same. I guess there must be a simple way to do that, like using quotes, parenthesis or similar, but so far I have not found one. Other alternatives are welcome as well.

I have a input file FILE1.TXT as below.     11 id1   12   13 AGE = 20   14 NAME = NAME1   15   16 id2   17   18 AGE = 30   19 NAME = NAME2   .   .   .   110 idXYZ   111   112 AGE = AGEXYZ   113 NAME = NAMEXYZ   114   115 idZZZ   116     I want to search all the fields that belong to a particular Id and get the value for NAME  I managed to loop through each Id and formed the below command for each Id as required.  sed -n '/11/,/14/p' FILE1.TXT | grep NAME | awk -F "= " '{print $2}'  The problem here is, I get the output NAME1, in addition to that, I also get NAMEXYZ.  What should be changed so that I only get NAME1 but not NAMEXYZ?  As a workaround, the below commands work.  sed -n '/11/,/14/p' FILE1.TXT | grep NAME | awk -F "= " '{print $2}'|head -1  Is there any 'switch' or am I missing something?


I'm newbie in C/linux. man time_t is unsuccess. I'm trying to clarify what exactly time_t type is? It's ok when I'm assign const int to the variable type time_t as follows:  time_t =4;   Seems this type is just alias for some numeric type. But I don't understand what is this type?

I searched my Linux box and saw this typedef:  typedef __time_t time_t;   But I could not find the __time_t  definition.


Where can I find accurate DEM data of Brighton UK with an attribute table to be used in ARC GIS, being used for a university GIS project and have struggled to find this data.

I am seeking closure with this question guys.  I am aware of various sources of free elevation data ~30+ m, and I have been searching for higher resolution FREE data for a while now. This already exists somewhat (), but may have changed since a year.  I'm afraid I may know the answer already, but to put an end to my misery and false hope:  What is the highest resolution, freely available (outside of academic institutions), elevation data covering the ENTIRE UK? - is 10 m available?


I'm having a hard time understanding why wavelength restricts a wave from passing through a hole smaller than that wavelength. For example on a microwave, the front grating prevents the microwaves from escaping but allows visible light to pass through.  The picture I have in my mind is a string in space representing a single photon, this string has a wave propagating down it with wavelength, lets say 1 meter, but the amplitude of the wave is 1 mm. So even with a wavelength of 1 meter it seems to me that the string can easily fit through any hole of size 1 mm or greater. I'm sure this analogy is wrong, but I don't understand why. Could somebody please explain to me the physical reason why the wavelength defines the minimum sized opening an electromagnetic wave can pass through and why my analogy doesn't work?

This is a follow-up to this question:   Hans Bethe wrote a paper in 1944, "Theory of Diffraction by Small Holes," Phys. Rev. 66, 163. I don't have access to the paper, but from descriptions online it sounds like he proved the following. Suppose a plane wave impinges on an absorbing sheet, and there is a hole in the sheet of diameter $d$, with $d<\lambda$. Let $P_0$ be the power incident on the hole, and $P$ the power diffracted through the hole. Then the transmission is $T=P/P_0=(d/\lambda)^4$.  As a practical application, I think this explains why microwaves don't leak strongly through the metal grille in the front of a microwave oven.  Questions:   Does the thickness of the sheet matter? From references online, it sounds like the hole is treated as a waveguide...? This seems to relate to cutoff frequencies of waveguides, etc.? It seems to me that Huygens' principle would give $T=1$ for $d\ll\lambda$, since in this limit the wavelets are in phase. Why is Huygens' principle invalid here? Is this related to question #1? Is there a simple argument for the proportionality to $(d/\lambda)^4$? Or if not, how does one prove this using the gory details of Bessel functions, etc.?


First of all, it seems  like there are a lot of posts with the same kind of title, but none of them is focusing on the problem I am facing. That is the reason why I opened this new question, and I hope the title is explicit enought.   I am working on a text-editor on my own, and I was using a <textarea> at first, but I wanted to add various styles to the elements I was writing. After reading a lot of topics about it, I decided to change my <textarea> for an <iframe>.  Before trying anything new with design or whatever, I would like to have the same behaviour with this <iframe> and my previous <textarea>. But I am facing an issue :  My <iframe> element is in a page, index.html, which is linked with a CSS file, style.css. I am able to change the global <iframe> design (like width, height, border...) of the frame in style.css, but I can't add a special design to the elements inside the <iframe> with properties I added in my style.css.  I saw in the inspector that the iframe has a #document before any tag   But even if I tried to add this strange tag to the CSS, the style is not applied to the elements I want to change.   So to be concise, my question is this one : Is it possible to add some style to elements inside an iframe in the stylesheet file of the host page ?  Here are some relevant parts of my code, which shows what I would like to do : add a custom font to the <p> tags inside the <iframe>.    window.onload = function() {   var frameElement = document.getElementById("text-field");   var doc = frameElement.contentDocument;   doc.body.contentEditable = true; }   html, body {  margin : 0px;  background : #f5f5f5;  font-family: 'Roboto', sans-serif; }  input:focus, textarea:focus {  outline: none; }  .text-editor {  min-width : 800px;  width : 1200px;   max-width : 1600px;  min-height : 400px;  height : 850px;  max-height : 850px;  background : #f0f0f0;  box-shadow : 0px 1px 4px #ccc;  margin : auto;  overflow:auto }  .text-editor .text-field {  display : block;  background-color : white;  min-height : 300px;  height : 600px;  max-height : 600px;  width : 90%;  margin : auto;  padding : 5px;  border: 1px solid #ccc; }  .text-editor .text-field #document html body {  font-family: 'Source Code Pro', monospace;  font-size : 14px; } <!DOCTYPE html>  <html>   <head>   <title>A Text Editor Project</title>   <link rel="stylesheet" type="text/css" href="CSS/style.css">   <link href="https://fonts.googleapis.com/css?family=Roboto:300,400" rel="stylesheet">   <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet">   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>  </head>    <body>      <div class="text-editor">    <iframe class="text-field" id="text-field" src="about:blank" contenteditable="true">        </iframe>   </div>    </body>  </html>

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


Let $A$ be the person who is standing on the Earth (ignoring gravitational field, etc.). Let $B$ be the person who is moving to the Proxima Centaura and back. By the time dilation equation we get: $$t_A=\gamma \cdot t_B$$ because the time is running slower for $B$ than for $A$. But the motion of $B$ back and forth is equivalent to the motion of $A$ forth and back, isn't it? Thus, by the same equation: $$t_B=\gamma \cdot t_A$$ and clearly, $\gamma$ must be 1 for both equations to be true, so $v=0$ and so they are both stationary, which is a paradox. Where is an error in my process of thinking?

I read a lot about the classical twin paradox recently. What confuses me is that some authors claim that it can be resolved within , others say that you need . Now, what is true (and why)?


Imagine I have a graph G = (V,E), where exactly 2*n vertices have odd degree. (Obviously, there cannot be odd number of vertices with odd degree in a graph). How can I prove that set of edges E of the graph G can be partitioned into n open trails? (ie all the edges can be divided into n chains).  Probably, this can be proved using properties of euler graphs. For example, we can add n edges to the graph, so that all the vertices get even degree. And then we can build the euler circuit. Then we remove added edges and get n open trials. This proof seems good, but it doesn't work in some cases, for example, when we have a complete graph, where all the vertices have odd degrees and we cannot add any more edges.  I'll be really grateful for any clues how to prove this statement or how to improve my own proof!

I'm reading the book Graphs and Their Uses which contains the following theorem and proof:     THEOREM 2.3. A connected graph with 2k odd vertices contains a family   of k distinct trails which, together, traverse all edges of the graph   exactly once.       PROOF. Let the odd vertices in the graph be denoted by   in some order.       $a_1,a_2,\dots,a_k$ and $b_1,b_2,\dots,b_k$      When we add the $k$ edges $a_lb_l, a_2b_2 ,\dots, a_kb_k$ to the graph, all   vertices become even and there is an Eulerian trail T. When these   edges are dropped out again, T falls into k separate trails covering   the edges in the original graph.   However this doesn't seem to make sense since in the graph whose vertices have degrees 3, 1, 1, 1 there is no way to add 2 edges in such a way that the degree of all odd vertices becomes even.  What am I missing here?


I'm trying to make a map but I'm stuck on a command When a player crafts an item I want to let it only be placed on a block, like when a player crafts a crafting table, the command block will make so it's only placeable on gravel. I seen it in other maps. How do I do it? Also I want to make it so certain tools and break some blocks If anyone knows please tell me. P.S. not the /give command

I want to detect when someone is building a lever, then replace it with another lever that has the canplaceon tag so it can be placed on a redstone_lamp  How can I clear the crafting item and replace it with one that has a canplaceon tag?


I am trying to project a shapefile which is in Geographic Coordinate System i.e. Geocentric Datum of Australia 1994 to a Projected coordinate system i.e. Map Grid of Australia Zone 55 using GDA 94 datum, also called as GDA 1994 MGA Zone 55 I think.   I have several shapefiles and this is the only one in a different coordinate system.   I tried to change the projection in Arc Catalog - right clicking the layer going into properties and selecting the projected coordinate system I want but when I actually add the data into ArcMap with other layers already there, I get an error saying:     Warning, inconsistent extent! One or more of the added layers has an   extent that is not consistent with the associated spatial reference   information. Re-projecting the data in such a layer may lead to   unexpected behaviour   The layer gets added but it doesn't overlap other layers.

I put 4 different layers into my ArcMap document, but only one of them will show up on the map! I should be seeing the other 3 layers as well. When I do a Zoom to layer, I can see one layer, but I cannot figure out how to make the other 3 show up at once on top of each other.  Before I opened ArcMap, I used ArcCatalog where I right-clicked 3/4 of the shapefiles and  clicked Properties → Coordinate system → Import and then clicked on my Trees layer, which has the coordinate system I want the other 3 to have. But when I opened ArcMap the 4 layers did not overlap, nor could I move them above or below each other.


I need get "v3.4.2" in string by regex php. String: "ABCDEF v3.4.2 GHI KLMN";

I don't really understand regular expressions.  Can you explain them to me in an easy-to-follow manner?  If there are any online tools or books, could you also link to them?


A new Question today :).  I've downloaded Sublime Text 2 for Linux (x32). Now I want to add it to the PATH-Variable. How does this work?  Greets,  Baldoius

How do I add a directory to the $PATH in Ubuntu and make the changes permanent?


How can i use a different chatter account to post feed items.  This is because I am posting feed elements from apex. But the user doesnt get notified when tagged himself(@mention) in feed.  So i wanted to use other chatter account to post and tag the logged in user, so that the user can get notification.  Below is the code for posting feed:  List<ConnectApi.BatchInput> batchInputs = new List<ConnectApi.BatchInput>();  for(sObject c : [select Name from user where name LIKE '%anurag%']){       ConnectApi.FeedItemInput feedItemInput = new ConnectApi.FeedItemInput();      ConnectApi.MentionSegmentInput mentionSegmentInput = new ConnectApi.MentionSegmentInput();      ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();      ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();       messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();      //Mention user here      mentionSegmentInput.id = userinfo.getUserId();      messageBodyInput.messageSegments.add(mentionSegmentInput);       textSegmentInput.text = '\n'+' Chatter text here';      messageBodyInput.messageSegments.add(textSegmentInput);       feedItemInput.body = messageBodyInput;      feedItemInput.feedElementType = ConnectApi.FeedElementType.FeedItem;      feedItemInput.subjectId = c.Id;       ConnectApi.BatchInput batchInput = new ConnectApi.BatchInput(feedItemInput);      batchInputs.add(batchInput);   }   ConnectApi.ChatterFeeds.postFeedElementBatch(Network.getNetworkId(), batchinputs);

I know this question has been asked earlier but I could not find the answer.  I am trying to create chatter Feed using Chatter connect API and my need is "Createdby user should be different than logged in User".  Please let me know if it is possible and if so then how.  Thanks


public interface Foo<E> {      public void blah(E e);  }  public class MyClass<E> {      private final Foo<E>[] fooArray = new Foo<E>[8]; // does not compile!      // (...)  }   What is the correct way of addressing that generics limitation?  Or maybe it is not a limitation and I am missing something?

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


I am using the Stack Exchange app (v1.0.71) on Android 4.1.2 with kernel version 3.4.0, on an LG Optimus F5.   The app crashes with "Unfortunately Stack Exchange has stopped" when I select the Achievements menu button. Everything else works properly. I can scroll through the feed, view questions, view my site and network profiles, view messages, and upvote comments. I have not tried to create a post since this behavior started.  The crash is only invoked when I tap the Achievements menu icon, and it has happened 100% of the times I've tried this action since the problem began, which was a couple of days ago.

Over the last day, every time I tried to check the Achievements the app crashes, even just after the app launch. Here's a snippet of the error report I sent:        I'm not sure if it's related, but my app also still displays the Embedded Engineering site which was closed as Unknown Site embedded which also crashes the app if selected.


Currently, I have an HDR lit scene with a tree. The tree has a particle system for leaves, that distribute them along the weight painted branches. This works perfectly fine except for the material I have on the leaves, I have a alpha map of a leaf to literally just make it a solid color, and a transparency shader to remove the rest from view. I even made the color bit an emission shader to remove the lighting part of the problem, but the inside bits where the leaves come together are still pitch black. What can I do to fix it?  Pictures: (The UV maps in the pictures are unrelated to the leaves)

Having problems with hair transparency using cycles. I ported over a model from daz studio (have done this a few times before with no issues).   Using a simple mix shader, transparent top, diffuse bottom, black/white texture in the fac.  Heres the blend  with images packed.


I'm want to install Ubuntu on my computer, but I have some doubts about the installation process.  So I have a 256 GB SSD and a 2 TB HDD. I currently use Windows 10 as my primary OS and it's installed on my SSD in partition C: (it's important to note that my SSD has 3 partitions: a system backup partition, EFI system partition and C: )  Now, I'm forced to install Ubuntu on my HDD (it only has one partition: E:) because my SSD is almost full. Nevertheless, I can create a new partition on my HDD for installing Ubuntu   Is it possible to install Ubuntu on my HDD, which is partitioned as NTFS, and dual boot when I turn on my PC? If so, what's the correct installation process in order to do so?  I'm pretty new to Ubuntu and I would like to learn more  Thank you in advance

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


Am trying to traceroute to google.com but unfortunately this is the output I am getting -    I know that these * * *s mean that the packets are not reaching back, perhaps due to firewalls, but no matter which website I am trying to traceroute, I am getting the same output, even our internal website. Any suggestions?

If I traceroute to my server via a bunch of different methods, the external ip seems to not work. However the server is online and accessible by this ip.  Localhost:  michaelxu@michaelxu-server:~$ traceroute 127.0.0.1 traceroute to 127.0.0.1 (127.0.0.1), 30 hops max, 60 byte packets  1  localhost.localdomain (127.0.0.1)  0.120 ms  0.069 ms  0.064 ms   Internal Ip:  michaelxu@michaelxu-server:~$ traceroute 192.168.1.3 traceroute to 192.168.1.3 (192.168.1.3), 30 hops max, 60 byte packets  1  michaelxu-server (192.168.1.3)  0.122 ms  0.065 ms  0.067 ms   External IP:   michaelxu@michaelxu-server:~$ traceroute 24.24.174.153 traceroute to 24.24.174.153 (24.24.174.153), 30 hops max, 60 byte packets  1  * * *  2  * * *  3  * * *  4  * * *  5  * * *  6  * * *  7  * * *  8  * * *  9  * * * 10  * * * 11  * *^C michaelxu@michaelxu-server:~$   ...it contines all the way to 30 ... the same thing happens if I traceroute it through the dns server  It also occurs if i do it from another online service:     Tracing route to cpe-24-24-174-153.socal.res.rr.com [24.24.174.153]...  hop rtt rtt rtt     ip address  fully qualified domain name 1   1   1   1       70.84.211.97    61.d3.5446.static.theplanet.com 2   0   0   0       70.87.254.5 po101.dsr02.dllstx5.networklayer.com 3   0   0   1       70.85.127.109   po52.dsr02.dllstx3.networklayer.com 4   0   0   0       173.192.18.230  ae17.bbr02.eq01.dal03.networklayer.com 5   0   0   0       66.109.9.97 ae-11-0.pr0.dfw10.tbone.rr.com 6   41  40  39      66.109.6.208    ae-6-0.cr0.dfw10.tbone.rr.com 7   39  39  40      66.109.6.0  ae-3-0.cr0.lax30.tbone.rr.com 8   37  39  39      66.109.6.65  9   42  40  39      72.129.9.3  agg1.lamrcadq-ccr02.socal.rr.com 10  36  36  35      72.129.10.73     11  53  60  49      24.24.209.18    ge17-0-spsdca1-ars1.socal.rr.com 12  *   *   *            13  *   *   *            14  *   *   *            15  *   *   *          What do the * * * mean? Is there any way to "fix this"


I have a sql view which take only one parameter, but this parameter is a list, and a need to know how can i pass this parameter in the url  Here is my sql view  SELECT * FROM shop WHERE id IN %list%   When I put the default value for %list% as (1, 2 ,3) as example, the layer preview works and show the shopa with the default ids,  but when I try this in the url  viewparams=list:(1,2,3)   does not work.   I already tried other things like   viewparams=list:"1,2,3"   but nothing works.  Does anyone know how to do this?

I am trying to zoom plot numbers.Plot numbers like 1 10-12 13/P road 20(A) 100&102 and etc.I am able to zoom to all combination plot numbers except 1,2,3.when I pass such value its trowing error:  1 feature types requested, but found 2 view params specified  geoserver sql view is:  select * from plotboundary where nmindar='%nmindar%' and plno='%plno%'   default values and validation are  Name  | Default Value   | validation  nmidar| Hanagawadi I A  | ^[\w\d\s]+$  plno  |  100,102&103    | ^[ A-Za-z0-9_ *@.\/#&+-\,()-_]*$   ajax function:   $.ajax({             url: 'http://XX.168.1.XX:8089/geoserver/XX/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=XX:vwplot&maxFeatures=5000&outputFormat=text/javascript',             contentType: 'application/json',             dataType: 'jsonp',             jsonpCallback: "parseResponse",             data: {                 viewparams: "nmindar:" + nmindar + ";plno:" + plno             }   Can any one tell me how to pass value to viewparams in geoserver, value includes comma. For example as mentioned above "100,102&103" is a single value(plot number).Here   comma is not a separator.


I am new to Ubuntu. After installation I am unable to play the media files like MP4, MP4 etc. What to do?? Thanks in Advance

I've just installed Ubuntu on my Lenovo g460  with Windows 7. I am not able to play any movie or mp3 file. When I click on a file I'm asked to install a plugin. When I click on the install button nothing happens.


my intent for this program was to create a simple program that takes input from the terminal line by line, and stores it into a file in the same fashion, ending when the user inputs "end".  I'm confused about why... 1) the while loop does not end when the user inputs "end" 2) the data is not written to the file (I've checked, it doesn't for whatever reason)  Edit: the answer has been found already! For those just arriving, my while condition should have been !temp.equals("end")  public static void main(String[] args) throws IOException{      Scanner in = new Scanner(System.in);      System.out.println("Type in data and it will be written to a file");     System.out.println("filename = blah.txt");      String temp, filename="blah.txt";      PrintWriter outfile = new PrintWriter(new FileWriter(filename));      System.out.println("enter next line... \"end\" to exit");     temp=in.nextLine();     while(temp!="end"){         outfile.println(temp);         System.out.println("enter next line... \"end\" to exit");         temp=in.nextLine();     }      outfile.close(); }

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


I recently downloaded blender but when I run the program it is full screen but the nav bars are very small including text and icons. I don't know if its anything to do with the fact my monitor is 4K, I have tried going into resolution settings but it means eeverything else will be too big.  Any help would be greatly appreciated.

The Blender UI elements are incredibly small by default on high resolution screens on Windows (15" UHD screen).  I found the Preferences -> System -> DPI setting which can be set up to 144.  This makes Blender usable, but still uncomfortable and difficult on the eyes.  Is there a way to make the UI elements even larger?


The Problem:   A couple of weeks ago, the iMac started "beachballing" regularly in normal use There is no discernible pattern to what triggered a beachball. It could be switching between windows, trying to type, using Spotlight, opening or closing an application, or even just whilst idle. Over the next few days, the hangs became so frequent it rendered the iMac effectively unusable I tried literally everything I could think of to fix it (detailed below), but to no avail The only thing that finally solved it was wiping the disk and reinstalling everything from a Time Machine backup But about a week later, the same thing began happening again. I still couldn't figure it out, so was forced to reinstall (again!) And now, yesterday, it's come back once more   I am at my wit's end. I work in IT, and rely on the iMac to be able to work from home whilst my country is in lockdown. My local Apple Store is obviously closed. Each Time Machine restoration takes almost 18 hours to complete, meaning I'm unable to work during that time (never mind the time waiting on the SBBOD to disappear).  The iMac:   2017 27-inch Retina 5K iMac macOS Catalina 10.15.4 32GB RAM 4.2GHz i7 processor Fusion Drive (APFS, comprised of a 128GB SSD + 2TB HDD) T2 security chip   What I've Already Tried:   Checking Activity Monitor during beachballing   CPU: load is usually ~20% Memory: 0 swap used, ~16GB free memory remaining  Signing out of iCloud Disabling Spotlight indexing Creating a new user account SMC reset NVRAM/PRAM reset Disk Utility First Aid Boot into Safe Mode Boot into Recovery Mode, and use diskutil verifyVolume and repairVolume Repairing Home Folder permissions Checking Console and reviewing system.log and other files   No correlation between beachballing and log entries  Running a spindump via Activity Monitor   Worryingly, spindumps don't show up — they just result in a Crash Report appearing in Console ()  Running EtreCheck   No major issues found No noteworthy minor issues found  Running DriveDx   The results for the SSD were fine The results for the HDD do look a bit concerning — .  Running Apple's hardware diagnostic test at startup   No faults found  Reinstalling macOS   My Suspicions:  I found it interesting that reinstalling macOS does NOT fix the problem, but wiping the Fusion drive, reinstalling macOS, AND restoring from a Time Machine backup in one go DOES fix it (at least temporarily).  My  seem to indicate the HDD is in a "failing" state. I don't know if this is just precautionary or if this could actually be causing it. It's hard to pin the blame on this directly, as the beachballs do not seem to correlate with disk I/O, but I can't say that for certain as I don't know enough about this area. I also would've assumed that the Apple hardware diagnostic test you can run at startup might have identified this if it really was a problem...?  So my hunch right now, in the absence of any more obvious clues, is that maybe this problem is caused by a failing HDD in the Fusion drive...? That might explain how wiping and reformatting the drive lets things work smoothly for a week or so, but after enough new sectors have been written to and data shuffled around on the disk, it starts to slow down after time. That's just a hunch!  What Next?   Do you have any other suggestions of things to check or try? Are there any other clues I might have missed? Do you think my hypothesis about the failing HDD is right?   If so, I understand the HDD in a Fusion drive is not user-serviceable... So I would assume the next best alternative would be to buy e.g. 2TB Thunderbolt drive and use that as the startup disk, instead of the Fusion drive? Is this possible? Are there any drawbacks? Any brands you'd recommend?    Thanks for reading this lengthy post. Any advice or guidance is really appreciated!  Jack

The HDD on my 27 imac Late 2012 has died. Is it replaceable?  At present, I switch on (soundless) and get the white screen which loads up one third and then freezes. I tried Disk utilities which told me my HDD was inaccessible and un-repairable.  If I fit a replacement HDD will I be able to restart, revive, reuse my computer?


The os hangs on the logo screen and all the orange dots are filled. The hard drive shuts down as you cant hear it spinning.  Btw, I'm very much a noob at Ubuntu!

All operating systems freeze sometimes, and Ubuntu is no exception. What should I do to regain control when...   just one program stops responding? nothing at all responds to mouse clicks or key presses? the mouse stops moving entirely? I have an    In what order should I try various solutions before deciding to pull the power plug?  What should I do when starting up Ubuntu fails?  Is there a diagnostic procedure I can follow?


Say that you have an infinite plate uniformly charged with voltage V, and you want to calculate the electric field strength at some distance z away from the surface.  I know that you can calculate the electric field in relation to the sheet charge $\sigma$ as $E = \frac{\sigma}{2\epsilon_0}$, but I don't know how to relate charge $\sigma$ and voltage V.

For an infinite plane charged surface electric field is constant above it no matter how far we go from the surface. So if the electric field remains constant in magnitude, how can the potential difference vary with distance . I am confuse as with distance if potential decreases electric field strength also decreases.and the force on another charge will also decrease if it goes it weaker areas of electric field strength. And in case of infinite sheet, EFL remains constant and hence the force but potential decreases with distance if the sheet is postive surface charged density.


I'm using a Canon 6D, using my Canon 50 mm f/1.8 lens.  I was taking pictures of my son using his "" (no idea how you say that in english :D) last night, in my kitchen, with only my ceiling lights as light sources.  Since he was moving fast, I was trying a setting that would provide me lot of speed. Here are my settings :   Shutter priority mode, 1/200 s. ISO 25600 Aperture around f/13 - f/14 (on the tests shots displayed below) Servo Mode to adjust quickly the focus Drive mode in burst Auto White Balance RAW   My pictures are pretty much all in focus, but, I ended having (on some pictures only) yellowish horizontal bands at random Y position... Sometimes on the bottom, sometimes in the middle, sometimes on the top and sometimes no bands and correct colors.  Here is an example of a 3 images burst shot with a slight move on the right... (using my wonderful kitchen cabinet, the result is pretty much the same with my kid) :      Apart from a mysterious ghost apparition, could someone explain me what is happening here ?

I took a bunch of photos at my son's martial arts club using a D90 with a 50mm F1.8.  The club is lit with overhead fluorescent lighting, and I was getting some weird results where some shots are "white", others have an "orange cast", and still others are partly white and partly orange in the same shot.  I suspect it has to do with the combination of the frequency of the light flicker and with the camera shutter speed. Here is a sequence of 3 shots that show the problem.  The shots were taken with 1/500s at F2 and ISO-800 and with Auto-WB.  First shot ("white/normal"):    Second shot ("orange cast" at top):   Third shot ("orange cast" at bottom):   These were taken in burst mode within a second of each other.  Can anybody tell me what is going on?  And, how I can avoid this?


I am currently developing a phone book in our Intranet (ASP.NET) that pulls out information from our Active Directory and stores them in a List  We have several branches in the country, and i need the employees to be shown grouped by branch, which i did using the following:  lstADUsers.Sort(delegate (MyUser x, MyUser y) {   return x.Branch.CompareTo(y.Branch); });   The problem is that i also want to apply a second sort, so employees are shown ordered by branch name and then in order of relevance (job position). So i want to show vicepresidents first, then managers, then engineers and such... I currently don't have that sort order stored anywhere, so i though of assigning each job position some kind of weight or priority and store it somewhere (database? map?)  I would appreciate any help in this matter. Thanks  EDIT: i would like an efficient method to store the weight of the second property. Right now i solved this by creating a property type int and then assigning weight manually with the following code:  if (objUsuarios.Cargo.Contains("something")) {     objUsuarios.OrdenCargo = 1; } else if (objUsuarios.Cargo.Contains("another thing")) {     objUsuarios.OrdenCargo = 2; }   and in my delegate i am using a triple sort, first by branch, then by job, then by employee name:  lstADUsers.Sort(delegate (Usuario x, Usuario y) {     int valor = x.Piso.CompareTo(y.Piso);     if (valor != 0)         return x.Piso.CompareTo(y.Piso);     else     {          int valorordencargo = x.OrdenCargo.CompareTo(y.OrdenCargo);         if (valorordencargo != 0)                                       return x.OrdenCargo.CompareTo(y.OrdenCargo);         else         {             int valornombrecargo = x.Cargo.CompareTo(y.Cargo);             if (valornombrecargo != 0)                 return x.Cargo.CompareTo(y.Cargo);             else             {                 return x.Nombre.CompareTo(y.Nombre);             }         }     } });

Similar to , we want to sort by one element, then another.  we want to achieve the functional equivalent of   SELECT * from Table ORDER BY x, y     We have a class that contains a number of sorting functions, and we have no issues sorting by one element. For example:    public class MyClass {     public int x;     public int y; }    List<MyClass> MyList;  public void SortList() {     MyList.Sort( MySortingFunction ); }   And we have the following in the list:    Unsorted     Sorted(x)     Desired ---------    ---------    --------- ID   x  y    ID   x  y    ID   x  y [0]  0  1    [2]  0  2    [0]  0  1 [1]  1  1    [0]  0  1    [2]  0  2 [2]  0  2    [1]  1  1    [1]  1  1 [3]  1  2    [3]  1  2    [3]  1  2   Stable sort would be preferable, but not required. Solution that works for .Net 2.0 is welcome.


I've been trying to remember the name of a Mars based movie. The plot takes place in the near future when the first mars man mission just leaves the earth.  While inside the martian installation, the mission crew are revealed that humans are a product resulted of martian DNA left by the martians (to be seeded on earth) millions of years in the past right after they left their planet behind.

So I watched this movie when I was younger (early 2000, I guess) and the only thing I remember is this one scene.  There were some people exploring the space and somehow they ended up in this white room and they shrank and in they were looking for someone in this form. And that's it and I am not even sure on the shrinking part, hah. But the white room/space stuck in my head.


The situation is as following: I have a .txt file that includes series of letters all divided bij newlines Here's a small part of the file:  lrtjxz lrtjhs lrtsxv lrtvsw lrtywj lrtyws lrxwwv lrvhsx lryjts lrytwv lrzvwj lzwscr lzjrww lzjroj lzjrvs lzjrhs lzojvs   I created a script that would count the number of times one of these lines is alphabetically ordered. But for some reason it echo's nothing not even 0.  Script:  cat file.txt | while read line do alphabeticSorted=$(echo $line | grep -o . | sort) if [ "$line" == "$alphabeticSorted" ] then count=$((count + 1)) fi done  echo "$newCount"   Does anyone know what I am doing wrong?

Why do I get different values for $x from the snippets below?  #!/bin/bash  x=1 echo fred > junk ; while read var ; do x=55 ; done < junk echo x=$x  #    x=55 .. I'd expect this result  x=1 cat junk | while read var ; do x=55 ; done echo x=$x  #    x=1 .. but why?  x=1 echo fred | while read var ; do x=55 ; done echo x=$x  #    x=1  .. but why?


If an Agent can possess anyone still connected to the Matrix, and, as we can see, they sense when someone is seen something weird (like the drunk beggar in the first movie), why didn't they possess Neo when he was in the car with Switch Apoc and Trinity?  I believe that's what Trinity meant when she said the gun was for their protection from him     Neo: what is this? (talking about the gun pointed to him)   Trinity: It is necessary, for our protection.   Neo: From what?   Trinity: From you!

Apparently, when someone sees something strange or unusual in the Matrix, it triggers some kind of red flag that tells the agents "come here and take over that body". We see it a few times during the movie, like in the subway station, with an old hobo, for example.  Couldn't the agents add Morpheus's and/or Trinity's faces to the list of triggering elements? If not, what about a self-repairing mirror?  My point is: why didn't the agents simply take over Neo's body? They had many opportunities before he was out of the Matrix. Can't they see through his eyes?  Plus, on a purely cinematic level, imagine how dramatic the scene would have been. Morpheus would have had a dilemma: getting rid of the agent would mean killing the potential One.


Let $\mathcal H$ be a Hilbert space and $\mathcal L$ is a self- adjoint operator with a discrete spectrum $\{\lambda_{j}\}$.  I read that it is well known that for, $\lambda \notin \sigma(\mathcal L)$,  $$\left|(L- \lambda I)^{-1}\right| \leq \sup_{j}\frac{1}{|\lambda - \lambda_{j}|}.$$  How to show this well-known result?

$H$ is a Hilbert space and $B(H)$ is the Banach space of its bounded linear operator on $H$. Assume $A\in$ $B(H)$, $A$ is self-adjoint. Suppose $\lambda_{0}$ is in the resolvent set of $A$. Show that: $||(A-\lambda_{0}I)^{-1}||=\frac{1}{d(\lambda_{0},\sigma(A))}$  Now I can use the knowledge of functional calculus(see $(A-\lambda_{0}I)^{-1}$ as the function of $A$)  to show that $||(A-\lambda_{0}I)^{-1}||\leq \frac{1}{d(\lambda_{0},\sigma(A))}$. But I don't know how to proceed.


$f: \mathbb{R} \to \mathbb{R}$ is continuous with $f(x)=0$ for all $x \in \mathbb{Q}$. Show that $f(x) = 0$ for all $x \in \mathbb{R}$.   Can anyone please point me in the right direction as to how I can go about answering this question?

Akhil showed that the  is the same as the continuum, using as a step the observation that continuous functions that agree at rational points must agree everywhere, since the rationals are dense in the reals.  This isn't an obvious step, so why is it true?


How to install drush on 1 and 1 linux hosting for creating sub-theme for ZEN?

I have a shared hosting account on which i have created sites using joomla 2.5 and drupal 7.  I want to use drush to apply patches to existing modules for my drupal 7 site.   Can any one guide me as to how can i install this drush and use it for these drupal 7 sites on my shared hosting ?  Step by Step Guide would be highly appreciated (New here)   Thanks


I want to retrieve the profile image of the user(URL). The user could have set image or not. So if the image field is empty, I get an exception. How could I check beforehand that image field is empty and I avoid crashing the app    firebaseFirestore.document("users/profiles/data/"+ad_poster_id).get().addOnCompleteListener(new OnCompleteListener() {      @Override     public void onComplete(@NonNull Task<DocumentSnapshot> task) { if(task.getResult().exists()){              String profile_image = task.getResult().getString("image");             if(profile_image!=null)             Picasso.get().load(profile_image).into(circleImageView);         }      } });

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


I'm a typical student in a 3rd world country working to pay for college. My monthly tuition is about 300 USD. Internships average pay is 450 USD for 30h/week of work... As I get to end of my bachelor, i'm required to write a dissertation, and when i start looking for articles and references if found this amazing paper: "QODM: A query-oriented data modeling approach for NoSQL databases" which lines 100% with my thesis. But it costs whooping 33 bucks! for a single source that might turn out to be not useful at all...  Are there alternative sources? (besides piracy, which i'm strongly against but is becoming really tempting right now...)

I’ve discovered that website like ResearchGate offer the possibility to ask the paper editor to provide his paper for free. Many are collaborating.  Are there any other ways for researchers to obtain free access to papers?


Why am I seeing people marking technical parts of texts (names of functions, files) a code (e.g. `explorer.exe`), while logically it is not a code? I agree that these things should be somehow highlighted, but I don't see the code marking an appropriate way of doing it.

When reviewing Suggested Edits on Stack Overflow, I often come across "fixed formatting" suggestions that use  to place emphasis on certain keywords, but isn't actual code.  For example:     I am having a difficult time with a background task in iOS. The problem I seem to be facing is that iOS is silently terminating the App if my background task runs for too long. What can I do to increase time iOS will wait for my background task to complete?   Gets edited to:     I am having a difficult time with a background task in iOS. The problem I seem to be facing is that iOS is silently terminating the App if my background task runs for too long. What can I do to increase time iOS will wait for my background task to complete?   This seems like an invalid use of an inline code span because, well, it isn't code, and it is distracting. There are a    of these edits being made. Often enough they get approved, which reinforces the behavior.  Is this a valid use of inline code spans? If not, should it be edited and corrected? Should edits suggesting these changes be rejected?


I created a custom form (adding some additional fields) using the Contact module from the core of Drupal 8.  When I submit the form is sent an email containing all values, but it is really bad formatted. The email only contains form's values without any field label and it is unreadable.  How can I customize the template of the email sent on the form's submit?    What I already tried  hook_mail_alter  I found some answer about the same problem for Drupal 7 suggesting to implement a custom hook_mail_alter function (for example: , ).   So I created a custom module with my function:  /**  * Implements hook_mail_alter().  */ function mymodule_mail_alter(&$message) {    // Process only 'contact_page_mail' messages   if ($message['id'] != 'contact_page_mail') {     return;   }    $params = $message['params'];    // Body   $message['body'] = [];   $message['body'][] = t('Some custom message');    // I don't know what should I do here?   // How can I access values of all fields in the form?   // ...    return; }   The function is correctly triggered before the email is sent, but I can't access field's values so I'm not able to build a custom email.  Also I can't get the form's id (only a generic 'contact_page_mail' valid on all contact forms) so I'm not able to handle different contact forms in this function.  Swift Mailer  As suggested in , I tried with the .  After , I'm able to get it working and now I have a swiftmailer.html.twig template file with this content:   <div>    {{ body }}  </div>   But as for the hook_mail_alter solution, I don't know how to access form's field values so I can't customize the email format.  Moreover, the Swift Mailer module currently is an alpha version (8.x-1.0-alpha1) and the Mailsystem module (required to get things working) is a beta version. So I would like to avoid to install unstable modules on a production website (anyway this can be the last solution, if no other works).    EDIT  Thanks to @Berdir, now within the hook_mail_alter function I can access field values with:  $contactMessage = $message['params']['contact_message'];  // Value of 'field_my_field_name' $contactMessage->get('field_my_field_name')->getString();   So I can put them inside the $message['body'].  Quite complicated, but it works.  Is there a way to get field values within the Swift Mailer template? I tried with {{ params.contact_message.field_work_with_us_name }} but it doesn't works.  What happen if I have two or more contact forms? The function hook_mail_alter will be triggered on all of them. Is there a way to have a specific function for each contact form?

I want to theme the outgoing mail from the contact module, because the standard output looks horrible. Where can I do this? It's the one starting with admin () sent a message using the contact form at .


I am reading a book. It says that spin $s$ describes the symmetry property of a particle. Basically, the number of different wavefunctions which are transformed into linear combination of one another is $2s+1$, under rotation.  Since photon wavefunction is a vector, therefore it has spin $s=1$. So it has $2s+1=3$ components under transformation.  But photon is massless. So it doesn't have rest frame. It always moves with light speed in any frame. As a result, it has a preferred direction which is direction of the momentum of the photon.  What I don't understand is since photon can never be at rest, it doesn't have the rotation symmetry of spin = 1 (seems to me). Indeed, when writing the polarization in density matrix, it is always 2 components. And I thought this corresponds to spin = 1/2 (i.e. 2s+1=2).  So, it seems photon behaves as spin=1/2. What's my misconception here? Is it possible to have longitudinal photon? Thanks a lot!

If photons are spin-1 bosons, then doesn't quantum mechanics imply that the allowed values for the z-component of spin (in units of $\hbar$) are -1, 0, and 1?  Why then in practice do we only use the $\pm 1$ states?  I have been told that this is directly related to the two polarizations of the photon.  This seems to be more of a classical argument however, arising from the fact that Maxwell's equations do not permit longitudinal EM waves in a vacuum.  I have also heard that it is related to the fact that photons have no rest mass, although I understand far less of this reasoning.  What I'm looking for are elaborations on these two arguments (if I have them correct), and perhaps an argument as to how these two are equivalent (if one exists).


I just ran across  which had been flagged for a broken link to example.com...  I'd like to see the `[Foobar](http://www.example.com)` URL markdown in comments.   That's all it is. For some reason, the URL in that inline code block is being parsed into an actual URL. The extra closing parentheses on the end is causing it to get flagged as an invalid link. Why on Earth is it getting parsed at all?     I'd like to see the [Foobar](http://www.example.com) URL markdown in comments.   It doesn't get parsed in the post preview as you're typing... and it's not getting parsed in this question's body either...

Markdown source:  `http://google.com`  - `http://google.com`     - `http://google.com`   Rendered result:  http://google.com   http://google.com   http://google.com    Note that the third code span is a link. Adding a newline before the list item makes the link disappear.


I have been having a problem writing an article for the Journal of Materials Science. I am using their template and when it comes to figures I get the following result in the text.   I am using the following preamble:  \documentclass[onecolumn,draft]{svjour3} \usepackage[square,numbers]{natbib} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{color} \usepackage{siunitx} \usepackage{graphicx} \usepackage{epstopdf}   and the figure insertion with the following:  \begin{figure}[h]     \centering     \includegraphics[width=\textwidth]{figure3a.eps}     \caption{example}     \label{fig:4} \end{figure}   I am not getting any errors and the converted pdf file looks ok but nothing displays in the text except from what you see in the figure. Can anyone help me with this? Has anyone stumbled on this problem before?  Cheers

I'm using IEEEtran to format an article, and I wanted to include an image. I included the graphicx and hyperref packages, and used the following code, like normal, to include an image.  \begin{figure}[!t] \centering \includegraphics[width=3in]{fetch} \caption{Pipeline: Fetch Instruction} \label{fig:fetch} \end{figure}   What appears, however, is this:    Fetch.png is a file in the directory, and if I remove it, pdflatex errors instead of producing an output. I'm using MiKTeX 2.9 on Windows 7. Any ideas?


Do academic peer reviewers receive any salary? If yes, what is the annual average?

Being a young researcher myself I received a comment from my colleague that some of the journals are paying reviewers for the reviewing process.  When I gave it a thought, it started to make more sense. In case of high quality, respected journal, an institution may consider itself privileged to have a reviewer of such journal and allow the reviewer to dedicate small proportion of his/her daily activities just on the reviewing process.  The reviewer being paid, has more obligations to provide thorough in depth review.  Does that hold true for some journals or is it just a myth?


Like int [] i or int i [] is there any difference I'm curious

I have recently been thinking about the difference between the two ways of defining an array:   int[] array int array[]   Is there a difference?


I have a web app using OpenLayers 3, with several layers added as image layers, like so:   mylayer= new ol.layer.Image({      source: new ol.source.ImageWMS({          url: 'http://server/geoserver/opengeo/wms',          params: { 'LAYERS': 'layername' },          serverType: 'geoserver'      })  });   I would like to have an info window popup on the click of a feature , I am following the example here :   I have Bootstrap and JQuery in my app (these are both needed for this example) and am not getting any errors, but no results either..  ..this example is for a vector layer, and so far I haven't been able to get this to work for me...Is there a way I can do this with an image layer? or do I need to add the layer as a vector layer?

I have a map a at the link below:    I added one of my GeoServer WMS layers to the map, now I try to add the attributes window pop up on click. I found to examples on the OpenLayers 3 homepage, but I cannot put together a working code...      Is there any chance to have a working sample somewhere?


So I am making a word generator that takes several inputted letters, puts them in all possible positions, and matches them with a document to find words. If I am approaching this wrong please tell me! If not how can I do this? Thanks

How do you generate all the permutations of a list in Python, independently of the type of elements in that list?  For example:  permutations([]) []  permutations([1]) [1]  permutations([1, 2]) [1, 2] [2, 1]  permutations([1, 2, 3]) [1, 2, 3] [1, 3, 2] [2, 1, 3] [2, 3, 1] [3, 1, 2] [3, 2, 1]


I want render my custom block in template file, but what I get is the block without going through the twig file.  theme_preprocess_page(&$variables) {       $block =  \Drupal::service('plugin.manager.block')->createInstance('id_custom_block', array());     $variables['custom_block'] = $block->build();  }   I Want render custom block, and different from a view block, this not work:  $block = \Drupal\block\Entity\Block::load('your_block_id'); $variables['block_output'] = \Drupal::entityTypeManager() ->getViewBuilder('block') ->view($block);   Am I doing something wrong?

I need to render a views block in my page.html.twig template. In D7 I would do this:  <?php   $block = module_invoke('module_name', 'block_view', 'block_delta');   print render($block['content']); ?>   In Drupal 8 module_invoke is deprecated and recommended to use this: (I've added the block's name as the second parameter)  Drupal::moduleHandler()->invoke($block, 'views_block__blog_block_1', $args = array());   I tried a few things. First tried to do it in a twig template but I don't know how to call php functions in a twig template, so that didn't turn out too well.  Then I called the function in the preprocess_page() function in the .theme file but before I could get it to work I tried something simpler just to try make a variable work inside the twig template which didn't work either, for example:  In the template_preprocess_page(&$vars) function in the .theme file:  $test = 'Hello World'; $vars['$my_var'] = $test;   I tried to call my_var inside the twig template but it didn't work and I got an error message saying "The site has an error, please contact the administrator"  So, to summarize, here are my questions:   How do I make variables available inside twig templates? How do I call functions inside twig templates? Do I render blocks inside the .theme file or twig template?


I have a safe mode issue with my iPod touch fourth gen. IOS: 5.1.1. It was working just fine for about a year and then the other day I installed a tweak that allowed for vertical scrolling of the home screen from HYI repo (I tried to install the same tweak a few months ago along with another tweak and I got booted into safe mode but everything worked fine in safe mode, so I went into Cydia and uninstalled the two tweaks thinking that they were conflicting with each other. After that I re-sprang it and it worked like normal.) and I got booted like normal but this time it froze on lock screen and then booted into safe mode. (o_O) THIS time my touch screen wouldn't work. So I forced re-booted it by holding the home and lock button until the screen flashed white and then showed the apple boot logo. After that I uninstalled the tweak and it worked fine. Today I just installed two add ons and upgraded HTML Widgets related to SB Settings. The other two add ons were iOS 7 ringtones and notification alert sounds. Yet again I was greeted by my usual lock screen pic and then the safe mode black picture lock screen, again, my touch screen wouldn't work but the buttons would. So I just re-booted it by holding the buttons thinking it would solve the problems, but of course, it did nothing to solve it... Now this time I am actually stuck in safe mode and do not want to restore my jailbreak because I have a bunch of tweaks and settings I worked really hard on.  PLEASE could SOMEONE fix this problem with the safe mode and SB Settings tweaks?! I am clueless with what to do.  Thanks!

I jailbroke my old iPod Touch 3rd Generation, with IOS 5.1.1, using the latest version of absynthe. It worked for several months, but then it randomly stopped. It went into safe mode, but the touch screen wouldn't work. It showed the lockscreen, but nothing worked at all, except for the physical buttons. The only way to reboot is to follow the same steps as DFU mode (Hold power button 3 sec, then home button AND power for 10, then just home for 8)... However, it always boots right back into Safe mode.  I had to restore, and once rejailbroken, it worked fine, until I installed SBsettings. Then it did the EXACT same thing, and I had to restore and re-jailbreak AGAIN! The other day, I finished installing ALL of my extensive list of tweaks, and got it to about where I wanted it, when lo and behold, it booted to safe mode again. I have spent so much time on this, and I do not want to do it again. Does anybody here have any knowledge on the topic? Is there a program I can run from my computer to manually control the device or kick it out of safe mode? Is there some other method of doing this? I am looking for any solution OTHER than restoring. I have done that several times.  Also, I know the problem isn't with my jailbreak. It worked for several months before, then one day stopped. Now, it has the problem within a day of rejailbreaking, OR instantly if I install SBsettings. I re-installed the jailbreak, and applied the new one as well, and that didn't work. I have given up, and don't want to go through the painful process of restoring, rejailbreaking, and re-installing all of those tweaks again.  Also, because I can't get into my iPod, I can't provide a list of tweaks. I would if I could, but it just can't happen unless I can get in there.


My website is showing 245 pages indexed in Google Search Console (formerly Webmaster Tools), but in Google SERP it is showing no results? My website is 2 months old, in GSC there are no crawl errors, but a site:example.com search is giving no results.  Can anyone tell me why not?

What are the best ways to improve a site's position in the Google search results?


So far the best way to get it working without breaking a possible background running installation ( as it could happen by removing the lock file), is stopping the service using apt:  Error:  # sudo apt-get upgrade E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?`   Solution:  sudo systemctl stop apt-daily.timer

I get this error when trying to use apt-get:  E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?     How can I fix this?


I have an array of Plotly traces. console.log(traces): traces: [{…}] 0: name: "temprature" type: "scatter" x: (7523) [1527581340000, …] y: (7660) [15.68, …] __proto__: Object length: 1 __proto__: Array(0)  At an event, I want to check if a newly created trace is on the list or not. Firstly, I check it with the includes function but it didn't work, then I found  on how to check the availability of an object in an array in js. function contains(a, obj) {         for (var i = 0; i < a.length; i++) {             if (a[i] === obj) {                 return true;             }         }         return false; }  but it seems not to work for me. $("#temprature").change(function () {         var trace_temprature  = {                             x: index,                             y: temprature,                             name: document.getElementById('temprature').name,                             type: 'scatter'         };          if (document.getElementById('temprature').checked) {             if( !traces.includes(trace_temprature) ){                 traces.push(trace_temprature);             }             console.log('trace in the add ', traces);                        console.log('temperature trace: ', trace_temprature) // this line prints the same object on the previous list                      } else {             console.log('if condiiton: ', contains(traces, trace_temprature)); // this line print False             if( contains(traces, trace_temprature) ){                 var ind = traces.indexOf(trace_temprature);                 traces.splice(ind, 1);             }          }            });  any ideas?

A strict equality operator will tell you if two object types are equal. However, is there a way to tell if two objects are equal, much like the hash code value in Java?  Stack Overflow question  is similar to this question, but requires a more academic answer. The scenario above demonstrates why it would be necessary to have one, and I'm wondering if there is any equivalent solution.


i got a dryer that have a green netural cord but the cord couldn't fit in the outlet because it had 3 prong with a circle prong it may be 4 prong my old dryer has a three prong that fir in the outlet but doesn't had a ground wire can I use that 3 prong for my new dryer w/o a ground wire will that cause problems?

I just moved into an old home that has a three pronged wall jack as shown below:    I have a newer dryer that has a four pronged cable.  Please see the back of the dryer, I've removed the four pronged cable.     Question  I bought a new three pronged cable from home depot. Can I put that cable into this dryer and simple connect it to the wall? Is that safe? Will it work? If so, what do I do about the spot for the grounding wire? I would love to see a video/image of this being done.   In the past I've replaced a three pronged cable with a four pronged cable in a dryer and successfully connected it. But this time I'm trying to do the reverse..    I've fixed and already washed one round of clothes. Hopefully all is well :)


In order to compute, in an elementary way,   $\displaystyle \int_0^1 \frac{x \arctan x \log \left( 1-x^2\right)}{1+x^2}dx$   (see  )   i need to show, in a simple way, that:  $\displaystyle \int_0^{\tfrac{\pi}{4}} \ln(\tan x)\ln(\cos x-\sin x)dx=\dfrac{G\ln 2}{2}$  $G$ is the Catalan's constant.  PS:  This formula is equivalent to:  $\displaystyle \int_0^1 \dfrac{\ln x\ln(1-x)}{1+x^2}dx-\dfrac{1}{2}\int_0^1 \dfrac{\ln x\ln(1+x^2)}{1+x^2}dx=\dfrac{G\ln 2}{2}$  It's not a trivial formula for me.  PS2:  $\displaystyle \ln(\tan x)\ln(\cos x-\sin x)=\ln(\sin x)\ln(\cos x-\sin x)-\ln(\cos x)\ln(\cos x-\sin x)$  Compare to:  $\displaystyle \ln(\cos x-\sin x)\ln(\cos x) dx-\ln(\cos x+\sin x)\ln(\sin x)$

In order to compute, in an elementary way,  $\displaystyle \int_0^1 \frac{x \arctan x \log \left( 1-x^2\right)}{1+x^2}dx$  (see  )  i need to show, in a simple way, that:  $\displaystyle \int_0^{\tfrac{\pi}{4}}\ln(\cos x-\sin x)\ln(\cos x) dx - \int_0^{\tfrac{\pi}{4}}\ln(\cos x+\sin x)\ln(\sin x)dx=\dfrac{G\ln 2}{2}$  $G$ being the Catalan constant.  The reason of my interest for this question is, if i am right, that this formula permits to find out a relation between integrals:  $\displaystyle \int_0^1 \dfrac{\ln(1+x)\ln(1+x^2)}{1+x^2}dx$  $\displaystyle \int_0^1 \dfrac{\ln(1+x)^2}{1+x^2}dx$  $\displaystyle \int_0^{\tfrac{\pi}{4}}\big(\ln(\cos x)\big)^2 \dfrac{}{}dx$  and some constants.


It often happens that after a variable in math mode, some punctuation in text mode follows (both display and inline). Depending on what the variable letter was, the spacing between letter and punctuation can look rather odd:   $A$, looks like  - which is fine $V$, produces  - here, the distance between V and comma is far to big.   There are lots of other letters that are not very well-spaced, U, W and others which end "too italic".  Is there any way to automatically fix this spacing? So far, I was inserting negative kernings all over the way, e.g. $V$\kern-1.5pt, giving . Of course, the kernings have to be adjusted for every letter (and font) manually once; perhaps there is some functionality in microtype (pdflatex only is fine) that allows for this?  Edit: For me, it is not possible to include the punctuation in the math ($A,$), since I do use different fonts for text and math (which might not be too conspicuous for the fullstop, but can be seen for larger punctuations, especially the double colon - which, if in math mode would need extra treatment anyway).  Completely subjective MWE (here, same font):  \documentclass[preview]{standalone}  \usepackage[utf8]{inputenc} \usepackage{amsmath, microtype, lmodern}  \begin{document}    Proper spacing: $A$, $E$, $Q$, $R$. \\    Acceptable spacing: $B$, $C$, $D$, $G$, $O$, $S$, $Z$. \\    Poor spacing: $F$, $H$, $I$, $J$, $K$, $M$, $N$, $P$, $T$, $U$, $V$, $W$, $X$, $Y$. \end{document}

It has been pointed out on this site, e.g. , that text punctuation doesn't belong to the formula in inline math. I've been following this practice for a long time, so I write for all $v\in V$, where ... as opposed to for all $v\in V,$ where .... However, the first version prevents kerning between V and the comma. Note that the comma is a lot closer to the V in the second version:    \documentclass{article} \begin{document} $v\in V$, where \quad $v\in V,$ where  \end{document}   Note that there's no difference between the two versions if I replace V with A:    Now I'm wondering: Should I start including punctuation in my formulas to enable proper kerning, at least as long as fonts are used where the text and math punctuation glyphs look the same? Or are there reasons why the kerning is not desirable anyway?


I'm not sure if there is any practical use case for this, but after playing around a bit with Python 3 in Jupyter notebook I'm wondering about the results I get from expressions like this: 54 == 54 == 54  # True in Python, False in Javascript 54 == 54 != 54  # False in Python, True in Javascript 54 != 54 != 54  # False in Python, True in Javascript 54 != 54 == 54  # False in Python, False in Javascript  If the values zero and one are used instead, Python gives the same results (I didn't test Javascript). The Javascript results are what I would expect if the first equality or inequality resulted in a Boolean value that was then compared with an integer (left to right evaluation of operators with equal precedence and Booleans never equal to integers). I'm trying to imagine the rules that give the Python results and am having difficulty coming up with a set that covers all cases. In some ways the answers Python gives are more what I would expect intuitively just by looking at the expressions. But for that to work it seems as if the result of the first operator has to be something other than a Boolean value. I'm not saying either result is necessarily wrong. I'm just wondering how the Python result is arrived at.  Wait, if Python evaluates: a == a == a a == a != a a != a == a a != a != a  like this: (a == a) and (a == a) (a == a) and (a != a) (a != a) and (a == a) (a != a) and (a != a)  Then that would account for the result, though not for why Python parses it that way.

What are the lesser-known but useful features of the Python programming language?  Try to limit answers to Python core. One feature per answer. Give an example and short description of the feature, not just a link to documentation. Label the feature using a title as the first line.  Quick links to answers:


Is it possible to get Biblatex (or bibtex, I can change) to put out a citation with each entry not on a new line?   Right now I have something that looks like:  1. Katz, M. J.; Ramnial, T.; Yu, H.-Z.; Leznoff, D. B. J. Am. Chem. Soc. 2008, 130, 10662–10673. 2. Lefebvre, J.; Korcok, J. L.; Katz, M. J.; Leznoff, D. B. Sensors 2012, 12, 3669–3692.   What I need is   1. J. Am. Chem. Soc. 2008, 130, 10662–10673. 2. Sensors 2012, 12, 3669–3692.   Now, removing the names seems pretty easy (as a last resort I can just do a find and replace in the bib file to get rid of them), but I have no idea how to make a super condensed block of citations. Is there an easy way to do this, or will I have to do it manually?

I have a strict page limit on a paper I'm writing, and the page limit includes citations, so to save space I would like to remove the line breaks between entries in my bibliography:  [1] Dr. Seuss. *Horton Hears a Who!* Random House, 1954. [2] J. Lennon. *In His Own Write*.  Macmillan & Scribner, 1964. [3] L. Carroll. *Alice's Adventures in Wonderland*. Macmillan, 1864.   instead of   [1] Dr. Seuss. *Horton Hears a Who!* Random House, 1954. [2] J. Lennon. *In His Own Write*.  Macmillan & Scribner, 1964. [3] L. Carroll. *Alice's Adventures in Wonderland*. Macmillan, 1864.   At the moment, the biblatex commands I'm using are  \usepackage[firstinits=true,backend=bibtex,doi=false,isbn=false,url=false]{biblatex} \AtEveryBibitem{%   \clearfield{pages}% } \renewcommand{\bibfont}{\normalfont\footnotesize} \addbibresource{bib.bib} \begin{document} \end{document}  \nocite{*} \begingroup \setlength\bibitemsep{0pt} \setlength\bibnamesep{0pt} \printbibliography[heading=none] \endgroup   which I think explains why I want to use Biblatex instead of the paralist solution I've seen (and that I could not get to work with Biblatex).  EDIT I: Here are two screen shots showing the spacing differences.  No line break:  With line break:   Edit II:  Solved with   \usepackage{setspace} ... \begin{spacing}{.5} \printbibliography \end{spacing}


Can someone guide me on how to find solution to such problems within a minute as that is the amount of time I will be given during my exams. also share what answer you get as I got different answers for same question with different methods

How do I efficiently compute $a^b\bmod c$:  When $b$ is huge, for instance $5^{844325}\bmod 21$? When $b$ is less than $c$ but it would still be a lot of work to multiply $a$ by itself $b$ times, for instance $5^{69}\bmod 101$? When $(a,c)\ne1$, for instance $6^{103}\bmod 14$?  Are there any other tricks for evaluating exponents in modular arithmetic?  This is being asked in an effort to cut down on duplicates, see  and .


How to copy files over the LAN with a cmd batch file?  I want when i execute the .bat to send my file from PCUSER1/Desktop to PCUSER2/DESKTOP?  How do I do that?

I am trying to copy a file over from a mapped drive on a network to the current computer through a batch file.   I've already attempted the following below and still no results. The plan is to run a batch file to copy a file from a network drive down to the local C:\ drive.   @echo off copy H:\Videos\TargetVideo\TargetVideo.mp4 C:\Video\


I am trying to draw a box in a window. The window itself (JFrame) is in a class, and the box i'm trying to draw is in another class. Each time i try to draw the box, i get an exception which i am unsure why it occurs. Here is my code:  The class that draws the circle:  public void drawCircle() {     Graphics g = this.getGraphics();     g.setColor(Color.RED);     g.fillOval(100 ,100, 100, 100);  }   The GUI class:  if(e.getKeyCode() == KeyEvent.VK_LEFT)     {         s.drawCircle();         System.out.println("Left button has been pressed"); }

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?


How to find the $\sum_{i=0}^n{\ell+i\choose i}$. I'd tried several binomial series, but cannot be work. Also does it have a combinatoric intuitive explanation?

After reading , the most popular answer use the identity $$\sum_{t=0}^n \binom{t}{k} = \binom{n+1}{k+1}.$$  What's the name of this identity? Is it the identity of the  modified.  How can we prove it? I tried by induction, but without success. Can we also prove it algebraically?  Thanks for your help.    EDIT 01 : This identity is known as the  because, on Pascal's triangle, when the addends represented in the summation and the sum itself are highlighted, a hockey-stick shape is revealed.


I am travelling to Japan from Uzbekistan through Incheon airport.    Do I need a Korean transit visa, if I only make transfer at Incheon and do not go outside of the airport?

I'm travelling from London (UK) to Jakarta and using 2 different airlines (2 separate tickets - non connecting flight), from London to Incheon using Asiana (1 ticket), and from Incheon to Jakarta using SQ/Singapore airlines (1 ticket) and have to layover at Incheon about 8 hours. Do I need a Korea visa if I have to transfer/change the airlines? Or can I change airlines without visa? I'm an Indonesia passport holder


Ladies and gentlemen, hello. Attracted by one research topic, I am facing a challenge of finding the most relevant sources, more precisely, of identifying the reputed and most qualified authors. My question is not about a general sources search. Not about asking myself a question, thinking up proper key words and looking them up in academic data bases. Once I set myself a goal, including the one of searching for literature, I may go as far as it is physically possible. But apart from spending much time, my main concern is that in the end I will most certainly miss out on all or many experts in my subject. Thus, I am looking to understand is there a way for to know which are the most important researchers who already wrote on a certain quite narrow subject? Maybe someone can recommend sites specialised in such kind of search? Obviously, I already looked this question up on internet search engines but they do not return any meaningful results. Furthermore, I also saw this  which is too narrow and does not provide a general solution. Finally, asking senior researchers is not an option either because I am not affiliated to any institution.

What is the best way to go about to find a certain research group that do work in a specific field (e.g research groups doing empirical brain investigations but working from a dualistic perspective, or research groups doing eyetracker work on infants)?


As the title, Can I use windows documents after install linux ?

Can I open Microsoft Word and Excel files with Ubuntu?