I've the following services:  public with sharing class LibraryService {      public static void remove(String jsonString) {         Library__c library = [ SELECT Id, ilms__Library_Name__c FROM ilms__Library__c WHERE Id = libraryId ] ;          AccessService.deleteReviewerGroup(library);          delete library;     } }   AccessService class  public  with sharing class AccessService {         public static void deleteLibraryReviewerGroup(Library__c library) {          List<Library__Share> reviewersGroups = [ SELECT UserOrGroupId FROM ilms__Library__Share WHERE AccessLevel = 'Read' AND ParentId = :library.Id  ];         System.debug('reviewersGroups: ' + reviewersGroups);          if(reviewersGroups.size() == 1) {             String reviewersGroupId = reviewersGroups[0].UserOrGroupId;              delete reviewersGroups;              AccessService.deleteReviewerGroup(reviewersGroupId);         }          return;     }     @future     public static void deleteReviewerGroup(String groupId) {         List<Group> reviewerGroup = [ SELECT Id FROM Group WHERE Id = :groupId ];          delete reviewerGroup;      } }   Now, when I try to test the LibraryService remove method: I keep receiving the below error:  first error: MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa):  @isTest(SeeAllData=true) private class TestLibrary {     static testMethod void testRemoveLibrary() {         Library__c library = new Library__c(...);         Boolean isRemoved = LibraryService.remove(TestUtilsClass.idJson(library.Id));          System.assertEquals(isRemoved, true);     } }   I tried adding Test.startTest() and Test.stopTest() to the testRemoveLibrary method, but I still get the same error. Am I doing something wrong? How to fix this.

I’m in a situation where I have to use a future method to avoid  MIXED_DML_OPERATION error. I have a trigger that runs after INSERT on USER and creates  a custom object X. They are in 1:1 relation. User is an owner of X and sharing model is private.  I’m not sure what is the best approach to write tests for this scenario.  I want to keep my data isolated so in tests I need to create a User and X he owns. I can think of 2 scenarios:  1)  Create a mock user and let the trigger create X for the test  Because in test context @future methods are executed  when the Test.stopTest() is called I would have to enclose my set up section in Test.start/stopTest(). This means I can’t use these two later in the method where I want to  test a particular logic on X.   2)  Create a mock user, don't wait for future method and create X manually in mock section  I can write a single test  for creation of X in the trigger. In all other  tests checking  the business logic  on X I create a user, manually create X setting the user as the owner. The problem is that now if later in the method I call Test.start/stopTest() and do a select from X where ownerId = user.id I will get two X records.  To my surprise I discovered that I’m able to insert X objects from the trigger while running a test. I didn't use the @future method and I got no MIXED_DML_OPERATION error ( - a bug?).  for(User aUser: newUsers){       newXtoInsertFromFuture.put(aUser.ID, aUser.lastName )       objectX.add(new X(ownerID=aUser.id, property=aUser.lastName));  } if(Test.isRunningTest()){         insert objectX; }else{         matchUsersWithX(newXtoInsertFromFuture); }  With this code in trigger I can create a user in a test set up section and the corresponding X is created synchronously. I’m not sure why things work this way.  Anyway this looks like a dirty hack that yields the same problems as 2) if I ever call Test.start/stopTest() in the test.  Could any of you good people out there tell me what is the correct way to write tests in my case? thanks in advance.


I have an dynamicly added div that I am calling to my page via a javascript tag added to the bottom from a third party plugin. I want to check if this element has the css value display:none or block. Im having trouble accessing the elements info I think because it was rendered to the page after my script. is there a way to check for this? i tried this:  if($('.element').css('display') == 'none') {     alert("none"); } else {      alert("block"); }

Is it possible to toggle the visibility of an element, using the functions .hide(), .show() or .toggle()?  How would you test if an element is visible or hidden?


Is there a rate of change force?          I know that net force is rate of change of momentum or mass *acceleration.  But is there rate of change of force or (mass * jerk) ? or Rate of rate of change of force(mass *jounce)  How to relate them to the physical world? Is it even physically possible?  Assuming mass to be constant

I know this may seem a weird question, but it always bothers me. My physics book (Resnick,Halliday,Walker), and also various sites never say anything beyond acceleration.   But when a moving body is being acted by a variable force , its acceleration will definitely change: it will either increase or decrease. Then there will be rate of change of acceleration with respect to time. So, why don't books mention this? What is the cause for not measuring $\frac{d\vec{a}}{dt}$ ? If it exists, what is the use of it?


Is wands the only tool used for spellwork? Are there any wizards that use staffs, like Gandalf, in Harry Potter? Is there any mention of other tools you can use to perform spells?

We know that wizards need a wand to focus their magic (wizards can cast spells without a wand, but they are unfocused and weaker). But some wizards aren't known to carry wands. Instead they carry something that works like a wand, but isn't.  Mad-Eye Moody uses a staff as his wand. Hagrid uses his pink umbrella, which was made from pieces of his broken wand.  Are there any other examples of wizards using something other than a normal wand to cast their spells? What are these objects? Do they work like normal wands, and what gives them their power? Would it be possible to use a magical weapon as a substitute for a wand? (Like, say, used the Sword of Gryffindor to channel your spells.)


I asked a question on  and after not getting an answer for two days I asked the same question on . There I got an answer immediately. Should I now delete my first question, or should I copy the answer back?

It is possible to migrate a question from one Stack Exchange site to another by closing, but if I have a question that I think is on-topic for multiple Stack Exchange sites, is it OK to post it on both (multipost)?   For example, I have a question that's earned me the tumbleweed badge on SO and I'm not sure what the best thing to do with it is. It's about a web server so it might be answerable on Server Fault but it's really more of a programming thing, hence the posting the question on Stack Overflow.    Is there any way to make the question visible on multiple sites (crosspost) and then accept the answer wherever it came from?


I was searching the web around for relevant information about this, but all I could find are incomplete or outdated information.  So consider this: You have your typical business website, but every link to static page point to just one iFrame. So there is no navigation outside of the main page. As far as I know, it is important to have good URL links with good keywords, but since everything is iFrame, there are no urls, outside of w-ww.something.com (no /our-producs or /about-us etc., just one parent page). So does that affect negatively the page ranking? I believe the iFrame content is not indexed at all, isn't it?

I thought frame and iframe were bad for SEO, but today I was doing a search for "numismatica" on Google.it.  The 3rd site is lemonete.com which is all made with frames. A competitor site (nummus.com) that has no frames ranks much lower when searching for the same word: "numismatica".  So can we use frames without taking an SEO hit now?  Any explanation (possibly simple) would be appreciated also about the fact the 2nd site ranks much lower. :)


I'm having a bit of trouble understanding why I'm wrong. Given a loop that starts on the point $(1,0)$ and does 1 loop in the clockwise direction in $S^1$ cant I construct a homotopy in the following manner: H(x,0) = the original loop H(x,1) = the point $(1,0)$. H(x,y) = a loop that starts at $(1,0)$ and then goes $(1-y)\cdot2\pi$ clockwise.  I know this isn't the most formal explanation but why is this wrong? It seems to uphold the definition of a homotopy, but it has to be wrong.  Any help would be appreciated.

Let $S^1 = \{z \in \mathbb{C} : |z| = 1\}$.  Take the loops $f,g : [0,1] \rightarrow S^1$, $f(t) = 1$, $g(t) = e^{2\pi it}$.  I know these represent different elements in $\pi_1(S^1, 1)$, but I don't see why $F(t,s) = e^{2\pi its}$ isn't a homotopy between $f$ and $g$.


I know that for HMAC/SHA there are default IV values. But if I want to supply my own IV (different from a default), there doesn't seem to be a way to implement it in — for example — Java. (At least, so far I hadn't found a solution in javax/bouncy castle. Looks like MessageDigest class isn't providing us with such methods).  Why are default values for IV (HMAC/SHA) used? What is the reason not expose them to a user?

Why do HMAC/SHA IV's have a fixed value? I refer to the arbitrary H constants which are included in the algorithm prior to any data being fed in.  Why aren't they exposed to the user, so one can decide on an IV and modify it accordingly (for example, in java they are provided at hash function specification, instead of being supplied by the user at init)?  How does modifying these IVs affect the algorithm?


Do squirrels have four legs, or two arms and two legs?  I first asked this question many years ago, and it has since unearthed a whole array of conundrums and questions that I have struggled to get a conclusive answer to.  See a squirrel (often described as a quadruped, 4 feet, which implies 4 legs) can stand on its back two legs and hold a nut in the paws of its front two legs - but those front legs are jointed in a very similar way to arms, look like arms and are being used as arms.  When a squirrel runs, it uses all four limbs - but then so does a gorilla, and that definitely has arms.  So in trying to answer this seemingly simple question I ended up lost in a world of definitions and further questions - questions like "what is an arm anyway?"  "what is the difference between a paw and a hand or foot?" - and after trying to find out the answers to those questions I ended up in a much stranger world.  Octopuses have arms, but no hands - bats have hands, but no arms (I will spare you one of the resulting conversations which wanted to know how long a nose has to be until it's a trunk, especially concerning anteaters).  I could be wrong but it seems to me that if your front paws are called hands, then you have two arms and two legs.  Koalas, for instance, are often described as having hands despite also being described as quadrupeds.  Perhaps the differences are merely linguistic choices rather than anything relating to the biological nature of these limbs.  I just don't know anymore, and at this stage, I am starting to wonder if I have given this question way too much thought, time and energy.  Can anyone help me out?    Very sorry if this question isn't appropriate here - if there is a better group for this question on Stack Exchange please let me know.

Ok, this is a bit of a tangent question, but it came up yesterday and I didn't know the answer:  How are arms and legs defined physiologically? For example, we say humans have two arms and two legs, while cats have four legs, and some monkeys (appear) to have four arms (although I guess they could be legs too). It's really unclear to me how we make these distinctions.   So:  What is the physiological definition of both "arm" and "leg"? How are they different?


I can't find lava. I'm trying to make obsidian so I can make a teleport to the nether world.

I have looked everywhere for lava or obsidian in 0.7.1. I've looked all the way from top to bottom and all around, in about a 100 block diameter, but I can't find any. Where can I get some?


My input file is,  ami41 ami56 ami23 ami67 ami45 ami34 ami88 jama66 tumi234 bichi23455 susami345   Using a single command line I need the output as,  ami42 ami57 ami24 ami68 ami46 ami35 ami89 jama66 tumi234 bichi23455 susami345   I used the command,  perl -pe 's/(\d+)/$1+1/eg' inputfile   But I got the output file as,  ami42 ami57 ami24 ami68 ami46 ami35 ami89 jama67 tumi235 bichi23456 susami346   i.e. all numerics with all types strings are increased. But I need the numerical only with ami string to be increased. Could anyone kindly suggest me some better command line.

My input file is,  ami21 ami65 ami67 ami66 ami88 ami76 ami29 ami55  ami54 ami32   Using a single command line I need the output as,  ami22 ami66 ami68 ami67 ami89 ami77 ami30 ami56 ami55 ami33   I used the command  awk -vRS=ami '{$0=$0+1;ORS=RT}++n' inputfile > outputfile   but I got the outputfile as ami21ami65ami67ami66ami88ami76ami29ami55ami54ami32  i.e. all strings are written in same line and without space. Could anyone suggext me some better command line.


I'm a newbie, and I've installed the restricted extras package but I still cant play a dvd. Is there a way to trouble shoot the problem or is there any important codecs that I've missed?

My machine can't play encrypted DVDs on a fresh install.  How do I add this capability?  Another useful bit of information would be what programs are best for playing DVDs, once I'm able to do so.  See the .  Will I be able to play DVD movies from ?


I have read the official git checkout documentation and some questions here and haven't found an answer to the behaviour I'm seeing.  Locally, I have a dev branch. From within the dev branch, I create a new feature branch  git checkout -b myBranch   Then, I add a new file  echo foo > myFile.txt   If I immediately go back to the dev branch  git checkout dev   the myFile.txt is already there, even though  1) I did not stage the file 2) I haven't merged the branches  My expectation is that any changes I make to the files while in the feature branch will not propagate over the other branches.  Why is this happening?

