I want to update records before insert if there is a match on a lookupkey rather than inserting a new record. I have viewed the related question but do not understand how to get the trigger list to update rather than insert a new record?  I appreciate everyone taking the time to review, and help a new coder out.  Trigger:  trigger TINCheck on Account (before insert) {     dupeCheck.checkforDupes(trigger.New); }   Class:   //A Utility class to process Account records  public class dupeCheck {      //the AccountTINTrigger list is getting passed in by our trigger; this should match trigger.new     public static void checkforDupes(List<Account> itemsFromTrigger){          //list variable for our query to use as a limit/bind variable         List<String> namesFromTrigger = new List<String>();         //populate that list variable         for(Account acct: itemsFromTrigger){             namesFromTrigger.add(acct.LLC_BI__lookupKey__c);         }          //query for existing items, but only if they have the same TIN (WHERE cond)         List<Account> existingRelationship = ([SELECT id, LLC_BI__lookupKey__c  FROM Account              WHERE LLC_BI__lookupKey__c in :namesFromTrigger]);          List<account> Recordstoupdate = new List <Account>();         //check to see if there are matches         if(existingRelationship.size() > 0){             //this means we have some dupes and we need to identify which records are dupes             //loop through Accounts              for (Account currentRelationship: existingRelationship){                 for(Account newRelationship: itemsFromTrigger){                     if(currentRelationship.LLC_BI__lookupKey__c == newRelationship.LLC_BI__lookupKey__c) {                         newRelationship.Id = currentRelationship.Id;} //What else is needed here to update the itemsFromTrigger so that records are upserted rather than inserted?                 }             }         }      } }

I have an afterInsert trigger on Events. When the Script is finished, I would like to delete the event. I keep getting this error message.     DML statement cannot operate on Trigger.new or Trigger.old   If I cannot do this within Trigger.new, what is the best way to do this? If SOQL is involved, what field am I looking for? event.ID?


I'm receiving data from the port.  This data has date and time.But not formatted.  Example:  '02012019', '090253'   I want to save it to the database and I want to convert this format.  02-01-2019   09:02:53   Is there a function for this? Or is it a problem if I write? It will run 200 times in 5 seconds.  Anybody have a suggestion?

I've got a huge list of date-times like this as strings:  Jun 1 2005  1:33PM Aug 28 1999 12:00AM   I'm going to be shoving these back into proper datetime fields in a database so I need to magic them into real datetime objects.   This is going through Django's ORM so I can't use SQL to do the conversion on insert.


If there is a table called employee  EmpID           EmpName ----------      ------------- 1               Mary 1               John 1               Sam 2               Alaina 2               Edward   Result I need in this format:   EmpID           EmpName ----------      ------------- 1               Mary, John, Sam 2               Alaina, Edward   Q: this record is in same Employee table. I have almost no experience using UDFs, stored procedures, I need to be done this thing through query.Is this possible without using UDFs, SP's.

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)


Find the sum of the $n$ terms of the following series: $$\frac{1}{1+1^2+1^4}+\frac{2}{1+2^2+2^4}+\frac{3}{1+3^2+3^4}+\dots$$   I tried it a lot .   But don't get a proper start .

Problem :   How to find the sum of the sequence $\frac{1}{1+1^2+1^4} +\frac{2}{1+2^2+2^4} +\frac{3}{1+3^2+3^4}+.....$  I am unable to find out how to proceed in this problem.. this is a problem of arithmetic progression... Please suggest how to proceed...Thanks..


So we have this machine at work, a strapping machine, and it has a long power lead which is left loose on the ground, and it's getting gradually destroyed - accident waiting to happen.  I know that there are fire hazard risks associated with coiling wire, but I don't know how to work out how much you can coil with virtually no risk.  I would prefer that we don't permanently shorten the cable, because it may come in handy to have it long in the future, and we'd have to raise engineering tickets etc... major hassle for what I suspect is a non-issue under these conditions.  Please help! Let me know what other info might be pertinent.   Rated Power: 5A  Volt/Hz: 230/50  Cable length: Around 3m

