Temporarily prevent hyperref from decorating links

I have a picture, drawn with tikz, that contains a few slanted hyperrefs (in fact, document-internal references). For these, the colored underline that I have told hyperref to draw are not slanted, so they greatly impair the prettiness of the drawing.  Is there a way to modify hyperref’s options, in particular hidelinks and/or colorlinks only temporary?


PHP & SQL (PDO): 1 row with 2 same fields to join in other table

I have province table     province_id province_name     1 Abra   2 Bulacan   3 Cagayan   4 Dagupa     and it is connected in 2 fields in person table     person_id person_name currentaddress_province_id provincialaddress_province_id     1 Jepoy 1 2   2 Jeff 3 4     I want to display output like this:     Name Current Province Provincial Province     Jepoy Abra Bulacan   Jeff Cagayan Dagupan     I tried the below code: $query = "SELECT * FROM person LEFT JOIN province ON province.province_id = person.currentaddress_province_id AND person.provincialaddress_province_id ";  $statement = $connect->query($query); $statement->execute(); $count = $statement->rowCount(); $output = '

Name	Current Province	Provincial Province

'; if ($count > 0) {     $result = $statement->fetchAll();     foreach ($result as $row)     {         $output .= '
'.$row["person_name"].'	'.$row["province_name"].'	'.$row["province_name"].'
';     } } $output .= '

'; echo $output;   but this is the result:     Name Current Province Provincial Province     Jepoy Abra Abra   Jeff Cagayan Cagayan


I'm getting vast amounts of these messages in my Console:  13/03/2015 16:02:20.924 WindowServer[250]: _CGXGLDisplayContextForDisplayDevice: No matching context for device (0x7fcfcaf18220) - disabling OpenGL   and WindowServer is consistently at around 16%. I'm using DisplayLink. Is there anything I can do about it?


ending loop with a string variable in java

having problems ending this loop when I type "quit"  String employee=" "; double pay; int hours;    while(employee != "quit")  {     System.out.print("Enter employee name: ");     employee = input.next();      System.out.print(employee);     System.out.println("\n"); }


Is there any way to favorite/bookmark an answer?

Lots of questions are very generic, "share an experience" kinds of questions. In these cases, I am quite often interested in specific answers that may not have gotten that many upvotes. These questions also tend to elicit lots of responses, so going back to find the answers I'm interested in somewhere in the middle of a sea of responses is a pain. Is there a way to favorite or bookmark these answers?


scp without replacing existing files in the destination

How do I copy an entire directory into a directory of the same name without replacing the content in the destination directory? (instead, I would like to add to the contents of the destination folder)


When should I dispose my objects in .NET?

For general code, do I really need to dispose an object?  Can I just ignore it for the most part or is it a good idea to always dispose an object when your 100% sure you don't need it anymore?


Entity Framework Order by descending by row field in query

I want to write a EF query which does order by ascending or descending based on condition. Following is the my pseudo code:    var result= q.OrderByDescending(x => x.StatusId == 3)                     then if( x.StatusId == 3)                            then order by x.ReserveDate                      else                           then order by descending x.LastUpdateDate   How can i do this?


Why does my Oval not print to the JFrame?

Whenever I run this I get an error:     "Exception in thread "main" java.lang.NullPointerException    at anime.re.drawShape(re.java:17)   at anime.re.main(re.java:12)"   I am not passing a null reference, what is the problem?  import javax.swing.JFrame; import java.awt.Graphics;  public class re {     public static void main(String[] args) {         JFrame frame = new JFrame();         frame.setSize(400, 400);         Graphics g = frame.getGraphics();         drawShape(g);         frame.setVisible(true);     }      public static void drawShape(Graphics g) {         g.drawOval(0, 0, 100, 100);      } }


How can I define From Email In this Apex Email Service Code

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


What's wrong in taking the cat as an observer in Schrodinger's experiment? Plz kindly elaborate! And if possible also describe about possible logics if the question bears the answer No.


Stagefright security issue: what can a regular user do to mitigate the issue without a patch?

There appears to be a giant security vulnerability with Android that seems to basically affect all phones.  wrote:  The vast majority of Android phones can be hacked by sending them a specially crafted multimedia message (MMS), a security researcher [Joshua Drake] has found. ... Drake found multiple vulnerabilities in a core Android component called Stagefright that’s used to process, play and record multimedia files. Some of the flaws allow for remote code execution and can be triggered when receiving an MMS message, downloading a specially crafted video file through the browser or opening a Web page with embedded multimedia content. ... The MMS attack vector is the scariest of all because it doesn’t require any interaction from the user; the phone just needs to receive a malicious message. For example, the attacker could send the malicious MMS when the victim is sleeping and the phone’s ringer is silenced, Drake said. After exploitation the message can be deleted, so the victim will never even know that his phone was hacked, he said.  What can a regular user do to mitigate the issue? Disable Google Hangouts?


How Model bind to a Enum using ASp.NET MVC

I have a enum and I am trying to model bind it using ASP.NET MVC.  public class MyViewModel {   public enum ESampleTime     {         Value1= 0,         Value2,         Value3,         Value4,         Value5,         Value6     } }   And I am trying to model bind it using ,
             @Html.LabelFor(model => model.SampleTime, htmlAttributes: new { @class="control-label col-md-2"})
                 @Html.DropDownListFor(model => model.SampleTime,new List<SelectListItem>())
     This results in empty list as I am passing a new SelectedItem List.  But how do I display Value1, value2... in listBoix?


Recover MySQL database from data folder without ibdata1 from ibd files