I am working on a git repository with a master branch and another topic branch. I have switched to topic branch and modified a file. Now, if I switched to master branch that same file is shown as modified.   For example:  git status in git-build branch:  # On branch git-build # Changes to be committed: #   (use "git reset HEAD <file>..." to unstage) # #       modified:   cvsup_current #   Switch to master branch  [root@redbull builder_scripts (git-build)]# git co master M       builder_scripts/cvsup_current Switched to branch "master"   git status in master branch  [root@redbull builder_scripts (master)]# git status # On branch master # Changes to be committed: #   (use "git reset HEAD <file>..." to unstage) # #       modified:   cvsup_current #   Why is that the file is shown as modified in master branch even though it was modified in git-build branch?   My understanding was that the branches are independent of each other and when I change from one branch to another the changes do not "spill over" from one branch to another. So I am obviously missing some thing here.   Anyone got a clue stick?


Let $A$ be an infinite set and ${\mathcal C}$ be the collection of all the subsets of $A$ which have the same cardinality with $A$. Does ${\mathcal C}$ have the same cardinality with the power set of $A$?

Let $\kappa , \lambda$ be cardinals with $\omega \leq \lambda \leq \kappa.$   Prove $\kappa^{\lambda} = |\{X: X \subseteq \kappa, |X|=\lambda\}|$.  i.e could anyone advise me on how to construct a bijection between $\{f \mid \text{$f$ is a function},~{\rm dom}(f) = \lambda,~ {\rm ran}(f) \subseteq \kappa\}$ and $\{X: X \subseteq \kappa, |X|=\lambda\}$?  Thank you.


I will fly from Reykjavik to Hong Kong and change flight in London. I have Chinese passport and Iceland permanent residence. Do I need an UK visa?

Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have.


It gives me this   E:Malformed line 3 in source list /etc/apt/sources.list (dist parse) E:The list of sources could not be read. E:The package lists or status file could not be parsed or opened.

I have unistalled and reinstalled the Ubuntu Software Center as per info I found in a similar thread and I got the same response about line 91 or something like that.  I just tried to upload a screen shot but since I'm new it won't allow me to.  I also can not figure out how to cut and paste anything so I have to hand type what the error screen says, both when I attempt to open the software center and nothing happens, when I try to enter commands into the terminal to uninstall, reinstall, whatever I get the same following:  COULD NOT INTITIALIZE THE PACKAGE INFORMATION An unresolvable problem occured while initializing the package information Please report t:his bug against the 'update-manager' package and include the following error message: 'E: Malformed line 91 in source list/etc/apt/sources.list (dist parse)  E: The list of sources could not be read.,  E: The package list of status file could not be parsed or opened.   How do I report bugs?  What can be done about this.  I have searched and everything everyone says to do leads me back to the same line error message.  So, I don't know how to get to line 91 in the source list; to tell you what it says. Sorry, I'm really new to this. That is what I need is to find out how to get there and fix what it says. I would really like to NOT have to re partition my hard drive and start from scratch, so I'm really looking forward to getting this problem solved. I need to be able to install new software.


How to find the table name based on a value I pass in Oracle ? The query should check all the tables in the schema to check if the given value exists in any of the tables

Is it possible to search every field of every table for a particular value in Oracle?  There are hundreds of tables with thousands of rows in some tables so I know this could take a very long time to query. But the only thing I know is that a value for the field I would like to query against is 1/22/2008P09RR8. <  I've tried using this statement below to find an appropriate column based on what I think it should be named but it returned no results.  SELECT * from dba_objects  WHERE object_name like '%DTN%'   There is absolutely no documentation on this database and I have no idea where this field is being pulled from.  Any thoughts?


Hello I am making a windows app using my java code but I am having trouble with swing GUI. Eventually I am trying to make a Panel that comes up and has a few options for different reports you can run. For now, I am just trying to get my panel to pop up and a button with an alert.  Here is my code. Since this is intellij IDEA, there's not really any code for the GUI but it is in a .form file. I want to add an event listener on JButton button that says hi.The error I get is null pointer execption. What am I doing wrong?  Thanks in Advance.  package com.project.go;  import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener;  /**  * Created by Joe on 12/16/2016.  */ public class App { private JButton button; private JPanel panelMain; private JTextPane MenuWelcome; private JComboBox pullDownBox; private JButton Exit; private JTextArea DateField;  public static void main(String[] args) {     JButton button = new JButton("run");     JFrame frame = new JFrame("App");     frame.setContentPane(new App().panelMain);     frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);     frame.pack();     frame.setVisible(true);     new App();  }  public App() {     button.addActionListener(new ActionListener() {         @Override         public void actionPerformed(ActionEvent e) {             JOptionPane.showMessageDialog(null, "hi");         }     }); }  private void createUIComponents() {     // TODO: place custom component creation code here } }

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


I keep getting this error on my computer and I can't find any way to get rid of it.  I've looked all over the internet. Can anyone help?  Operating System: Windows 7 When it occurs: Randomly, 3 of them just pop-up.

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


I just recently read this article by Nicholas Wade on Time Magazine's website about .  It all sounded very racist, but of course my Western liberal attitudes about racism shouldn't cloud my stronger Western liberal convictions about Science giving every empirical claim a fair hearing.    So, that said, where can I learn more about the evidence supporting and contradicting this view?  I found on his Wikipedia page that a number of scientists have condemned his work, but I'd like to actually know the evidence and arguments underneath all this.   I suppose I should also ask more generally about the state of biological evidence for the reality of race.  I had heard in college that there is no biological basis for race, but I'm wondering if that is an out-dated view in light of recent work in genomics.  I read  but it had more to do with whether there is a consensus rather than on the arguments surrounding the issue.

After my online research on the subject, I learnt that, biologically speaking, many scientists believe that there is no such thing as a race. Homo sapiens as a species is only 200,000 years old, which has not allowed for any significant genetic diversification yet, and our DNA is 99.99% similar. I've read statements that there can be more genetic variation inside a racial group than between different racial groups, meaning that, for example, two individuals from the same "race" can have less in common with each other than with an individual from another "race".  :     Scientists consider biological essentialism obsolete, and generally discourage racial explanations for collective differentiation in both physical and behavioral traits     Q1: If Homo sapiens has no races (according to biologists), why are we so different morphologically? (hair/eyes/skin colour and even athletic performance seem to differ between human populations)  Q2: Is it common for other species too, when genetically close populations have very different morphological traits? Are there any other mammal or animal species that exhibit biological diversity comparable to human diversity, and how do taxonomists treat these species? (excluding intentionally bred domestic species to keep the comparison fair)    The question has been paraphrased to emphasize that it is the biological debate that is in question, not the sociopolitical. I.e., why is there no consensus in evidence and opinions of scientists?


I want to use a new modem-router to replace one fried by a power surge.  Snake-bit by that, I checked out the voltage for the new unit's adapter.  It's supposed to be 12V, 600ma.  Using a volt-ohmeter, I get 17V, no-load.  Input is 120-121V AC.  If I plug this in to the modem-router, will the load take care of this higher-than-needed voltage?

When I measure a 9V DC wall adapter power supply with a multimeter it shows 11.8V. When connected to my board this voltage lowers to 10V. Is this normal? Should I be afraid of toasting my  supplied board when using this adapter?  Edit: This regulator accepts up to 12V inputs. So that will be no problem. A second "9V" adapter yields 15V to the multimeter. Will this one burn my circuit?