What aspect using a coiled extension cord makes it more dangerous than using an unrolled power cord.  Many fire safety websites reference that an extension cord should not be used while coiled.  Is this due to the cord acting as an air core inductor (I can't really see why this should cause fires). If this is the case, if every second loop is in the opposite direction is it safe.  My theory is that if the cord is getting heated from high current draw, when coiled all of this heat is in a much more condensed location, causing a greater temperature rise than if the cable was unrolled.  Is it dangerous, if so what is the cause. Am I missing anything, do parameters like loop size, loop direction etc make any appreciable difference.


Which is the easiest way to change flavors in ubuntu?? Thanks I'm a newbie just trying new things.I haven't tested any out right now running ubuntu 20.04

Can I convert Ubuntu into another form of Ubuntu like Kubuntu or Ubuntu Studio and the system recognize itself as the new form?  UPDATE: After getting an answer and talking with people, I managed to gain a lot of information on this topic. I then wrote an article about converting between Ubuntu systems -


Please advise where do i need transit visa in Europe if am holding Indian passport & US visa and flying from Washington to Delhi with 2 stops anywhere in the Europe. For Exp: i am going to Delhi to Washington via Vienna, Austria (layover is only for 4 hours 20 minutes) then fly back from Detroit to Delhi via Frankfurt, Germany FRA (layover is only for 2 hours 40 minutes) and Vienna, Austria VIE (layover is only for 3 hours)

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


I'm trying to get bold vectors in a superscript, but for some reason this won't happen when using the cmbright package (I like the font).  Is there a way to get it to behave?  Code:  \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{cmbright}  \begin{document}  This is a bold vector \begin{equation}     \mathbf{p} \end{equation}  This is a plane wave \begin{equation}     \psi=Ae^{i(Et-\mathbf{p}\cdot\mathbf{x})} \end{equation}  \end{document}

In this MWE, I want to obtain bold letter for the letter "H" (compare the two "H") :  \documentclass[10 pt]{beamer} \usetheme{default} \usepackage{lmodern} % load a font with all the characters \usepackage{fontspec} \usepackage{cmbright} \SetSymbolFont{largesymbols}{normal}{OMX}{iwona}{m}{n} \usepackage{amsmath}%loads amsmath that should go before unicode-math \usefonttheme{professionalfonts} \defaultfontfeatures{Mapping=tex-text}  % This seems to be important for mapping glyphs properly  \begin{document} \begin{frame} \[ \mbox{First bold H : }\|x\|_{\mathbf{H}},\; \mbox{Second bold H : }\mathbf{H}  \] \end{frame} \end{document}   but I don't know how doing it. THe "H" produced by this MWE is tiny but no bold effect. If I use      \SetSymbolFont{largesymbols}{normal}{OMX}{iwona}{m}{n}   I obtain bold tiny "H" but the font used still not the same.


What should commands echo [:space:]  and echo [:alpha:] print on bash terminal? The behavior seems pretty random.  Sometimes it just prints the whole strings [:space:] or [:alpha:], at other times they expand to some (but not all) single character file names in the directory.

Please explain why 1 4 5 6 is displayed for the last four echo statements?  I hit this by accident once, but I am now curious as to why this behavior occurs.  These statements work as expected (for me).  $ echo [ 9876543210 ]   [ 9876543210 ]  $ echo [237890]   [237890]   These echo statements consistently display 1 4 5 6.  Is there something special about these numbers?  $ echo [9876543210]   1 4 5 6  $ echo [abcd9876543210ghi]   1 4 5 6  $ echo [-123456-]   1 4 5 6  $ echo [-7654321-]   1 4 5 6   Thanks!   The possible duplicate is related and helpful, but not a duplicate. The possible duplicate is from the perspective of an rm command. This question is from the perspective of a perceived "weird behavior" of an echo command. The underlying answer for both is globbing. Someone searching for issues with an echo command would not easily find the rm question, but would more likely land here.


Let $K$ be a number field and $\mathcal{O}_K$ be its ring of integers. Furthermore, let $\mathfrak{I}$ be a non-zero ideal in $\mathcal{O}_K$.  Question: Why is $(\mathcal{O}_K:\mathfrak{I})<\infty$?  I would like to know that since this result guarantees the well-definedness of the numerical norm of ideals. Could you please explain that to me or give me an appropriate reference? Thank you!

Let D be the ring of integers of a number field K. Let I be a non-zero ideal of D. Why D/I is finite?  Would you help me please? Thank you in advance.


I'm not sure if this is a bug or a feature, but occasionally (usually in Object Mode) while I'm Zooming In or Panning (using Shift + Middle Mouse Button), Zooming In will stop and won't allow me to zoom in any further (I can still zoom out, but can only zoom in so much), or Panning will no longer work.  I don't believe I've pressed any key combination to trigger this, as this usually happens during a time of me zooming or panning.  I did some research and found this question here (which is similar to my issue):  Panning with Shift + middle mouse button stopped working But unfortunately, "Restoring to Factory Defaults" is in no means a proper answer for fixing something that feels more like a bug. (Especially if no settings/preferences were changed prior to this issue happening.) What does fix this issue is @GilesDMiddleton's answer to go to Object Mode & click View All (Home button, if you have it).  @GilesDMiddleton's answer found here This is a good answer for quickly fixing this issue (while keeping all of your settings), but it's an odd fix and doesn't explain what causes the occasional (and sudden) "lock".  Now back to my main question:  How can I prevent this "bug/issue" from happening?  Or perhaps my question should be: What can cause the "Zoom In" & "Pan" to stop working, and why does Object Mode + View All fix the issue?

I often find that I can zoom in to a point, but then cannot zoom any more, even when there is a lot of room to zoom to the meshes on the scene.   This is particularly annoying in the following scenario:  I often land up left clicking on the scene and the 3D cursor shifts there. I use Shift+C to shift the 3D cursor back to the origin. However, this also centers the view on the cursor and shifts the view to show all objects, and sometimes this zooms things way out – at this point, if I try to zoom in, I can zoom in to a point (using the pinch/zoom on trackpad), but then it stops zooming in.   How do I zoom in after that? Is there anything else I am doing wrong in this case?


Comments in the IOS-app (Version 1.4.1) feed are identified with a Comment immediately followed by the actual comment:    This can greatly benefit from inserting a space.

It's a pain in the ass for me to quit the app, draw a red circle in another app and return to the app, so...    If you notice the three questions in the bottom, you will notice that the emboldened headings (New Answer, Comment) are stick to the next character. Imperfect.    App Version: 1.4.0.249 Device: iPad 2 (GSM) OS Version: Version 9.1 (Build 13B143)


She failed to respond. She wanted to smile. She decided to return. She preferred to travel by train. She managed to save a little money.   Are the infinitival clauses complements or direct objects in these sentences? Are they complements in the last two sentences and direct objects in others?

In order to understand the English grammar, I have to read the Grammar Section in OALD. I don't understand the grammar constituents of to-infinitives in these sentences. How can I understand them?  OALD said        Eat and to eat are both the infinitive form of the verb. Eat is called a BARE INFINITIVE and to eat is called a TO-INFINITIVE. Most verbs that take an infinitive are used with the to-infinitive.      the goldfish need to be fed. she never learned to read.     Some verbs can be used with both a noun phrase and a to-infinitive. The noun can be the object of the main verb.    Can you persuade Sheila to chair the meeting?      or the noun phrase and infinitive phrase together can be the object.    I expected her to pass the driving test first time. We'd love you to come and visit us.    My question is that in 1, can I think of the to-infinitive (to be fed and to read) is the object of need and learn, respectively？ And in 2, why can her to pass or you to come be bound together to be the object of expect or love? At the same time, why I can't think of Sheila to chair in this way?  I love our language, but can't understand its grammar :-(     Edit: What role is the to-infinitive playing in these sentences?


I did: sudo apt-get update  I got this: Reading package lists... Done E: Could not get lock /var/lib/apt/lists/lock. It is held by process 1131 (packagekitd)  N: Be aware that removing the lock file is not a solution and may break your system.  E: Unable to lock directory /var/lib/apt/lists/  I used to just remove the lock file, but I've never seen that note before (did it break my system?)?? What do I do?

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?


Let $a, b, c, d, e, f$ be positive integers such that:  $$\dfrac{a}{b}<\dfrac{c}{d}<\dfrac{e}{f}$$  Suppose $af - be = -1$. Show that $d \geq b+f$.  Looked quite simple at first sight...but havent been able to solve this inequality. Have no idea where to start. Need help. Thanks!!

Let $a,b,c,d,p$, and $q$ be natural numbers such that $ad-bc = 1$ and $\frac{a}{b} > \frac{p}{q} > \frac{c}{d}$.  How prove that  $q \geq b+d$?


Let $A \in \text{GL}(n,\mathbb R)$ with all nonnegative entries such that $A^{-1}$ also has all nonnegative entries. How many nonzero entries does $A$ have, what are their locations, and what are the entries of $A^{-1}$ in terms of the nonnegative entries of $A$?  My attempt: Diagonal matrices $D$ with all positive diagonal elements are examples of matrices so characterized. Such matrices have $n^2-n$ zero entries and $n$ non-zero entries and the non-zero elements of $D^{-1}$ are diagonal entries, each the reciprocal of the corresponding location on the diagonal of $D$. For $A$ not diagonal, I tried equating cofactors of $A$ with cofactors of $A^{-1}$ and seeing which entries are equal to their negative. I couldn't get any obvious way to equate them, though. Edit: I'd prefer a proof that doesn't rely on graph theory, a subject in which I'm unfamiliar. Presumably this is solvable just with matrix algebra or determinants.

I am interested in matrices with the property that both $A$ and $A^{-1}$ have nonnegative entries.  The only such matrices I could construct were diagonal matrices, and my question is whether these are the only such examples.  What I can say about such matrices is that they must preserve the quadrant $$ Q^+ = \{x\in\mathbb{R}^n \mid x_i \geq 0 \}. $$ That is, $x\in Q^+$ if and only if $Ax\in Q^+$.  This seems rather unlikely unless $A$ preserves the axes, that is, unless $A$ is diagonal.  But I can't seem to turn this into a proof.  EDIT  Cameron Buie made the nice observation that permutation matrices also work. So I wonder: are there any examples with more than $n$ nonzero entries?  What about 2x2 examples with at least 3 nonzero entries?


I own an online game where you have a status box. Which you can update it on how you're feeling.  The problem I have had was that users were putting java script tags into messages and into status. So when another user came to their page, a pop up box would pop up saying haha or whatever they wanted.  I then stopped that by using  $status = mysql_real_escape_string($_POST['status']); $foo = preg_replace('/[^a-z]/i', null, $status );   That has now stopped any JavaScript being ran but now when someone sends someone a message, it takes the spaces out so for the message  "how are you "  It will show "howareyou". Of course this is safe but users can't read messeges.  Is there any other way from stopping script tags being inserted into the virable but still allow spaces?  I'm also real scared of someone hacking me with XSS. Because before, I was told a user could enter something in a message then when the other user opens it, it will send them there password.....

Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of HTML tags?


Although I know a couple of proofs of the statement $$ \lim_{x \to 0 } \frac{\sin x}{x} = 1, $$ I would like to be able to come up with a proof using the definition of the limit (i.e. an $\epsilon$-$\delta$ proof). Here $x$ is in radians of course.

It is well known that   $$\lim_{x \rightarrow 0} \frac {\sin(x)}{x} = 1$$  I know several proofs of this: the geometric proof shows that $\cos(\theta)\leq\frac {\sin(\theta)}{\theta}\leq1$ and using the Squeeze Theorem I conclude that $\lim_{x \rightarrow 0} \frac {\sin(x)}{x} = 1$, other proof uses the Maclaurin series of $\sin(x)$. My question is: is there a demonstration of this limit using the epsilon-delta definition of limit?


I'm working with many raster files. Is there a way to make virtual raster with average values in each pixel. (QGIS)  It's for an NDVI index of summer months over 5 years.

I want to calculate the difference of two bands. I have the individual bands stored somewhere, but I was thinking that maybe there's a way of producing a VRT file that is the result of this difference. I know that you can use pixel functions in GDAL, but this limits the use (C++, and only available when the function is linked in...).  It would be nice if simple "virtual" operations were available!


I cannot find a way of private messaging SO members, is it possible?

Couldn't find it anywhere on user profile page. How can I reach some people who just answered my question for some details?


I picked off 120v from an outlet (parallel) to power a dual switch that inturn will switch on a light and the other to switch on a bathrom fan using a 3/12 with grnd.  The circuit is connected through the dual switch by providing the black "hot" wire to the "com" terminal of the dual switch.  The other side of one switch will go to the light (wht) and the other side of the second switch will go to the fan (red) and all the grounds and nuetrals are continuously connected respectively.  The open wires are waiting to be connected to their respective fixture.  With my multimeter on the open wires I turn the switch on and I get 120volts but when I turn the switch off I get a 15volt reading.  Is this normal because I am reading through a switch that doesn't have a load on it?

I am replacing a power receptacle at my apartment. It has the standard four wires, with one of the two reds going to a nearby toggle switch.  I am concerned because when the toggle switch is off, I measure 16V between one of the red wires and a white. (The other red wire always measures 0 V, so I assume it doesn't go to anything.)  I don't want to wire up the red if it's going to sit at 16 V when it's supposed to be off. Any ideas why this is happening or what I can do? Or is 16 sufficiently close to 0?


In Game of Thrones S08E2 "A Knight of the Seven Kingdoms", in the scene where      Jaime Lannister is knighting Brienne of Tarth, Jaime says it doesn't require a king to make one a knight. An existing knight can name another warrior a knight. Finally, Ser Jaime Lannister knights Brienne of Tarth and she is named "A Knight of the Seven Kingdoms".   Are there any instances in the books where an existing knight gave another warrior Knighthood by himself?

Motivating scenario:  I'm a swell upstanding guy, so Ser/Lord X, an acquaintance of mine, knights me. So I walk into my village tavern; the barkeep asks "What'll it be, friend?" and I tell him "That's 'Ser' to you now. I have been knighted by X!" He sneers and goes "well then, X can call you Ser if he likes."  Actual Question:  What about a person's being knighted makes the knighting 'stick'? Is it the identity/standing of the knighter (is that a word?) ? Is it the fact that many other knights walk around telling people that the new guy is also a Knight? Is it the public nature of the knighting?  The  says  about knighting:     This usually happens when a squire reaches adulthood and his master   judges him worthy of accepting the responsibilities of a knight. A man   who has not been raised in the knightly tradition can also be made a   knight as a reward for service. This is often granted to soldiers or   other smallfolk who have shown bravery or performed a great feat.   Notes:   I'm only asking about Westerosi Andal-culture Knights, around the time of Robert I Baratheon's rule.


i am unable to perform the task though i followed the instruction. how to handel Unable to locate package ubuntu-restricted-extras?

I would like to install the restricted extras package, which I didn't select during the install. How can I do that?        is a meta-package that installs:         Support for MP3 and unencrypted DVD playback   Microsoft TrueType core fonts   Flash plugin   codecs for common audio and video files


I am a Philippines passport holder working in Kazakhstan. From Kazakhstan I would like to fly to USA but I will have a 2 hour and 30 minute layover in Amsterdam AMS Airport.    Do I need an airport transit visa?

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


I had to rebuild the OS for my iMac/Yosemite system.  Homebrew persists in installing software to the old, corrupted profile.  What should I do?  I think that I should remove Homebrew and re-install it, but I'm really scared of screwing up.  Please help with basic, solid, fool-proof advice.

How can I cleanly remove Homebrew. I might have a faulty older installation, and I'd like to have a fresh start.


We recently moved our website to a new server. But after changing the NS (name server) records, I can't access my website. The hosting provider said we need to flush the DNS settings in order to see the new website.  I searched relating to this but I couldn't find a way to flush DNS settings in Ubuntu 13.10.

I just updated the DNS record (ns1, ns2, ns3.myhostingcompany.com) for a site I've got hosted, but I still get the domain registrar parking page.  I'd like to see if the problem is Ubuntu's cached DNS records. Is there a way to clear Ubuntu's DNS cache? (if such a thing exists?)


I was wondering if I can find a certain way that show me the number of clusters my data has by its nature.I don't want to find the optimal number of clusters for clustering, I want to know the number of clusters my data has by its nature not what i wanted it to be.  Any little help would be greatly appreciated.

We find the cluster centers and assign points to k different cluster bins in  which is a very well known algorithm and is found almost in every machine learning package on the net. But the missing and most important part in my opinion is the choice of a correct k. What is the best value for it? And, what is meant by best?  I use MATLAB for scientific computing where looking at silhouette plots is given as a way to decide on k . However, I would be more interested in Bayesian approaches. Any suggestions are appreciated.


I keep getting killed by a command block in minecraft 1.11, and I can't type anything, how to fix this? I Could not find a solution for minecraft "1.11" before, but i solved it by using NBTExplorer.

I set a command block to /tp. It was supposed to activate only if you had 0 time left, and to activate the command block with a hopper clock to keep giving it power.   But it is not checking if you have 0 time left, so it keeps teleporting me. I can't get close enough to the command block to break it, so I'm stuck in a neverending teleport loop.  Any ideas?


They are fetishising men paying the bill in heterosexual   couples.       I came across this sentence in a stand-up show. I wonder if it is grammatically correct?  I think this one is better since the first one might give the impression that "they" are fetishising "men" who pay the bill in heterosexual couples. I think what the comedian is talking about is the concept that is imposed on men that they should always pay the bill.         They are fetishising men's paying the bill in heterosexual   couples.

The rule says that we can use a possessive adjective or an object pronoun before a gerund. Is there a rule  that says when to use each or are they interchangeable? Some say that it's wrong to use an object pronoun before a gerund.


Why Kernal events not triggering on cached pages.I have tried using priorities..  $events[KernelEvents::REQUEST][] = ['onRequest', 27];  Services.yml file  tags:   - { name: 'event_subscriber', priority: 210, responder: true}   MyEventsubscriber.php      public static function getSubscribedEvents() {     $events[KernelEvents::REQUEST][] = ['onRequest', 27];     return $events;    }      public function onRequest(GetResponseEvent $event) {     $response = $event->getRequest();    \Drupal::logger('my_event_subscriber')->notice('Page Hit');    }   It is not logging when the page is served from cache... Any other approach?

I am trying to implement a KernelEvents::REQUEST event subscriber to perform some action on page load.   I need this event to fire regardless of whether the requested page exists in the Drupal cache - it seems that KernelEvents::REQUEST does not fire when Drupal serves something from the cache.  Is there an event I can use to achieve this, or must I implement my requirements as some form of middleware?


I have a Migrate.ksh file, in that some passwords are available, I would like to encrypt this file in the Unix. The Passwords file being used in another script. Can you please let me know the process and script to encrypt?

How can I  encrypt or scramble my shell script so that it's unreadable to the naked eye? Either method would be acceptable, please provide specific steps.


I want to iterate through all files in the Source directory and stick them into the Dest directory.  Example list of files:  /source/folder/text.txt /source/folder/document.pdf /source/folder/that/is/deeper/picture.jpg /source/folder/picture2.JPG   After the script is run, I'd like the dest folder to look like:  /dest/folder/txt/text.txt /dest/folder/pdf/document.pdf /dest/folder/jpg/picture1.jpg /dest/folder/jpg/picture2.JPG   I've learned I can chain -exec commands on the back of find, but I don't think that's what I want.  grep might be useful, but since it's a one-liner, I think writing it will be complex.  A forloop seems to be the best way, but I cannot for the life of me figure out how to extract the file name.  SOURCE=/my/source/dir/  for f in $SOURCE do   echo $f done   $f appears to be only the directory and does not list the actual file name.

I have some files with different extensions such as *.pdf, *.mp3, *.jpg and a few others. All of them are stored in a parent directory.  How can I get a list of all extensions, create some folders based on these  extensions and then move all files into their relevant folders?


I just installed blender 2.91.2 and whenever I switch to wireframe view it displays only the outer frame while the material preview or  render view shows nothing but gray , whether it's new project or old from the previous version it's the same

I don't know why but now, when i go in material preview or rendered (in solid mode it works fine), my object is entirely gray, or invisible idk, because it has the same color of the background. I've been working for days on this project without having this issue, it suddenly showed up. I tried opening other old projects and suddenly they all do the same so i guess it is some blender program setting that applies for all the projects, but idk how it happened cuz i didn't change anything :/, anyone got any tips?


If a large sample of volunteers were not representative of a specific population, would it necessarily mean that any conclusion of a study performed with sound methodology on this sample could not be generalized to that population?

Take as an example the well-known . In the original paper, the regression model was used to model the amount people were willing to pay for improved air quality.  But the 'people' whose behaviour was being modelled was never specified. Presumably, it was not limited to 'residents of Greater Boston'. Only implausibly would it be 'humans anywhere on the planet'. Nor, 'all US residents'.   So what inference are we invited by the authors to draw about the scope they intend for their theory? Perhaps 'all residents of large US metro areas'. But - what about other First World metro areas? The first two sections of the Boston paper scrupulously avoid any reference which might suggest that they had a particular 'population' to which their 'sample' was to apply.  There is also the dimension of time - the data came from the 70s, whereas the theory is has no time limitations spelt out.  Plus - going back to first principles - how could the Boston data be treated as a sample of a population including, say, the Chicago metro area when no data from the Chicago area was considered?   Besides, lots of the covariates in the Boston regression weren't samples at all, but totals - so, for example, the proportion of blacks was supplied from census stats.  My question: how can we conceive the Boston data as supporting the geographically unlimited propositions in the paper? Is there a mathematical way of showing equivalence or approximation of the Boston data analysis to other cities? Or is it just assumed as a matter of common sense - such that the paper's authors would be amazed to think anyone could have any doubts on the matter?


why are we giving void as parameter for getdetails  function i.e getdetails(void) and not (char name, int rollNO ) as  parameter .why is this being done only while using array of class objects. why ?  class student {  private:  char name[30];  int rollNo;  public:  void getDetails(void); //member function to get student's details  void putDetails(void); //member function to print student's details }; void student:: getDetails(void) //member function definition, outside of the class {  cout << "Enter name: " ;  cin >> name;  cout << "Enter roll number: ";  cin >> rollNo; }

Consider these two function definitions:  void foo() { }  void foo(void) { }   Is there any difference between these two? If not, why is the void argument there? Aesthetic reasons?


I can "Create Partition Image" on my Ubuntu Desktop machine anytime using Disks Utilities. And I can also "Restore Partition Image" to my machine anytime if anything goes wrong.  My question is this; can I "Restore Partition Image" of my machine to another machine that has different configuration? And will all the drivers and other programs work perfectly?  Other than that disk cloning would be useless and sometimes a total waste of time.

I've just cloned a computer () and I want to make sure it will be OK on the same network as the original.   I've changed the host name back to what it was pre cloning, so there won't be duplicates on the network, but I want to make sure I make any other necessary fixes before I put the computers running Ubuntu 12.04, on the same network. Is there anything else I need to do before I link them back up?


In the beginning of Goblet of Fire, Harry sends Snuffles a letter.  Hedwig somehow finds him after the extremely specific command from Harry, "Just find him, okay?"   Theories:   Hedwig has a scanning system, like Baymax in Big Hero 6. Hedwig got super lucky. Hedwig flies really, really fast.   Now I know that owls are intelligent beings in the Harry Potter canon. But.... those ideas are just as crazy as the next.  So how did Hedwig do it?

How do owls in Potterverse know how to deliver letters? Is there some sort of training they go through before being out in the field? Can any owl be used, or are there only specific breeds that are more suited for the task?


My kids read a YA science fiction novel about three teens who survived a world-wide catastrophe by hiding in an underwater cave that they reached with a mini-sub. At the urging of my kids, I read the book and, now that I'm trying to recall it, they have no idea what I'm talking about.  The details aren't all that clear in my mind, but there was some sort of catastrophe, possibly begun by radio communication with aliens, that ended up killing everyone else except two boys and a girl. Time travel may have been involved towards the end of the book. I would have read this sometime in the last five years.  It may have taken place in Australia or New Zealand.  I'm hunting for the physical copy of the book, but we have so many books and it could have been given to a friend of theirs, so I'm not too hopeful. I'm trying to put a list together of all the books I've ever read, and this is just one more I want to capture. I know that's a hopeless and vainglorious goal, but still.

I read a book back in middle school. Can't remember the name of the book or the author or anything. Tried googling all the stuff I remember, but nothing ever fit it. It had a biohazard symbol on the cover, and it was sort of holographic, a bunch of whites and blues, looked kind of like how people interpret dream sequences or warp jumps in sci-fi animation or film. The book involved three kids, and they got a message one day or something, and they eventually decoded it to be lottery numbers, and they were told to buy a submarine with it and some other things. Some weird fog starts appearing all over the place, and these white creatures start beating up on everybody else. When they lose pretty much everybody, they're just kind of sitting in the submarine, and they send a message back in time, I think. It's been a few years. Anybody know what the book is or have any hints on it? Thank you~


There are so many guides that say SuperSU is a "rooting app".  A method of rooting a phone is to install SuperSU as a .zip:   Then, SuperSU shows up as an app in Play store that requires root:    says that the way to root zenfone 2 is to install SuperSU.zip   is another guide where installing SuperSU is a way to root a phone.  Who is correct? Is it a way to root or is it an app that requires root?

I see that some  say that rooting involves:   Download a SuperSU as a zip file that would be accessible to the phone (e.g. the sdcard). Unlock the phone's bootloader. Booting into a "custom" recovery mode. E.g. TWRP or CWM. Either temporarily booting using fastboot or flashing the custom recovery to the phone and then booting. Use the custom recovery mode to install the downloaded SuperSU zip file. Reboot the phone into normal mode and root access should be A) available and B) managed by the SuperSU program.   However, I also see that SuperSU is also on the . Installing from the Play Store does not promise any root access. (It actually assumes you already have it.)   So, my questions are:   What is different between these installation methods practically? What is are the technical differences in actions or restrictions?  And how can/does the custom recovery installation method provide root access whereas the Play Store method can not?


In vb.net I've this code block:  Public Sub AddItem(Text As String, Optional Left As Integer = 0, Optional Header As Boolean = False)     Dim Item As ListItem     ReDim Item.Text(0)     Item.Text(0).Text = Text     Item.Text(0).Left = Left     Item.Header = Header     LstItems.Add(Item) End Sub   UPDATE: ListItem  Public Structure ListItem     Dim Text() As ListText     Dim Header As Boolean End Structure   this code allow me to add an item to a list, ReDim allocate the storage space for an array variable in vb.net, in c# what is the equivalent of this code? I also tried to convert it on  without success.

I was shocked to find out today that C# does not support dynamic sized arrays. How then does a  developer used to using  deal with this in C#?  At the beginning of the function I am not sure of the upper bound of the array. This depends on the rows returned from the database.


In D'Alembert's Principle,what is reversed effective forces and how to determine it's direction?

I have some confusion about the "Reversed effective force" as it appears in the derivation of .  In Goldstein d'Alembert's principle is given as:  $(F-\dot{p}) \cdot \delta r = 0$  First I have sources that seem to be contradictory.    This book, on page 8, indicates that "reversed effective forces" are not real forces.  However, this book indicates otherwise.    On page 345, this book indicates "this is the force exerted by the moving body to resist the change in its state.  I think that the former source is probably correct, but I lack good intuition of D'Alembert's principle. For reference the reversed effective force is represented by $-ma$ or $-\dot{p}$. My best guess as to what the reversed effective force is that it it the force that is required to appear if you view the system from the perspective of the accelerating body.  Is this correct?  If it is then how is d'Alembert's principle applicable to inertial systems?


I have been asked this questions by many biology students and even non-biologist without a pretty straightforward answer to give. We are quite accustomed to phylogenetic trees where a common ancestor becomes two different species and these new species become, each one, two more. But, Why is not possible that a species might divide in three different species? Or four? Or more?  What arguments support this conception of the evolutionary process? Also, if somebody has a good article explaining this, please provide me with the link or citation so I can refer my fellow biology students to it.

I read that wherever there is polytomy there is an unresolved pattern of divergence. I don't understand why this is so.  When divergence takes place, is it necessary that there will be division into only 2 paths? Can't there be more than 2 paths with all the paths being equally related to each other (that is, no 2 paths being related more to each other than to a third path)?  In other words, does a fully-resolved phylogenetic tree have to be dichotomous?


So, here was a guy who landed on our planet a small baby, went to school a normal kid, with normal looks, no difference from his peers externally. Now, here he is, can lift the whole Empire State building with one hand, and lift planets with two hands with little effort.   Curious thing is, as an adult, he is almost always portrayed as one hell of a Hunk; well built, Ronnie Coleman/Hulk style physiques. So, can someone tell me when the guy ever went to the gym? How and when did he gain so much muscle and mass yet he can lift every possible weight on earth with a finger or hand? Or is it the Yellow Sun?

Did DC Comics ever say if Superman works out? I mean, above and beyond fighting crime and saving the world, what does Superman do to stay physically fit? If he didn't excercise and there was a peaceful lull in crime, would he get a pot belly?


I read it in the 80's.  Cover had a person in a spacesuit standing in a river of lava.  On the shore was some sort of alien critter(s).  Think perhaps this was inside a cave? Premise of the book was a group of people were decimating planets for some unknown reason.  Main character (?Bron?) was "imprinted" with the memories/behaviors of a person the "ravengers" would want to abduct.  Main character was in contact with remote "handlers" who could communicate with him and assist via implants.  One of the controllers was a woman called or nicknamed JC. Ended up that aliens in the far distant past were sending sub-light "bombs" to destroy the planets which took eons to finally show up and deliver their payload. There was also some sort of prognosticating going on -- the main character was imprinted with the memory of one of the main teacher/leader/something of this technology. Final explanation is that the aliens foresaw that humans would one day visit their planet, and in a fit of xenophobia decided to try to destroy the humans.  Main character figured this out and then backtracked to the aliens home world.  When humans showed up, the race had degenerated back into savagery.

I read a story--the first part of one, at any rate--years ago, and haven't tracked it down since. It started with a man been sent to a planet under attack to pose as a monk--he arrived in the middle of an assault, but still had to do penance for being late. So he wore a hair shirt, that created an agonising reaction. He was captured by the attackers (who took him for the man he was posing as), who then stood off the planet in their starships and watched as a 'hell burner' weapon tumbled out of deep space and torched the planet. The attackers then explained that they weren't responsible for the hell burner, but every time they arrived at a planet, a hell burner turned up afterwards, at shorter and shorter intervals.  As the story developed, there was some kind of time travelling dimension, and a character turned out to have his organs reversed. I may have got some details wrong, but this was the shape of it.  Anyone know this story, and the author?


In the photo below I would like to use a single resistor after the LEDs, instead of having individual resistors before the LEDs. Is this problematic? Will it work?

My very basic electronics education has taught me that parallel circuits are equivalent to separated circuits. To my surprise, when I was playing around with some electronics I found the following:  Essentially I connected two red and two blue LEDs in parallel. The red ones lit up, but the blue ones didn't. Only when I removed the red LEDs would the blue ones light.  Why is this?


I have installed installed QGIS 2.10 from source on CentOS 6.6 however the issue I'm facing is that I am missing the GRASS plugin form the GUI.  I have checked the plugin manager, its not listed there. It does seem like it installed grass related objects /mnt/opt/Centos6.4/qgis-2.10.1/share/qgis/python/plugins  It is also referenced when compiling using cmake so it looks like it compiles the GRASS module but the app can't see it somehow when it starts.  Anyone know where would the GRASS plugin be installed to and if I can just manually copy it in somehow?  I have encountered this before but just used yum instead but now my users want the latest version along with GRASS functionality.  gdal_nograss-1.10.0  qt-4.8.5  spatialindex-1.8.0  spatialite-2.4.0-0.6_qgis  proj-4.8.0  geos-3.4.2-gcc-4.4.7  qwt-6.0.1  python-2.6.9-gcc447  grass-6.4.3-gcc447  cmake-2.8.12.2

I saw in  how to get Qgis 2.10 running from the non ubuntugis repository with grass features but I'm still having problems with getting it to work with the ubuntugis unstable dependencies.  I have tried using 2.10, 2.8.3, and the nightly build but can neither get the GRASS plugin toolbar to work or the new browser to show the grass files like the video shows .  While I can get work done with the standard install I like having using the ubuntugis dependencies and packages for work with postgis, spatialite, etc and would really like to have it all gel together rather than have multiple repositories that may confuse each other.  So after all of that filler I guess my question would be has anybody got QGIS 2.10's grass tools(both processing and plugin) to work with the ubuntugis dependencies and if so how?


I have the following:   vCenter 5.0.0 build 755629   The problem:  In the plug-in manager:  vCenter Hardware Status  VMware, Inc. 5.0 Disabled Displays the hardware  status of hosts (CIM  monitoring) The following error occured while downloading the  script plugin from https://192.168.1.1:8443/cim-ui /scriptConfig.xml:  The client could not send a complete request to  the server. (The underlying connection was closed : An unexpected error occurred on a send.)   vCenter Service Status  VMware, Inc. 5.0 Disabled Displays the health status  of vCenter services The following error occured while downloading the  script plugin from https://192.168.1.1:8443/health -ui/scriptConfig.xml:  The client could not send a complete request to  the server. (The underlying connection was closed : An unexpected error occurred on a send.)   What I have tried   Read many article online regarding this matter. Enabled - Secure Socket Tunneling Protocol Service I can access the URLs located above with only http, thus there must be an issue with SSL, I am guessing here.   Side notes:   We have no plans to update to vCenter 5.1 as of yet. I have been looking for 2 days for a solution so far.    Does anyone know of any solution for this please?

I'm running VMware ESXi on two Dell PowerEdge R610 servers, with a third server, a PowerEdge R410 running vCenter Server. We have an Essentials license.  In the past I used to be able to open vCenter Server, select a host, and open the Hardware Status tab to see the various sensors, fan speeds, etc.  Now, that no longer works. On each server, I get a popup message "An error occurred, please try again in another vSphere session." and I can't resolve the error. Whatever I try, 'Update', 'Reset sensors', rebooting vCenter, rebooting hosts, nothing helps. I always get that error.  When I connect the vSphere Client directly to an individual host I can see the Health Status just fine, on the Configuration tab of the host. Which leads me to believe the problem is with vCenter. The problem could have appeared after the 4.0 to 4.0u1 update, but I'm not sure since I only noticed it weeks later.   vCenter version is 4.0.0 build 258672 ESXi version is 4.0.0 build 261974   Update Manager shows all hosts are up-to-date.  I don't know what else to try. What can I do?


Consider a random permutation of $1,2,\ldots,n$. What is the expected number of cycles in it? I thought about using linearity of expectation, but here it's not clear how we can break down the main random variable into different ones.

There is a party with 20 people, and everyone writes their name down   on a piece of paper and puts it into a bag. The bag is mixed up, and   each person draws one piece of paper. If you draw the name of someone   else, you are considered to be in his "group". What is the expected   number of groups after everyone draws?   So basically if we have a loop where each person draws someone else's name, and the last person draws the first person in that list's name, we have a group. Not quite sure how to approach this problem.  Thanks for any help.


I see lots of Hot Network Questions which don't have lots of votes and views (after becoming hot network question, it gets both lots of votes and views).  How are they selected? Is this purely random or picked by human hands?

I really like the , where certain questions from the Stack Exchange Network are presented, along with a hotness rating that is described as "arbitrary" in its tooltip. Such questions also appear randomly on the sidebar on sites across the network, under the heading "Hot Network Questions". How do these arbitrary hotness points work, and how are they used to select questions to appear in those lists?


We submit bank statment for visitor visa, with government pension and private company pay being credited in. There are big and small credits from sale purchase of own property and other amounts.  Do we need to give an explanation of all credits?  I think yes.  Also legal official papers of each and every credit?  Is this really required other than written explanation, when the pension proof and employment proofs are being given already?  Our previous visitor visa got approved.

I have applied recently for a general visitor visa to the UK to spend 10 days during Christmas with my British unmarried partner and it has been turned down.   The Entry Clearance Officer stated on his refusal notice the following:     I note that you have never previously travelled to the UK or any country with similar immigration requirements and you therefore do not have a history of travel and compliance to consider.      You have submitted an employment letter to confirm your occupation in KSA but I am required to also assess your personal, domestic and economic circumstances in determining whether you are genuine visitor travelling to the UK for the period and purpose you state.      You claim an income of SAR ........ per month which equal ........ GBP and from the evidence submitted this appears to be your sole source of income.   I note that this monthly income is reflected on your bank statements. However, the bank statement you have presented show a recent large deposit that are in excess of your stated income and inconsistent with the account history. You haven't provided evidence toward the origin of this recent deposit and in the absence of reasonable evidence I am not satisfied that these bank statements accurately reflect your personal circumstances.      In view of the above, I am not satisfied you have demonstrated that your circumstances are as you claim and therefore I am not satisfied that you're travelling to the UK for the period and purpose you stated. 41(i)and(ii).   Its true that I have deposited that sum of money right before I apply and it was a commission I received from work earlier this month.   So, could you please give me your advice on the above as I am planning to apply again soon. and how to avoid my application being refused again?


I need some help finding a good solution to this problem. I know AD just fine, but admittedly, I'm not an expert. And I know I don't want to expose it to the internet...  I inherited a workforce at my new company (~100 employees, all Mac) that often work remote. Every laptop authenticates to the Active Directory. Works great(ish).  However, when users go remote, they sometimes need to leave their laptop with another employee that doesn't have a laptop (for reasons). The problem is that employee 2 can't login to employee 1's laptop because the computer cannot contact the AD. There are no cached creds for employee 2 because its the first time he's logged in to this particular machine.  Normally VPN is the solution, but without being able to login to the computer first, you can't login to the VPN. Are there any solutions that I should look into not involving persistent VPN to help with this? I don't want to expose AD or LDAP to the wider internet, but the bottom line is that I need to be able to authenticate from there without VPN.  Also, just to add a layer of complexity on top of this...the domain I inherited is a "domain.local" Not too big of an issue (I can work around some of the normal mac problems), however I see this causing an issue when trying to contact dc.domain.local from the internet.  Can anyone smarter than me point me in the right direction for a solution (without a lecture on bad practice, etc)?

I have a client whose workforce is comprised entirely of remote employees using a mix of Apple and Windows 7 PCs/laptops.   The users don't authenticate against a domain at the moment, but the organization would like to move in that direction for several reasons. These are company-owned machines, and the firm seeks to have some control over account deactivation, group policy and some light data-loss prevention (disable remote media, USB, etc.) They are concerned that requiring VPN authentication in order to access AD would be cumbersome, especially at the intersection of a terminated employee and cached credentials on a remote machine.  Most services in the organization are Google-based (mail, file, chat, etc.) so the only domain services are DNS and the auth for their Cisco ASA VPN.  The customer would like to understand why it is not acceptable to expose their domain controllers to the public. In addition, what is a more acceptable domain structure for a distributed remote workforce?  Edit:   is in use for a handful of Mac clients.


I have created two node-types: 'match' and 'set'. When a 'match' node is viewed it displays a listing of several 'set' nodes. I've acheived this by calling node_load_multiple in hook_node_view. That's all 'set' nodes do: they are listed by a match node. 'Set' nodes can be created, edited and deleted, but I only want the user to be able to view them in listings.  So, I want to deny access to viewing 'set' nodes on their own page at node/1 or whatever. I've denied access to 'set' nodes using the node access mechanism, but then they don't appear in my listing either.  How can I set these nodes so that they can only be viewed in my listing?  The only thing I can think of is not to call node_load_multiple but to write by own db_select query to retrieve all the necessary 'set' nodes to list in a match 'node': a bit messy.  Hope this makes sense. I open to any suggestions. Thanks.

I've found that there are times I have a node that simply contains content that will be displayed somewhere else, but shouldn't be viewed directly. That is, no one should ever go to node/1234, but the content in node 1234 should be displayed somewhere else. For example, I create an about page with tabbed content using views. So there are "About Me", "About Us" and "About Them" pages. All of these are displayed in a single page with tabs using Views. So I don't want people to get directly to the "About Us" node because then they wouldn't see the tabs for the other pages. At the same time, I don't want Google giving people a direct link to this node, I want to limit access so users can only get to it through the View (i.e., the tab).  So I need to restrict access to the node, remove it from the Drupal search results, and make sure Google doesn't pick up on it. Any suggestions?


I have spent almost all day trying to figure out why this is happening, I had code that incremented a float if it was not a whole number until it was a whole number, i'd trigger it by incrementing the value by 0.01 and the loop keeps incrementing it by 0.01 until it is an integer however it never stops, debugging it I noticed that the number to becoming increasingly inaccurate as the loop progressed leading to it being 0.0000066 out by the end. I thought maybe the variable might had been being accessed elsewhere somehow so I created it simply in an empty "main" program:  float value = 0; for (int i=0; i<100; i++) {     value += 0.01f; } System.out.println(value); // Displays 0.99999934 System.out.println(value == 1); // Just in case it's displaying wrong in println (displays false)   Why is this not 1 by the end? I don't think it could be anything to do with data types as i'm adding a float to a float.

double r = 11.631; double theta = 21.4;   In the debugger, these are shown as 11.631000000000000 and 21.399999618530273.  How can I avoid this?


It should be, I believe "She is having difficulty shopping." But I am not sure how I can explain to someone who is a non-native English speaker why the form "She is having difficulty to shop" is not correct but "She is having difficulty shopping" is okay.

Some verbs are followed by ing, e.g. I enjoy swimming. We can't say I enjoy to swim. Likewise, some verbs are followed by to, e.g. I decided to make a plan.   Which particular verbs are followed by ing and to? Can you please provide a list for that?  Moreover, which verbs can be followed by both without having the meaning changed?


I have a 7 day Schengen Validity Visa and currently visiting one of the Schengen countries. Is it possible to have a few days extension in the visa? or can i stay up to my Visa Validity Date?  Also, is it ok to apply for another Schengen Validity Visa after i leave the Schengen zone.

My daughter applied at the Italian Consulate in Philadelphia, and they gave her two entries for 20 days (we thought it was for 20 days each entry). She was in Italy 12 days, then went to England for 1 week and flew to Venice to take a 10-day cruise. She couldn't make it because they said she has only 8 remaining days, but she still has a land tour already paid this week.  What can she do? Can she extend the Schengen visa for 12 more days? Right now, she is in Madrid, but next week she has to fly from Barcelona to Paris to start with the tour. What would happen if she decides to take the tour with the expired visa? She is a US permanent resident.


I have implemented Spring boot, with Spring security. And here is how I configure the http requests:  @Override protected void configure(HttpSecurity http) throws Exception {   http.authorizeRequests()     .antMatchers( "/registeration").permitAll()     .antMatchers("/home").hasRole("USER")     .anyRequest().authenticated().and()     .formLogin().loginPage("/login").permitAll();   http.formLogin().defaultSuccessUrl("/home", true); }   So, I am trying to redirect my logged in users to the /home url, and here is the controller:  @GetMapping("/home") public String home(Model model,@RequestParam Long userId) {     model.addAttribute("user", userService.getUserById(userId));     return "home"; }   But, as you see, I need to pass the userId, to add it as a model into my view. The problem is, I don't know how to retrieve the information of yje user before redirect, and after log in.

I have a Spring MVC web app which uses Spring Security.  I want to know the username of the currently logged in user.  I'm using the code snippet given below .  Is this the accepted way?    I don't like having a call to a static method inside this controller - that defeats the whole purpose of Spring, IMHO.  Is there a way to configure the app to have the current SecurityContext, or current Authentication, injected instead?      @RequestMapping(method = RequestMethod.GET)   public ModelAndView showResults(final HttpServletRequest request...) {     final String currentUser = SecurityContextHolder.getContext().getAuthentication().getName();     ...   }


I have two different kernel reclassified raster files and I would like to find the overlap area between them, what I should do?   I have tried Boolean operators and map algebra and it does not work.

I have two raster images, Boolean classified (1 or 2).  They overlap in given areas.   I need a raster that is only the overlapping sections.  Using Arcinfo 10.  Answer can only use raster methods, no converting to polygons, points, etc...


I am attempting to create a Quick Action using LWC without using Aura however I am getting a error. I was reading the documentation  When I change the js-meta.xml for action Type <?xml version="1.0" encoding="UTF-8" ?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>52.0</apiVersion> <isExposed>true</isExposed> <targets>    <target>lightning__RecordAction</target> </targets> <targetConfigs> <targetConfig targets="lightning__RecordAction">  <actionType>Action</actionType> </targetConfig> </targetConfigs> </LightningComponentBundle>   Error Invalid element name:  actionType  One of the following is expected:  hasStep objects property propertyType supportedFormFactors  Error indicated by: {http://soap.sforce.com/2006/04/metadata} with code:xml(cvc-complex-type.2.4.a)

I receive a problem in the targetConfig, when I enter the actionType it gives me an error that says it is an invalid element name. Do you know why that happens?


I know how to interpret residuals in a linear regression model. I am now working in a model that predicts a binary target combining numerical and categorical variables.  My residual plots is as follows:     If this were residual plots from a linear regression model I would be able to interpret them and notice that they are terrible. However I do not know if the same interpretation must be done when working with a logistic regression model.

Can anyone tell me how to interpret the 'residuals vs fitted', 'normal q-q', 'scale-location', and  'residuals vs leverage' plots?  I am fitting a binomial GLM, saving it and then plotting it.


In Avengers: Endgame, there was a moment when Thor summons the Stormbreaker and Thanos catches it in between and uses it to beat Thor.  Just thinking if anyone can pick up Stormbreaker or if it is the same as with Mjolnir.

In Avengers Hulk tried to raise Thor's hammer and failed miserably. In Avengers: Infinity War, Groot raises Thor's new axe and holds it for a few seconds! Is the axe made of some other light material, or is Groot stronger than Hulk?


How to compute 'z', where $\displaystyle z = \sum_{n=1}^{100} n\times 2^n$ ?   The answer is of the form $99 \times 2^{101} + 2$, I need a fast approach as this problem is supposed to be solved under a minute.

Given $$1\cdot 2^1 + 2\cdot 2^2 + 3\cdot 2^3 + 4\cdot 2^4 + \cdots + d \cdot 2^d = \sum_{r=1}^d r \cdot 2^r,$$ how can we infer to the following solution? $$2 (d-1) \cdot 2^d + 2. $$   Thank you


My page has:     But it should be:     As you can see I need to add /INDEX.PHP in front of this image url.  How do I add a RewriteRule to my Apache2 .htaccess to fix that?  1000 Thanks!

This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.


When there is a very long line of code in the code section , it does not scroll when you swipe to the left. it will scroll only a tiny amount each time (one character at a time)  For example:  this is a really long line of code that will not properly scroll to the left when viewed on a device that's not wide.

This occurs in the  released recently to the public. When someone posts a code block in their question or answer, the code block is cut off on the right hand side, and I can't scroll to the right to view the rest of it. How can I view these code blocks?


I will be in Canada for a visit lasting about one month in August 2018. I will need the most affordable prepaid SIM to call Nigeria while in Canada. Some data will be desirable but not a priority. Please advise the best priced SIM. Regards.

Next month I am traveling to country X, where I would need Y minutes of calls, Z text messages and most importantly Q megabytes of data. How can I find the cheapest/most reliable SIM card for my needs?


I am using a 2 columns IEEEtran template. I have some long URLs in the references section. One of the URLs exceeds the column's width and does not break properly. How can I force URLs to break into multiple lines if the URL exceeds the column width?  Here is my main script:  \documentclass[conference]{IEEEtran} \IEEEoverridecommandlockouts \usepackage[noadjust]{cite} \usepackage{amsmath,amssymb,amsfonts} \usepackage{algorithmic} \usepackage{graphicx} \usepackage{textcomp} \usepackage{xcolor} \usepackage{hyperref}   \begin{document}     \title{Title Here}       \maketitle     \begin{abstract}         Abstract here.     \end{abstract}      \section{Introduction}\label{sec:intro}     Some text here \cite{test}.  \bibliographystyle{IEEEtran} \bibliography{ref}  \end{document}   Here is the ref.bib script:  @misc{test,     author = {Xing, Wang},     title = {My Ref title},     date = {2018},     note = {Accessed Dec. 1, 208},     url = { https://www.zzzzz.com/article/gggggg-aa-zzzzz-aaa-qqq-rrr-tttt-yyyy-8888-vvvvvv-qqqqqq-lllll-xxxxxx-oooooo-pppppp/},     }

I've discovered a rather weird behaviour of PdfLaTeX. In this example  \documentclass{article} \usepackage[breaklinks]{hyperref} \begin{document} \url{http://www.emarketer.com/blog/index.php/quick-stat-smartphone-users-account-38-mobile-phone-users/} \end{document}   PdfLaTeX won't break the URL and create a too long line. However, if I replace \url with \href like this:  \documentclass{article} \usepackage{hyperref} \begin{document} \href{http://www.emarketer.com/blog/index.php/quick-stat-smartphone-users-account-38-mobile-phone-users/}{http://www.emarketer.com/blog/index.php/quick-stat-smartphone-users-account-38-mobile-phone-users/} \end{document}   I get the line broken, but the font of the link is not right any more of course (normal instead of texttt). Why doesn't URL break the line at dashes and what could I do to get a nicely typeset line-broken link?


When I try to boot I get this message: error: unknown filesystem. Entering rescue mode... grub rescue>   results of: grub rescue> ls  Is as follows:  (hd0) (hd0,msdos1)

I have a multiboot system set up. The system has three drives. Multiboot is configured with Windows XP, Windows 7, and Ubuntu - all on the first drive. I had a lot of unpartitioned space left on the drive and was reserving it for adding other OSes and for storing files there in the future.  One day I went ahead and downloaded Partition Wizard and created a logical NTFS partition from within Windows 7, still some unpartitioned space left over. Everything worked fine, until I rebooted the computer a few days later.  Now I'm getting:    error: unknown filesystem.   grub rescue>   First of all I was surprised not to find any kind of help command, by trying:    help, ?, man, --help, -h, bash, cmd, etc.  Now I'm stuck with non-bootable system. I have started researching the issue and finding that people usually recommend to boot to a Live CD and fix the issue from there. Is there a way to fix this issue from within grub rescue without the need for Live CD?  UPDATE  By following the steps from , I was able to boot to initramfs prompt. But not anywhere further than that.  So far from reading the manual on , I was able to see my drives and partitions using ls command. For the first hard drive I see the following: (hd0) (hd0,msdos6) (hd0,msdos5) (hd0,msdos2) (hd0,msdos1)  I now know that (hd0,msdos6) contains Linux on it, since ls (hd0,msdos6)/ lists directories. Others will give "error: unknown filesystem."  UPDATE 2  After the following commands I am now getting to the boot menu and can boot into Windows 7 and Ubuntu, but upon reboot I have to repeat these steps.    ls ls (hd0,msdos6)/ set root=(hd0,msdos6) ls / set prefix=(hd0,msdos6)/boot/grub insmod /boot/grub/linux.mod normal   UPDATE 3  Thanks Shashank Singh, with your instructions I have simplified my steps to the following. I have learned from you that I can replace msdos6 with just a 6 and that I can just do insmod normal instead of insmod /boot/grub/linux.mod. Now I just need to figure out how to save this settings from within grub itself, without booting into any OS.  set root=(hd0,6) set prefix=(hd0,6)/boot/grub insmod normal normal   UPDATE 4  Well, it seems like it is a requirement to boot into Linux. After booting into Ubuntu I have performed the following steps described in the :  sudo update-grub sudo grub-install /dev/sda   This did not resolve the issue. I still get the grub rescue prompt. What do I need to do to permanently fix it?  I have also learned that drive numbers as in hd0 need to be translated to drive letters as in /dev/sda for some commands. hd1 would be sdb, hd2 would be sdc, and so on. Partitions listed in grub as (hd0,msdos6) would be translated to /dev/sda6.  UPDATE 5  I could not figure out why the following did not fix grub:  sudo update-grub sudo grub-install /dev/sda   So I downloaded  based on an answer from  post. That seemed to do the trick after I picked the "Recommended Repair (repairs most frequent problems)" option.


My phone is an Elephone P6000 Pro with Android 5.1 and I want to flash the Vernee Thor's 7.1 rom. Both of the phone has MT6753. Is it possible?

I own a MicroMax A100. I want to install the latest version of a different ROM (Samsung or Nexus).  Is it possible? If so, can you tell me how?  If not, can I install a ROM made for a different device, but from the same manufacturer? For example, could I install a ROM for the MicroMax A110, which is the successor of A100?


I have the following code:  output = io.BytesIO() some_function(output)   # some_function writes output to file n times buffer = output.getbuffer() output.getvalue()   output.getvalue() returns the following piece: b'\x01\x02\x03\x01\x02\x03\x01\x02\x03\x01  but imagine if this were a long piece. the problem is with the get value() function that could potentially return a large number of data based on number of times some_function() is called.  lets say n = 1000000.  How would i process the binary data returned from get value() in chunks so that i can   write(chunk) for each chunk in get value    to the file?

I have a very big file 4GB and when I try to read it my computer hangs. So I want to read it piece by piece and after processing each piece store the processed piece into another file and read next piece.  Is there any method to yield these pieces ?  I would love to have a lazy method.


well there are many packages and applications installed by default in Ubuntu, which some relate to old choices made by Canonical like using Unity and stuff like that. But I'm wondering about the decision when they select an specific software over other similar ones to be installed by default on the OS, for example transmission.   So is there any explanation by Canonical over these kinds of decisions and selections? Are these decisions more about system stability and performance rather than popularity?

For example there is a lot of text editors, media players, text editors, mail clients, etc, but only one of each group is selected to be delivered as pre-installed in the next version of Ubuntu. So, I'd like to know how are those applications rated to become a pre-installed application?  Do it need to be not that great so that applications other developers have written have the chance to be installed by the user? For example, let's say that the application AAA is the best of its group, but if this application is used as default/pre-installed, other applications from the same group will probably not be installed by the users because they will know that AAA is the best.


I have a mbp 15 early 2013 model. It was running smoothly until yesterday suddenly it passed out with a folder question mark screen. so I went to recovery because I can't boot up. In the startup disk I can't find my ssd and in disk utility can't first aid my ssd and even can't erase my ssd to perform a fresh install.. when tried erasing in terminal it shows up the error waiting for disks to reappear.. so I think that ssd is working fine because it shows up on the disk utility, so this might be a controller problem in which in my case I don't have a hard drive cable, instead I think it's part of the logic board where ssd has to be plugged.. suggest me a solution.. Sorry for my explanation if it's bad.. I'm very much worried 😯 as of now..  My question is different.. the apple genius couldn't figure out whether it's logic board or ssd.. because both are functioning properly in diagnosis.  how it is different.. I cant able to format using gparted.. so by using terminal I tried pdisk commands and was able to create and write partitions.. so does it conclude that ssd is still working.. if so what could have been the error

I currently own a 15 inch MacBook Pro with retina display model ( early 2013) . My Mac was working fine and all of a sudden my Mac won't boot up. I see a flashing folder with a question mark symbol on my screen.  I took my Mac to a technician who diagnosed the issue and said flash disk has to be replaced. He said  "Reseted SMC and PRAM. Still same issue. Tried to erase the SSD by booting with known good OS. still same issue. tried to erase the SSD using terminal mode same issue. tried to repair the SSD found not getting repaired. Reseated the SSD and tried to erase the SSD still not able to erase the SSD".  Is there any other way to fix this issue without replacing the SSD?   Or could you suggest any other SSD for this model of Mac?


Why doesn't gnome-software show all available software from my repositories?  In other words, is gnome-software restricted in some way by Canonical from listing all available software packages? If so, which software is restricted and which software is allowed? Also, when was this change made and why was this change made?  (Note, I'm not looking for a technical solution).  I've looked at similar questions, but I don't see a clear answer to my question.        Here are a couple of example applications that are not available in gnome-software:   torcs trigger-rally   But a command-line search with apt shows these applications are actually available to install:  apt search ^torcs$ Sorting... Done Full Text Search... Done torcs/disco 1.3.7+dfsg-4 amd64   3D racing cars simulator game using OpenGL  apt search ^trigger-rally$ Sorting... Done Full Text Search... Done trigger-rally/disco 0.6.6+dfsg-2 amd64   free 3D rally racing car game

The Software Center in Ubuntu 16.04 (Gnome Software) shows only part of the packages available. While e.g. apt list qtcreator correctly lists the corresponding package a search in Software Center finds nothing.  Is there something misconfigured? I upgraded from 15.10. Until now I have used the old Ubuntu Software Center which worked fine.


in my paper I used tables to display the results, these tables do not come in the pdf file as same as the writing's order in the latex code

Is there any package or a method to force LaTeX to keep floating environments like table and figure closer to where they are declared?


I am still new to Linux and when I was trying to update Mono, I believe the part where I had to copy and paste, the echo - tee command lines is where my mistake happened. Anyhow, I can't do anything in the terminal without getting this error. I read in other forums and their solutions didn't help. I also cant paste my,  cat /etc/apt/sources.list, because with all the links, this website assumes I am spamming. Typing in: cat /etc/apt/sources.list | nc termbin.com 9999   gives: https://termbin.com/t1noy  which seems to change every time I type it in. Finally, typing in:   sudo nano /etc/apt/sources.list.d/mono-official-stable.list  returns: sudo apt-get update  Thank you!

I don't know what caused the following to happen:    The content of /etc/apt/sources-list.d/mono-xamarin.list is sudo apt-get update.


Applications usually cache data on an implementation of hash data structures to speed up the query, typically Memcached or Redis. Does relational databases also do the same things internally?  For example, if I do the select * from account where id = 1 where id isn't indexed or b-tree indexed, does the engine caches the result to the cache using the key like account_id_1 so that the subsequent same queries could return the result from the cache until it's invalidated?  I'm asking this because I saw the following from the , and wondered whether that feature is something new for FoundationDB or relational databases have been doing this also although it's not distributed:     Distributed Caching      When your database scales out, you don’t need a separate distributed   caching layer: you already have one. FoundationDB uses the aggregate   memory of the entire cluster to cache commonly accessed data. Unlike a   caching tier such as memcached, FoundationDB’s cache is completely   synchronized to the database and provides all ACID guarantees.

I'm having difficulty finding 'lay' explanations of how indexes are cached in PostgreSQL, so I'd like a reality check on any or all of these assumptions:   PostgreSQL indexes, like rows, live on disk but may be cached. An index may be entirely in the cache or not at all. Whether it is cached or not depends on how often it is used (as defined by the query planner). For this reason most 'sensible' indexes are going to be in the cache all the time. The indexes live in the same cache (the buffer cache?) as rows, and therefore cache space used by an index is not available to rows.    My motivation for understanding this follows on from  where it was suggested that partial indexes can be used on tables where a majority of the data will never be accessed.  Before undertaking this, I'd like to be clear that employing a partial index yields two advantages:   We reduce the size of the index in the cache, freeing up more space for rows themselves in the cache. We reduce the size of the B-Tree, resulting in a faster query response.


I read a novel from the mid to late 80's where a class was transported for a survival weekend but the transporter malfunctioned and the group wound up on an unknown planet. I believe the kids were stuck there for a couple before being found. At the end of the book one of survivors journeyed back to the new planet with a type of wagon train of pioneers. Anyone know this book and if so its name?

I would love to identify a sci-fi novel I read in the late 60s or 70s.  It followed a group of young space cadets through their training in the Space Academy.  The training culminated in small groups of cadets being sent through a gateway in the space station, into different worlds where they had to survive whatever conditions they met beyond the gateway, as part of their training.  One such trip went wrong and the group ended up stranded in a hostile world for days, hoping to be rescued by their trainers.  I can't remember much about the story or protagonists so this may be too vague, but I remember descriptions of a vast space station hall and these young cadets bringing whatever kit they hoped they might need - some brought breathing apparatus and full survival gear, but others came with very little as they believed they would not be sent into conditions where they could die without the right equipment.  They hadn't bargained for the power surge or whatever it was that misdirected them as they passed through the gateway!  I also remember rivalry between the cadets - I think the hero was male and quietly heading for top cadet of the year award... and I think at least one of the group died in the unknown planet before they were rescued.  Does this ring a bell with anyone?  I remember the mood and tension more than the details but it was a long time ago!  I have a 10-year old son who I think would love this kind of story.  If anyone can help you have my thanks!


This question is not a duplicate, because here we need also to ensure, that group of common values/rows remain in the same split file (and is not scattered across multiple split files).  All, I tried to google a solution but did not find any that suits my requirement.  Question: I have a huge file that needs to be split into multiple files if the the size exceeds 2GB. This, I am planning to do using the record count. But the challenge is, when I split the file, the group data should not split. It should remain in single file.  ex:  A,1,2,6/11/2018,X,Y,Z A,2,2,6/11/2018,X,Y,B A,3,2,6/11/2018,X,Y,Z A,4,2,6/12/2018,X,Y,Z B,1,2,6/11/2018,X,Y,Z B,2,2,6/11/2018,X,Y,B A,5,2,6/15/2018,X,C,Z A,6,3,6/110/2018,A,Y,Z C,3,2,6/11/2018,X,Y,Z C,4,2,6/12/2018,X,Y,Z C,5,2,6/15/2018,X,C,Z D,6,3,6/110/2018,A,Y,Z E,6,3,6/110/2018,A,Y,Z E,6,3,6/110/2018,A,Y,Z G,6,3,6/110/2018,A,Y,Z   In the above sample example, let's say my group key is the first column. Therefore, if I decide to split a file into multiple files (with record count cut off in each file as 7 records max), I don't want records with value "A" to be split into multiple files. Similarly, records with 'B", "C" etc should also remain in single file. All grouped data should remain in the same splitted file.A total of 3 files are created from above example (but same group data should remain in a single splitted file)  For above example: below should be a sample output:  op_file_1  A,1,2,6/11/2018,X,Y,Z A,2,2,6/11/2018,X,Y,B A,3,2,6/11/2018,X,Y,Z A,4,2,6/12/2018,X,Y,Z A,5,2,6/15/2018,X,C,Z A,6,3,6/110/2018,A,Y,Z G,6,3,6/110/2018,A,Y,Z   op_file_2  B,1,2,6/11/2018,X,Y,Z B,2,2,6/11/2018,X,Y,B C,3,2,6/11/2018,X,Y,Z C,4,2,6/12/2018,X,Y,Z C,5,2,6/15/2018,X,C,Z E,6,3,6/110/2018,A,Y,Z E,6,3,6/110/2018,A,Y,Z   op_file_3  D,6,3,6/110/2018,A,Y,Z

I have seen solutions of splitting a file with respect to pattern matching and line matching but what I want is the following.  The scenario is, let's say I have a file file1  -   A.B|100|20 A.B|101|20 A.X|101|30 A.X|1000|20 B.Y|1|1   Now I want to split this file into 3 different files just based on the first column where the 1st file would be all the lines containing A.B in the first column, the 2nd file should have all the lines with A.X and so on.  If the first column changes in  any way, there should be a new file created for those lines. Is there any way of doing it with bash  or awk?  Since there is no way of actually knowing before hand what the first column value is, I wasn't able to use any feature like split or cut. Thanks for the help in advance!


I have a problem with this situation. Would you mind helping me?  To what place (does/do) either the man or his sons wish to go?    Can you show me which is correct? do or does is correct?

Should I use 'was' or 'were' in this example?     I was always delighted when my brother or one of my sisters was/were asked to do them.


I am planning to use m1.small in Elastic Beanstalk for the image processing of my app. It can scale behind a load balancer and provide more processing power when the app needs to based on specific metrics.  I also considered using m3.medium which is more optimized for compute intensive application like image processing. The problem is that my application runs on ASP.NET 4.5 and when running on Windows 2012, I assume that the m3.medium 4GB SSD drive won't work for this type of instance.  The other option is m1.medium that has 160GB of storage space but less powerful than the m3.  Which server considering that I need to run my application on Windows and I am running it behind a load balancer (Elastic Beanstalk) and can add remove servers using auto scale, which one do you recommend for image processing?

This is a  about  Related:      I have a question regarding capacity planning. Can the Server Fault community please help with the following:   What kind of server do I need to handle some number of users? How many users can a server with some specifications handle? Will some server configuration be fast enough for my use case? I'm building a social networking site: what kind of hardware do I need? How much bandwidth do I need for some project? How much bandwidth will some number of users use in some application?


I wanted to measure the "average distance from the average value", but I can't understand the "standard deviation". Many text books say the standard deviation is used to "summarize" the deviation, but I have trouble understanding why it uses squares to do it. If I have many x numbers the formula is: $$\sigma = (\frac{1}{N} \sum_i \lvert x_i - avg \rvert^\color{red}{2.0})^{1/\color{red}{2.0}}$$ So, there it is... that magic number 2.0. It shows up twice. What is so magic about it? Can't I use 1, 3, 4, or 6? or even 1.9, or 2.1? Why 2.0? Edit: I just learned that 1 is called "mean deviation".

Let's take the numbers 0-10.  Their mean is 5, and the individual deviations from 5 are -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 And so the average (magnitude of) deviation from the mean is $30/11 \approx 2.72$.  However, this is not the standard deviation.  The standard deviation is $\sqrt{10} \approx 3.16$.  The first mean-deviation is a simpler and by far more intuitive definition of the "standard-deviation", so I'm sure it's the first definition statisticians worked with.  However, for some reason they decided to adopt the second definition instead.  What is the reasoning behind that decision?


I have read  question. It was asked if photons are able to curve spacetime. But if classical electromagnetic fields can curve spacetime (due to the energy contained in the fields contributing to the mass-momentum tensor) why shouldn't photons be able to do this? If the em field curves spacetime then photon fields should be able too. After all, they constitute the classical em field when the number of photons is large. I mean, what would be the reasons to ask if a photon would not be able to make spacetime curve? One thing I can think of (thanks to @WolphramJohnny): a photon has a different energy in different frames of reference, so if it curves spacetime in one frame it curves spacetime differently (more or less) in different frames of reference. This holds true also for massive particles but massive particles have a rest mass, while photons have not, so curvature due to mass is not there. Only curvature due to motion, which gives rise to linear frame-drag. Though this can also be said for classical em waves. So photons must emit gravitons (or small spacetime distortions) like a speeding boat emits bow waves (if it speeds. But how can this be different for different frames? In one frame the photon will not even emit gravitons (no energy). Can we say that photons can't exist in General relativity in the first place (because they are a quantum object)? Can only fermions emit gravitons (because they are quantum objects)? Of course, you can say that we need a quantum theory of gravity (which doesn't necessarily mean that gravitons are involved though; spacetime itself can also be seen as quantized) but the theory has to involve an interaction with a graviton field.

I have read this question:     where Safesphere says in a comment:     Actually, photons themselves don't bend spacetime. Intuitively, this is because photons can't emit gravitons, because, as any massless particles not experiencing time, photons can't decay by emitting anything. The latest theoretical results show that the gravitational field of a photon is not static, but a gravitational wave emanating from the events of the emission and absorption of the photon. Thus the spacetime is bent by the charged particles emitting or absorbing photons, but not by the photons themselves.        where John Rennie says:     as far as I know there has been no experimental evidence that light curves spacetime. We know that if GR is correct it must do, and all the experiments we've done have (so far) confirmed the predictions made by GR, so it seems very likely that light does indeed curve spacetime.   Now this cannot be right. One of them says photons do bend spacetime, since they do have stress-energy, but it is hard to measure it since the energy they carry is little compared to astronomical body's stress-energy. So they do bend spacetime, it is just that it is hard to measure it with our currently available devices.  Now the other one says that photons do not bend spacetime at all. It is only the emitting charge (fermion) that bends spacetime.  Which one is right? Do photons bend spacetime themselves because they do have stress-energy or do they not?


Let $g: [0,1] \rightarrow \mathbb R$ and $g(x)=\frac{1}{q}$ if $x=\frac{p}{q}  $  otherwise $0$.Prove that g is Riemann integrable.  Hint: Analyze the discontinuities of $g$. Prove that if $x$ is irrational and if $\frac{p_n}{q_n}$ is a sequence of rationals converging to $x$, then $q_n \rightarrow \infty$.  My idea: I observe that this function has countably many discontinuities. If I prove that If a function has countably many discontinuity then it is Riemann integrable. Is this direction is right?  Anyone suggest some idea from the hint?

Consider the function $f: [0,1] \to \mathbb{R}$ where f(x)= \begin{cases} \frac 1q & \text{if } x\in \mathbb{Q} \text{ and } x=\frac pq \text{ in lowest terms}\\ 0 & \text{otherwise} \end{cases}  Determine whether or not $g$ is in  $\mathscr{R}$ on $[0,1]$ and prove your assertion. For this problem you may consider $0= 0/1$ to be in lowest terms.  Here's an attempt. I may have abused a bit of notation here, but the ideas are there.   Proof: Let $M_i = \sup \limits_{x \in [x_{i-1},x_i]} f(x)$.  Notice first that the lower Riemann sums are always $0$, since every interval contains an irrational number. Thus, to prove $f \in \mathscr{R}$, it suffices to prove that, given any $\epsilon >0$, $\sum \limits_{i \in P} M_i \Delta x_i < \epsilon$ for some partition.     Let $\epsilon > 0 $ and $M  > \frac{2}{\epsilon}$. We first show that there exists $\eta(x,\frac{1}{M})$ so that $|f(x) - f(y)| < \frac{1}{M}$ if $|x-y| < \eta$. Fix $x \in (\mathbb{R} \setminus \mathbb{Q}) \cap [0,1]$. Now, consider the set $$R_{M} := \{ r \in \mathbb{Q} : r = \frac{p}{n}, n \leq M, p \leq n, p \in \mathbb{N} \}.$$ Clearly this set is finite, enumerate it as $\{q_1,\ldots, q_m\}$. So, let $$\eta(x,\frac{1}{M}) = \min_{i=1,\ldots, m} |x- q_i|.$$ We see then, $|f(x) - f(y)| < \frac{1}{M}$ on this $\eta$-neighborhood.    After we choose that $\eta$ so that $x \in (\mathbb{R} \setminus \mathbb{Q}) \cap [0,1]$, is continuous in a $\eta$-neighborhood, we see  $$ A:= [0,1] \setminus R_M \subset \left( \bigcup_{ x \in ( \mathbb{R} \setminus \mathbb{Q}) \cap [0,1]} B_{\eta(x)} (x) \right) \cap [0,1].$$  Since $A$ is compact, we may take finite sub-covering, and let $\delta = \min \limits_{i=1,\ldots,n} \{\eta(x_i)\}$. Take a partition $P_1$ of $A$ so that $\Delta x_i < \delta$. Since $R_M$ is non-empty, we can take a partition $P_2$ of $R_M$ so that $\Delta x_i < \frac{\epsilon}{2m}.$ Moreover, we see that,  on $[0,1]$, $f$ is at most $1$. Let $P = P_1 \cup P_2$. Thus,   \begin{eqnarray*} \sum_{i \in P} M_i \Delta x_i &=& \sum_{i \in P_1} M_i \Delta x_i + \sum_{i \in P_2} M_i \Delta x_i \\ &\leq& \frac{1}{M} \sum_{i \in P_1} \Delta x_i + \sum_{i \in P_2} \Delta x_i \\ &<& \frac{\epsilon}{2} + \frac{\epsilon}{2} = \epsilon  \end{eqnarray*}    Comments?    EDITED I think I resolved the issue.


I am preparing a submission to Applied Economics and I downloaded the latex package from the website of the editor ().  Regarding bibliography, it uses a specific style (tdcaf.bst), available in the package, to produce a Chicago-style bibliography.   I tried to compile the file (interactcadsample.tex) using the bib file interactcadsample.bib and putting the lines below where the bibliography is supposed to appear:  \bibliographystyle{tfcad} \bibliography{interactcadsample}   Unfortunately, it seems not to work and I cannot undestand why.  THE MWE is:  \documentclass[]{interact}  \usepackage{epstopdf} \usepackage{subfigure} \usepackage{natbib} \bibpunct[, ]{(}{)}{;}{a}{}{,} \renewcommand\bibfont{\fontsize{10}{12}\selectfont}  \begin{document}  \title{My title\thanks{My acknowledgements.}}  \author{ \name{First author\textsuperscript{a}\thanks{CONTACT First author. Email: firstauthor@email.com} and second author\textsuperscript{b} and third author\textsuperscript{a}} \affil{\textsuperscript{a}Department X, University Y; \textsuperscript{b}Department K, University Z} }  \maketitle  \begin{abstract} \noindent The abstract  \end{abstract}  \begin{keywords} Keywords \end{keywords}   \section{Introduction}  In the introduction I want to cite \citep{Alb05,Gre08,Sch87} and \citealp{Mor08}.  \bibliographystyle{tfcad} \bibliography{interactcadsample}  \end{document}   As you may notice, when compiling the file citations and bibliography are missing. Any help on how I can fix this? Thanks in advance.

I've browsed the forums and found a number of posts that have addressed this issue, but none of the solutions seem to work for me. I have the following script that I just copied from the bibtex home page to get familiar with it. Instead of the citation number I get a question mark. I compile using Latex+Bibtex+Latex+Latex+PDFLatex+ViewPDF just as has been previously suggested and the problem persists.   \documentclass[11pt]{article} \usepackage{cite}  \begin{document}  \title{My Article} \author{Nobody Jr.} \date{Today} \maketitle  Blablabla said Nobody ~\cite{Nobody06}.  \bibliography{mybib} \bibliographystyle{plain} \end{document}   My bibliography (Bib.bbl)  @misc{ Nobody06, author = "Nobody Jr", title = "My Article", year = "2006" }    Looking at previous posts one thing that is concerning is that my .bbl looks empty as shown below. Further, I don't have a .blg  \begin{thebibliography}{}  \end{thebibliography}


Yes, I've tried all the basic kill, pkill, etc. methods that come up with a Google search. Sometimes it works, other times it seems something is preventing the process from terminating. There is no stderr message when the kill command fails, but ps, pgrep, etc. show the process is still running.  Is there a more forceful way to do this? Thanks.

I have a process I can't kill with kill -9 <pid>. What's the problem in such a case, especially since I am the owner of that process. I thought nothing could evade that kill option.


#include <stdio.h>  increment(char *c) {     c++;     c++;     printf("works 'n' %c \n", *c); }  int main() {      char *p;     char mon[10] = "Monday";     p = mon;     increment(p);     printf("expecting 'n' %c \n", *p);      return 0; }   If character buffer pointer incremented in other function it will not reflect after coming out of the function.

What is the difference between    a parameter passed by reference a parameter passed by value?   Could you give me some examples, please?


I am designing this logo for my website. It looks great in Illustrator CC but looks pixilated on the site. I want to smooth out the "A" and "W" diagonal vector lines.  I have tried exporting as a PNG Interlaced and using the "Align to the Pixel Grid" option. The image is partially vector lines and partially type. Any tips or suggestions? Thanks in advance.

I'm exporting a document to raster image with Illustrator and get this result:  But I want to get this quality:  It lookes more pixel-perfect and thin then the Illustrator's render.  How do I setup Illustrator to render text pixel-perfectly? Also, is it possible to enable subpixel AA in it? Thank you!


I need help understanding this equation: $\int_0^T |e^{j\omega t}|^2 dt$ = $\int_0^T 1.dt$ = T  0-T is only one period, not all T.  $\ e^{j\omega t}$ is a periodic complex exponential and \omega  is the angular frequency.  $\ e^{j\omega t} = \cos\omega t + j\sin\omega t$  My question is how $\ |e^{j\omega t}|^2$ got evaluated to 1.  Thank you!

Why does $|e^{ix}|^2 = 1$?   The book said $e^{ix} = \cos x + i\sin x$, and square it, then $|e^{ix}|^2 = \cos^2x + \sin^2x = 1$.  But, when I calculated it, $ |e^{ix}|^2 = \left|\cos x + i\sin x\right|^2 = \cos^2x - \sin^2x + 2i\sin x\cos x$.  I can't make it to be equal $1.$ How can I do it?


This may be, after decades of Windows use, the moment when I switch to Mac...  Issue: Win is rebooting my PC, once or twice a day, once when I was on a phone call, with a word doc in front of me, discussing it by tel.  I believe the core issue is that the big update to Win 10 is failing to install properly.  I followed the steps here:   But the reboots continue.  The GUI currently shows as below.  a) How do a PREVENT auto reboots, in general?  b) How do I STOP the reboot that the system is telling me will occur in the next hour?

Windows 10 lets you 'schedule' a reboot for later. I want to disable it.  Evidently Windows scheduled itself for a reboot last night when I wasn't looking and just closed everything I had been working on the night before.  I reboot on the regular; I don't need Windows to do that for me.  Can I disable it completely? I don't mind if it downloads everything, and then says "hey, you should reboot," but it should never reboot itself, ever.  I'm using the "Pro" edition of Windows 10.