My WAMP directory accidentally get deleted by another user. Only data folder in MySQLis available. And, in that only database-folders (folders in "\bin\mysql\mysql5.6.12\data\" with name of databases) are available. All files including "ibdata1" in root of "\bin\mysql\mysql5.6.12\data\" are also deleted.  The database folders contains files with below extensions only.  *.frm, *.ibd  and "db.opt" file.  How the databases can be recovered?  I already have tried to recover bdata1. But, unable to get it back. And, some database contains MYISAM also.


How to find my administrator details when I can't even see an administrator account

I have Ubuntu Gnome 13.10. In the beginning, the first user account I created was considered as my administrator account. I changed that account to Standard now and I can't make it back to administrator and whenever I make some changes in my computer, it is asking me for a administrator password which I don't have now.


Why does time seem to flow in only one direction?

According to my understanding. Since Einstein, physicists have thought of space and time as forming a four-dimensional structure known as “spacetime.” But space differs from time in some very fundamental ways. In space, we’re free to move about as we wish. When it comes to time, we’re stuck. We grow older, not younger. And we remember the past, but not the future. Time, unlike space, seems to have a preferred direction — physicists call it the “arrow of time.” Some physicists suspect that the second law of thermodynamics provides a clue. It states that the entropy of a physical system (roughly, the amount of disorder) rises over time, and physicists think this increase is what gives time its direction. (For example, a broken teacup has more entropy than an intact one — and, sure enough, smashed teacups always seem to arise after intact ones, not before.) Entropy may be rising now because it was lower earlier, but why was it low to begin with? Was the entropy of the universe unusually low 14 billion years ago, when the Big Bang brought it into existence? Recent computer simulations seem to show how the asymmetry of time might arise from the fundamental laws of physics, but the work is controversial, and the ultimate nature of time continues to stir passionate debate. All of this is theory by the physicists but I feel like there is more reasons just other than these 2. If time is considered the 4th dimension then we should be able to travel back and forth right? I am just looking for a curious group of people to add their perspective and reasoning on why time only seem to flow in only one direction? So I can get a even depth understanding on other people's perspective and reasoning and the topic itself.


If no spell can reawaken the dead, how did the resurrection stone work?

Dumbledore himself said that no spell can reawaken the dead. Isn't that the main objective of the resurrection stone? If one can't reawaken the dead then what is the use of the stone? Surely then one of the Hallows is flawed?


Show $4x^2+6x+3$ is a unit in $\mathbb{Z}_8[x]$ (inverting unit + nilpotent)

Show that $4x^2+6x+3$ is a unit in $\mathbb{Z}_8[x]$.  Once you have found the inverse like , the verification is trivial. But how do you come up with such an inverse. Do I just try with general polynomials of all degrees and see what restrictions RHS = $1$ imposes on the coefficients until I get lucky? Also is there a general method to show an element in a ring is a unit?


I have a loop:  List<A> list = new List<A>(); A obj = new A();  for (int i = 0; i < 10; ++i) {     obj.num = i; // Assigns the current i to the num attribute inside obj     list.Add(obj); }   However, in this case, whenever I modify obj, the previous instances of obj already added into the list will be modified. How do I write the code such that whatever that is added into the list has no more reference to the current value of obj?


Why can't this kill White Walkers in Season 8 Episode 3?

After the latest episode, I have some doubt about what can kill a White Walker and why.  We know, as a fact, that both Valyrian Steel and dragonglass can kill White Walkers, and they have in common being forged by dragon fire, which I initially thought was the reason they had this power.  In the latest episode, though,      we see the Night King stand untouched in one of the arguably strongest breaths of dragon fire, made with the sole purpose of killing him   That scene gives me lots of doubt.      if dragon fire cannot kill White Walkers, why should things forged with it do it? We can argue Valyrian steel has been enchanted in the forging process, but weapons made from dragonglass have clearly not been, yet they have been shown to kill White Walkers. Why can't the dragon fire kill the White Walkers?


I've seen this convention pretty much everywhere, and, at times, it comes close to driving me nuts:  <?php //The loop ?> <?php while ( have_posts() ) : the_post(); ?>     <?php the_content(); ?> <?php endwhile; // end of the loop. ?>   Where the <?php and closing ?> are on every single line, even if there is no intervening HTML code.    My question is: Why?  Why include all these extra tags?      To me, it seems this convention adds a significant amount of clutter to code, is annoying to follow in the first place, and adds that many more places to accidentally leave out an opening or closing tag.  NOTE  This is code pulled from the Twenty-Twelve theme, the example given by WordPress.


How can I upgrade my EOL 16.10 to any new version?

I can't upgrade to 17.10 as it's not supported, I can't update to 17.04 and I can't install packages. I added old-releases etc. It's not worked for all apps.  Why does Canonical not provide tool/instructions?


How can I export all item IDs, metadata and names? [FTB 1.4.7 Mindcrack]

I have used NEIs dump thing but that does not give meta data and the names are average at best. How can I access the item id, meta data and proper name (that you get by hovering over the item in NEI)?  I have seen a mod that does this for 1.5 but not for 1.4.7  I want this data for a table for use in my interactive sorter program


Mouse: Single clicks occasionally register as double clicks

I have a generic Logitech USB Optical Mouse (couldn't find a model number) and occasionally when I am doing a single click, it registers as a double click instead.  For example, when I click a file once, it opens it rather than selects it. What could be the source of this problem?


How can I pass command line arguments to a script through Dash? (14.04)

I recently asked this question about adding a shell script to Dash:      It worked perfectly.  Follow-up question:  How can I pass command-line arguments through Dash?  Example:  In this case, my dash command is named "Panel".  The script panels my screen with 8 terminals.  Here's an example of the usage:  panel             # Tile the screen with 8 terminal windows. panel --left      # Tile the left side with 4 terminals panel --right     # Tile the right side with 4 terminals   And so on.  How can I pass arguments like --left or --right through Dash?  Ideally I'd like to have this workflow:   Press the SUPER key Type panel --left (for example) Dash goes away and the left side is paneled.   Right now it runs the right script, but ignores --left.   Tips?


Is it possible that using jQuery, I cancel/abort an Ajax request that I have not yet received the response from?


I am applying for a Tier 5 Youth Mobility visa, but have been refused a visa/overstayed in the Czech Republic/Schengen zone

I am applying for the tier 5 Youth Mobility Visa from Canada. I traveled to the Czech Republic in 2012 and was denied a freelance working visa shortly thereafter in 2013. I appealed the decision, only to be refused again. I therefore ended up overstaying my 90 day tourist visa in the course of this. I had no troubles upon leaving the country in December 2013.   The Tier 5 application asks if you have been refused a visa in any other country. It is very obvious on my passport that I was denied-as the visa appointment is stamped in it. Would it be wise to "lose my passport" or just be honest and hope for the best? Will the fact I was denied and overstayed be detrimental to my tier 5 application?   I also traveled throughout the Schengen zone whilst waiting for the appeal to come through-I was under the impression I was still legal whilst waiting for the appeal answer (I'm still unsure if that is true or not). The tier 5 application also requires you to list all the countries you have traveled to in the past 10 years. Since I traveled to many countries (perhaps illegally) will that be further detrimental to my application? I also don't have stamps in my passport for the above travels since I traveled by ground and did not receive stamps. I know that the UK and the Schengen zone do not share information, so how necessary is it to list these travels?


Which bibliography stile to have the references with "et al." after the third author and the (year) after the authors?

I am working on a LaTeX chapter for a Springer book for the  series. This is my header:  \documentclass[graybox,vecphys]{svmult}  For the bibliography, I am using the \bibliographystyle{spmpsci} command and my references have the following format:     Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., Devin,   M., Ghemawat, S., Irving, G., Isard, M., Kudlur, M., Levenberg, J.,   Monga, R., Moore, S., Murray, D.G., Steiner,B., Tucker, P., Vasudevan,   V., Warden, P., Wicke, M., Yu, Y., Zheng, X.: TensorFlow: a system for   large-scale machine learning. In: Proceedings of OSDI 2016 – the 12th   USENIX Symposium on Operating Systems Design and Implementation, pp.   265–283 (2016).   But this is not the style requested by Springer MIMB. I need to find a style that puts the year after the names, puts "et al." after the third author, removes all the dots after the abbreviated first names, removes "In" and "and". That is, it should print the above example as:     Abadi M, Barham P, Chen J. et al. (2016) TensorFlow: a system for   large-scale machine learning. Proceedings of OSDI 2016 – the 12th   USENIX Symposium on Operating Systems Design and Implementation:   265–283.   Please notice the "et al." and the position of the (2016) year.  Which style can I use to achieve this result? Thanks!  EDIT: I found a way to insert "et al." after the 3rd co-author, to keep the reference list numeric, to remove the "In:" and the "and". The steps are the following.  At the top of my LaTeX file, I had to insert:  \usepackage[style=numeric, maxnames=3, minnames=3, firstinits=true, sorting=none, terseinits=true]{biblatex} \renewcommand*{\revsdnamepunct}{} \DeclareNameAlias{author}{last-first} \renewbibmacro{in:}{} \addbibresource{bibliography_file.bib}   At the bottom of my LaTeX file, I had to remove:  \bibliographystyle{spmpsci} \bibliography{bibliography_file}   and I had to insert:  \printbibliography   These commands led to the following result:     Abadi M, Barham P, Chen J, et al. “TensorFlow: a system for large-scale   machine learning”. Proceedings of OSDI 2016 – the 12th USENIX Symposium on    Operating Systems Design and Implementation. 2016, pp. 265–283.   I still need to solve an issues: I have to move the (year) to have it after the name list. How can I get that? Thanks!


simple javascript decimal addition produces incorrect results

I have the following function:  var a = 0.1; var b = 0.2;  function checkValue(){     if(a + b === 0.3){         alert('statement is true');        }     else {         alert('statement is false');        } }  checkValue();   This function evaluates to false??   Now, the same function with different decimals that also equal 0.3:  var a = 0.15; var b = 0.15;  function checkValue(){     if(a + b === 0.3){         alert('statement is true');        }     else {         alert('statement is false');        } }  checkValue();   evaluates to true.  Has anyone run into this before? If so are there languages commonly used for web applications that do not do this?


Views global text area replacement patterns for multiple values

I have a views block that is listing the similar nodes (based on taxonomy terms).  I want to show some custom text and the taxonomy term field's value(s) on the footer of the block.  I added Global: Text area to footer of the views and selected the Use replacement tokens from the first row option.  What I want to show is that My Term's other nodes and I'm using that for what I wanted:      [field_my_taxonomy_term]'s other nodes.    It works correctly if the field_my_taxonomy_term field has only one value but if it has multiple values (multiple terms) it only shows the first taxonomy term value.    How can I show multiple values on Global: Text area?    This is the replacement patterns part of the Global: Text area:   [title] == Content: Title [field_my_taxonomy_term] == Content: My Term %1 == Content: Nid title !1 == Content: Nid input %2 == Content: Has taxonomy term ID title !2 == Content: Has taxonomy term ID input


Why are "define" and "definition" pronounced with different vowels?

It just doesn't make sense. "Define" has a long vowel and "definition" has short. Isn't "definition" the noun form of "define"? Shouldn't both have the same vowels? Why are both pronounced differently? Can someone explain it please?


regex match list of words and another word

I am searching text files that contain:  -any word in this list (build|tune|scrap) -and one more specific word (engine)  The text files have CRLF as line endings.  I've cobbled together the following regex, which matches when engine is on the same line as one of the first three: (?=.*\b(build|tune|scrap)\b).*(?=.*\b(engine)\b)  edit:  I've tried the suggested duplicate post.  The files I am searching have CRLF line endings, so I believe my regex should have \r\n someplace, but I have been unable to get it to find engine in the rest of the text (i.e. on other lines)  when there's a build, tune or scrap anywhere else. (?=.*\b(build|tune|scrap)\b)((.|\n|\r)*)(?=.*\b(engine)\b) (?=.*\b(build|tune|scrap)\b)((|\n|\r))(?=.*\b(engine)\b)  Thanks.


Change content of entire page without reloading

I'm looking for a way to change the html content of my entire page (even the head) , after an ajax call.  So I can't use :  $("body").html(result)   I have this code :  $.ajax({ url: myURL, type: "POST", success: function (result) {    document.open();    document.write(result);    document.close(); }   But it's reloading the page. I don't want it because the transition is bad (my pages background color is black and there is a white flash during the refresh).  I need something like :  $("html").html(result)   But it doens't works. Is there a way to do it ?


Let $U(n)$ be the set of all positive integers which are coprime to $n$ and less than $n$. We see that $U(8) = \{1,3,5,7\}$. It is a good observation to see that $U(8)$ consists prime numbers except 1. One more example is $U(12)$. I had many futile attempts to find such $n$ where $U(n)$ consists only primes except 1. Is it true that there are finitely many $n$ such that $U(n)$ consists only primes except 1?


I have an old Windows 7 box that is used as a media centre. There are 2 partitions: C contains all the sys files, and all the data is stored on D. For some reason, the C drive has been filling up with more and more data recently, and I can't figure out why.  Here can you can clearly see that the C drive is   I then ran WinDirStat and it looks to me like there is only about .   I would expect that the usage should be much closer to 50GB, than 200GB, because that drive is only used for system files. Any ideas on how I can find out what is actually using all this space and how I can get it down?


In the context of particle physics, does time flow for a particle that is isolated and has no subsystems?


I'd like to change spacing around binary operators and this issue is discussed there:   Is there way how to change spacing in math and displaymath separately?


Lubuntu not booting without USB used to install it

My Lubuntu v12.04 (I'm not using the newest one because my Laptop doesn't support PAE) doesn't boot when the USB I used to install it isn't plugged in. I've overwritten my Windows XP with Lubuntu and the hard drive is the top priority in the boot options. I can even remove the USB while Lubuntu is running, it just needs it for booting, which is really annoying. What am I doing wrong?


This is a minor, OCD driven, request but that's never stopped me before...  After showing the vote counts for a post, I would like to re-collapse to the regular view. So far the only way I know to get this is to refresh the whole page. I think that another click on the expanded vote count should re-collapse the votes to the normal total.


I'm looking at a few "fully" funded PhD's in the UK. Now I understand it is a terrible timing with the whole Brexit travesty. But disregarding that, I'm failing to understand a few things and I hope you may be able to assist.  1) "...first-class or strong upper second-class undergraduate degree with honours (or equivalent international qualifications), as a minimum, in science or mathematics..."   What nightmarish system is this? I tried converting my Masters Degree in Science(2 years), which by the Danish system has an average at 10.93. Now according to a conversion guide I located, a 10 is 2:1 whilst an average of 12 is a first-class(Which is unrealistic to obtain by the way).  Am I right to assume an undergraduate degree would be equivalent to my bachelors in science(3 years) and won't matter? So if I only look at my masters degree average, then what am I? First class graduate or 2:1 graduate? Who determines this when applying? What about honours? This doesn't exist in my country at all. I also found something about some information about early courses counting less, than harder courses later on - where as we count everything by the ECTS system.   2) When finding fully funded PhD positions, it often says that as a non-UK citizen, a fee is applicable. However, I cannot find anything specific detailing this. I find this concept slightly difficult to grasp, as any EU citizen that comes to my university here in Denmark, and is accepted into a fully funded PhD, will have no economic expenses and will be paid very VERY well every month. Generally regarded as an employee.  I hope my questions was specific enough. I appreciate you taking your time to look it through.  Best regards.


I would like to change my account handle

Is it possible to change my account handle, username?  How do I do this if yes?


MYSQL - do not add duplicates depending on another field value

I can't get my head around the MySQL I need; I want insert a row only if the variety is unique against plant_id in the same table. My example is: id  plant_id  variety 1   1         cara 2   1         rocket 3   2         money maker 4   2         crimson crush  So.... plant_id = 1; variety = cara  - I don't want this to be added as there is already as it is duplicate on both fields. plant_id = 2; variety = cara  - I do want this to be add as there isn't record with the plant_id = 2 and a variety of cara I tried to make a composite key but this failed because neither of the fields will be unique in themselves. I'm not a SQL guru so be kind to me, but quiz me if this make no sense! :)


PHP fetching all columns after a joined mysqli query

Consider the following mysql query: SELECT a.*, b.* FROM a INNER JOIN b ON b.id = a.b_id. These two tables have identicaly named columns (id for example). I was under the assumption, that if I run this query with php, I will be able to access the fields from each returned row of the query the following way:   $sql = "SELECT a.*, b.* FROM a INNER JOIN b ON b.id = a.b_id";  $result = mysqli_query($connection, $sql);  $row = mysqli_fetch_assoc($result));  print_r($row);   My expected outcome from a similar script would need to be an array along the following lines:     array(         'a.id'        => ...,          'b.id'        => ...,          'a.b_id'  => ...      )   Instead, what I get is something like this:     array(         'id'        => ...,          'b_id'  => ...      )   If I run the same query in mysql, I get the results from both tables in the result set (so columns with overlaping names aren't retrieved only once). Is there any way to simulate the same thing with php, and still maintain using wildcard in the query?  I am well aware of why wildcard should not be used in queries, but taking into account, that I will need to use ALL columns from these two tables in my script, and we are talking about a bunch of columns, I would prefer to use it this way.


I want to start learning algebraic geometry. What introductory books do you recommend? My background in algebra includes group and basic ring theory, as well as some module theory. Do I need Galois theory?  Thanks!


3D Viewport Sidebar tab ordering, hierarchy

Is there any way to group, order, or create a hierarchy of sidebar tools, and vary these across the same 3D Viewport in more than one Workspace.  I especially focus on my plethora of tools in my 3D Viewport, but I could imagine this useful elsewhere to organize and reduce clutter. The only way I can think of is to carefully enable each add-on in order of sidebar appearance (for vertical ordering), which would require a redo when I decide to enable another add-on with sidebar. Is there at least some .ini file somewhere to be edited if blender offers no interface to order these? In the following example, I would like not only to order my DAZ tools, but to create a parent that hides/reveals all of these.   Or in another use case to group all architectural tools. It would also be nice to be able to launch a "DAZ version" of blender, and "architectural version" of blender, where the add-ons and sidebar tools appear based on session need.  Note that the Issue  shows how to sneak behind blender and edit a core python file, that only allows you to change order or remove CORE tabs -- is crude, inelegant and insufficient.


Unable to to install Heimdall on Ubuntu 18.04

The repository 'http://ppa.launchpad.net/modycz/heimdall/ubuntu bionic Release' does not have a Release file.    Just started two weeks ago on Ubuntu. real novice!


K-2SO beats up the troopers easily. Up in the sky, the bombers are preparing to attack. Just as they start the attack run, TIE fighters come in from the shield and swarm the rebel fleet.  JON VANDER (GOLD LEADER): Red Leader, this is Gold Leader, we’re starting our attack run on the  shield gate. Keep it tight and watch out for those towers. GOLD PILOT: More fighters. Form up, at 65.  What does "65" mean?


I want to make words small (like image credits), and I tried all the available edit buttons for words. How can I make regular words small?


Solving the recurrence $T(n) = \sqrt n T(\sqrt{n}) + \sqrt{n}$

A former student of mine was TA-ing an algorithms class last quarter and asked students to solve this famous recurrence relation:  $$T(n) = \sqrt n T(\sqrt{n}) + n$$  There are  and this question has already been asked here.  I was talking to my student about this problem and mentioned that it's quite hard to solve and is pretty dependent on the particular choices being made. As an example, I suggested this variant of a recurrence relation that was less simple to solve:  $$T(n) = \sqrt n T(\sqrt{n}) + \sqrt{n}$$  The TA and I tried solving this recurrence for about an hour and a half without making any progress. Here are a few things we tried:   My approach to solving the initial recurrence relation was to draw out a recursion tree and notice that each level of the tree contributes $n$ to the total and that there are $O(\log \log n)$ layers, so the recurrence solves to $O(n \log \log n)$. When I tried doing this here, I noticed that the work per layer was no longer constant; instead, the top layer sums to $\sqrt{n}$, the second layer to $n^{3/4}$, the third to $n^{7/8}$, etc. We got stuck working with the summation $n^{1/2} + n^{3/4} + n^{7/8} + ...$. We tried using the iteration method to unroll the recurrence. With the original recurrence relation, this works out nicely; here, we got stuck at the same summation given above.   I'm completely stuck trying to figure out how to solve this recurrence relation. There's nothing riding on it per se - I don't need to solve it for any particular reason - but the fact that we arrived at it by a straightforward modification of a common algorithms problem set question makes it all the more enticing.  Any idea how to solve this recurrence?  Thanks!


It'd be nice if answers which are an exact copy of an existing (possibly upvoted) answer or contain large substring of such an answer and few own text - which should be a comment on the copied answer - are hard to spot in review because only the question and the answer is displayed.  A warning that the above described similarity has been detected (by an algorithm which can be quite simple for starters) would be helpful and avoid that those unwanted answers get into the system/stay in there for long time as easy as possible.


Use the Chinese Remainder Theorem to find all solutions to the system of congruences  $$x\equiv 1\pmod 3$$ $$x\equiv3\pmod 5$$ $$x\equiv5\pmod 7$$


If G be a cyclic group of prime order p ,prove that non identity element of G is a generator of the group.  Let , a be the generator of the group . Then o(a)=p ==>a^p = e, where e be the identity element . G={a,a^2,a^3,.....,a^p(=e)}.


"Splistitem being updated was not retrieved with all taxonomy fields" in GUI?

I often get this message when I use a column that is a taxonomy field. Sometimes it works if the list is empty and I re-apply my custom created content type, but sometimes it doesn't.  Anyone have any suggestions? This happens in SharePoint GUI.  I should clarify that I get the message when I try to save an item.


I have a an Indian passport and a valid residence permit for Denmark until December 2016. I am travelling to India from Germany via British Airways. I just have a connection for 2 hours in the UK. Do I need a transit visa?


Speed of post-increment vs pre-increment operator on objects

I've read historically that pre-increment is faster/better for a variety of reasons (and also that it should be moot on modern compilers). But isn't there additional processing required for the copy process when objects come into play?  For example:  iterator iterator::operator++(    int) {    iterator copy(*this);    _index++;     return copy; }  iterator& iterator::operator++() {    _index++;     return *this; }   The pre-increment operator needs a copy operation. So simply doing this should be slower:  loop { --object }   Does the philosophy of "pre vs post" only apply to primitives?


$gcd(i,n)=1 \iff n\nmid ik$ for all $1 \leq k \leq n-1$

I am working on my homework and have come into a problem. I am relying on this fact to prove the statement:  "Let $a$ have order $n$ modulo $m$ and let $i$  denote an integer. Prove that $a^i$ has order $n$ modulo $m$ if and only if $gcd(i, n)=1$.  My intuition keeps telling me to use the division algorithm, but I can't see it.  Hints appreciated!


Question related to trigonometric identities and ratios

Prove that  $$\tan \frac{\pi}{30} \tan \frac{7\pi}{30} \tan \frac{11\pi}{30} \tan \frac{13\pi}{30}=1$$  I tried this and i was able to reduce it to $$\cot \frac{\pi}{30} \cot \frac{2\pi}{30} \cot \frac{4\pi}{30} \cot \frac{8\pi}{30}$$  but could not do it any further please tell how to do this after this :)


I have an xps model in blender with textures and then when I import to mixamo it is grey. I tried to zip the fbx with the textures but that didnt work it either stayed grey or said couldnt map existing skeleton. I tried saving the grey mixamo animation hoping it would add it back in blender but that didnt work. help?


Ubuntu tries to install onto USB (which contains ISO files) instead of computer drive

I'm trying to dual boot my Dell xps 15 with 512 gb ssd drive. I've created a boot device with a USB (Ubuntu 16.04). However, after selecting language in the installation process it says I need at least 8.5 gb disk space and that my computer only has 8.0 GB (which is the size of my USB stick I'm installing Ubuntu from). Running gparted in a live session also only shows my USB's storage, not my actual drive. Any suggestions would be helpful, thanks.


I'd like to typeset documents using the '' of page layout. Good examples are on pages 40-53 of . The  package is helpful for this, but two additional features would be useful:   Automatic flow of text across (arbitrarily placed) columns / textpos blocks. Vertical line spacing enforced to be an integer multiple of a base line spacing, even when interrupted (for example) by an equation of arbitrary height.   Any ideas as to how either or both of these could be accomplished?


Is $f(x,y(x))$ a function of two variables? If so, how is that possible?

I don't know how to interpret this function:     Let $D$ be an open subset of $\mathbb{R}^2$ with a continuous function $f:D \rightarrow \mathbb{R}$  and   \begin{align} y'(x)=f(x,y(x)) \end{align}   is a continuous, explicit first-order differential equation defined on $D$.   From $f:\mathbb{R}^2 \rightarrow \mathbb{R}$ I interpret $f$ as a two variable function, $f(x,y)$.  But here $y$ is a function of $x$, so isn't $f(x,y(x))$ a function of one variable, $f:\mathbb{R} \rightarrow \mathbb{R}$?


Is there a way to determine the respective canonical status of Tolkien's Middle-earth related works?

It is almost always difficult to determine the canonicity (if that's a word) of different works within a fictional universe, but the problems are even more complicated in regards to Tolkien's Middle-earth/Arda related material.  It is safe to say that LotR, the second edition of The Hobbit, and probably the published Silmarillion are canon.  But even the published Silmarillion is, in large part, the work of Christopher Tolkien, although to a lesser degree than it is the work of his more famous father.    When we look at the rest of the corpus, things become even more opaque.  Unfinished Tales contains different versions of the same stories.  The same is true, in even greater degree, of The History of Middle-earth.  These volumes might be considered an almost equal endeavor on the parts of Christopher and J.R.R Tolkien.    Is there a tentative canon of Tolkien's Middle-earth related works, and if not, is it possible to create one?    With such a large body of work, of varying degrees of canonicity, it would be very helpful to have something like the now-outdated levels of canon associated with the Star Wars universe, ranked by a series of letters.  Has anyone put together such a system for Tolkien's Middle-earth related works?


who to make a debounce function when I stop writing it send request to get data

I tried to make a send request after I stop writing in the search box i don't understand this part of the code  return function(...e){ // i don't understand this line and from where we get ...e         clearTimeout(timeout)         timeout=setTimeout(()=>fn.apply(this,e),time)     }   this debounce function work correctly but I don't understand why we return a function(...e) in it function debounce(fn,time){     let timeout     return function(...e){ // i don't understand this line and from where we get ...e         clearTimeout(timeout)         timeout=setTimeout(()=>fn.apply(this,e),time)     } } searchBox.addEventListener('input',debounce((e)=>{     searchTerm=e.target.value;    loadAllVideo(sortBy,searchTerm)    },500))


C++: forward a template member function call failed

Assume I have a template class TemplateClass with a template function templFcn as follows:  template <typename T> struct TemplateClass {   template <bool Bool> void templFcn(int i) { } }; void test() {   TemplateClass<float> v;   v.templFcn<true>(0);  // Compiles ok. }   Now I would like to write a forward function to emulate this behavior  template <typename T, template<typename> class C, bool Bool> void forward(C<T>& v) {   v.templFcn<Bool>(0);  // Compiler error, Line 16 (see below) };  void test2() {   TemplateClass<float> v;   forward<float,TemplateClass,true>(v);  // Line 21 }   Compiler error by clang++:  test.cc:16:5: error: reference to non-static member function must be called   v.templFcn<Bool>(0);   ~~^~~~~~~~ test.cc:21:3: note: in instantiation of function template specialization       'forward<float, TemplateClass, true>' requested here   forward<float,TemplateClass,true>(v);   ^ test.cc:3:29: note: possible target for call   template <bool Bool> void templFcn(int i) { }                         ^ 1 error generated.   Can someone explain why such template forward failed in this case? And is there any way to circumvent it? Thanks!


Printing every Nth line out of a large file into a new file

I am trying to print every Nth line out of a file with more than 300,000 records into a  new file. This has to happen every Nth record until it reaches the end of the file.


'User was deleted' removed too much of my reputation

I will get straight to the point: I lost 155 reputation because a user was removed. Now, my question isn't about why the user was deleted, it's actually about how to contact the administration to get back that reputation, as 155 reputation is a lot of reputation to be deleted/gone!   This is not a duplicate of         The answers to that do not answer my question.


Can someone explain how the square root of two negative numbers multiplied together doesn't equal a positive/negative number.

On a test I got a question asking to simplify $\sqrt{-25}\times \sqrt{-3}$ I answered $5\sqrt 3$ but apparently it's only $-5\sqrt 3$ because of some rule of imaginary numbers, could someone please explain to me why $\sqrt{-25}\times \sqrt{-3} \ne \pm 5\sqrt 3$


Is there a name based virtual host SSH reverse proxy?

I've grown quite fond of HTTP reverse proxies in our development environment and found the DNS based virtual host reverse proxy quite useful. Having only one port (and the standard one) open on the firewall makes it much easier for management.  I'd like to find something similar to do SSH connections but haven't had much luck. I'd prefer not to simply use SSH tunneling since that requires opening port ranges other than the standard. Is there anything out there that can do this?  Could HAProxy do this?


Apply positive and negative voltage to component using single power supply

I have an electromagnet and a 12V power supply. I would like to apply +12V to the electromagnet at some times and -12V at other times.  My current thought is to use four transistors (two NPN, two PNP) in a matrix (see diagram). I have two concerns:   When all four transistors are open, the "inside" leads will be floating. Is this a problem? If so, would a pulldown resistor on the "inside" sides mitigate it? Using two transistors (one each side) would be cheaper and take up less space, but I can't figure out a way to do it (even with diodes) that doesn't short out the power supply. Is there an easy way to do this (besides adding a second -12V supply)?   Thanks!


Connect Talend to Salesforce using OAuth JWT Flow

I followed the steps exactly mentioned here  for connecting Talend to salesforce.  I have done the configuration in Talend and added the test(sandbox) URL in the advanced setting. I am facing an error while trying to establish the Oauth connection (JWT) between Talend ETL tool and salesforce: {'error':'invalid_grant','error_description':'invalid assertion'} Here is the screenshot of the configuration and error message:   Please help to resolve this issue.


If a bob attached to a string is swinging in vertical circular motion, we say that the bob leaves the circular path when the tension in the string becomes zero, but even when tension becomes zero, there's always a component of the bob's weight towards the center of the circle. Why then does the bob leave the circular trajectory?


USB transceiver helps me to update firmware program to microcontroller via USB interface?

I am doing one hobby project, using STM32F103R8T6 Micro controller for my project, I would like to use USB transceiver for this micro controller,  does this helps me to update my firmware program through USB interface or do I need to have separate programmer for uploading firmware to microcontroller.


If a car is travelling faster than the speed of light, do the headlights still work?  If you can help because i really need to know i am going on a trip with my car tomorrow!


Is there a grammar rule for nouns coming from verbs?

I'd like to know if there is a grammar rule stating when the last consonant of the verb  has to be doubled.  E.g. why: "to cut" -> cutter, "to program" -> programmer, but "to read" -> reader?


Install ubuntu 20.04 in 1.5 GHz quad processor

I'm planning to install ubuntu 20.04, but in system requirements, i need to have 2 GHz dual core processor or better, and i have 1.5 GHz quad core processor, will this affect the speed run of the OS?


True contents of a directory in a *nix system

I am learning about *nix file systems. In particular, I've been following this tutorial  interspersed with some Googling & whatnot. Is the true form of a Unix directory essentially just a file that consists of (column 1) inode numbers and (column 2) a string indicating the name of the file/directory corresponding to that inode number? And then, what we see as "The files/other directories that are contained in this directory" is really just the fact that the OS prints out the list of items in the table, when you do $ ls (or otherwise browse a particular directory)? So for example is this the true format of a directory file...  if this were done in C, a file with a int inode column and a char * filename column.


Does the sequence $t_n=\sqrt{a_1+\sqrt{a_2+\cdots+\sqrt{a_n}}} (a_k>0,k=1,2,\cdots)$ converge? I need to prove that if $$ \limsup\limits_{n\to\infty} \dfrac{\ln\ln a_n}{n}<\ln 2, $$ the sequence $\{t_n\}$ converge. (When $a_n\le 1$, $\ln\ln a_n$ is defined to be $-\infty$.) I have no idea about this question. But if I consider the sequence $$ p_n^{(r)} = \sqrt[r]{a_1+\sqrt[r]{a_2+\cdots+\sqrt[r]{a_n}}}, r\in\mathbb{Z}_+$$ and in particular, when $r=1$, I have that $$ p_n^{(1)} = \sum_{k=1}^n a_k, $$ thus, if $$ \limsup\limits_{n\to\infty}\dfrac{\ln a_n}{n}<0(=\ln 1), $$ it's easy to obtain that $\{p_n^{(1)}\}$ converges. I guess there is a connection but I don't know how to  continue. Any hint?


What mathematical conjectures broke down in an unintuitive way?

Conjectures are often based on inference from a few cases.  A famous example is the Riemann Hypothesis which states that all zeros of the zeta function have real part 1/2. All the zeros that we've found on the zeta functions had real part 1/2.  In the same fashion, the abc conjecture has been verified for a lot of large cases.  Can you think of any conjecture true for a "large" number of cases but was still proved wrong?


Okay, so I want to buy a iTunes giftcard for my iPad, but I’m pretty confused. Firsthand, my iPad is from Singapore and I’m in bangladesh right now. Am I able to order a Singaporean giftcard so I can use it here? Or do I have to go to Singapore to redeem my giftcard? I know it’s a pretty stupid question but I’m genuinely confused.


On a new iPhone (not connected to the phone network), running iOS 7, date is actually set to January the 1st, 1970.  It is easy to change the date by scrolling the day.  How is it possible to enter the date and time directly,  to avoid scrolling through each day from 1970 to 2014?


Windows 7 not booting after installing Ubuntu 12.10

I have Samsung sf511 with Windows 7 Home preinstalled.  I installed Ubuntu 12.10 last night. First I downloaded ubuntu 12.10 DVD iso and burned a DVD. I rebooted and changed the boot option to DVD and let the Ubuntu DVD run. I selected "Install ubuntu alongside windows 7". In the next step I allocated the diskspace . Ubuntu installed perfectly and it ran OK.  I spent a good time exploring Ubuntu. When I restarted to start my work on Windows again and selected Windows 7 to boot, it showed blue screen after booting up (after logging in). I tried restarting several times but the same blue screen keep showing  at the same point of bootup. I also restored windows to an earlier time.  Left with no option I booted from Samsung provided windows recovery option. The recovery process ran fine but when it restarted to boot Windows for the first time all I see is a black screen. Nothing happens. It switches between dark command promt screen to a pitch black screen as if it's rebooting after every 10 seconds or so.  The laptop can be booted from the DVD Drive or USB drive but is not booting from Harddisk.  What should I do in order to use both Windows 7 and Ubuntu?


how to get the timestamp with current date and microseconds in Node.js?

Is there a way to get the complete timestamp(including date, hour of the day, min, microseconds and timezone) in Node.js?  I am using node version 4.3.0.


Do you need to erase the memory of *watching* a memory in a Pensieve?

You remove your memory from your brain to store in a Pensieve (as Snape or Dumbledore did). Then, you re-watch the memory (e.g. as Dumbledore re-watched his memories of Voldemort's investigations with Harry) in the Pensieve.   Does that mean that you now re-created the memory in your brain (because you remember watching it) and thus you'll need to extract/erase it from your brain again if you don't wish to keep it there for security/capacity reasons (which was why you stored it in the Pensieve in the first place?  Canon answers only please.


Doesn't the 'Avis' charm indirectly violate the Gamp's law of Elemental Transfiguration?

‘Yeah, well, food’s one of the five exceptions to Gamp’s Law of Elemental Transfiguration,’ said Ron, to general astonishment.   Now Avis is a charm that creates a flock of birds. Isn't it possible to create the birds, and cook them to get food? Isn't this an indirect violation of the Gamp's Law of Elemental Transfiguration?


How to configure NTP time synchronization on a server?

I would like to configure my Ubuntu 12.04 server to synchronize its clock with a specific NTP server. Where to set this up?


Android: Checking for null, still get NullPointerException

I have no clue what's happening, so I will have to ask this here.  I have an Activity that returns a location as LatLng. I then check if it's null before I pass it to my moveCamera() method that's supposed to show it on a map.   if(location != null) {         mapActivity.moveCamera(location);     }else{         Toast.makeText(MainActivity.this, "Couldn't determine location",  Toast.LENGTH_SHORT).show();     }   But although I check for null, when i run it, i get:   java.lang.NullPointerException: Attempt to invoke virtual method 'void de.ratchetcoding.theotherside.MapsActivity.moveCamera(com.google.android.gms.maps.model.LatLng)' on a null object   Any help is appreciated. If you need the source code tell me, I can upload it to github.


How to process off-topic discussions in comments

Just going through my usual  until I saw  in the comments:    20 comments, of which maybe 2 are on-topic, are arguing about the ethics of voting to balance or the validity of the answer.  So far, I've  2 of comments as "not constructive", but it would be extremely tedious to flag every single one of them (including the 5-second cooldown).  Question: As a <1k user, what should/can I do about extended discussions in comments?


Solutions of this set of linear congruences using Chinese Remainder Theorem?

Suppose m1, m2, ..., mk are positive integers > 1, not necessarily pairwise relatively prime. Also Suppose a1, a2, ..., ak ∈ Z. What can be said about the solutions of the following set of linear congruence equations? x ≡ a1 (mod m1), x ≡ a2 (mod m2), x ≡ a3 (mod m3), ..., x ≡ ak (mod mk).


Linux equivalent command for "open" command on Mac/Windows?

Coming from Mac OS X, you can type:  $ open yourfilehere.txt   and your file will open just as if you had opened it from Finder.  On Windows, one can type:  > start yourfilehere.txt   and it will open just as if you had opened it from Explorer.  On Ubuntu, I'd like to be able to open files in the same manner in GNOME. What's the command?


Windows 10 Logging When A Window Opens or Closes

I've noticed a window that pops open and then immediately closes at random on my Windows 10 system. I haven't been able to figure out yet how to figure out what is causing that. My malware scans haven't turned anything up yet.  I've tried using the Event Viewer however the search fails to run for events that happen in the specified time period. Apparently the query is too long. How can I go about logging what processes open/close or what windows are created?  Thanks!


Prove $$\csc(x)=\sum_{k=-\infty}^{\infty}\frac{(-1)^k}{x+k\pi}$$   Hardy uses this fact without proof in a monograph on different ways to evaluate $\int_0^{\infty}\frac{\sin(x)}{x} dx$.


"Failed to start lvm2.service: Unit lvm2.service is masked"

I am following  on Lubuntu 18.04  I was wondering why I get the following problems. Thanks.  $ sudo apt-get install system-config-lvm Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package system-config-lvm  $ sudo service lvm2 start Failed to start lvm2.service: Unit lvm2.service is masked.   I still can't get it right.  $ sudo systemctl mask lvm2  Created symlink /etc/systemd/system/lvm2.service → /dev/null.  $ sudo systemctl enable lvm2  Synchronizing state of lvm2.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable lvm2 Failed to enable unit: Unit file /etc/systemd/system/lvm2.service is masked.  $ sudo systemctl unmask lvm2  Removed /etc/systemd/system/lvm2.service.  $ sudo systemctl enable lvm2  Synchronizing state of lvm2.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable lvm2 Failed to enable unit: Unit file /lib/systemd/system/lvm2.service is masked.  $ sudo service lvm2 start Failed to start lvm2.service: Unit lvm2.service is masked.


Are there any massless (zero invariant mass) particles carrying electric charge?  If not, why not? Do we expect to see any or are they a theoretical impossibility?


Anyone know what kind of unicode is this with &# and semicolon please? how to turn it into chinese characters string in Python please?

I have these symbols which I am quite sure they are chinese characters.  &#26053;&#34892;&#26178;&#65292;&#25105;&#29983;&#30149;   Please anyone know what kind of unicode is this with &# and semicolon please? And how can I turn it into chinese characters string or normal unicode in Python please?


Blending two overlapping DEMs using ArcMap

I have two point clouds with X,Y,Z which have been converted to DEM's. One is more accurate than the other. The point at which they overlap (just a 100m strip) however is very uneven. Is there a way I can make it blend better, I have tried using focal stats but it still isn't enough. Is there any other method I could use? Here's a picture of the "unblended" DEM merged. I am wanting a better blend


I've come across a strange problem with datatool. If the first character of the first column of a row is immediately followed by a space, that space gets gobbled somehow.  Am I doing something wrong or is this a bug?  \begin{filecontents}{\jobname.csv} Sentence1,Sentence2,Sentence3 The child played a new game.,He played it three times with his friends.,He loved the game. I visited my childhood home last week.,It's just as I remembered it.,My house has always been white. It's just as I remembered it.,I visited my childhood home last week.,My house has always been white. \end{filecontents} \documentclass{article} \usepackage{datatool} \DTLloaddb{sentences}{\jobname.csv} \begin{document} \DTLforeach{sentences}{% \sOne=Sentence1,\sTwo=Sentence2,\sThree=Sentence3} {% \sOne\par \sTwo\par \sThree\par } \end{document}   Here's the output.  Notice that the  sentence in column 1 of the CSV file (marked with the red arrow) has the gobbled space, but the exact same sentence in column 2 (marked with the blue arrow) doesn't have the space gobbled.


Let $G$ be a group and $g_{1},g_{2} \in G$, then if  $g_{1}g_{2}$ has finite order then we have to prove that $g_{2}g_{1}$ also has finite order too.  I have proved like this-   If $g_{1}g_{2}$ has finite order that means there exists positive integer $n$ such that $(g_{1}g_{2})^n = e$, now we rewrite the equation in a clever way.  $(g_{1}g_{2})^n = e$  $(g_{1}g_{2})(g_{1}g_{2})(g_{1}g_{2})...(g_{1}g_{2})= e$  $g_{1}(g_{2}g_{1})^{n-1} g_{2} = e$  $(g_{2}g_{1})^{n-1} = g_{1}^{-1}g_{2}^{-1}$  Multiplying $g_{2}g_{1}$ on both sides from the left hand side, we get -   $(g_{2}g_{1})^n = g_{2}g_{1}g_{1}^{-1}g_{2}^{-1} = e$  Implying that the element $g_{2}g_{1}$ has finite order too.  Now I am thinking of another approach, that is through homomorphism -   That is can we find a homomorphism between the two  -  Say $\phi$, that is $\phi(g_{1}g_{2}) = g_{2}g_{1}$, which would mean that $\phi(g_{1}) \phi(g_{2}) = g_{2} g_{1}$.  Any candidate for $\phi$, as if I can find a homomorphism then the order of both the elements will be same.


Using Tasker to know if I'm at work for more than a minute

I use Tasker's Wifi Near option to activate some tasks in my phone when I arrive at my workplace. My problem is that sometimes I pass by my workplace, with no intention of entering, and the tasks get activated.  Is there a way to make Tasker activate the tasks IF I've been near my workplace's wifi spots for more than a minute?


Every differentiable function $f:R \rightarrow R$ with the property that $(2h)f′(x) =f(x+h)−f(x−h)$ for all $x \in R$ and all $h$ has the form $f(x) =ax^2+bx+c$.  I would like to get some help on this one. Taking partial derivatives was an idea, but is that legal?


I have a error Exception in thread "main" java.lang.NullPointerException when I connect SQL Server and Check User in table

I am having a problem at a Java program. Exception in thread "main" java.lang.NullPointerException  Exception in thread "main" java.lang.NullPointerException     at DBOperation.DBOperation.checkLogin(DBOperation.java:30)     at DBOperation.DBOperation.main(DBOperation.java:82)   who can help me find error? how to fix them? (Please note that the code is still complete and I have entered some print statements for checking)  My code:   package DBOperation;  import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.*; public class DBOperation {     private String url;     private String serverName;     private String dbName;     private String usr;     private String pwd;     private Connection cnn;          public boolean checkLogin(String user, String pass) {         boolean tmp = false;         Statement stm = null;         ResultSet rs = null;          try {             stm = cnn.createStatement();             rs = stm.executeQuery("Select *from ListUser where username = '"+user+"' and password = '"+pass+"'");             if(rs.next())                 return tmp = true;         } catch (SQLException e) {             // TODO Auto-generated catch block             e.printStackTrace();         }finally{             try {                 rs.close();                 stm.close();             } catch (SQLException e) {                 // TODO Auto-generated catch block                 e.printStackTrace();             }          }         return tmp;     }      public DBOperation() {          this.url = "jdbc:sqlserver://";         this.serverName = "localhost";         this.dbName = "sharefile";         this.usr = "sa";         this.pwd = "123456";     }     @SuppressWarnings("finally")     public Connection getMyCon()     {         Connection cn = null;         try {             Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");             try {                 cn = DriverManager.getConnection(getMyUrl(),usr,pwd);                 if(cn!=null)                 {                     System.out.println("Ket noi thanh cong");                 }                 else{                     System.out.println("Ket noi khong thanh cong");                 }             } catch (SQLException e) {                 // TODO Auto-generated catch block                 e.printStackTrace();             }         } catch (ClassNotFoundException e) {             // TODO Auto-generated catch block             e.printStackTrace();         }finally{         return cn;         }     }     private String getMyUrl() {         // TODO Auto-generated method stub         return url+serverName+"; databaseName="+dbName;     }     public static void main(String[] args) {         DBOperation objDB = new DBOperation();         objDB.getMyCon();         objDB.checkLogin("teri", "123456");      }   }


Why the extraterrestrial solar spectrum is higher than blackbody spectrum?

I am reading "Radiation Heat Transfer by Michael F. Modest(2003)" and the author talks about how the solar spectrum can be approximated by black body radiation at 5777K. I'm finding the plot to be confusing, as I'm unable to find an explanation for the higher extraterrestrial solar spectrum in the visible range as compared to black body radiation. Can someone help me out?


Security best practices for mysqli connection in PHP

I am developing a little website project for a cybersecurity course. What is the best practice for utilizing mysqli_real_connect on a PHP document? Is writing the db credentials directly as arguments of the function a good way to go or should I pass them in a different way? P.S. The user can't see the source code, but I am trying to see if there are security aspects which I am overlooking.


Windows: Disable folder type detection in explorer globally

In Windows Explorer (Win7-10) the folder's type is detected automatically by the files in it (e.g., music). I can disable this on folder base manually in the properties of each folder (and its subfolder). But this creates a lot of desktop.ini files.  Is there a way to disable the folder type detection on a system based level - like "Windows should never detect the folder types on its own and should always use the plain file view"?


If the number of functions from $A \to B$ is equal to $A$, then the cardinality of A and B is $1$.   In set theory notation: If $|B|^{|A|}=|A|$ then $|A|=|B|=1$.  Any ideas? I was think of assuming $|A|$ or $|B| \neq 1$ but can't think of anything I can do after/


Let $x_1 = a, x_{n+1} = \sqrt{5 + x_n}$. Then      A. there exists $a \geq 0 $ such that sequence $x_n$ is unbounded.      B. for any $a \geq 0 $ sequence has a limit   The answer is supposed to be B, but I believe that it's wrong, i.e. the correct answer is A. The easiest way to see this is to look on the figure of intersection of $y=x$ and $y = \sqrt{5+x}$. Start at any point to the right of the intersection, and you'll go to infinity.  My question: am I right, or did I miss something?


What voltage is a 3-LED light from a LED-TV?

I have some "NDV rev1.1 4248 back lights" from a television.   There is a print that sais "94V" on the strip, and on the wire supplying the strips it said "96V".   Every strip has 9x buttons which have 3 LED's in them. So i devided 94 by 9 and figured that every button should have 10.4V roughly, which makes sense, because a white LED is normally 3.5 volts.  I have a 12v Lithium battery which measured 11.1V so i tested one of the LED's with it and it lasted less than one second.   Are the LED's are rated for 10.4V roughly and not more?


Can't get the formula to autofill correctly

In Excel I entered two formulas manually:   B3 = C3 * C2   B4 = C4 * C2   I have a lot of rows so I wanna copy the formula down. The problem is, I select them both and then pull down.  What happens is I instead get:  B5 = C5 * C4 (but the C4 should be C2).  Why doesn't Excel understand this even though I made the two first formulas manually?


A key doubt about the resultant of two polynomials and their common zero locus

I am studying algebraic geometry following Harris. To prove that the projection of a variety $X\subset\mathbb{P}^n$ on an hyperplane $H\cong\mathbb{P}^{n-1}$ is a projective variety, the notion of resultant of two polynomials is used there. In particular let us fix:    $F,G\in K[x_0,...,x_n]\cong K[x_0,...,x_{n-1}][x_n]$  $p=[0:0:...:1]\in\mathbb{P}^n$, $q\in H$, $H\cong\mathbb{P}^{n-1}=V(x_n)$   Now it is clear to me that the resultant  $R(F,G)(q)=0$ iff $F[q](x_n), G[q](x_n)$, the polynomials in $x_n$ resulting from the evaluation of $x_1,...,x_{n-1}$ in the coordinates of $q$, have a common zero or the leading coefficient of $F$ or $G$ vanishes in $q$, as a polynomial of $K[x_0,...,x_{n-1}]$.  What is not clear is why this is the case if and only if $F,G$ have a common zero on the line $l=\bar{pq}$.   Thanks in  advance for help.  P.s. these are the two pages where Harris succintly adresses the problem.


Methods to prove $\frac{21n + 4}{14n + 3}$ is irreducible for every natural number $n$

Prove $\frac{21n + 4}{14n + 3}$ is irreducible for every natural number $n$.  I was thinking of taking a number-theory based approach.  Can you suggest the following method  Calculus/Number theory based methods? Please take a look at my attempt here.   Assume $\frac{21n + 4}{14n + 3}$ is reducible so we can apply modular arithmethic, considering the numerator and denominator seperately.  Ideas here,  $21n + 4 \equiv 4 (\mod 7)$ $14n + 3 \equiv 3 (\mod 7)$  $35n + 7 \equiv 7 (\mod 7)$  Taking the LHS separately, $35n + 7 (\mod 7) \equiv DNE$ there is no residue since there is no remainder.   Therefore, by contradiction, it is true?  Thanks!


SSH failed to start - Missing privilege separation directory: /var/run/sshd

I have a VPS running Ubuntu 16.04.5 that's been going for a number of years now with little issue. Today, however, I found I was unable to access the server using SSH, receiving 'connection refused' errors. I accessed the server using my VPS host's serial console service, and traced the issue down to openssh server failing to start. Here's an output of service status, service start, and sshd -t following a fresh reboot:  root@167:/# service ssh status ● ssh.service - OpenBSD Secure Shell server    Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)    Active: failed (Result: start-limit-hit) since Fri 2019-01-18 04:56:42 EST; 24min ago   Process: 983 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=255)  Jan 18 04:56:42 167 systemd[1]: Failed to start OpenBSD Secure Shell server. Jan 18 04:56:42 167 systemd[1]: ssh.service: Unit entered failed state. Jan 18 04:56:42 167 systemd[1]: ssh.service: Failed with result 'exit-code'. Jan 18 04:56:42 167 systemd[1]: ssh.service: Service hold-off time over, scheduling restart. Jan 18 04:56:42 167 systemd[1]: Stopped OpenBSD Secure Shell server. Jan 18 04:56:42 167 systemd[1]: ssh.service: Start request repeated too quickly. Jan 18 04:56:42 167 systemd[1]: Failed to start OpenBSD Secure Shell server. Jan 18 04:56:42 167 systemd[1]: ssh.service: Unit entered failed state. Jan 18 04:56:42 167 systemd[1]: ssh.service: Failed with result 'start-limit-hit'. root@167:/# service ssh start Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details. root@167:/# sshd -t Missing privilege separation directory: /var/run/sshd   I've attempted some research into this, but nothing that's come up seems to have an actual solution - Just endless cycles of 'I have this problem' with no answers, answers that are outdated, or just generally unhelpful information.  Does anybody have any ideas on what to do next to troubleshoot/resolve this issue? SSH was last working about 12 hours ago when I logged in to run updates and rebooted the server.  UPDATE  Issue was resolved using workaround 1 as provided here:


uninstaling ubuntu and keeping windows7 working

I am new to Ubuntu and having a GRUB issue. I installed Ubuntu on my PC with Windows 7 successfully. During boot, GRUB gave me the opportunity to select which OS to use. I tried to copy Windows 7 to another partition. This worked and I could see two Windows choices during the boot process. I ran the Ubuntu installation again and reinstalled the Ubuntu (by mistake) and now my GRUB OS Selection screen start shows two Ubuntu and two Windows boot options. How do I fix GRUB so that I see only one Windows OS choice and one Ubuntu OS choice during the boot process?


Get exit status of process that's piped to another

I have two processes foo and bar, connected with a pipe:  $ foo | bar   bar always exits 0; I'm interested in the exit code of foo. Is there any way to get at it?


I have a DEM built from LiDAR data and the file extension is .tif. When I open this file in ArcMap it seems to be a shaded relief DEM (see the screenshot below).  It happens I want to visualize the DEM colored by elevation. How should I proceed?


Prove that the limit of two consecutive fibonacci numbers EXISTS.

Using the definition of Fibonacci numbers, $F_n=F_{n-1}+F_{n-2}$, I can prove that the limit of $\frac{F_{n+1}}{F_n}$ as $n\to\infty$ is $\phi$ if we assume that the limit exists.  How can we prove that the limit does in fact exist?  Is there more than one method?    I do not think this is a duplicate. Please can someone explicitly show how to split the odd and even terms of this ratio sequence into two sequences- one monotonic increasing and one monotonic decreasing- and given that all ratios are between 1 and 2, show that the limit exists and we do not oscillate forever.    Most of the question has been answered.  I have shown that there are two subsequences- one increasing and bounded above by 2 and one decreasing, bounded below by 1. Using the fact that the limit exists, I can show it has value $\phi$. But how can I show the limit is the same for both subsequences?!


If you have algebraic numbers $x$ and $y$, and you know the polynomials of least degree of which each is a solution (written as a vectors of coefficients), then how is the vector of coefficients of the polynomial of least degree of which $x y$ is a solution found; and likewise for $x+y$?


Intersection of straight line and circle

Why does this example only partially work?  \documentclass{minimal} \usepackage{etex} \usepackage{tikz} \usetikzlibrary{shapes,calc,arrows,trees,positioning,through,intersections,fadings} \begin{document}     \begin{tikzpicture}[scale=0.5] \coordinate (a) at (0,0); \coordinate (b) at (6,0); \coordinate (c) at (9,6); \node(A)[label=$A$] at (a) {$\bullet$}; \node(B)[label=50:$B$] at (b)  {$\bullet$}; \node(C)[label=$C$] at (c) {$\bullet$}; \draw[thick] (a)--(b)--(c)--cycle; %           \node(c1) at (a)[draw,circle through=(b)] {}; %           \coordinate(ac) at(intersection 1 of c1 and a--c); %            %           \node(c2) at (ac)[draw,circle through=(b)] {}; %           \node(c3) at (b)[draw,circle through=(ac)] {}; %           \coordinate(bta) at(intersection 1 of c2 and c3 ); %           \node(xx)[label=$C$] at (bta) {$\bullet$}; %       \coordinate(bisa) at(intersection 1 of a--bta and b--c); %       \draw (a)--(bisa); %%%%%%%%%%%%%%%%%%%%%%%%%%% work %%%%%%%%%%%%%%%%%%         \node(c4) at (b)[draw,circle through=(a)] {};             \coordinate(bc) at(intersection 1 of c4 and b--c);             \node(xx)[label=$prova$] at (bc) {$\bullet$};             \node(c5) at (bc)[draw,circle through=(a)] {};             \node(c6) at (a)[draw,circle through=(bc)] {};             \coordinate(btb) at(intersection 1 of c5 and c6 );         \node(xx)[label=$prova$] at (btb) {$\bullet$};         \coordinate(bisb) at(intersection 1 of b--btb and a--c);         \draw (b)--(bisb); %%%%%%%%%%%%%%%%%%%%%%%%%%% work %%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% it doesn't work%%%%%%%%%%%%%%%%%% \node(c7) at (c)[draw,circle through=(b)] {}; \coordinate(ac) at(intersection 2 of c7 and a--c); \node(xx)[label=$prova2$] at (ac) {$\bullet$}; %%%%%%%%%%%%%%%%%%%%%%%%%%% it doesn't work %%%%%%%%%%%%%%%%%%  \end{tikzpicture} \end{document}


Setspace package and vertical distance between footer and text

When I use the setspace package, then the vertical distance from the text to the page number changes. This happens only on the page with a section title. After this page, the distance between the footer and text normalises. Does someone know how to fix the vertical distance?    I'm using the following code:  You've to insert text for two pages after noindent.  \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage[left=1.00in, right=1.00in, top=1.00in, bottom=1.00in, footskip=0.5in]{geometry} \usepackage[onehalfspacing]{setspace}  \usepackage{fancyhdr} \pagestyle{fancy} \fancyhead[C]{\itshape\nouppercase\leftmark} \fancyhead[R]{} \fancyhead[L]{} \renewcommand{\headrulewidth}{0pt}  \begin{document}  \pagenumbering{arabic}  \section{}      \subsection{}          \noindent   \end{document}


You are standing still in a vacuum, and you throw a ball that moves 10 m/s away from you.  Now you start moving in one direction at 5 m/s, and throw the ball in the other direction, away from the direction you are moving.  The ball, relative to you, is going 10 m/s, but relative to an unmoving body, it is traveling 5 m/s.  My question is: is this same concept applied to light?  If a light source is traveling away from you at a speed greater than that of light, would you be unable to see it?  Or would light just keep going the same speed relative to an unmoving body?


Is my proof correct? Prove: $a_n \leq b_n \implies \limsup a_n \leq \limsup b_n$  Proof:  Let $a_n$ and $b_n$ be sequences such that $a_n \leq b_n \forall_n$. Suppose $\limsup a_n \nleq \limsup b_n$.   That is: $\limsup a_n > \limsup b_n$. From this we know:  $\forall_{\epsilon > 0} \exists_N \forall_{n>N} \implies |b_n - b| <\epsilon$. Where $b$ is the $\limsup b_n$.  $\forall_{\epsilon_1 > 0} \exists_{N_1} \forall_{n > N_1} \implies |a_n - a| < \epsilon_1$. Where $a$ is the $\limsup a_n$  So, let $a^* = a + \dfrac{\epsilon_1}{2}$ and let $b^* = b - \dfrac{\epsilon}{2}$.  Hence, $a^* \in |a_n - a| <\epsilon_1$ and $b^* \in |b_n - b| < \epsilon$. And clearly we see that $b^* < a^*$.Thus, we have found an element of $b_n$ namely $b^* < a^*$ an element of $a$. This is contradiction since we are given $a_n \leq b_n \forall_n$.   Therefore, the supposition is false, and $\limsup a_n \leq \limsup b_n$.


Mavericks upgrade screwed up my pdflatex (command not found)

so everything was working fine ... until i upgraded to os x mavericks (version 10.9.2) a couple days ago.  using   emacs version 24.3 (9.0) auctex version 11.87.3   after upgrade, tried to compile and got:  Running `LaTeX' on `test' with ``pdflatex  -interaction=nonstopmode "\input" test.tex'' /bin/sh: pdflatex: command not found  LaTeX exited abnormally with code 127 at Wed Mar  5 09:45:28   where did my pdflatex go? what is the fix?


What do you do when a spell or something says that the target needs to do a saving throw without a number for the throw?

For command, it states, "The target must succeed on a Wisdom saving throw or follow the command on its next turn" without any context to how high the target needs to roll for it to succeed. What does the target need to roll to succeed that saving throw? Is the number specific for command or is it the same for all spells like this? I'd like to get all the info I can for this.


how to use delegates correctly in multi thread application

I am trying to show a message box on top of my form and get the result. I am using backgroundworker and in my dowork function, I am calling below function. I used delegates based on my past experience for show the message box but I am not sure what is wrong it is giving me below error.     e.Message = "Cross-thread operation not valid: Control 'Form1'   accessed from a thread other than the thread it was created on."   Would you mind check why I am getting above error even after using delegates?          public delegate DialogResult Del(Form1 fr,string text, string title, MessageBoxButtons mbb, MessageBoxIcon mbi);          public static DialogResult showMessageBox(Form1 fr, string text, string title, MessageBoxButtons mbb, MessageBoxIcon mbi)         {             return MessageBox.Show(fr, text, title, mbb, mbi);         }      public static OutputEventArgs execSync(string exe, string arguments, string standardInput,Form1 fr)         {             OutputEventArgs oea = new OutputEventArgs();             try             {                 using (Process myProcess = new Process())                 {                     ProcessStartInfo startInfo = new ProcessStartInfo();                     startInfo.WindowStyle = ProcessWindowStyle.Hidden;                     startInfo.RedirectStandardOutput = true;                     startInfo.RedirectStandardError = true;                     startInfo.RedirectStandardInput = true;                     startInfo.UseShellExecute = false;                     startInfo.CreateNoWindow = true;                      startInfo.FileName = exe;                     startInfo.Arguments = arguments;                     myProcess.StartInfo = startInfo;                      myProcess.Start();                     string line = string.Empty;                      while (!myProcess.StandardOutput.EndOfStream)                     {                         line = myProcess.StandardOutput.ReadLine();                         if (line.Contains("is already defined in archive"))                         {                             Del handler = new Del(showMessageBox);                              DialogResult dialogResult = handler(fr, "Do you want overwrite the version label?", "OverWrite",MessageBoxButtons.YesNo,MessageBoxIcon.Question);                             if(dialogResult == DialogResult.Yes)                                 myProcess.StandardInput.WriteLine("y");                             else                                 myProcess.StandardInput.WriteLine("n");                         }                      }                      oea.Data = line;                      myProcess.WaitForExit();                     oea.exitCode = myProcess.ExitCode;                 }             }             catch (Exception e)             {                 oea.Data = e.Message;                 oea.ExceptionHappened();             }             return oea;         }


Terraria Mobile - What to do after I have a full set of Crimson tools + Armor

Unfortunately, there is one thing that I do not know; I've broken all the crimson orbs I can find, I have a full set of Crimson armor and tools, but I don't know what to do next. I've beaten Skeletron, the eye of Cthuhulu, the brain of Cthuhulu, Goblin Army. I've maxed out my health, and I have quite a few useful offhand items.


I'm a first year engineering student who is new to physics, so I apologize if my question is stupid. But in our statics course we are using the book "Engineering mechanics: statics" by R.C. Hibbeler and it contains the following image:       The astronaut is weightless, for all practical purposes, since she is far removed from the gravitational field of the earth.   Now this conflicts with my previous understanding of weightlessness. I always assumed it was because astronauts are orbiting the earth. But if it's because they are far away from the earth, why would spacecraft spend so much energy to accelerate to such large speeds if it's not really necessary to "stay afloat"?


Is there a way to restore an uninstalled executable from bin?

I tried upgrading pip3 using su -c 'pip3 install' --upgrade pip' because I got errors and it failed when trying to upgrade it as a normal user.  This removed the pre-installed pip from /usr/bin and dumped it in /tmp, replacing it with a system wide installation of pip which is only accessible by root. I haven't tried to uninstall this new pip because I suspect it would lead to more problems.  Since I still have the old pre-installed pip in /tmp, how do I get back the pre-installed pip using this executable that is still in /tmp?  Location of pip in /tmp:  /tmp/pip-ufkfr3th-uninstall └── usr     └── bin         └── pip


I've got this object which started as an SVG file.  I've used solidify and bevel on the curve but it will not bevel no matter what I do. So I converted it into a mesh.  I've converted tris to quads.  I still can't get the edge to bevel. What can I do? BLEND FILE:


Shell: mutual piping of STDIN/STDOUT of two commands

When we run this with a POSIX shell,  $ cmd0 | cmd1   STDOUT of cmd0 is piped to STDIN of cmd1.  Q: On top of this, how can I also pipe STDOUT of cmd1 to STDIN of cmd0?  Is it mandatory to use redirect from/into a named pipe (FIFO) ? I don't like named pipes very much because they occupy some filesystem paths and I need to worry about name collisions. Or do I have to call pipe(2) via C, Python or some general purpose programming languages?  (Both cmd0 and cmd1 do some network I/O, so they won't block each other forever.)


We are a family of 13 travelling from Mumbai to Istanbul via Frankfurt and return in the same direction. we have 4 hours layover each way, do we need a transit visa for Germany?


I am getting a value as 9999912499 from the database. I have separated it in two parts 99999 and 12499 using substring. Now I want to check whether if the 1st string is equal to 99999 then i do some processing otherwise something other processing. But controls never gets in to the if loop   Following is a snapshot:  String strPscId = Long.toString(pscID); String convPscID = strPscId.substring(5, strPscId.length()); String checkNine = strPscId.substring(0,5); BigDecimal jpaIdObj = jeuParam.getJpaIdObj(); Long mod_id  = modele.getModId();  log.info("outstrPscId == " +strPscId); log.info("outconvPscID == " +convPscID); log.info("outcheckNine == " +checkNine); log.info("outjpaIdObj == " +jpaIdObj); log.info("outmod_id == " +mod_id);  if(checkNine == "99999") { <method-call> } else { <another - method - call> }


I'm using Python Keras package for neural network. This is the . Is batch_size equals to number of test samples? From Wikipedia we have  information:     However, in other cases, evaluating the sum-gradient may require   expensive evaluations of the gradients from all summand functions.   When the training set is enormous and no simple formulas exist,   evaluating the sums of gradients becomes very expensive, because   evaluating the gradient requires evaluating all the summand functions'   gradients. To economize on the computational cost at every iteration,   stochastic gradient descent samples a subset of summand functions at   every step. This is very effective in the case of large-scale machine   learning problems.   Above information is describing test data? Is this same as batch_size in keras (Number of samples per gradient update)?


sanitizing inputs with prepared PDO statements explanation

So I realize there are some similar post to this, but I found the explanations were not detailed enough so I will word the question more specifically; and also this post is specifically about prepared statements. I believe this is constructive to the forum, and so should hopefully be within the guidelines.  So my general question is: How to prepared statements using the PDO library prevent SQL injection.  The following website has some good examples   try {   $pdo = new PDO('mysql:host=localhost;dbname=someDatabase', $username, $password);   $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);    $stmt = $pdo->prepare('INSERT INTO someTable VALUES(:name)');   $stmt->execute(array(     ':name' => 'Justin'   ));    # Affected Rows?   echo $stmt->rowCount(); // 1 } catch(PDOException $e) {   echo 'Error: ' . $e->getMessage();   According to a similar post responded to by user ExtPro () "Using PDO you can seperate the SQL and passed parameters using prepared statements, this removes the need to escape strings, as because the two are held seperately then combined at execution, the parameters are automatically handled as stings, from the above source:"  Now this I am sure is perfectly valid answer, but to me this does not explain it. How can a insert query possibly be made without allowing whatever is in the :name variable to be allowed into the database; and if the contents of that variable is malicious sql code, then I don't see how this is sanitized.  Thanks.


Would anyone can help me how to show that a finitely generated projective module over a local ring and PID are free?    What I know about a finitely generated projective module $M$ over a PID $R$ is isomorphic to $R^k\oplus R/(a_1)\oplus\dots\oplus R/(a_n)$, and for the local ring case I don't know how to start.


How to learn how much you type in a day?

Do you know of any software or script that helps you measure how much you type in a day, in terms of keys pressed? Maybe even do a bit of pattern analysis on those keys, etc. I'm interested on a solution that works on Windows and all keyboards, or as many keyboards as possible.  Appreciate any suggestions you might have.


Swift 4 can't decode properly if json data contain new line ("\n"). What i can do for this case. Please take a look of my sample code :  var userData = """ [  {   "userId": 1,  "id": 1,  "title": "Title \n with newline",  "completed": false  } ] """.data(using: .utf8)  struct User: Codable{ var userId: Int var id: Int var title: String var completed: Bool  }  do { //here dataResponse received from a network request let decoder = JSONDecoder() let model = try decoder.decode([User].self, from:userData!) //Decode JSON Response Data     print(model) } catch let parsingError {     print("Error", parsingError) }   If i change the userData value as like below that time it can decode properly.  var userData = """ [      {       "userId": 1,      "id": 1,      "title": "Title \\n with newline",      "completed": false      } ] """.data(using: .utf8)


How to extract/inject ID3 tags via bash?

I have a huge collection of MP3 files that have ID3 metadata. Is it possible to extract existing tags and images to plain text (e.g. JSON, XML)? Can I inject from plain text to MP3 file? How can I do that only via-command-line


We were targeted earlier today by a DDoS attack. There was 20x as many connections as normal on our load balancer (HAProxy), and all the backend nodes continued to go down during this attack.  System structure: HAProxy > Squid > Apache (for ModSecurity) > IIS app layer.   During the attack, I noticed that there was a MaxClients Reached error in Apache, so I bumped the setting from 150 to 250, and it seemed to help to some extent. However, it seemed that I had to keep restarting Apache manually in order for the backends to recover. The attack lasted for about 50 minutes.  After the attack began to subside, a final Apache restart on each node brought us into the green, but now I'm looking into why it occurred in the first place. In the error logs in Apache, I see a lot of these:  [Wed Jun 22 11:46:12 2011] [error] [client 10.x.x.x] proxy: Error reading from remote server returned by /favicon.ico [Wed Jun 22 11:46:13 2011] [error] [client 10.x.x.x] (70007)The timeout specified has expired: proxy: error reading status line from remote server www.example.com   Apache is using default keep-alive settings (keep-alives are enabled and timeout is set to 15 seconds). After doing some additional reading on HAProxy + keep-alives, is it a reasonable conclusion to believe that the DDoS was worsened by keep-alives being enabled?  While the HAProxy max connections are way below the maximums set in Apache, perhaps with the 20x connections too many connections were being opened in the ol' DOS fashion, but then Apache was keeping them open.


itemize inside a node breaks when no text width is given

The following code breaks with ! LaTeX Error: Something's wrong--perhaps a missing \item.  \documentclass{article}  \usepackage{tikz}  \begin{document} \begin{tikzpicture}      \node {%         \begin{itemize}             \item{Won't work}          \end{itemize}}; \end{tikzpicture}  \end{document}    But this compiles just fine:  \documentclass{article}  \usepackage{tikz}  \begin{document} \begin{tikzpicture}      \node[text width=2cm] {%         \begin{itemize}             \item{Works}          \end{itemize}}; \end{tikzpicture}  \end{document}    Is this a limitation of TikZ in general or am I on an older version?


How to view the system console message after Blender crashes?

I am testing a script in Blender game engine. I can view the helpful message on the external system console when the script throws exception. Sometimes the bugs of the script cause the Blender to crash and close the console immediately.    Is there any way to view the message after the Blender crashes? How to write the message to a text file for later viewing? Any suggestion?


How to build large multiplexers using SystemVerilog?

Note: This question about multiplexers is similar to but not identical to  which is about demultiplexers. I want to build a fully parameterisable multiplexer in SystemVerilog. So far, I know how to build multiplexers of variable widths like this: module scale_mux #(parameter WIDTH = 1) (   input logic sel_a,         logic [WIDTH-1:0] in_a,                     in_b,   output logic [WIDTH-1:0] out);    always_comb     unique case (sel_a)       1'b1 : out = in_a;       1'b0 : out = in_b;     default: out = 1'bx;     endcase  endmodule  I also know how to extend this for 4:1 and 8:1 multiplexers. But the number of case statements for large multiplexers will be a lot. I'd like to build a multiplexer in which the number of inputs is variable. I'm not sure how I can extend this case statement for the n input case, do you have any ideas?


Converting to float for division and then convert back

I am looking for a way to convert strings to a float for a division and then convert back to strings afterwards.  Strings;      scalavars.ExchangeValue scalavars.Rate   int:  scalavars.CurrencyAmount   All contain values and I am trying to complete this equation;  scalavars.ExchangeValue = scalavars.CurrencyAmount / scalavars.Rate   How can I convert all three to floats for the division and then convert back to their orignal types and store the result in scalavars.ExchangeValue as a string again?


PHP unable to save to MySQL db with correct character encoding

I know this question has been asked a million times before, but I'm unable to find a solution to this specific issue.  I'm saving the word "Tečný" from my PHP 5.6 application to a MySQL 5.6 db, using PDO::prepare() and PDOStatement::execute();  The data being passed in is definitely correct. The DB connection is made using 'SET NAMES utf8'. and 'SET CHARACTER SET utf8'.   When the string reaches the db, it's saved as "Te?ný". However, when I save it manually with MySQL Workbench, it saves and retrieves correctly.  Am I missing something?


Sort and compare function....why do the sets look like this

I'm wondering WHY when I sort items in the original array they show up in a weird order when processing but the result is correct. Here's the code var arr = [100, 8, 20, 12];  var x = 1;  console.log("Original Array = " + arr) arr.sort(function(a,b){      console.log("Set " + x++) //for tracking purposes     console.log(a, b)     console.log("a-b = " + (a-b))     return a-b; })  console.log(arr)  I've tried this on both SoloLearn and on Chrome to see if it had something to do with the browser itself but I get the same results RESULT:  I want to understand why this behavior of sorting happens (a=8 and b=100...etc) Any help or reference would be greatly appreciated.


How should someone with a German PhD be addressed in the UK?

This question has been discussed   but there doesn't seem to be a clear answer for my particular situation.  I have a Dr.rer.nat from Germany but currently I am working for an institute in the United Kingdom. Is it legal or acceptable to continue to use the title Dr.rer.nat (First Name) (Last name) in the UK or do I need to change it to (First Name) (Last name), (Ph.D)?


Example 1:   Example 2:   If you move your mouse to New contributor then the text is not fully visible.

             Awaaaaarghhh is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
   Tested on Google Chrome Version 76.0.3809.132 (Official Build) (64-bit) and Firefox Quantum 68.0.2 (64-Bit).


I am an Algerian national and I have been granted a Norway Schengen entry visa (single entry) valid for one month only because I will be getting a student residence permit once I'm in Norway.  The issue is that I am traveling from Algeria to Germany (stopover) and then to Norway on the same day (Lufthansa). Do I need a transit visa when I enter Germany?   My visa indicates that it is only for Norway (first line in the visa).  VISA TYPE: D  NON-DUPLICATE Explanation: My visa is valid only for Norway. It is not for the whole Schengen area. If it was for the whole Schengen are, then I would not need a transit visa because I already did it.


What are the benefits and purpose of presenting a paper in an academic conference?

If i have completed all the research work and compiled a research article then why should I present that paper in a conference and not submit it to a good journal for publication ?


How to perform QA when dev provided no deliverables?

The development team will release new epic after 30 days, today is day 1 and they did not provide any deliverables.  What should a QA Engineer do to assure high quality?


3 Statements of axiom of choice are equivalent

This winter I started to study much harder the set theory and especially the axiom of choice. Unfortunately, I have problems with solving the next exercise:  Prove that the 3 statements of the axiom of choice are equivalent :  1) For any non-empty collection $X$ of pairwise disjoint non-empty sets, there exists a choice set.  2) For any non-empty collection $X$ there is a choice function.  3) For any non-empty set $X$, there exists a function $f:P(X)\setminus\{\varnothing\}\to X$ so that for any non-empty set $A\subseteq X$, $f(A) \in A$.


Can two electron moving in opposite direction move faster than light?

Suppose we are moving two electrons in opposite direction both having a speed of 1.6e8 meter per sec.When they will cross each other then their relative velocity will be 3.2e8 ms_1.Isn't it faster than speed of light?


I have a problem I am stuck on. its really confusing and I don't know where to start  The slope of the tangent line to the graph of $f(x)$ at each $x\ne 0$ is given by $e^{6x}+{6\over x}$ and knowing that the graph contains the point $(1,{e\over 3})$, find $f(x)$.   How do I start this?


Book or short story about a future where humans go to a supposed virtual world

I remember reading this when I was in middle school so late 1990's. Dystopian society. Jobs have been given to robots. Young adults can no longer get jobs so they have this trial program going on. Groups are teleported to what they believe is a virtual world and have to learn to survive there, they go three times; each time the ability and severity of an accident can become greater before being brought back.  I dont remember the author, name, any any character names either. I believe the groups were groups of five, and it seems they were actually teleported to another world, not virtually.


How to create a bash script that every 5 minutes insert a record in a log file?

I am very new into bash scripting and I need to create a simple script that every 5 minutes insert the date and time into a log file and save it.  What can I do to do it? From what can I start?


how to remove leading space in command line argument

I am losing my mind here.. have tried every combination of functions that strip whitespace but I can't get rid of this particular whitespace  I want to write a convenience alias so that typing  runit cmd arg   results in  php artisan runit:cmd arg   I have tried all of these  alias runit="php artisan runit:${1}" alias runit="php artisan runit:${@}" alias runit="php artisan runit:${1} ${@:2}" alias runit="php artisan runit:${1:1:${#1}-2}"   And I've tried many other ways to basically strip the whitespace that is always added in between the runit: and my passed first argument  The end result no matter what I've tried is  php artisan runit: cmd arg   Cannot for the life of me get rid of the space between "runit:" and a CLI argument. I've tried assigning ${1} to another variable first, can't get rid of that leading whitespace..   Hope someone can help!


Prove clique exists under the following conditions

Given a graph $G$ with $n \ge 4$ vertices, where $n$ is even, prove that if every vertex has degree $n/2 + 1$, then $G$ must contain a clique of size $3$.   Recall that a clique of size $3$ is cycle on $3$ vertices. Therefore, you must show that there always exists $3$ vertices $a, b, c$ in $G$ such that $ab$ is an edge, $bc$ is an edge and $ac$ is an edge.


Why don't I have the option ''Install Ubuntu alongside'' my other systems?

Why don't I have this option?    here's my disk layout  sudo fdisk -l  Disk /dev/sda: 640.1 GB, 640135028736 bytes 255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x5b53cc54     Device Boot      Start         End      Blocks   Id  System /dev/sda1   *        2048      409599      203776    7  HPFS/NTFS/exFAT /dev/sda2          409600  1153767021   576678711    7  HPFS/NTFS/exFAT /dev/sda3      1216962560  1250050047    16543744    7  HPFS/NTFS/exFAT /dev/sda4      1250050048  1250261679      105816    c  W95 FAT32 (LBA)  Disk /dev/sdb: 4005 MB, 4005527552 bytes 32 heads, 63 sectors/track, 3880 cylinders, total 7823296 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x20d8782d     Device Boot      Start         End      Blocks   Id  System /dev/sdb1   *          63     7822079     3911008+   c  W95 FAT32 (LBA)


I want link directly to my iOS in App Store, when a user scans a QR code. Actually I'm using this link in QR code:   But it always first links to Safari and the redirects to my iOS app in the App Store.  Is there a way to directly link to the App Store, without Safari?


In  one can find the following symbol:    I have tried to Detexify it to no avail. What is this symbol/font?  It appears many times in the following excerpt:


I just install Ubnutu 14.04 to my Windows 8.1 machine. Install looked until the reboot. The boot choice did not come up. System went strait to Windows. Help? Thank you, William


Import modules using a variable in Python

I have a script which imports modules on-the-fly. Because modules name are changed as soon as a new version appears, it is difficult to check if the specific module name is also changed in the script. Because of this, I keep the modules name in the top of the script, in variables, like in this example:  var1 = 'moduleName1_v04' var2 = 'moduleName2_v08' ................... import var1 ................... import var2 ...................   But if I am writing like this, I will get an error.  The question is: how to import a module using a variable like in the example? Is it possible?


Is there a way to check if an istream was opened in binary mode?

I'm using an istream which could be stringstream, ifstream or a user-defined stream type and I need to know if, in the case of an ifstream, it was not opened in binary mode (so I can throw an exception). I have tried the following method:  if ((_is.flags() & ios::binary) == 0)     throw exception(...)   but no exception is ever thrown. The test fails in this case because _is.flags() returns 0x201 and ios::binary is 0x20. Is there a way to find out if a stream was opened in text mode?