I have this weird problem in the last couple of days where it takes ~5 minutes to completely open some posts on WordPress wp-admin dashboard. Please hear me out carefully. 1   This is happening only with 1 person in the team. Not an issue for others in the team (same role, same posts) 2   I have tried different browsers, different machines. I even shared my credentials with my editor and he faced the exact same issue. 3   We have disabled Gutenberg and using classic editor. No issues while using Gutenberg (but that's not really an option). The page freezes for approx 5 minutes on opening and eventually loads completely. 4   It's mostly happening for "some" of my own posts already published (it's a multi-authored blog), but I can't be 100% sure since it's all so random. Here's what all we have tried till now; 1   Tried using Query monitor. Nothing untoward found. 2   Tried activating redis cache. Didn't help. 3   Tried changing my role from Editor to Admin. Didn't help. 4   Deactivated 5-6 recently installed plugins. No luck. Note: I’ve already asked this question previously, but unfortunately did not receive a solution.

I have this weird problem in the last couple of days where it takes ~5 minutes to completely open some posts on WordPress wp-admin dashboard. Please hear me out carefully.  This is happening only with 1 person in the team. Not an issue for others in the team (same role, same posts)  I have tried different browsers, different machines. I even shared my credentials with my editor and he faced the exact same issue.  We have disabled Gutenberg and using classic editor. No issues while using Gutenberg (but that's not really an option). The page freezes for approx 5 minutes on opening and eventually loads completely.  It's mostly happening for "some" of my own posts already published (it's a multi-authored blog), but I can't be 100% sure since it's all so random.   Here's what all we have tried till now;  Tried using Query monitor. Nothing untoward found. Tried activating redis cache. Didn't help. Tried changing my role from Editor to Admin. Didn't help. Deactivated 5-6 recently installed plugins. No luck.  In response to queries, here’s what I see- Attached below are two screenshots: first image is what appears in the Network tab on Chrome. Second is what the editor sees on the console. ￼ ￼


I have a problem with objects being reset when rendering a scene.  I have created a shape which I hope to 3d print by mirroring an object on the x and y axis. I have created a duplicate and rotated them to display over a plane for a render as can be seen in the first screenshot.    However, the moment I render the scene, the render shows both objects without any rotation, and when I go back to the 3d view, both objects have been reset to their initial rotational axis of 0,0,0.      Can anyone help explain what's happening please! Thanks.

So I am attempting to make a modular environment in Blender, so I'm modeling many pieces in one scene to make sure they all match up properly before separating them out.  However, whenever I restart Blender after saving and closing it, many of my grouped objects (and their subobjects) have positions reset NOT to where I placed them.  For example, take a look at this:   Here you can see that the door pieces are in the "open" state, when I left them closed AND the "column" for the wall on the left has been moved from being flush with the wall (on the side) to being inside it.  It appears to be trying to move all of the objects to 0,0,0 which is what is messing this up. I'm not sure if it's an object hierarchy problem, but here is my hierarchy if anyone has ideas there:  Wall_Normal (parent)   Wall_Normal_Column (child)   Empty Axis Object (parent)   Door_Left (child a) Door_Right (child b)   Is there a reason why object positions (and their relative subobjects) aren't being saved?


When I use GetMap on a raster layer of a WMS GeoServer, the color scale adjusts automatically, so the scale is relative to the retrieved content of the requested area. How do I extract numerically the absolute altitude/elevation ? Alternatively, is there a way to tell the WMS server (GeoServer) to provide the absolute values ?

I have tried reading up on WMS on wiki and other sources but haven't managed to get my head around a couple of points.   1) Using WMS is it possible to get a local copy of the raster data (say a tiff image tile). The reason, I ask is, I need to use his raster data in a secondary process that needs a local copy of the file.   2) I am primarily interested in allowing users the option of downloading orthoimagery and elevation from the USGS repository. I've tried using the Seamless viewer but I am thinking more along the lines of user specifying a coordinate (or four corner coords) and getting the orthoimage and elevation data corresponding to that. I thought WMS (Geoserver being my first option) is the way to go for this, but not certain. So wanted to get your advice.  Thanks in advance.  Sincerely, ST.


I am running a PCA against two datasets of biological data (gene expression data).  The first has 20K genes (dimensions) x 450 samples, while the second has 11K genes (dimensions) x 185 samples.  Running PCA on these two datasets I get a very low amount of explained variance by the first principal components. Specifically, in the case of the first dataset I get                               PC1       PC2       PC3       PC4       PC5 Standard deviation     1.175e+05 1.132e+05 9.022e+04 8.412e+04 7.002e+04 Proportion of Variance 1.396e-01 1.296e-01 8.236e-02 7.161e-02 4.961e-02 Cumulative Proportion  1.396e-01 2.692e-01 3.516e-01 4.232e-01 4.728e-01                              PC6       PC7       PC8       PC9      PC10 Standard deviation     6.857e+04 6.816e+04 6.147e+04 5.796e+04 4.940e+04 Proportion of Variance 4.758e-02 4.701e-02 3.823e-02 3.399e-02 2.470e-02 Cumulative Proportion  5.204e-01 5.674e-01 6.056e-01 6.396e-01 6.643e-01                             PC11      PC12      PC13      PC14      PC15 Standard deviation     4.434e+04 4.196e+04 3.953e+04 3.667e+04 3.374e+04 Proportion of Variance 1.989e-02 1.782e-02 1.581e-02 1.361e-02 1.152e-02 Cumulative Proportion  6.842e-01 7.020e-01 7.178e-01 7.315e-01 7.430e-01                             PC16      PC17      PC18      PC19      PC20 Standard deviation     3.324e+04 3.237e+04 3.155e+04 3.080e+04 2.955e+04 Proportion of Variance 1.118e-02 1.060e-02 1.007e-02 9.600e-03 8.830e-03 Cumulative Proportion  7.541e-01 7.648e-01 7.748e-01 7.844e-01 7.933e-01   In this case, the first principal component amounts for the $13.96$% of total variance.  For the second dataset, which is smaller in size, the first principal component amount for the $41.71$% of total variance, the second for the $10.56$%.  In particular:   in the first dataset, cumulative explained variance for the first $10$ principal component is $66.43$% in the second dataset, cumulative explained variance for the first $10$ principal component is $78.43$%   I have two questions:   Could it be that the amount of explained variance is this low because of the high number of dimensions? Could the result of this PCAs be used for subsequent analysis, even if the amount of variance is very low?

I have a dataset with 11 variables and PCA (orthogonal) was done to reduce the data. Deciding on the number of components to keep it was evident for me from my knowledge about the subject and the scree plot (see below) that two principal components (PCs) were enough to explain the data and the remaining components were only less informative.   Scree plot with parallel analysis:  observed eigenvalues (green) and simulated eigenvalues based on 100 simulations (red). Scree plot suggests 3 PCs, whereas parallel test suggests only the first two PCs.      As you can see only 48% of the variance could be captured by the first two PCs.    Plotting observations on the first plane made by the first 2 PCs revealed three different clusters using hierarchical agglomerative clustering (HAC) and K-means clustering. These  3 clusters turned out to be very relevant to the problem in question and were consistent with other findings as well. So except the fact that only 48% of variance was captured everything else was tremendously fine.      One of my two reviewers said: one cannot rely much on these findings as only 48% of variance could be explained and it is less than required.      Question Is there any required value of how much variance should be captured by PCA to be valid? Is it not dependent on the domain knowledge and methodology in use? Can anybody judge on the merit of the whole analysis just based on the mere value of the explained variance?    Notes     Data are 11 variables of genes measured by a very sensitive methodology in molecular biology called Real-Time Quantitative Polymerase Chain Reaction (RT-qPCR).   Analyses were done using R.   Answers from data analysts based on their personal experience working on real-life problems in the fields of microarray analysis, chemometrics, spectometric analyses or alike are much appreciated.   Please consider supporting you answer with references as much as possible.


Why does gravitational force of the Earth decrease as we move towards the centre of the Earth? Where as inverse square rule says that distance is less than gravitational force is more.

Would the effect of gravity on me change if I were to dig a very deep hole and stand in it? If so, how would it change? Am I more likely to be pulled downwards, or pulled towards the edges of the hole? If there would be no change, why not?


I am typesetting a document using the package tipa, and it happens often that the contents of each cell in a column of a table are notionally IPA and need to be enclosed between \textipa{ and }. So I want to define a column type which will add those enclosing strings.  I know the technique of using \newcolumntype from package array for enclosing such cell contents between two strings, e.g. \newcolumntype{M}{>{$}p<{$}} to supply math mode $'s. But what if a string to be added contains a backslash or a brace?  MNWE. Here, the \textipa disappears and I get literal braces. \backslash and \arraybackslash are to no avail.      \documentclass[12pt,a4paper]{article}     \usepackage{array} % for \newcolumntype     \usepackage{tipa}     \newcolumntype{I}{>{\textipa\{}c<{\}}}      \begin{document}     \begin{tabular}{I}     lOrEm IpsUm     \end{tabular}     \end{document}

I want to apply a macro to all the cells of a column with the cell content as the input to the macro. Is this possible?  For example if the cell contents have the word TEST, the macro should take TEST as its argument.


So the two options I am considering is a drop down for months, showing the number followed by an abbreviated month, e.g. 02 Feb. Or a text field, that splits the numbers into the format MM / YY. With a placeholder MM / YY.  Which is the most likely to convert for an expiry date, open to other options.

What is the best format for gathering the card expiry data during the checkout process on an eCommerce website?  So we need to collect the month of expiry and the date of expiry (as standard on all web card transactions).  I have seen this done differently on websites so it would be good to know the best practice.


I would like to know how l can overload a function named void maximum to find the maximum of two integer or two double numbers. When passing one integer and one double number function it should print that double vs int or int vs double. And in this case comparisons are not allowed and user should not be asked for input.?

Is it possible to find the greatest of two integers without any comparison? I found some  solutions:   if(!(a/b)) // if a is less than b then division result will be zero. {     cout << " b is greater than a"; } else if (!(a-b)) // we know a is greater than or equal to b now.  check whether they are equal. {     cout << "a and b are equal"; } else     cout << "a is greater than b";   But if(c) or if(!c) is a comparison to zero. In addition it doesn't work for negative numbers. In fact I need a solution that avoids any if statement. Instead I should use switch statements and arithmetic operators. ThanX.


I'm very new at python and maybe this is a possible duplicate, but I didn't found anything near these topic.  I want to shuffle an int list in each possible variant in python.  Example:  a = [2, 5, 8, 9]   Expected result:  variants =  [   [2, 5, 8, 9],   [2, 5, 9, 8],   [2, 9, 5, 8],   [2, 9, 8, 5],   [2, 8, 9, 5],   [2, 8, 5, 9],   [5, 2, 8, 9],   ... ]   Anyone an idea, to do this very fast and efficent?   Thanks for helping me guys.

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


How can I solve the ODE:  $f'(x) = f(x) - f(x-1)$ where $f(0)= 0$, and $x \geq 0$  Note: I am trying to solve a problem where it came up and I haven't done DE for years and thus not sure where to start.

The question is:     When $f(x+1)-f(x)=f'(x)$, what are the solutions for $f(x)$?   The most obvious solution is a linear function of the form $f(x)=ax+b$. Is this the only solution?  Edit  I should add that $f:\mathbb R\to\mathbb R$ to the question.


Prove/Disprove $f(x) = x + \frac{x}{{x + 1}}$ is uniformly continuous at $\forall x,y \in [0,\infty )$    This is my trial:  $$\forall \varepsilon  > 0\exists \delta  > 0.\forall x,y \in [0,\infty ):$$ Let $$\left| {x - y} \right| < \delta $$  $$\left| {x + \frac{x}{{x + 1}} - y - \frac{y}{{y + 1}}} \right|... \le \delta  + \frac{\delta }{{(x + 1)(y + 1)}}$$  As you can see after some algebra I got an expreesion with denominator involving $x,y$. I need to "get rid" of $x,y$ at the denominator.    One way doing it is just multiplying by $(x+1)(y+1)$, because then I left with just $2\delta$ which is great. what do you think? Am I doing it right?

Is $f(x)=x+\frac{x}{x+1}$ uniformly continuous on $(0,\infty)$   Going from the epsilon delta definition we get:   $$\forall x,y>1,\text{WLOG}:x>y \ ,\ \forall\epsilon>0,\exists\delta>0 \ s.t. \ |x-y|<\delta\rightarrow |x+\frac{x}{x+1}-y-\frac{y}{y+1}|<\epsilon$$  But I'm not really sure on how to continue from here.  Alternatively: if $\lim\limits_{x\to \infty}f(x)$ exists on $[0,\infty)$ then the function is uniformly continuous, well, it's easy to see here that $\lim\limits_{x\to \infty}f(x)=\infty$ but is that enough ?


I had recently installed a major windows update (Version 1709, build 16299.125), and since then I have noticed a strange problem: whenever I shutdown the computer having open programs, I still see them at the same state when I power it back on. It seems like my computer actually hibernates instead of fully shutting down.  After searching and reading many articles, I realized there's a built-in function called "Fast Startup", which is supposed to exit all programs and hibernate instead of shutting the computer down.  Thinking the "Fast Startup" function might didn't work well (by skipping the stage of exiting all programs), I tried to totally disable the function using the following method:    1. Right click the Windows start menu button and choose Power Options.     Click on Choose What the Power Button Does.  2. If there is a Windows     UAC shield at the top with Change Settings That Are Currently     Unavailable, click it and choose Yes or enter your password to     reopen the dialog with administrative privileges.  3. At the bottom     below Shutdown Settings, it will say Turn on Fast Startup     (recommended). Deselect the option and press Save Changes.   Yet, my computer still remembers its previous state after I power it on from a (so-called) complete shutdown. Has anyone encountered a similar bug? Do you know how can I fix it?

Environment: Windows 10 Fall Creators Update / 1709  Background: There is a new feature in the Fall Creators update where post reboot applications and browser windows are reopened to the state they were in before the reboot.  Issue: The only time i really reboot is when I no longer want the applications to be open. Its driving me crazy that i cant fully shutdown/reboot the machine.   Solutions attempted I always reboot by using Win+R and running "Shutdown -r -t 0". the "-r" option should do a full reboot but that isnt working for me.   Any other suggestions or hacks to control via commandline on how to do a full reboot vs. this Zombie reboote (Which is a feature i like when i did not want to reboot and had to)


This has become my nightmare with Ubuntu... since I'm using it (version 14.x). Everything works slick a couple of weeks after a fresh installation but I have no idea what happens in between so that suddenly I have to wait a couple of minutes for rebooting my relatively performant Laptop (a high-end ThinkPad). On the net I couldn't find a consistent solution… there are various consumptions and suggestions on changing fstab etc. but these are not the issue… Does anybody know how I could solve this?

I'be been running 18.04 since a clean SSD install on the day of it's official release, without issues. Power on to login was seconds (max 10)  Then, I did a regular upgrade this morning:  $ sudo apt update && sudo apt dist-upgrade   The packages installed/upgraded were:  Install: linux-headers-4.15.0-24:amd64 (4.15.0-24.26, automatic), linux-headers-4.15.0-24-generic:amd64 (4.15.0-24.26, automatic), linux-modules-extra-4.15.0-24-generic:amd64 (4.15.0-24.26, automatic), linux-modules-4.15.0-24-generic:amd64 (4.15.0-24.26, automatic), linux-image-4.15.0-24-generic:amd64 (4.15.0-24.26, automatic) Upgrade: gnome-control-center-data:amd64 (1:3.28.1-0ubuntu1.18.04.1, 1:3.28.1-0ubuntu1.18.04.2), linux-headers-generic:amd64 (4.15.0.23.25, 4.15.0.24.26), gnome-control-center:amd64 (1:3.28.1-0ubuntu1.18.04.1, 1:3.28.1-0ubuntu1.18.04.2), linux-image-generic:amd64 (4.15.0.23.25, 4.15.0.24.26), linux-signed-generic:amd64 (4.15.0.23.25, 4.15.0.24.26), gnome-control-center-faces:amd64 (1:3.28.1-0ubuntu1.18.04.1, 1:3.28.1-0ubuntu1.18.04.2), linux-generic:amd64 (4.15.0.23.25, 4.15.0.24.26)   I rebooted once the upgrade had completed, and noted a 2-3 minute delay on the Ubuntu loading/splash screen (prior to login) (without any progress/activity indicated on the dots).  I powered off and tried to boot again, but am getting this delay consistently now. Also close down is much slower too.  Update #1 (2018-07-03): Analysis on systemd:  $ sudo systemd-analyze blame 3min 53.073s plymouth-quit-wait.service     2min 20.699s snapd.seeded.service          49.949s snapd.service           6.186s NetworkManager-wait-online.service           1.148s dev-sda2.device           1.098s plymouth-start.service   Showing that plymouth-quit-wait.service (which I now believe is related to the Ubuntu loading/splash screen) and snapd.seeded.service were by far the longest running services to initiate. So I compared the times before the dist-upgrade and after:  $ journalctl -u plymouth-quit-wait.service --since today -- Logs begin at Fri 2018-04-27 13:01:30 BST, end at Tue 2018-07-03 12:38:05 BST. -- Jul 03 04:15:43 user-laptop systemd[1]: Starting Hold until boot process finishes up... Jul 03 04:15:46 user-laptop systemd[1]: Started Hold until boot process finishes up. -- Reboot -- Jul 03 04:21:17 user-laptop systemd[1]: Starting Hold until boot process finishes up... Jul 03 04:24:52 user-laptop systemd[1]: Started Hold until boot process finishes up.   Before the upgrade plymouth-quit-wait.service took 3 seconds. After the upgrade it took 3 minutes 35 seconds  $ journalctl -u snapd.seeded.service --since today -- Logs begin at Fri 2018-04-27 13:01:30 BST, end at Tue 2018-07-03 12:42:14 BST. -- Jul 03 04:15:43 user-laptop systemd[1]: Starting Wait until snapd is fully seeded... Jul 03 04:15:43 user-laptop systemd[1]: Started Wait until snapd is fully seeded. -- Reboot -- Jul 03 04:22:47 user-laptop systemd[1]: Starting Wait until snapd is fully seeded... Jul 03 04:24:49 user-laptop systemd[1]: Started Wait until snapd is fully seeded.   Before the upgrade snapd.seeded.service took 0 seconds. After the upgrade it took 2 minutes 2 seconds.  Update #2 (2018-07-06): This morning's boot saw the return of the delay. So I guess we're still waiting for the kernel/plymouth/snapd update.  Update #3 (2018-07-12): The problem seems to be resolved, but I didn't see any update to snap or plymouth, and I'm still running 4.15.0-24 kernel. So I'm not sure which package update fixed the problem, or if it just resolved itself somehow. Reading the bug updates on launchpad it's unclear to me what was done (or is being done) to what package/s. If anyone can clarify that would be very useful.


I just set up Ubuntu 20.04.1 with VirtualBox 6.1 and the standard screen resolution sizes don't allow for me to use my full monitor display. I know how to use xrandr to add new resolution ratios to my options, but I don't know which resolution ratio I SHOULD be using. At this point, I've added 10 or so different resolutions (eg. 1440x720, 1920x1080, ...) but I can't find the one that perfectly fits. Is there a way to find the exact resolution ratio or exact values for my display? I'm getting a bit tired of trial and error at this point. In case it's important, this is how I'm adding custom resolutions in terminal: cvt 1440 720 sudo xrandr --newmode "1440x720_60.00" 83.75 ... sudo xrandr --addmode Virtual1 "1440x720_60.00"

I am running Ubuntu 12.04 in VirtualBox 4.2.6 on a Windows 7 host. After installing Ubuntu I wanted to get the VB interface in fullscreen. I therefore installed guest additions from Virtual Box Manager (devices > install guest additions -> run --> reboot).  But after booting I can only see a part of the desktop without menus. In addition I am asked again to install the guest additions after every reboot (the guest additions CD reappears even though I had removed it).  Editing the resolution in system settings via right click > appearance -> all settings (since I can only partially see the desktop) the actual resolution changes but the whole desktop still does not fit.  Do I have to uninstall/reinstall the guest additions? What other options do I have?


Can anyone tell me a way to calculate area of a triangle given the equations of its 3 sides without sketching or finding the points of intersection?

I read this formula in some book but it didn't provide a proof so I thought someone on this website could figure it out. What it says is: If we consider 3 non-concurrent, non parallel lines represented by the equations : $$a_1x+b_1y+c_1=0$$ $$a_2x+b_2y+c_2=0$$ $$a_3x+b_3y+c_3=0$$ Then the area of the triangle that these lines will enclose is given by the magnitude of : $$\frac{det\begin{bmatrix}a_1 & b_1 & c_1\\a_2 & b_2 & c_2\\a_3 & b_3 & c_3\end{bmatrix}^2}{2C_1C_2C_3}$$ Where $C_1,C_2,C_3$ are the co-factors of $c_1,c_2,c_3$ respectively in the above matrix.  What I'm wondering is, where did this come from? And why isn't it famous? Earlier we had to calculate areas by finding the vertices and all but this does it in a minute or so and thus deserves more familiarity.


Please resolve an "argument"  Which of the following is correct:  Post an HTML snippet  Post a HTML snippet  I believe it's the first - that the sound/vocalization, not the spelling, is what requires "an" instead of "a"; in other words "HTML" has an "A" sound and is, thus, verbally, a vowel. Am I wrong? The second possibility grates on my ears, and is as dissonant as all get out.

I've seen many people who say:     This is a HTML page.   Yet I've also seen many people who say:     This is an HTML page.   Are both usages equally correct?  Or, which is the grammatically correct one?       Possible Duplicates:


I have a following table:  +----+-----------+------+ | id | parent_id | name | +----+-----------+------+ |  1 | 4         | d    | |  2 | null      | a    | |  3 | 2         | b    | |  4 | null      | c    | +----+-----------+------+   parent_id points to a record in the same table. If parent_id is null it a root element.  Data can be in random order. Is it possible to order my select so the output will be in the order they would be in an expanded tree: A, B, C, D?  Or is it better to select it in random order and order it programmatically by iterating the result, finding the first root element and then iterating the whole result again to find all the children for that element and etc?

Assume you have a flat table that stores an ordered tree hierarchy:  Id   Name         ParentId   Order  1   'Node 1'            0      10  2   'Node 1.1'          1      10  3   'Node 2'            0      20  4   'Node 1.1.1'        2      10  5   'Node 2.1'          3      10  6   'Node 1.2'          1      20   Here's a diagram, where we have [id] Name.  Root node 0 is fictional.                          [0] ROOT                           /    \                [1] Node 1          [3] Node 2               /       \                   \     [2] Node 1.1     [6] Node 1.2      [5] Node 2.1           /            [4] Node 1.1.1   What minimalistic approach would you use to output that to HTML (or text, for that matter) as a correctly ordered, correctly indented tree?   Assume further you only have basic data structures (arrays and hashmaps), no fancy objects with parent/children references, no ORM, no framework, just your two hands. The table is represented as a result set, which can be accessed randomly.   Pseudo code or plain English is okay, this is purely a conceptional question.  Bonus question: Is there a fundamentally better way to store a tree structure like this in a RDBMS?    EDITS AND ADDITIONS  To answer one commenter's ('s) question: A root node is not necessary, because it is never going to be displayed anyway. ParentId = 0 is the convention to express "these are top level". The Order column defines how nodes with the same parent are going to be sorted.  The "result set" I spoke of can be pictured as an array of hashmaps (to stay in that terminology). For my example was meant to be already there. Some answers go the extra mile and construct it first, but thats okay.  The tree can be arbitrarily deep. Each node can have N children. I did not exactly have a "millions of entries" tree in mind, though.  Don't mistake my choice of node naming ('Node 1.1.1') for something to rely on. The nodes could equally well be called 'Frank' or 'Bob', no naming structure is implied, this was merely to make it readable.  I have posted my own solution so you guys can pull it to pieces.


Which of the following prepositions is correct when talking about seeing something on internet?      You can see it ON / IN / AT the internet.

I have come across both the phrases - 'on the internet' and 'over the internet.'   I'm pretty sure that both are correct but then which to use when?  Please note, I'm well aware of all over the Internet which I'm not concerned about.


I always read "take an orthonormal basis of say $\ell^2(\mathbb N)$, then extend it to a Hamel basis". Can you please explain how this "extension is possible"?   Thanks.  Math

Is it always possible to extend a linearly independent set to a basis in infinite dimensional vector space?  I was proving with the following argument: If S is a linearly independent set, if it spans the vector space then done else keep on adding the elements such that the resultant set is also linearly independent, till it spans the vector space . But the problem is how can we guarantee that the process will stop?


I have the following code SQL injection susceptible:  $r = $db->query(sanitizeSQL("SELECT a.* FROM asistentes a WHERE a.id = $id")); f ($row = $r->fetchArray()) {      $scope['asistente'] = $row;      if (is_numeric($id) && $id != $_SESSION['auth']) {          $error = 'You don't have permission to see this user';      }  }else {      $error = 'Wrong assistant';  }   As far as I have understood, the code is weak to a SQL Injection attack because although you sanitize the db->query statement with the filter sanitizeSQL (I think it's a private method they have coded instead of a native PHP filter), when you decide if the client is going to have access to the user information, you are using the $id value introduced by the client without sanitizing or filtering it anyway, so a possible attacker can introduce any SQL command there.  The url you get when you login successfully is:  10.14.79.2/?action=details&id=1   I have tried some methods to get access to the user you want, and a way which is working is this one:  10.14.79.2/?action=details&id=3;   By simply adding the user id you want to access to and a semicolon, you get the access while if you only enter the user id (without the semicolon) you get a "You don't have permission to see this user" message.  I would like to know why that code acts like that. I mean:   Does the is_numeric method just ignore the semicolon and returns true because $id starts by a number? After is_numeric($id) && how doesn't the $id call break the code if it is returning a semicolon just before a != statement? I don't get the function of the semicolon on that part of the code How does the semicolon skip the != comparison so that we get the user details we are asking to the db? Is there any better way to perform the SQL Injection on this stage?

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


I have experienced this issue today. I closed my MacBook as usual when I had something to do. Then I came back, tried to use it again. However the screen went dark when it was opened vertically beyond 90 degree.  I went on the Internet to search for this problem and tried to resetting SMC, but it did not work. How can I do to fix this problem?

This is not a problem at booting up. For a couple months now I'll be using my laptop when suddenly the screen dims to about 50% of normal. According to the brightness indicator the brightness is all the way up; I can make it dimmer, but not as bright as normal. The dimming isn't super even either, there are small areas of the screen that seem darker/brighter. In the past the problem easily goes away if I close the lid and reopen it... but now it's happening a lot and sometimes going completely black. Is this an easy/cheap fix? I'm traveling and can't do it myself. Is it worth bringing to the Mac store?  Thanks!


I need a lot of independent planes (like 200x300), but creating them programmatically with a loop took a lot of time (with bpy.ops.mesh.primitive_plane() or with vertices and faces). But creating one grid with subdivisions is very cheap. My problem is, that the vertices of the subdivision planes are connected and i need them independent (having each inner vertice four times).  So i would ask you, if there is an option to divide an grid in many independent planes?

I am looking for a way to take all the faces of an object and make each face it's own object.   In the image above, you'll see a basic representation of what I'm trying to accomplish. On the left is a shape with faces, all attached. On the right is the result I want, an object for each face. The project I'm working on is much more complicated than this example, so I can't select each face and separate by selection. I have over 3,000 faces to work on.


$$\int_0^{2\pi}\ln(1+a^2-2a\cos(x))dx,\;\;\;\;\text{with }a>0$$   How to evaluate Integral of $\ln(1+a^2-2a\cos x) dx$? where $x$ from $0$ to $2\pi$ and $a>0$, $\ln$ is the natural logarithm.

For $a\ge 0$ let's define $$I(a)=\int_{0}^{\pi}\ln\left(1-2a\cos x+a^2\right)dx.$$ Find explicit formula for $I(a)$.   My attempt: Let  $$\begin{align*} f_n(x) &= \frac{\ln\left(1-2 \left(a+\frac{1}{n}\right)\cos x+\left(a+\frac{1}{n}\right)^2\right)-\ln\left(1-2a\cos x+a^2\right)}{\frac{1}{n}}\\ &=\frac{\ln\left(\displaystyle\frac{1-2 \left(a+\frac{1}{n}\right)\cos x+\left(a+\frac{1}{n}\right)^2}{1-2a\cos x+a^2}\right)}{\frac{1}{n}}\\ &=\frac{\ln\left(1+\dfrac{1}{n}\left(\displaystyle\frac{2a-2\cos x+\frac{1}{n}}{1-2a\cos x+a^2}\right)\right)}{\frac{1}{n}}. \end{align*}$$ Now it is easy to see that $f_n(x) \to \frac{2a-2\cos x}{1-2a\cos x+a^2}$ as $n \to \infty$. $|f_n(x)|\le \frac{2a+2}{(1-a)^2}$ RHS is integrable so $\lim_{n\to\infty}\int_0^\pi f_n(x)dx = \int_0^\pi \frac{2a-2\cos x}{1-2a\cos x+a^2} dx=I'(a)$. But  $$\int_0^\pi \frac{2a-2\cos x}{1-2a\cos x+a^2}=\int_0^\pi\left(1-\frac{(1-a)^2}{1-2a\cos x+a^2}\right)dx.$$ Consider $$\int_0^\pi\frac{dx}{1-2a\cos x+a^2}=\int_0^\infty\frac{\frac{dy}{1+t^2}}{1-2a\frac{1-t^2}{1+t^2}+a^2}=\int_0^\infty\frac{dt}{1+t^2-2a(1-t^2)+a^2(1+t^2)}=\int_0^\infty\frac{dt}{(1-a)^2+\left((1+a)t\right)^2}\stackrel{(*)}{=}\frac{1}{(1-a)^2}\int_0^\infty\frac{dt}{1+\left(\frac{1+a}{1-a}t\right)^2}=\frac{1}{(1-a)(1+a)}\int_0^\infty\frac{du}{1+u^2}=\frac{1}{(1-a)(1+a)}\frac{\pi}{2}.$$ So $$I'(a)=\frac{\pi}{2}\left(2-\frac{1-a}{1+a}\right)\Rightarrow I(a)=\frac{\pi}{2}\left(3a-2\ln\left(a+1\right)\right).$$  It looks too easy, is there any crucial lack?  $(*)$ — we have to check $a=1$ here by hand and actually consider $[0,1), (1,\infty)$ but result on these two intervals may differ only by constant - it may be important but in my opinion not crucial for this proof.


I cant use scanf() because to receive integer input you need to press ENTER (when you are running the program).

I can never remember how I do this because it comes up so infrequently for me. But in C or C++, what is the best way to read a character from standard input without waiting for a newline (press enter).  Also ideally it wouldn't echo the input character to the screen. I just want to capture keystrokes with out effecting the console screen.


Let $f(x)$ be a non-negative continuous function such that $f'(x)-f(x)\leq 0, \forall x\geq 0$ and $f(0)=0,$find the value of $f(1)$.   $f'(x)-f(x)\leq 0$$\Rightarrow f'(x)\leq f(x)$$\Rightarrow \frac{f'(x)}{f(x)}\leq 1$$\Rightarrow \int\frac{f'(x)}{f(x)}dx\leq \int1 dx$$\Rightarrow \log f(x) \leq x$.Then could not solve further.Can someone assist me find $f(1)$?

I did not know what to search to see if this existed elsewhere. But, I could not find it. Here's the question:  Does there exist a continuously differentiable function, $f: [0,1] \rightarrow [0, \infty)$, such that the following hold? (i) $f(0) = 0$ (ii) $f'(x) \le c f(x)$ for all $x$ ($c$ is a fixed constant) (iii) $f \not\equiv 0$  This was a fun problem someone asked me a long time ago. I have always been convinced there is no such function, but I cannot prove it. I have mainly tried using the mean value theorem (in multiple forms), and re-wording the problem in terms of the integral of a continuous function to no avail. I spent some time trying to use (ii), the definition of derivative, and squeeze theorem, but no luck. After much time trying to prove non-existence, I spent a little time trying to find such a function... also with no luck. This problems ability to avoid being solved has since taken away the original fun and replaced it with a twinge of annoyance.


There is a phrase "Not only should I succeed but others should fail". And I saw it many times in similar structures that the order of words "should I" are as if they were in a questioning sentence. (In a declarative sentence the order is "I should")  Can anyone give me an explanation why that is?

I have seen this construction quite often:      Online ads have been around since the dawn of the Web, but only in   recent years have they become the rapturous life dream of Silicon   Valley.   What is the rule there?. When your sentence doesn't start with pronoun + verb, invert them as verb + pronoun?. I know it sounds awkward but is it possible (grammatically correct) to use something similar to:      Online ads have been around since the dawn of the Web, but only in   recent years they have become...   And in any case, does this only work with have (or has)? Maybe it works fine with 'had' but I can't think of an example right now.


Let $f$ be a function from $A$ to $B$ such that the image $f(A)\subset A$. Is there a widely accepted notation for the expression $$f\circ\left(f\circ\cdots(f\circ f)\right),$$ where $f$ composite with itself $n$ times? I failed to find a natural way to include the information $n$ in the notation.

Does there exist some notation that represents the iterative composition of a single-input, single-output function with itself? As in, say, $f_5(x)=f(f(f(f(f(x)))))$.  In other words, going by the above (incorrect, I'm pretty sure) notation:  $f(x)=x+1$, $f_n(m)=m+n$  I'm looking for the correct way to express the notion of "$f_n(x)$" for any $f$.


I've been trying to figure out how I can completely backup my PostgreSQL database. I have not seen any resource that explains how to do a complete backup.  I am aware of the pg_dump and pg_dumpall utilities.  The syntax is simple, but the details are not very clear.   It appears that pg_dump only backs "some" tables for a particular db and none of any type of configuration info. I am guessing that things like permissions and many other things are not backed up. So in the event of a total re-install of a PostgreSQL db, the dump backup would not work without significant manual configuration and setup.  pg_dumpall backs-up some more things than pg_dump but again no clear info is provided in the Postgres docs about what else is left out from the backup dump and needs to be backed-up in addition to.  I need to back up all PostgreSQL configuration info, tables, indexes, permissions, schemes, etc.  In the event of a complete catastrophe, provided that I reinstall the same version of PostgreSQL I should not have to reconfigure anything.  I don't care for example if the indexes are re-built from scratch of if the backup already stores the indexes... stuff like this doesn't matter to me... I just want the db to be in the exact same state after the restore as it was at time of backup.  I'd appreciate if someone could list the things needed to be backed-up in order to achieve a complete backup.  Of course, I'd appreciate if you would recommend some tools along with some procedure for the various things on the list.  Please explain which items on the grand list the tool & procedure you recommend covers.

I was hoping I could get a clear answer on how to ensure taking a full Postgres backup just like you would get with MS SQL Server, and then take care of orphaned users.  From what I've read, and it could be wrong, finding a good PostgreSQL blog has been challenging so please feel free to recommend some to me, I need to figure out how this app works so I can have trust in my backups and Slony replication.  I had a developer restore a backup I took from PgadminIII via custom, directory, and tar format while selecting OIDs but he said two of them didn't load, tar did but it was only the directory, not the data.  I'm really confused now.   I am using PGAdminIII, it has a pg_dump and pg_dumpall option.  I want to back everything up that I need to test restore this database somewhere and verify that yes, all the data we need and our backup is good.  Eventually I want to write an auto-restore script but one day at a time.   pg_dumpall apparently has a -globals option that's supposed to backup everything, but the help for pg_dumpall shows a -g, --globals-only          dump only global objects, no databases, not a --globals option.    I thought pg_dumpall would at least backup foreign keys, but even that seems to be an 'option'.  According to the , even with pg_dumpall I need to use a -o option to backup foreign keys, I can't really imagine when I wouldn't want to backup foreign keys and this would make more sense as a default options.   How would I take care of orphaned users and validate I have everything?  I'd like to actually restore my backup file on another server and verify everything works.  If anyone has any suggestions on how to take a real backup in PostgreSQL and restore, I'd be very grateful.   I had a PostgreSQL server but I still can't fathom why the app would not backup OIDs by default!  It seems like 99.9% of the time you would want that.    UPDATE 1:  The Postgres  mentions that the globals option I was looking for seems to be a default option on this version, but it still needs the -o option.  If someone can verify or give me an example command to restore a single database elsewhere with everything it needs I'd appreciate it.   Edit: being asked by site to show the uniqueness of this question by editing my question.  This question raises the issue and get's clarity on OIDs in backups, the difference between globals and non globals, as well as testing restores recommendations to ensure the backup is good as opposed to just backing up.  Due to the answers I was able to backup, figure out globals/oids, and started a test restore process nightly on Postgres using cron jobs.  Thanks for the help!


What steps do I take to upgrade from LTS 12.04 to LTS 14.04 with the least amount of trouble and loosing the fewest amount of data.

What are the different ways I can use to upgrade Ubuntu from one release to another?


I recently got Legend of Zelda: Breath of the Wild and have been trying to complete the Hyrule Compendium. I noticed in a YouTube video that Master Khoga is one of the entires, but unfortunately I already killed him. I don't know if you can revive him in some way but I really want to know if you can so I don't have to restart the game. If it matters I'm playing on the Switch version.

I was planning to do a 100% completion run, including a full Hyrule Compendium. About halfway through the game, I realized I never took a picture of my first dungeon boss. I didn't worry too much at first, since you can buy additional pictures in Hateno, but now that I bought every single monster picture available, that boss is still missing (as well as a few others, which I assume to be the final boss and some special enemies I haven't seen yet).  Is there any way to still get a picture of dungeon bosses and complete the compendium? Obviously I don't have any save files from before I fought that boss, and even if I did, I'd have to pretty much re-do the entire game.


I was trying to create closed formulas for certain iterated sequences, and came across this sum: $$A := \sum_{k=0}^n q^{2^k} = q+q^2+q^4+\dots+q^{2^n}, \quad q\in\Bbb{R},n\in\Bbb{N}^+$$ I'm trying to find a closed formula for this expression, or a formula where you can obtain the value of the sum by using much fewer arithmetic operations.  I know that the sum  $$S := \sum_{k=0}^n q^k = 1+q+q^2+\dots+q^n$$  has a closed form, since  $$\begin{align} S &= 1+q+q^2+\dots+q^n \\ qS &= q+q^2+q^3+\dots+q^{n+1} \\ qS-S &= q^{n+1}-1 \\ (q-1)S &= q^{n+1}-1 \\ S &= \begin{cases} \frac{q^n-1}{q-1} \quad \text{ if } q \ne 1\\[2ex] n+1 \quad \text{ if } q = 1\end{cases} \end{align}$$  But when trying to use a similar method to determine the value of $A$, we just get a tautology:  $$\begin{align}A = q+q^2+q^4+\dots+q^{2^n}\end{align}$$  Multiplying with $q^c$ won't result in any sort of simplification, so it makes the most sense, to square both sides:  $$\begin{align} A^2 &= \begin{matrix}q^2+q^4+q^8+\dots+q^{2^{n+1}} + q(q^2+q^3+\dots+q^{2^n}) + \\ + q^2(q+q^3+\dots+q^{2^n})+\dots+q^{2^n}(1+q+\dots+q^{2^{n-1}})\end{matrix} \\ A^2 &= A-q+q^{2^{n+1}}+q(A-q)+q^2(A-q^2)+\dots+q^{2^n}(A-q^{2^n}) \\ A^2 &= A-q+q^{2^{n+1}}+qA-q^2+q^2A-q^4+\dots+q^{2^n}A-q^{2^{n+1}} \\ A^2 &= A-q+q^{2^{n+1}}+A(q+q^2+\dots+q^{2^n})-(q^2+q^4+\dots+q^{2^{n+1}}) \\ A^2 &= A-q+q^{2^{n+1}}+A^2-(A-q+q^{2^{n+1}}) \\ A^2 &= A^2 \dots \end{align}$$  I also tried writing up $A$ in the $q$-number system, such that:  $$A = \left(\stackrel{q^{2^n}}{1}\ \underbrace{00\dots 0}_{n-1}\ \stackrel{q^{2^{n-1}}}{1}\ \underbrace{00\dots 0}_{n-2}\ \stackrel{q^{2^{n-2}}}{1} \ \dots \ \stackrel{q^{2^2}}{1}\underbrace{\stackrel{q^3}{0}}_{1}\stackrel{q^{2^1}}{1}\stackrel{q^{2^0}}{1}\stackrel{q^0}{0}\right)_{q}$$  And tried to use formulas to fill up the $0$'s, and relate $A$ to $(11\dots 1)_{q}$, but I just got even more complicated equations that would be more difficult to write up in a closed formula than $A$.  I'm doubtful of there being such a formula, but maybe we can actually obtain one using a different approach.  WolframAlpha also couldn't simplify it, however, that still doesn't mean that such a closed formula doesn't exist.  I'm aware of the trick that  $$A = q+q^2+q^4+\dots+q^{2^n} = q(1+q(1+q^2(1+q^4(1+\dots(1+q^{2^{n-1}})\dots),$$  which involves fewer arithmetic operations to calculate, however I'm only satisfied with a closed formula if it doesn't include dots and/or sum/product/etc. notations. If you could help me find one or show that it doesn't exist using our basic arithmetic notations, that'd be highly appreciated! Thank you in advance.

I am wondering if there exists any formula for the following power series :  $$S = r + r^2 + r^4 + r^8 + r^{16} + r^{32} + ...... + r^{2^k}$$  Is there any way to calculate the sum of above series (if $k$ is given) ?


I switched Alpha to transparent in Shading menu, but renderred images still have grey background. How can i get the transparent background?

I would like to render an animation as a series of .png images with transparent backgrounds for use in a video. Is this possible?


Hi,  I've created a small program in C++ I would like to run like a command from the terminal. With that I mean that I can open the program from and in the terminal (as it is a console application) regardless of which directory I'm in, without having to specify the path to the program. I know how to arrange it so that I would only have to type /program_name, but I'm interested in how the above would work. Thanks in advance!

System utilities such as ls don't need to have the full path typed before executing them. However, to execute Netbeans, I have to type /home/chris/netbeans-7.0.1/bin/netbeans. How can I make it so that I only have to type netbeans?


So I'm doing a project where you put an input and once you do it matches one of cube, pyramid, ellipsoid, quit or it goes back to the original question  I want the user to be able to input any of those words in whatever uppercase or lowercase possible, so an example would be I'd want cUbe or cubE to do the same thing as cube  while True:     shape = input("What shape would you like?: ")      if (shape == "cube" ) : #Calculating cube volume         cube_func()         continue

How can I do case insensitive string comparison in Python?  I would like to encapsulate comparison of a regular strings to a repository string using in a very simple and Pythonic way. I also would like to have ability to look up values in a dict hashed by strings using regular python strings.


I want to escape single and double quotes and some other characters in JavaScript  String to escape is `dynamic initializer for 'Graphics::CDeviceCMYK::s_WicFactoryBoundData''  I want to pass this as argument to some function.  I tried encodeURI(string);  Its not working. What's the correct way to do this ??

When encoding a query string to be sent to a web server - when do you use escape() and when do you use encodeURI() or encodeURIComponent():  Use escape:  escape("% +&=");   OR  use encodeURI() / encodeURIComponent()  encodeURI("http://www.google.com?var1=value1&var2=value2");  encodeURIComponent("var1=value1&var2=value2");


For indented code blocks, adding <!-- language: lang-none --> disables syntax highlighting. What about for fenced code blocks? Can I use lang-none or none in fenced code blocks too? Which of the below is correct? #1:  ```lang-none === some text here === ```  #2:  ```none === some text here === ```

I noticed that sometimes my code gets highlighted in different colors when rendered.   What is syntax highlighting? How does it work? Why isn't my code being highlighted correctly? How do I report a bug or request a new language? How do I use syntax highlighting? What languages are currently available on Stack Exchange?


I have to comply to the style guidelines of some freaking academic journal. As usual, they always let the author do the work, but this one is pretty tedious even from the initial submission. What's left for me is to get rid of the brackets around the year. What I need in particular is this:   As this question has been , I tried to adapt that solution, but it does not work out for me. I include biblatex with my preferred settings in the MWE, but reducing it to 'style=authoryear' as the only option does not help either. Other than the biblatex call, I did exactly as in the linked question. Did biblatex change in the meantime to let this crash?  \documentclass{article} \usepackage[style=authoryear,sorting=nyt,isbn=false,doi=false,clearlang=false, backend=biber,natbib=true,hyperref=true,giveninits=false,useprefix=true, backref=false,maxcitenames=2,uniquelist=false,uniquename=init, maxbibnames=10]{biblatex} \renewbibmacro*{issue+date}{% \setunit{\addcomma\space}% NEW %  \printtext[parens]{% DELETED \iffieldundef{issue} {\usebibmacro{date}} {\printfield{issue}%     \setunit*{\addspace}%     %       \usebibmacro{date}}}% DELETED     \usebibmacro{date}}% NEW \newunit}  \usepackage{filecontents}  \begin{filecontents}{\jobname.bib} @article{Bli74,     hyphenation = {english},     author = {Blinder, Alan S.},     year = {1974},     title = {The economics of brushing teeth},     journaltitle = {Journal of Political Economy},     volume = {82},     number = {4},     pages = {887--891}, } @book{Kop04,     hyphenation = {ngerman},     author = {Kopka, Helmut and Daly, Patrick W.},     year = {2004},     title = {Guide to \LaTeX},     edition = {4},     location = {Boston},     publisher = {Addison-Wesley}, } \end{filecontents}  \addbibresource{\jobname.bib}  \nocite{*}  \begin{document}  \printbibliography  \end{document}     Thanks in advance!  EDIT: This is the working MWE, tnanks to Moewe's link in the comments.  \documentclass{article}  \usepackage[style=authoryear,sorting=nyt,isbn=false,doi=false,clearlang=false,backend=biber,natbib=true,hyperref=true,giveninits=false,useprefix=true,backref=false,maxcitenames=2,uniquelist=false,uniquename=init,maxbibnames=10]{biblatex}  \usepackage{xpatch,filecontents} \xpatchbibmacro{date+extradate}{% \printtext[parens]% }{% \setunit*{\addcomma\space}% \printtext% }{}{}    \begin{filecontents}{\jobname.bib} @article{Bli74,     hyphenation = {english},     author = {Blinder, Alan S.},     year = {1974},     title = {The economics of brushing teeth},     journaltitle = {Journal of Political Economy},     volume = {82},     number = {4},     pages = {887--891}, } @book{Kop04,     hyphenation = {ngerman},     author = {Kopka, Helmut and Daly, Patrick W.},     year = {2004},     title = {Guide to \LaTeX},     edition = {4},     location = {Boston},     publisher = {Addison-Wesley}, } \end{filecontents} \addbibresource{\jobname.bib} \nocite{*} \begin{document}     \printbibliography   \end{document}

I have a question that has been answered a few times, but does not work for me (and also not for another commenter in a previously asked question).   I want to remove the parenthesis around the yead in the bibliography with biblatex style authoryear, and ideally also add a comma and space before it. I have looked at the following questions:        I use biber 2.10 and TexLive 2017/W32Tex.  This MWE should work according to the question v2 above, but does not work for me, i.e. the output is still Author, Anne (2001a). Alpha. The output I need is Author, Anne, 2001a. Alpha.  \documentclass{article}  \usepackage[style=authoryear,dashed=false]{biblatex} \usepackage{xpatch,filecontents}  \begin{filecontents}{\jobname.bib} @misc{A01,author={Author, Anne},year={2001},title={Alpha}} @misc{A02,author={Author, Anne},year={2001},title={Beta}} \end{filecontents} \addbibresource{\jobname.bib}  \xpatchbibmacro{date+extrayear}{%   \printtext[parens]% }{%   \setunit*{\addperiod\space}%   \printtext% }{}{}   \begin{document} \nocite{*} \printbibliography \end{document}


When I check for definition of independent events I get the following definitions  Type 1  ()  When two events are said to be independent of each other, what this means is that the probability that one event occurs in no way affects the probability of the other event occurring.  Type 2    $P(A \cap B) = P(A)P(B)$   Then it follows some useful information such as ()   a) Do not say that two events are independent if one has no influence on the other    b) No circumstances say that A and B are independent if $ A \cap B  = \phi $ (this is the statement that A and B are disjoint, which is quite a different thing!)  b) Also, do not ever say that P(A ∩ B) = P(A) · P(B) unless you have some good reason for assuming that A and B are independent (either because this is given in the question, or as in the next-but-one paragraph).  Example  Consider example where events are not independent     My conclusion is that $P(A/B) \ne P(A)$ and $P(B/A) \ne P(B)$ . It says given   precondition of   event B has an effect on  P(A) ($P(A/B) \ne P(A)$) and given precondition of   event A has an effect on  P(B) ($P(B/A) \ne P(B)$) . So  these are  dependent events    My conclusion is that $P(A/C) = P(A)$ and $P(C/A) = P(C)$ . It says given the precondition of an event C has no effect on  P(A) ($P(A/C) = P(A)$) and an event A has no effect on  P(C) ($P(C/A) = P(C)$). So  these independent events    Doubt  1) Mathematically we can say whether two events are independent by formulas such as $P(A/C) = P(A)$ and $P(C/A) = P(C)$ or $P(A\cap C) = P(A)P(C)$ . But is it possible to show  meaning using Venn diagrams as we show $P(A \cup B )$ etc.?  Can we make some statements about the participating event sets if know prior two events are independent. I am looking for  getting a conceptual meaning derived from the formula with visual identification from Venn diagram if possible   2) But if you check the definitions I got from two sources as mentioned above as type 1 and type 2, type 1 says      When two events are said to be independent of each other, what this means is that the probability that one event occurs in no way affects the probability of the other event occurring.      and type 2 says      Do not say that two events are independent if one has no influence on the other.No circumstances say that A and B are independent if $ A \cap B  = \phi $ (this is the statement that A and B are disjoint, which is quite a different thing!)      What is the difference between influence of events on other and affecting other event as mentioned above? What is meaning of two independent events which never affects each other but influence each other? I am looking for a precise conceptual definition or identification method for independent events

From my recent experience in probability, it feels as though independence is something we "discover" from the system via the equation:   $$P(A)*P(B)=P(A\cap B)$$  Could one ever conclude independence from the "system" by intuition? Is it wise to conclude independence for events that are "seemingly" independent? What would be some interesting examples where this would fail.


my LapTop, that runs on Windows 10, now doesn't start anymore. So I wanted to save all my files by USB-Booting Ubuntu 16.04.1 LTS before sending it in for repair.  But when I try to access my drive in Nautilus it gives a lengthy dialogue:  Unable to access “255 GB Volume”  Error mounting /dev/sda2 at /media/ubuntu/CAEED374EED356F3: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=999,gid=999" "/dev/sda2" "/media/ubuntu/CAEED374EED356F3"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda2': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option.   How do I mount that drive as Read-Only? Due to lack of disk space I can't install Ubuntu without erasing the stuff, that I actually want to save.  A graphical solution in nautilus or something would be much appreciated. Else could you please tell me exactly what I need to type in the Terminal.  Kind regards!  Markus

Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount.  When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens.    Here's my partition table, if any more data is needed please let me know.     Device Boot      Start         End      Blocks   Id  System /dev/sda1            2048    20000767     9999360   83  Linux /dev/sda2        20002814   478001151   228999169    5  Extended /dev/sda3   *   478001152   622532607    72265728    7  HPFS/NTFS/exFAT /dev/sda4       622532608   625141759     1304576   82  Linux swap / Solaris /dev/sda5        20002816   478001151   228999168   83  Linux


I've seen this in many schematics, I also do it myself, but I don't really know why it's needed. I've also noticed that on RGB led strips, there's tiny 100nf caps, too.  Why is it needed? Also, if it's generally needed, why aren't those capacitors integrated in the IC itself already? I'm sure there's tech for doing it, so why not?

Just wondering if someone can give me an explanation for this capacitor layout - what is it's function? The chip to the right is an ADC.  Circled in blue.    I'm guessing it is well known but i don't know how to search for it.


I have a Problem getting UTF-8 encoded Strings out of a MariaDB-Database. Today I updated my XAMPP-Distro to 10.4.11-MariaDB (MySql) and PHP 7.2.29 and now a strange Problem arised wich had not occoured with the older version.  Preliminary informations: I am importing data from a database dump from a working MariaDB-Database (productive system) to my local Database. And on the local Database the problem occours.  When I send a query on the local system to the database via PHP (mysqli) (the code is the same as on the production system) I get the wrong encoding:    If I wrap the text from the database with the following php function  utf8_decode($textFromTheDatabase);   everything works fine.  I also tried the following lines before every query but this does not change anything:  $dbConnection->set_charset('utf8'); $dbConnection->query("SET NAMES 'utf8'");   As mentioned above everything works on the production system but not on the new XAMPP installation. When I still had the old XAMPP version on my local system everything worked fine. So I think something is wrong with the configuration of my local Database or PHP or Apache?

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


So I separate the 2 white wires and label the hot one black? How do I determine the hot white wire without a tester?  Thank you guys for your help!

I'm installing a new ceiling fan. I have 2 black and 2 white wires coming from the ceiling. 1 black wire is not a power source. The 2 white wires are capped together. I've left the non power black wire source capped and left the 2 white wires capped together. After hooking up everything the fan and light works. Yay!! However, there is a wall switch that should turn on and off the fan and it's not working. I'm assuming it has something to do with the non ground black wire. If so, how do I connect it to the fan switch? Thank you for your time.


I have a guide that tells me that for interfacing 640x480 screen you need 800 pixels in a row and 521 lines along with all of that front and back porch stuff I wanna know how do they determine that number? If i have a screen of different resolution how do i determine the pixels and lines? also the non displayable  area i.e porches and retrace time , how are they determined

I want to generate VGA signal with micro-controller (like TI Tiva ARM which runs at 90/120Mhz speed).  I'm not sure how to make accurate timings with micro-controller. Which programming pattern I need to use?  Do I need any inline assembler code? How to wisely use interrupts?  Would be great if anybody show some pseudo code how to generate VGA signal.  I successfully generated VGA signal with FPGA. But I just can't figure out how to do it with MCU.


I have a difficult time understanding how can a sequence of random variables, lets say {$z_i$}, converge in probability to a constant.   Is that the mean of the realization of all random variables in the sequence converges to a number? (If yes, isn't it just the central limit theorem?)   Thank you.

What is the intuitive difference between a random variable converging in probability versus a random variable converging in distribution?  I've read numerous definitions and mathematical equations, but that does not really help. (Please keep in mind, I am undergraduate student studying econometrics.)  How can a random variable converge to a single number, but also converge to a distribution?


I'm sort of stuck on this proof   I know that $a\equiv b\pmod n$ means $a - b = mk$ for some integer $k$ and by the Division algorithm   $a = mq_1 + r_1$   $b = mq_2 + r_2$   $a - b = m(q_1 - q_2) + (r_1 - r_2)$  Once I get to the line above I get stuck how do I show that $r_1 - r_2$ are actually equal and the same remainder? I've looked at other proofs that just say the remainder for $a$ and $b$ equal to $r$.  I feel like i'm missing something extremely obvious.

Let $a$, $b$, and $n$ be integers with $0 \le a \lt n$ and $0 \le b \lt n$. Suppose $a \equiv b \pmod n$. Then $a-b=0$ and $a=b$. Why does the congruence of two non negative integers imply that they must be equal?


We have some CAD data that's based off a  (PSM) (details below). How do I create a CRS so that the data can be brought into GDA94 (4283)?  PSM: 110326 GDA94 Lat: 12D 39M 50.5201"S Lon: 141D 50M 49.8383"E E: 591994.116 N: 8599867.976 Zone: 54 Order: 1st Class: A Adjustment: GSA - WEIPA Control  This seems to be the reverse process of  or am I mistaken?  Basically, the question is how to bring a dataset that is fixed to a position that has GPS coordinates (is real world) into real world coordinates as a whole.

I don't know so much about coordinate systems...  In my office we use to deal with spatial data coming from archaeological sites. Each site has its own x-y-z coordinate system (GCS). Three simple ortogonal cartesian axis. In the last years we have been managing this spatial data through GIS software (ArcGIS), without using specific coordinate system (just leave it as "undefined")  I'd like to know if there exisits any GCS designed to deal with such datasets using simple cartesian orthogonal axis, without grid distortions of the typical GCS. In addition, I'd like to know if this system is suitable for using it in an online mapping application.  By the way, we manage 2D (ArcMap) and 3D (ArcScene) environments and work with "mm" as length base unit.   If such a thing doesn't exists, maybe someone knows how to create it.


Downloaded the newest version, 2.73a, twice.  Each time the download seems to go well, but when i start the program it opens only for a second then closes.  It does this repeatedly.  Using Win8.1.  Had no trouble with v2.72, i used it from when it first appeared until yesterday.  Anyone know what my problem is and how to fix it?  ..thanks,  gmo

I installed blender on a windows 7 64 bit system.  I opened it one time then went to the tutorials.  in the meantime I had a power failure and when I tried to start blender again I get a dos window that closes itself then nothing.  I reinstalled Blender and get the same thing.  I am going to try to uninstall then reinstall but in the mean time, any other suggestions are welcome.


I have a view that (left outer) joins multiple recursive CTEs. There are about 10k rows. The results of running SELECT * FROM MyView ORDER BY MyPrimaryKey, with statistics time and io on:   SQL Server Execution Times:    CPU time = 0 ms,  elapsed time = 0 ms.  (11063 row(s) affected) Table 'Worktable'. Scan count 49743, logical reads 296781, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'MyTableA'. Scan count 7, logical reads 23690, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'MyTableB'. Scan count 18832, logical reads 38207, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'MyTableC'. Scan count 6, logical reads 5458, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'MyTableD'. Scan count 2, logical reads 112, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'MyTableE'. Scan count 2, logical reads 184, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.   SQL Server Execution Times:    CPU time = 688 ms,  elapsed time = 881 ms.   The results of SELECT TOP 25 * FROM MyView ORDER BY MyPrimaryKey:   SQL Server Execution Times:    CPU time = 0 ms,  elapsed time = 0 ms.  (25 row(s) affected) Table 'Worktable'. Scan count 48353, logical reads 801727, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'MyTableB'. Scan count 9360, logical reads 20006, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'MyTableA'. Scan count 4, logical reads 7359, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'MyTableD'. Scan count 1, logical reads 17944, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'MyTableE'. Scan count 2, logical reads 184, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'MyTableC'. Scan count 5, logical reads 226, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.   SQL Server Execution Times:    CPU time = 29765 ms,  elapsed time = 30865 ms.   Why on earth are the execution times so drastically different?

For a moderately complex query I am trying to optimize, I noticed that removing the TOP n clause changes the execution plan.  I would have guessed that when a query includes TOP n the database engine would run the query ignoring the the TOP clause, and then at the end just shrink that result set down to the n number of rows that was requested.  The graphical execution plan seems to indicate this is the case -- TOP is the "last" step.  But it appears there is more going on.  My question is, how (and why) does a TOP n clause impact the execution plan of a query?  Here is a simplified version of what is going on in my case:  The query is matching rows from two tables, A and B.    Without the TOP clause, the optimizer estimates there will be 19k rows from table A and 46k rows from table B.  The actual number of rows returned is 16k for A and 13k for B.  A hash match is used to join these two results sets for a total of 69 rows (then a sort is applied).  This query happens very quickly.  When I add TOP 1001 the optimizer does not use a hash match; instead it first sorts the results from table A (same estimate/actual of 19k/16k) and does a nested loop against table B.  The estimated number of rows for table B is now 1, and the strange thing is that the TOP n directly affects the estimated number of executions (index seek) against B -- it appears to always be 2n+1, or in my case 2003.  This estimate changes accordingly if I change TOP n.  Of course, since this is a nested join the actual number of executions is 16k (the number of rows from table A) and this slows down the query.  The actual scenario is a bit more complex but this captures the basic idea/behavior.  Both tables are searched using index seeks.  This is SQL Server 2008 R2 Enterprise edition.


$email = strip_tags($_POST['email']);     $password = strip_tags($_POST['password']);  $email = $DBcon->mysqli_real_escape_string($email); $password = $DBcon->mysqli_real_escape_string($password); $password= md5($password); $query = $DBcon->query("SELECT id, email, password FROM food_user WHERE email='$email' and password='$password"); $row=$query->fetch_array();  $count = $query->num_rows; // if email/password are correct returns must be 1 row  if (password_verify($password, $row['password']) && $count==1) {     $_SESSION['userSession'] = $row['id'];     header("Location: cookiecups.php");     $msg = "
                  &nbsp; Invalid Username or Password !
";  } else {     $msg = "
                  &nbsp; Invalid Username or Password !
"; } $DBcon->close();

It is currently said that MD5 is partially unsafe. Taking this into consideration, I'd like to know which mechanism to use for password protection.  This question,   suggests that hashing multiple times may be a good idea, whereas  suggests using salt.  I'm using PHP. I want a safe and fast password encryption system. Hashing a password a million times may be safer, but also slower. How to achieve a good balance between speed and safety? Also, I'd prefer the result to have a constant number of characters.   The hashing mechanism must be available in PHP It must be safe It can use salt (in this case, are all salts equally good? Is there any way to generate good salts?)   Also, should I store two fields in the database (one using MD5 and another one using SHA, for example)? Would it make it safer or unsafer?  In case I wasn't clear enough, I want to know which hashing function(s) to use and how to pick a good salt in order to have a safe and fast password protection mechanism.  Related questions that don't quite cover my question:


I have a json file like this  {     "doctors": [{         "name": "...",         "Section": "...",         "Grade": "..."     },     {         "name": "...",         "Section": "...",         "Grade": "..."     }],     "nurses": [{         "name": "...",         "Grade": "..."     },     {         "name": "...",         "Grade": "..."     },     {         "name": "...",         "Grade": "..."     },     {         "name": "...",         "Grade": "..."     }] }   Inside the script tag of the html file I have defined a loadData function that is called when a button is pressed.  function loadStaffData() {         var xo = new XMLHttpRequest();         xo.overrideMimeType("application/json");         xo.open('GET', 'staff_data.json', true);          xo.onreadystatechange = function () {             if (xo.readyState == 4 && xo.status == "200") {                                  var X=JSON.parse(xo.responseText);               console.log(X); //line 18             }           };           xo.send(null);         }   Right now I am only able to get the whole set of data in the json file. But I need to be ale to retrieve each doctor's/ nurse's name/ section/ gender separately. I tried typing  xo.responseText('doctors'[0]) and even xo.responseText([0][0]), but none of them worked.  Edit I have also tried parsing the responseText: JSON.parse(xo.responseText). But I have got this error: JSON.parse: expected ',' or '}' after property value in object at line 18   The json file is on my local disc and I use firefox (developer edition) to get output.

Given a string of JSON data, how can I safely turn that string into a JavaScript object?  Obviously I can do this unsafely with something like:  var obj = eval("(" + json + ')');   but that leaves me vulnerable to the JSON string containing other code, which it seems very dangerous to simply eval.


I have a project on Overleaf and I am using bibtex for managing my references. This has a .bib file. I want to put the paper on arxiv and they want me to add a .bbl file not .bib. How can I convert .bib to .bbl ?

Overleaf V2 does not seem to have a way to get the BBL file for arxiv, how do I get it?


I am wanting to take self portraits using my Nikon D3200 and was wondering is there a way I can stream the live view through a laptop, tablet or some other screen?   I want to have the screen facing me so I can see what the picture will look like before I capture it so it's not a case of clicking and hoping.  I have an AV out (from camera) to USB lead and also an AV out (from camera) to the yellow and white lead  Hope that makes sense  Thanks

I own a Nikon D3100 and I need a way to see the live view of my camera on my laptop screen.  There must definitely be a way (I am not just aware of it). I have searched all around the web sites... I could not get a solution.  The Nikon Camera Control Pro 2 does not support D3100, and "Camera Control 5.1" connects and shoots remotely from a laptop but does not show live-view nor shoot in RAW.  There is a way of connecting my camera to a TV or monitor directly via an HDMI cable and getting the live view, but I want it displayed to my laptop screen.


I have a rooted OP3 on Android 7.1.1 with Play Store v. 8.2.38. I have tried uninstalling updates from apps manager(which reverts it to 7.9 the version I want to keep) but it updates Play store as soon as I open it afterwards. I can't keep my phone offline and I need app updates but not the play store itself. I want to keep Play Store at 7.9 or 8.0. How Do I go about doing that? All the related posts here are either outdated or not working

How can I stop Google play from automatically updating to the latest version? I tried deleting my hosts file but it's not being deleted. My phone is rooted.