I'm sending JSON string from Django view to javascript file named idbop.js at the client side. I'm using the serializer in Django to convert query result in Django to JSON. Here is my code in views.py of Django  def index(request): template='posts/index.html' results=feed.objects.all() jsondata = serializers.serialize('json',results) context={     'results':results,     'jsondata':jsondata, } return render(request,template,context)   At client side, I'm accessing jsondata in javascript as follows:  var jsondata="{{jsondata}}".replace(/&quot;/g,"\"");   Here jsondata is in string format. If I try to parse it using, var data = JSON.parse(jsondata); It is throwing an error:SyntaxError: JSON.parse: bad control character in string literal at line 1 column 344 of the JSON data  I'm having whitespace at 344 in jsondata but that whitespace is inside the string of value. Here is my JSON string:   [     {         "model": "posts.feed",         "pk": 1,         "fields": {             "author": "J Watson",             "title": "Service Worker",             "body": "A service worker is a type of web worker. It&#39;s essentially a JavaScript file that runs separately from the main browser thread, intercepting network requests, caching or retrieving resources from the cache, and delivering push messages.  Because workers run separately from the main thread, service workers are independent of the application they are associated with. This has several consequences:"         }     }]

I've generated some JSON and I'm trying to pull it into an object in JavaScript. I keep getting errors. Here's what I have:  var data = '{"count" : 1, "stack" : "sometext\n\n"}'; var dataObj = eval('('+data+')');   This gives me an error:   unterminated string literal   With JSON.parse(data), I see similar error messages: "Unexpected token ↵" in Chrome, and "unterminated string literal" in Firefox and IE.  When I take out the \n after sometext the error goes away in both cases. I can't seem to figure out why the \n makes eval and JSON.parse fail.


I would like to obtain a book that has to do with geometrical methods/subjects for physicists. When I say geometrical methods/subjects I mean things like Topology, Differential Geometry, Lie derivative/groups, Manifolds, vector fields etc. Note: I do not want a book containing only Topology.

I'm interested in learning how to use geometry and topology in physics. Could anyone recommend a book that covers these topics, preferably with some proofs, physical applications, and emphasis on geometrical intuition? I've taken an introductory course in real analysis but no other higher math.


i have this JSON string, which i want to insert into table. Here is my insert query:  $insert_sql = 'INSERT INTO yun_postmeta (post_id, meta_key, meta_value)     VALUES (5054, "_wc_free_gift_coupon_free_shipping", "a:1:{i:6;a:3:{s:10:"product_id";i:6;s:12:"variation_id";i:0;s:8:"quantity";i:1;}}");';   Of course, the query breaks because of the quotes ("). When i add backslash () in front of them, to escape, the query works and string gets inserted into the table, but for some reason my system doesn't work properly.  However, if i copy the JSON string and insert it manually into table, using phpmyadmin, system works normally.  Any idea what could be the problem here?  This sounds like encoding problem, but i don't have a clue what to do to solve it.  Thank you!

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


m trying to write a super simple piece of code which asks "are we nearly there yet" if the user inputs yeah they get the answer "finally" if the user says anything other than yeah the computer keeps asking are we nearly there yet? for some reason when I run the code below even if I type "yeah" after the first prompt the computer just keeps printing are we nearly there yet? and can't get through the loop.     import java.util.Scanner;      class FirstAttempt {      public static void main(String args[]) {          Scanner s= new Scanner(System.in);     String a ="  ";          System.out.println("are we nearly there yet?");     a  = s.next();                  while ( a != "yeah" & a != "Yeah")                 {System.out.println("are we nearly there yet?");            s = new Scanner(System.in);         a = s.nextLine(); }                  System.out.println("finally");              } }

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


In the exercise they ask me to prove that $f : B_a \rightarrow \mathbb{R}^k$ define by $x \rightarrow \frac{ax}{\sqrt{a^2-||x||^2}}$ is a difeomorphism between $B_a$ and $\mathbb{R}^k$. Well I dem that $f$ is bijective and smooth, but I don't know how to prove that $f^{-1}$ is smooth, I think about obtaining the expression of $f^{-1}$ but I don't know if it is correct or not. Obs: $B_a = \{ x : ||x||^2 < a \}$

Let $B_a$ be the open ball{$x: |x|^2<a$} in $\mathbb{R}^k, |x|^2 = \sum x_i^2$.   What is the inverse of the function $x \mapsto \frac{ax}{\sqrt{a^2 - |x|^2}}$?   Here I want some justification to equate $|x|^2$ with $x^2$, I don't know to justify; but otherwise I don't know how to solve it.


The scroll wheel of logitech M325 mouse became very sensitive, I noticed it few weeks ago, so it is probably caused by driver update. It is enough to put my finger on scroll wheel and it scrolls the page.  On Windows I haven't noticed such problem. So there is not problem with mouse.  Can you please advise me what can I do with it?  this question is different from  because it relates to ubuntu 15.04 with package xserver-xorg-input-evdev already installed

This question has been asked many times with no answer. I've used my basic Google skills and haven't come across a fix. This is system wide. My mouse simply scrolls too fast.   I'm new to ubuntu and linux in general. Would switching styles or whatever it is called (Ubuntu, KDE, Xubuntu) help at all? Is there a terminal code I can enter?


I read this series back in the early 2000s - sometime between 2003 and 2010. There were a ton of them, thin paperbacks. Some of them focused on different characters.   The plot that I remember: Earth was ending and they sent a space shuttle out to a habitable planet, but most of the people died in hypersleep. A few of them, all teenagers I believe, wake up and end up on a planet where some of them develop superpowers. I vaguely remember one girl's consciousness ending up in someone else's brain so she could only think to the other person for communication. There were aliens on this planet, but I don't remember them being humanoid. I think there were different groups forming and a lot of infighting between the kids. I think it ended with them growing up, some of them had kids and they had established a new kind of civilization on this planet.  Does anyone know what this is?

Looking for the name of a book series I read in middle school, 2001-2004 roughly.  All I can remember about it was that there were a handful of teenagers who somehow ended up on an alien planet that they eventually found out to be a ship. They have to fight for survival against multiple different enemies, I think one of the kids could communicate with part of the ship telepathically. Some of the aliens were either blue or I think even transparent. There really isn't too much to work off of, but I figured someone might know what it is.


Let $f:\mathbb C \to \mathbb C$ be a function such that $(f(z))^2$ and $(f(z))^3$ are entire   then is $f$ entire ?    I can conclude $f$ is entire if given $f$ is continuous ; but without continuity of $f$ , is it true ?

Let $f: \mathbb{C} \to  \mathbb{C}$ be a continuous function such that $f^2$ and $f^3$ are both analytic. Prove that $f$ is also analytic.   Some ideas: At $z_0$ where $f^2$ is not $0$ , then $f^3$ and $f^2$ are analytic so $f = \frac{f^3}{f^2}$ is analytic at $z_0$ but at $z_0$ where $f^2$ is $0$, I'm not able to show that $f$ is analytic.


I'm trying to create a datapack for a "Fire Wand" (which is a carrot on a stick enchanted with Flame until they fix the stat tracker for shield usage) which spawns a fireball at the players position and  spawned at the origin to give it momentum in the direction the player looks. I've got most of it working, however I also want to have several other behaviors (in other datapacks), also triggered by differently named and enchanted carrots on sticks, so I need to track not the simple use of a carrot on a stick but the use of a specifically named and enchanted one. If this isn't possible, is there a way to check for the item currently in the player's hand to make sure it is the correct function being run?

I'm trying to make a command block that spawns an item in front of you if you are holding an item with a specific name. I've got these two working scripts;  /testfor @p[r=10] {Inventory:[{tag:{display:{Name:"Item Name"}}}]}  /testfor @p[r=10] {SelectedItemSlot:0,Inventory:[{Slot:0b,id:"minecraft:diamond_sword"}]}   but I can't get them together. The block should only look for an item in the active slot.


I recently was told that Cave Story was ported to the Wii. It was an excellent game on the PC, the perfect match of excellent gameplay and story. The Wii version isn't just a straight port, is it? Are there extra features available that will provide a completely new experience to the game?

What are the critical differences between the various releases of Cave Story (PC, WiiWare, DSiWare, 3DS)? In particular, I already have a copy (of Cave Story+) on Steam from the Humble Indie Bundle 4, but the 3DS release sounds like the most intriguing—is the 3DS remake worth the $30 if I already own a version?


When executing the following code, I get the error:    Undefined control sequence.  <recently read> \c@lor@to@ps l.7 [name=A] 1 & [name=B] 8 \\[0pt] ?    Here is the code:  \documentclass{article} \usepackage{pstricks} \usepackage{pst-node}  \begin{document} \begin{psmatrix}[fillstyle=solid,mnode=circle,colsep=1] [name=A] 1 & [name=B] 8 \\[0pt] [name=C] 2 & [name=D] 9 \end{psmatrix} \end{document}    I have updated my packages as well but no affect.


During execution the problem is giving stack overflow problem, but what is this! Runtime Error (NZEC)  Exception in thread main java.lang.StackOverflowError at sun.nio.cs.US_ASCII$Encoder.encodeArrayLoop(US_ASCII.java:198) at sun.nio.cs.US_ASCII$Encoder.encodeLoop(US_ASCII.java:231) at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:579) at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:271) at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125) at java.io.OutputStreamWriter.write(OutputStreamWriter.java:207) at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:129) at java.io.PrintStream.write(PrintStream.java:526) at java.io.PrintStream.print(PrintStream.java:669) at Solution.solve(Solution.java:22) at Solution.solve(Solution.java:23) at Solution.solve(Solution.java:23) at Solution.solve(Solution.java:23) at Solution.solve(Solution.java:23) at Solution.solve(Solution.java:23) at Solution.solve(Solution.java:27) at Solution.solve(Solution.java:23) at Solution.solve(Solution.java:27) at Solution.solve(Solution.java:23)  import java.util.*; public class Solution {          public static void printIncreasingNumber(int n) {         /* Your class should be named Solution.          * Don't write main() function.         * Don't read input, it is passed as function argument.         * Print output as specified in the question         */         int k = 10;         int N = (int)Math.pow(10,n);//limit         solve((int)Math.pow(10,n-1),N);     }               static void solve(int j,int n){         if(j==n){             return;         }                  if(check(j)){             System.out.print(j+" ");             solve(j+1,n);         }         else{             j = increase(j,n);             solve(j,n);         }     }          static boolean check(int k){         ArrayList<Integer> arr = new ArrayList<>();         int temp = k;         while(temp>0){             arr.add(temp%10);             temp = temp/10;         }         boolean ans = true;         for(int i=0;i<arr.size()-1;i++){             if(arr.get(i)<=arr.get(i+1)){                 ans = false;                 return ans;             }         }         return ans;     }          static int increase(int j,int n){         int ans = 0;         for(int i = j;i<n;i++){             ArrayList<Integer> arr1 = new ArrayList<>();             int temp = i;             while(temp>0){                 arr1.add(temp%10);                 temp = temp/10;             }             int count = 0;             for(int i1=0;i1<arr1.size()-1;i1++){                 if(arr1.get(i1)<=arr1.get(i1+1)){                     count++;                 }             }             if(count==0){                 ans = i;                 break;             }         }         return ans;     } }  My main function is, import java.util.Scanner;   public class Main {      public static void main(String[] args) {         int a;         Scanner s = new Scanner(System.in);         a = s.nextInt();         Solution.printIncreasingNumber(a);     }  }

What is a StackOverflowError, what causes it, and how should I deal with them?


I know a set is closed if it contains all it's limit points. It sounds like if it contains all it's limit points in $\mathbb{R^{+}}$ then it will contain all it's limit points in $\mathbb{R}$, but I have no clue about the proof.

Give an example of a topological space $(X, \mathcal T)$, a subspace $(A, \mathcal T_A)$ of $(X, \mathcal T)$, and a closed set in $(A, \mathcal T_A)$ that is not closed in $(X, \mathcal T)$.   All the sets I create are closed in both and I am stuck.


I remember reading this great trilogy series about 10-15 years ago. It's about a family living in a dystopian walled city where people are sorted and classed by their intelligence.  The protagonists are twins, a boy and girl. They defy the system and are exiled from the city, along with another boy. They journey across a desert and have many adventures etc. This is only in the first book.  I remember the cover being a big 'S' shaped symbol. It had something to do with a wind chime that was central to the plot.  Edit: There is already another question with the same answer . I did do a search on stackoverflow before I posted this question of course, but I feel I would never have know it's the same question just looking at the title. It's up to the community to close this question as a duplicate.

I'm trying to find the name of a book series I read about 10 years ago. It might be a children/young-adult series since I was fairly young. There is also a small chance it was written by a french author, as I read it in french. The series is composed of at least three books, maybe more. Here is what I remember :   The main character is a poor girl/young woman, but there are several point of view characters At the beginning of the first book the plot is set in a city where rich people live in the city center and the further you go from the center the poorest people are. Moreover, the houses are painted according to the wealth of the owner. It was something like : the richer had red houses, the poorer blue houses, and the moderately wealthy purple (it was not those colors in particular but it was something like that) At the end of one of the book there is some kind of uprising and the people paint all the houses in multiple colorful shades (to symbolize the new found equality between the citizen) At some point the main character and other peoples of the city get captured (maybe after some kind of war the city was involved in), separated and sold to slavery One of them, an older boy, become a soldier and learn a special fighting technique that looks like dancing (and he grows to like it) Another of the captives, a young girl (the sister of the main character if I recall correctly) get marked with a fire-heated mark to show her condition of slave   That is all I remember, I have no clue about the time or geographic setting nor the story details.  I know it's not much to go by, any help would be greatly appreciated, as I would like to find these books and read them again.


Can we compute the cardinality of the linear group $GL_n({\mathbb Z}/{p \mathbb Z})$?

$F$ is a finite field of order $q$. What is the size of $\operatorname{GL}_n(F)$ ?  I am reading Dummit and Foote "Abstract Algebra".  The following formula is given:  $(q^n - 1)(q^n - q)\cdots(q^n - q^{n-1})$.  The case for $n = 1$ is trivial.  I understand that for $n = 2$  the first row of the matrix can be any ordered pair of field elements except for $0,0$. and the second row can be any ordered pair of field elements that is not a multiple of the first row.  So for $n = 2$  there are $(q^n - 1)(q^n - q)$ invertible matrices.  For $n\geq 3$, I cannot seem to understand why  the formula works.  I have looked at Sloane's OEIS A002884.  I have also constructed and stared at a list of all $168$ $3\times 3$ invertible matrices over $GF(2)$.  I would most appreciate a concrete and detailed explanation of how say $(2^3 - 1)(2^3 - 2)(2^3 - 2^2)$ counts these $168$ matrices.


I wanted to convert this path to mesh to extrude it and make it 3D. The resulting mesh is a mess when i look at it in edit mode. Check my screenshots. How could i avoid all those zigzags across the surface and make this mesh something like the origin path? The original SVG file is there:  This is just one single closed 25 nodes path without any zigzag lines going across... In Blender, I did: File > Import > SVG (and re-scaled) and then: Right-click to convert to mesh, and the result is a mess:  EDIT: My logo does not have anything special or tricky. I tested a pure simple circle made in Inkscape and imported into Blender: same bad results at first, and same 5 seconds quick fix.

I am wondering if there is an easy way to inset mesh that is generated from text/curves? When I convert text to mesh it generates a bunch of uneven triangles that don't inset properly. My only solution is slow and tedious and requires manually removing all but the outline edges and refilling with quads. More specifically I am trying to create an engraving of text into a mesh, and rather than a straight bool cut I need the engraved text to inset a bit. The result needs to mesh (not through a shader). Any ideas appreciated.


This is kind of a meta-question for Meta Stack Exchange. You may remember my question about a . I realized it wasn't suitable for Meta Stack Exchange, and because regular users can't delete questions with answers, I decided to flag for mods to delete it. My first flag said:  I realize now that this is not^1 really about SE, so I was wondering if I could have it deleted?  It was then declined, and I got this message:  flags should only be used to make moderators aware of content that requires their intervention  I tried reflagging and changing my message to this just in case the first one was misinterpreted:  I already flagged this post asking for deletion, but it was declined. Maybe they misinterpreted my flag? Anyway, could this post be deleted by a mod (I can't; it has an answer) because I now realize it is not about SE?  It was then again declined with the same automated message:  flags should only be used to make moderators aware of content that requires their intervention  Why were my flags declined with such message when I was clearly asking a moderator to delete my question (which I can't do, therefore meaning that it requires a mod to). What should I do now? The question is off-topic, low scored (perhaps I could mark as community wiki?), and leaves an unneeded black mark on my answer list for a small matter - so I feel like it would be best deleted. I see Journeyman Geek's point though, so I am a little confused. What would the best course of action be? And I'm afraid to flag a third time, just in case it is declined and I pick up a flag ban.  I don't think this question is a duplicate of the FAQ on  because I already know how deleting works and the criteria behind it, I just want to know why my flags to delete were rejected. The proposed dup question tells you to flag for mod deletion, which I did. It doesn't provide any further info. ^1 I flagged originally without the not - oops, I was typing fast and my mind jumped over a word. For clarity purpose, I meant to add a not.

What circumstances can cause a question or answer to be deleted, and what does that actually mean?    How can a post be deleted? When can't I delete my own post? Can I still see my post even after it's deleted? Can I see a list of my deleted posts? How can I undelete one of my posts? What does deletion mean for a post? How do votes to delete work? What are the criteria for deletion? What else should I know about deleted posts? If I flag my question with a request to delete it, what will happen?       For more information, see the articles about  and  in the .


You don't have to go through the complete code from the beginning. The problem is in the execl(..) statement inside main. Code is --  #include <cstdio> #include <iostream> #include <cstring> #include <unistd.h> #include <sys/wait.h> #include <vector>  #define li long int  using namespace std;   char TypedCommandInTerminal[1001]; vector <string> ValidCommands,TypedCommand;   void ShowTerminal() {     cout<<"User:$ ";     gets(TypedCommandInTerminal); }   void PushCommands() {     ValidCommands.push_back("mkdir"); }   void GetCommandIntoVector() {     TypedCommand.clear();      char *p = strtok(TypedCommandInTerminal," ");      while(p)     {         TypedCommand.push_back(p);         p = strtok(NULL," ");     } }  bool MatchCommand(string Command) {     li i;      for(i=0;i<ValidCommands.size();i++)     {         if(ValidCommands[i].compare(Command)==0)         {             return true;         }     }     return false; }    int main() {     int status;     string StoredCommand;      PushCommands();     while(true)     {         ShowTerminal();         if(fork()!=0)         {             waitpid(-1,&status,0);         }         else         {             GetCommandIntoVector();             if(MatchCommand(TypedCommand[0]))             {                 StoredCommand = "mkdir";                 if(StoredCommand.compare(TypedCommand[0])==0)                 {                     execl("/bin/mkdir","mkdir",TypedCommand[1],NULL);/*ERROR*/                 }             }             else             {                 cout<<"Command Not Available\n";                 return -1;             }         }     }     return 0; }   I am trying to design a simple terminal using c++ in linux. What I am trying to do here is -- taking this command in console as input - "mkdir ab" . Then I managed to tokenize this string and kept "mkdir" in TypedCommand[0] and "ab" in TypedCommand[1]. Problem is when I write "TypedCommand[1]" inside execl compiler gives an error--"cannot pass objects of non-trivially-copyable type....." I removed TypedCommand[1] and manually wrote "ab" in place of it. The code ran and created a folder named "ab" in the execution directory. So looks like execl is working fine.  I need to pass the second string saved in TypedCommand[1] inside execl in some way...what is wrong here ?

How can I convert an std::string to a char* or a const char*?


I was reading a Python textbook when I saw this piece of code:  def print_matches(matchtext):     print "Searching for", matchtext     while True:         line = (yield)      if matchtext in line:         print line  matcher = print_matches("python") matcher.next() matcher.send("Hello World") matcher.send("python is cool") # prints "python is cool" matcher.send("yow!") matcher.close()   I always considered it a kind of return-sibling, so now I am really interested how (yield) works. Some people referred me to  and .  But as I am not a native speaker it's really hard for me to understand anything written in there. Could anyone please tell me in as simple language as possible how (yield) works?  I understand the syntax when you use "yield" to return object on demand. But I don't understand the implementation of "line = (yield)". Why "yield" is a value of a variable?

What is the use of the yield keyword in Python? What does it do? For example, I'm trying to understand this code1: def _get_child_candidates(self, distance, min_dist, max_dist):     if self._leftchild and distance - max_dist < self._median:         yield self._leftchild     if self._rightchild and distance + max_dist >= self._median:         yield self._rightchild    And this is the caller: result, candidates = [], [self] while candidates:     node = candidates.pop()     distance = node._get_dist(obj)     if distance <= max_dist and distance >= min_dist:         result.extend(node._values)     candidates.extend(node._get_child_candidates(distance, min_dist, max_dist)) return result  What happens when the method _get_child_candidates is called? Is a list returned? A single element? Is it called again? When will subsequent calls stop?   1. This piece of code was written by Jochen Schulz (jrschulz), who made a great Python library for metric spaces. This is the link to the complete source: [Module mspace][1].


I was studying the sinc function, it led me to the study the following equation on $\mathbb{R}$ $$ x=\tan\left(x\right) \ \ \ \ \left(\star\right) $$ The equation $\left(\star\right)$ has a unique solution $x_n$ on $\displaystyle I_n=\left]\frac{\pi}{2}+n\pi, \frac{\pi}{2}+\left(n+1\right)\pi\right[$ for $n \in \mathbb{Z}$ with $x_{n}=-x_{-n}$ and $x_0=0$, which allows us to define a sequence on $\mathbb{N}$ only.  I've read somewhere the following ( astonishing ) equality     $$ \sum_{n=0}^{+\infty}\frac{1}{\left(x_n\right)^2}=\frac{1}{10} $$   This sum does exist, because I've shown that $$ \frac{1}{\left(x_n\right)^2} \underset{(+\infty)}{\sim}\frac{1}{\pi^2 n^2} $$ But I dont know how to compute it. I thought about residue theorem making $x_n$ appears in a pôle but cannot find a way to prove it. Any help would be great.

The sum of the squares of the reciprocals of the positive fixed points of the tangent function is $1/10$.  I've seen this proved by means of residues, but I don't remember the details.  I've also heard it asserted that it that it can be done by means of Green's functions.  What proofs of this fact are published or otherwise known?  PS: Maybe it is of interest to note that the positive fixed points of the tangent function are also the abscissas of the extreme values of the function $x\mapsto\dfrac{\sin x} x.$


I have 3 python classes. The Order class has an attribute that is a list passed at instantiation. The Cue class also has a list attribute but is initialized with an empty list. My goal is to update a group of Cue class instances dynamically by a parsing function that loops over Order.items list and evaluates the condition of in Cue.items_they_need_on_their_q list attribute and if True add it to the Cue.working attribute of that instance. from itertools import count  class Item(object):          _ids = count(0)     def __init__(self, name, inventory):     self.item_number = next(self._ids)  class Order:     _order_ref_number = count(0)     def __init__(self, items=[]):         self.order_ref_number = next(self._order_ref_number)         self.items = items   class Cue:     """ alright, queue, im lazy """     def __init__(self,  working=[], sold=[]):         self.working = working         self.sold = sold         items_they_need_on_their_q = []  itemOne = Item(name='cow', inventory='100')  itemTwo = Item(name='pig', inventory='10')  itemThree = Item(name='goat', inventory='6')  itemFour = Item(name='buick', inventory='1000')  stationOne = Cue() stationOne.items_they_need_on_their_q = [itemOne.item_number, itemThree.item_number]  stationTwo = Cue() stationTwo.items_they_need_on_their_q = [itemTwo.item_number, itemFour.item_number]   def parse_order(takesOrderClass):     for i in takesOrderClass.items:          if i.item_number in stationOne.items_they_need_on_their_q:             stationOne.working.append(i)                    if i.item_number in stationTwo.items_they_need_on_their_q:             stationTwo.working.append(i)  bob = Order(items=[itemOne,itemTwo,itemFour])  parse_order(bob)  print(stationOne.working) print(stationTwo.working)  I expected it would append only those items that resolved to True in the list and route those. Instead I get all three Item objects in both instances of Cues working lists output: [<__main__.Item object at 0x0000017E19B48FD0>, <__main__.Item object at 0x0000017E19B48F70>, <__main__.Item object at 0x0000017E19B48D90>] [<__main__.Item object at 0x0000017E19B48FD0>, <__main__.Item object at 0x0000017E19B48F70>, <__main__.Item object at 0x0000017E19B48D90>]  When I print the conditions to sanity check the order condition satisfies that indeed stationOne returns [True,False,False] when the order is looped over comparing items as well as stationTwo returning [False,False,True]. I also tried using the following conditions in the loop if i.item_number == True:  ##and ... check_one = i.item_number in stationOne.items_they_need_on_their_q  if check_one == True:    do the thing ##and ... if check_one == 1:    do the thing   If these are all evaluating truthwise correctly why are the lists not effectively filtered and being populated with all results and what would be a better solution?

Sometimes it seems natural to have a default parameter which is an empty list. Yet . If for example, I have a function: def my_func(working_list=[]):     working_list.append("a")     print(working_list)  The first time it is called the default will work, but calls after that will update the existing list (with one "a" each call) and print the updated version. So, what is the pythonic way to get the behavior I desire (a fresh list on each call)?


Suppose there is an isosceles triangle ABC with $\angle$B$=20$ degrees, $AB=BC$  M,N are points on AB,BC such that $\angle$MCA=60 degrees, $\angle$ NAC=50 degrees. Find $\angle$NMC  How do you even start? Many angles can be found by using angle sum property of the triangle but I can't get anywhere beyond that. I tried constructing a parallel through both M and N but it doesn't help.  Also, one could repeatedly use sin rule to find it out, but this is extremely inefficient.  Please give me a hint...

The following is a geometry puzzle from a math school book. Even though it has been a long time since I finished school, I remember this puzzle quite well, and I don't have a nice solution to it.  So here is the puzzle:    The triangle $ABC$ is known to be isosceles, that is, $AC=BC$. The labelled angles are known to be $\alpha=\gamma=20°$, $\beta=30°$. The task is to find the angle labelled "?".  The only solution that I know of is to use the sine formula and cosine formula several times. From this one can obtain a numerical solution. Moreover this number can be algebraically shown to be correct (all sines and cosines are contained in the real subfield of the 36th cyclotomic field). So in this sense I solved the problem, but the solution is kind of a brute force attack (for example, some of the polynomials that show up in the computation have coefficients > 1000000). Since the puzzle originates from a book that deals only with elemetary geometry (and not even trigonometry if I remember correctly) there has to be a more elegant solution.


Is it possible to switch a certain Stack Exchange site's interface (as a personal preference) to the theme used by beta sites?  Some sites have flashy decorations or unreadable fonts (I prefer to disable antialiasing on fonts). It would be nice to have an option to see a site with the "beta" theme.  If there's a solution using custom styles, I would accept that as an answer.

Since there already seem to be ways to do this with user-specific CSS: why not have a couple of base themes for the sites? I'd like to see a theme like the dark flair that is available.  Getting into the more unlikely, what about a way for users to choose their own colors? I know this site is more for questions and the like, but customizability never hurt anyone :P


I have a few apps, but this tablet is new and I want more apps. Every time I say download, it says I have insufficient space. Please help!

If you're not used to seeing the 'low on internal storage' notification, what is it that you're doing to keep your phone's internal memory from filling up so quickly?   The 'SD Card and Phone Storage' menu in the settings doesn't really tell me much other than how much is free. And, I don't really have that many applications installed. The top 5 storage hogging apps on my phone are Gmail (18.6 MB), Twitter (17.5 MB), Facebook (12.55 MB), Maps (9.63 MB), and Swype (6.06 MB).  So, are there apps out there (besides your normal file manager ones, like Astro) that will help monitor internal phone storage? Is there something I should be doing to keep my phone storage use to a minimum?


I've to do activities in my template based on type of class I get as parameter:  In Class.h  class SomeClass; class SomeOtherClass;  class Class  { public:     template <typename T> void function(T value); };   In Class.cpp  template<typename T> void Class::function(T value)  {     // Whole lots of common code here      if (T == SomeClass)     {        // Do something by casting value to SomeClass        SomeClass* ptrSomeClassObj = (SomeClass*) &value;        ptrSomeClassObj->MemberFunctionOfSomeClass();     }     else     {        // Do something else     }      // Whole lots of common code here }   Now I've these questions:   Here if (T == SomeClass) is not correct syntax. How shall I do this? Type casting of T the way I've done doesn't give me any syntax error. But is this appropriate to do like this? I believe C++ has better ways.   Update: Not really looking for  because it would replicate lots of common code (as mentioned in code above) in specialized functions.

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


For instance I have a string parameter @p_colors with a value like:   'yellow','blue','red'  which is passed into a stored procedure. And when I try to select it like this:  EXECUTE(CONCAT('SELECT ', @p_colors));   The result is the values are selected by columns.  No column name | No column name | No column name ------------------------------------------------ Yellow         | Blue           | Red   How will I do it if I want to display them by row like this:   No column name | ---------------- Yellow         | ---------------- Blue           | ---------------- Red            | ----------------   using only the string formatted parameter. Is there any way in SQL to make this?   EDIT:  The actual result will be inserted into a temp table so the actual code is :  EXECUTE('INSERT INTO #colors(color) SELECT ', @p_colors);

Using SQL Server, how do I split a string so I can access item x?  Take a string "Hello John Smith". How can I split the string by space and access the item at index 1 which should return "John"?


I'm trying to edit a mesh in blender, but when I try to move a vertex it moves by a set amount that is ridiculously far from the original position, and there's no ability to place it at any point in between. This happens regardless of whether or not proportional editing is being used.

My cursor is moving by every selection by large increments!  Normally when I use Blender, I am able to select and move objects to any coordinate. Now, all of the sudden, when I select an object or mesh the selection moves by an inch or so in each direction.  How do I reset it to normal?


Unlike most of meta folks, I take duplicated questions as a disaster.  Disaster that ruins the site. Disaster inspired by the very site rules. An Uroboros of some sort - a serpent eating its own tail.  So, I propose a game to fit the current rules. As getting reputation points considered feature critical - let them get these points, but for finding duplicates. If the OP consider linked question useful - they can tick some special button and reward a duplicate finder.   It can be abused, yes. However, I believe that this site should be less afraid of its users. There are many frauds already, despite of all the limitations. So, better follow the famous Franklin's quip and give people Liberty instead of "Safety".  It will require some programming, yes. I realize that chosen stack makes it hard to make improvements.  If it was built using LAMP, I'd volunteered with writing the feature myself. Yet I believe that such a feature is not that hard to implement even with MS stack.

At present if you see a question that may be a duplicate and has an easy answer you can post the answers or post a link to the duplicate question.  (Or the few hi-rep users can vote to close it as duplicate, think of normal users here, not the people that read Meta) It is better for Stack Overflow if a link to the duplicate is posted as a comment, or the user votes to close the question as a duplicate.  However, the user gets more rep if he/she posts the easy answer quickly. I'm thinking of something along the lines of:  First person to post a comment that points to possible duplicate gets some rep if the question is closed as a duplicate and at least 2 of the other closers chose that same dupe question.  Whenever someone votes to close as a duplicate, a “possible duplicate” comment should be posted with a link to the other question, if there is not already a link to it in a comments.  (The system now does this)    As Ether said,  The removal of reputation earned from answering a question that is later closed as a duplicate would at least remove the negative incentive, but is that enough to correct this behaviour? Is a “duplicate finder” badge part of the solution?  A bronze badge for being the first person to vote to close a question as a duplicate with the same “duplicate of” question chosen as most closers choose. A silver badge for doing the same 25 times.  See also  , would also help.  Now that the duplicate can be marked by the OP as helpful, we have another trigger to consider for awarding badges and/or rep.


Why the command \LaTeX (and I think also \TeX, \XeLaTeX, etc.) is missing of a blank space? I add my MWE: \documentclass[a4paper,12pt]{article} \begin{document} Far far away, behind the word mountains \LaTeX far from the countries Vokalia and Consonantia, there live the blind texts.  \end{document}

I have a definition:  \newcommand{\arnold}{Arnold Schwarzenegger}   When I refer to it by:  \arnold is a   it is rendered as:   Arnold Schwarzeneggeris a    In order to have a space in front of "is" I would need to write  \arnold\ is a   Is there some other shorter way?


What was the first known instance of a story that provides a relationship between werewolves and vampires? What was that relationship?  In some movies (Underwold, Van Helsing and Twilight), werewolves are portrayed as the vampires' slaves: as the latter represented the aristocratic class, who were on the top food chain thanks to their human-like appearance and self-control. Totally the opposite for the werewolves, who were simply seen like savage beasts, who cannot control themselves (Twilight, Underworld).

If you can believe  some ancient traditions believe that werewolves would become vampires after being killed.     Before the end of the 19th century, the Greeks believed that the corpses of werewolves, if not destroyed, would return to life as vampires in the form of wolves or hyenas which prowled battlefields, drinking the blood of dying soldiers.   Modern fiction has Vampires and Werewolves at odds with each other (Underworld, Van Helsing, Twilight).  Where did it originate that these two night prowlers would be bitter enemies?


I want to make a cube for which the lower border are dashed line like this one :  Should I make an appropriate texture ? Or is there any another way ?

I'm trying to render a cube with 2 additional vertical edges on a one of the faces. I use the wireframe modifier for making faces transparent and freestyle for making the dashed edges. The issue is the fact that these 2 dashed edges become non-dashed in render. Can I somehow make the edges to be dashed while the wireframe modifier is applied?


In a work by Thomas Watson (1555-1592), there is a line as follows: Her dainty forehead from the sun ykept.   Why does y appear in front of kept?  I have seen this odd use of y in other poems in the collection I am reading: Poetry of the English Renaissance, by Hebel and Hudson.

The Germanic languages that I'm familiar with all use a prefix similar to ge- on past participles:  German: Ich habe mir den Fuß gebrochen. Dutch: Ik heb mijn voet gebroken.  But English doesn't do this at all:  English: I've broken my foot.  Where did this prefix come from? Did English ever have the ge- past participle prefix? If so, why was it lost?


I'm considering buying a PC which comes with Windows preinstalled; typically I run Linux.  If I were to format the hard drive and install Linux so that Windows was removed from the hard drive, just note the license key?  Just keep or re-use the output from:  wmic path softwarelicensingservice get OA3xOriginalProductKey and then re-activate?  Assuming no hardware changes, as that  to be a factor.  Pardon, not sure whether it's a retail or OEM license -- nor the specific version of Windows 10.  (Just buying from Amazon, newish desktop PC.)

I've been using Windows 10 for a couple of month now (joined the Insider Preview).  Now my hard drive started ticking so I've bought a new SSD and I want to move the windows installation to the new hard drive, which has been connected to the computer (unpartitioned). I don't mind and I even prefer reinstalling it over again.   Since I have the free version of Windows 10 pro, can I still reinstall it anew? Does the windows 10 installation offer disk management and partition like the older Windows installations used to? How should I reinstall Winodws 10 x64 the easiest but still remain on free mode?


How do I tell whether a SPID connected via the AG Listener name or the server name (or its IP address)?

We have multiple generations of applications connecting to SQL Server, some of which we know [their connection libraries] do not support using the MultiSubnetFailover=True connection parameter. Fine.  For the apps that "say" they are capable of using the AG listener, is there any way to verify this from the SQL side once they are connected? Unfortunately, our role (DBAs) does not grant us (nor would we want) the liberty of validating all kinds of application strings to ensure they configured it correctly. These older generation applications have historically used the literal server name, but we're trying to migrate all over to listeners.   First post; please let me know what info I might be missing from my question. Thanks!


I am using Windows 7 32-bit OS. I want to dual-boot Ubuntu alongside it.  I downloaded wubi.exe file but when I try to run it after asking for username and password details, I get an error message which says,  An error occured:  Could not retrieve the required disk image files  For more information, please see the log file c:\users\dell\appdata\local\temp\wubi-12.04-rev272.log   I don't understand the text in the log file.

I tried to install Ubuntu 12.10 with the Wubi installer while running Windows, because my PC does not accept my BootCD as a bootable medium.  But Wubi showed me this error:  Ubuntu-Installationsprogramm (X) Ein Fehler ist aufgetreten: Could not retrieve the required disk image files Weiter Informationen finden Sie in der Protokolldatei: c:\users\username\appdata\local\temp\wubi-12.10-rev273.log   What can I do, because I want to get rid of my Windows 7 and use the way better Ubuntu 12.10?  Thanks for your huge answer, now my next problem after trying to install wubi with the .iso is, that the same error shows up again and i am not shure which part of the errorreport you need.  Can you tell me? Because i'm not that good at linux.


Is this correct?  If a group has prime order $p$, then it is cyclic since it all nonidentity elements have order $p$ by Cauchy's theorem.  If it is cyclic, then it is abelian since every element is a power of the generator.  Thus, every group of prime order is abelian.

Show that every group of prime order is cyclic.   I was given this problem for homework and I am not sure where to start. I know a solution using Lagrange's theorem, but we have not proven Lagrange's theorem yet, actually our teacher hasn't even mentioned it, so I am guessing there must be another solution. The only thing I could think of was showing that a group of prime order $p$ is isomorphic to $\mathbb{Z}/p\mathbb{Z}$. Would this work?    Any guidance would be appreciated.


After a fresh install of 11.04 I have a script that does a few useful things. Is there a way to remove the LibreOffice, Ubuntu One etc icons from the Unity launcher using command line so I can put it in my script?

In order to automatically configure fresh installations, I need a way to unlock the default applications from the launcher bar. Don't know where this information is stored, may be editing/substituting the file would be the easiest way.


I've googled a lot about it, but everyone suggests to skip them manually. It's not easy.  Maybe there is some add-on or script to make Blender render identical frames only once? And then I can make the needed frames longer using video editors. It could save many hours of rendering.

I have an animation with lots of text objects flying about.  I'd like to render it with motion blur and stuff, but there are quite a few long sections where nothing is moving so that the text can be read. In these sections the render output (should) remain exactly the same.  Since it's pretty pointless to render the same image over and over, is there some way to automatically detect and skip those sections, only rendering one frame until there are more keyframes?


This is a similar question to , where I'm trying to understand how Burnside's Lemma is used to compute orbits of of a matrix. I've been working through the example of how this applies to a cube rotation or the bead arrangements, but what I don't really get is how this applies to a matrix.  Given this specific example where I have a 2x2 matrix where each cell can have 2 values (black/white), I know there are 7 orbits from manually drawing them out.  In reading Burnside's Lemma, I think I have to get to the form:  1/n(...) = 7  but I'm not sure how to create the terms inside the parenthesis. I'm not really looking for heavy mathematical notation here for the general case (if possible), but I'm looking for more of an explanation of how the equations translate to actual numbers in this particular case.  More generally, when the matrix is MxN and not NxN, how do I compute the number of orbits?

If I have a $w \times h$ matrix where each value is an integer  $0 \lt n \lt 20$,  how can I count the number of distinct configurations, where $2$ configurations are "distinct" if there is no way to reshuffle the rows and columns that would produce the same matrix?  Can this be counted with the stars and bars method?    For example, these are equal (we swapped a row, then a column):  0 0 0    2 0 4 0 2 4    0 0 0   but these are distinct (no way to swap rows or columns to produce the other):  0 0 0    2 0 0 0 2 4    0 4 0   It seems like there ought to be a way to count the rows or columns as "bins" and the values as balls.  I realize that in this case there are $18$ different colored balls, but even if the only values possible were $1$ and $0$, (ball or no ball) I can't see how to represent it as stars and bars.


I'm working on a map with my friend and I recently stumbled into a problem, neither me nor my friend know which brackets to change in this command:  /summon zombie ~ ~1 ~ {     HandItems:[     {Count:1,id:iron_hoe,tag: {display:{Name:"Grim Reaper's Scythe"},     ench:[{id:16,lvl:5},{id:19,lvl:2}]}}, {Count:1,id:book, tag:{display:{Name:Magical Book}}}],ArmorItems:[{Count:1,id:leather_boots, tag:{display:{Name:"Grim Reaper's Weak Boots"}}},{Count:1,id:leather_leggings, tag:{display:{Name:"Grim Reaper's Weak Pants"}}},{Count:1,id:leather_chestplate, tag:{display:{color:3157807, tag:{display:{Name:"Grim Reaper's Weak Tunic"}}}},{Count:1,id:skull,Damage:3, tag:{SkullOwner:Grimreaper}}],CustomName:Grim Reaper,Visible:1,HandDropChances:[0.2f,0.1f]}   I am fairly sure it has to do with the tag to color the chestplate.

Often, when making a command block contraption, you need to set an entity's data tag. These tags can sometimes be very long, with many layers of nested curly and square brackets. For example, this is the command to summon a villager with a single custom trade:  /summon Villager ~ ~ ~ {Profession:3,Career:2,Offers:{Recipes:[{buy:{id:minecraft:diamond,Count:6b}},sell:{id:minecraft:diamond_hoe,tag:{ench:[{id:16s,lvl:10s}]}]}}   The single-line command block interface of Minecraft makes it incredibly difficult to find and fix errors, especially when it comes to mismatched brackets. In fact, for illustration purposes, I put an error in the above command.  What techniques can I use to find and fix unbalanced square or curly brackets when writing long and complicated data tags?


The issue I'm currently struggling with is: What is the mathematical relationship between power dissipation and temperature in a resistor?    The project I'm working on is a controller card for a [supercapacitor w/ resistive precharge] in a box.         – Schematic created using   The resistance and capacitance are known parameters of the system and the voltages are measured.  With this information I can calculate the amount of energy I'm getting ready to dump into the resistors and then decide if I have the thermal overhead to complete that charge cycle:     if(Predicted_Energy < MAX_ENERGY - Current_Energy)   {      charge=1;      Current_Energy += Predicted_Energy;   }     Once I finish charging and switch to RUN mode, those resistors are cut out of the circuit.  Now they're just sitting there cooling off... dissipating energy.  How can I take this cooling over time into account with my Current_Energy value?  Is it possible to estimate or assume how much energy is lost given time only? Or would I need to monitor the temperature of the resistor to determine this?

I want to model the transfer function of a resistor mathematically, and am after some resources / tips on if it's possible to do so.  For example, if I put 1V into a 1 Ohm resistor, I want to know how long and how (shape) it will take to reach a steady state temperature, given 25 deg C ambient.  I.e.   $$ \frac{T(s)}{V(s)} = ??? $$  Where T(s) is the laplace transform of temperature T(t), measured in say Kelvin.  I understand there are a lot of factors which will affect this model (material, size, shape, ambient (?)), but I'm not sure where to even start. A  shows the heat rise at a certain load, but not really how it gets there. I can't find a time-domain function for the temperature rise either.


Can anyone help me to calculate and explain me time complexity of this algorithm : function mystery(n)     r := 0     for i := 1 to n − 1 do          for j := i + 1 to n do              for k := 1 to j do                 r := r + 1      return(r)

Most people with a degree in CS will certainly know what . It helps us to measure how well an algorithm scales.   But I'm curious, how do you calculate or approximate the complexity of your algorithms?


I have a class object that has a constructor containing input parameters relevant to a product. Once instantiated it's member variables contain result data.  For example:  int parm1 = 1; int parm2 = 2;  MyClass myclass = new MyClass(parm1, parm2);   The MyClass class makes parm1 and parm2 available as public members.  So now I need to create copies of the myclass object, like:  MyClass myclass1 = myclass; MyClass myclass2 = myclass;   But setting a member in any instance of these classes sets the value in all 3 copies. For example:  myclass1.parm1 = 10;   Sets myclass.parm1, myclass1.parm1 and myclass2.parm1 all to 10.  I need to be able to do the following:  myclass.parm1 = 3; myclass1.parm1 = 45; myclass2.parm1 = 5499;   with none of these effecting the others' settings.  How do I create a copy of the initial class object that allows changing public member values without changing those in the original/other copies?

I want to do something like:  MyObject myObj = GetMyObj(); // Create and fill a new object MyObject newObj = myObj.Clone();   And then make changes to the new object that are not reflected in the original object.  I don't often need this functionality, so when it's been necessary, I've resorted to creating a new object and then copying each property individually, but it always leaves me with the feeling that there is a better or more elegant way of handling the situation.  How can I clone or deep copy an object so that the cloned object can be modified without any changes being reflected in the original object?


everywhere I look I can only find derivations of the Gauss–Ampère law $\partial_\alpha F^{\alpha\beta}=\mu_0 J^{\beta}$, and this follows quite simply from the variational method with the Lagrangian Density, but I cannot seem to find any way to derive the Gauss-Faraday law $\partial_\alpha\left(\frac{1}{2}\epsilon^{\alpha\beta\gamma\delta}F_{\gamma\delta}\right)=0$ (equivalently as $\partial_\gamma F_{\alpha\beta} + \partial_\alpha F_{\beta\gamma} + \partial_\beta F_{\gamma\alpha}=0$ "Bianchi identity") also from the Lagrangian Density and Euler-Lagrange Equations. As far as I know the Gauss–Ampère law represents only half of the Maxwell's equations, the other half being represented by the Gauss-Faraday law, does this mean that Faraday's law of induction and Gauss's law for magnetism are not equations of motion of the fields in question?

In Heaviside-Lorentz units the Maxwell's equations are:  $$\nabla \cdot \vec{E} = \rho $$  $$ \nabla \times \vec{B} - \frac{\partial \vec{E}}{\partial t} = \vec{J}$$ $$ \nabla \times \vec{E} + \frac{\partial \vec{B}}{\partial t} = 0 $$ $$ \nabla \cdot \vec{B} = 0$$  From EM Lagrangian density: $$\mathcal{L} = \frac{-1}{4} F^{\mu \nu}F_{\mu\nu} - J^\mu A_\mu$$   I can derive the first two equations from the variation of the action integral: $S[A] = \int \mathcal{L} \, d^4x$. Is it possible to derive the last two equations from it?


I'm hoping someone here could help me with the installation problem I'm having, namely Ubuntu doesn't detect my hard drives. I've tried installing from a disc and using wubi; neither have worked. Drives are detected just fine in Windows 7.  I searched around to see if any of my hardware is incompatible, but didn't find anything. Here's a list just in case I missed something:   Mobo: ASRock H61M/U3S3 LGA 1155 Intel H61 SATA RAM:G.Skill Sniper 8GB(2 X 4) 240 pin DDR3 GPU: GeForce GTX 560 Ti CPU: Intel i5-2400 3.1 GHz Quad-core HDD: Western Digital WD Blue WD50000AAKX 500GB SATA SSD:Intel SSDSC2CW120A 128GB   Nothing shows up in gparted or disk utility when I run the live CD.  I ran the boot info script, the results of which are:  Boot Info Script 0.61 [1 April 2012]   ============================= Boot Info Summary: ===============================   ============================ Drive/Partition Info: =============================  no valid partition table found "blkid" output: __________________________________________________ ______________  Device UUID TYPE LABEL  /dev/loop0 squashfs /dev/sr0 iso9660 Ubuntu 12.10 amd64  ================================ Mount points: =================================  Device Mount_Point Type Options  /dev/loop0 /rofs squashfs (ro,noatime) /dev/sr0 /cdrom iso9660 (ro,noatime)   ========= Devices which don't seem to have a corresponding hard drive: =========  no block devices found  =============================== StdErr Messages: ===============================  No volume groups found    Does anyone have any ideas as to what the problem could be? No one over at Ubuntu Forums had any ideas.

I have a new computer with a Seagate ST500DM002 SATA internal hard drive.  I am trying to install Ubuntu 11.10 64-bit on it but the installer does not recognize/detect/see the hard drive. When I reach the Installation type step, the panel which is supposed to show devices and partitions looks empty.  sudo fdisk -l shows only /dev/sda1, the USB drive from which I am running the installation. I have already tried the following two solutions without any success:   sudo apt-get remove dmraid Switch the SATA mode in the BIOS from IDE to AHCI   I am sure it's not a hardware related problem as I have already successfully installed another operating system on the same computer.  The output of sudo lshw -class storage -class disk follows:    *-ide UNCLAIMED                 description: IDE interface        product: ASMedia Technology Inc.        vendor: ASMedia Technology Inc.        physical id: 0        bus info: pci@0000:06:00.0        version: 01        width: 32 bits        clock: 33MHz        capabilities: ide msi pm pciexpress cap_list        configuration: latency=0        resources: ioport:d040(size=8) ioport:d030(size=4) ioport:d020(size=8) ioport:d010(size=4) ioport:d000(size=16) memory:fe400000-fe4001ff   *-storage        description: SATA controller        product: 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller        vendor: Intel Corporation        physical id: 1f.2        bus info: pci@0000:00:1f.2        logical name: scsi1        version: 05        width: 32 bits        clock: 66MHz        capabilities: storage msi pm ahci_1.0 bus_master cap_list emulated        configuration: driver=ahci latency=0        resources: irq:44 ioport:f0b0(size=8) ioport:f0a0(size=4) ioport:f090(size=8) ioport:f080(size=4) ioport:f060(size=32) memory:fe705000-fe7057ff      *-cdrom           description: DVD-RAM writer           product: DVDRAM GH22NS70           vendor: HL-DT-ST           physical id: 0.0.0           bus info: scsi@1:0.0.0           logical name: /dev/cdrom           logical name: /dev/cdrw           logical name: /dev/dvd           logical name: /dev/dvdrw           logical name: /dev/scd0           logical name: /dev/sr0           version: EX00           capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram           configuration: ansiversion=5 status=nodisc   *-scsi:0        physical id: 1        bus info: usb@1:1.2        logical name: scsi6        capabilities: emulated scsi-host        configuration: driver=usb-storage      *-disk           description: SCSI Disk           physical id: 0.0.0           bus info: scsi@6:0.0.0           logical name: /dev/sda           size: 14GiB (16GB)           capabilities: partitioned partitioned:dos           configuration: signature=0004e5a4   *-scsi:1        physical id: 2        bus info: usb@1:1.3        logical name: scsi7        capabilities: emulated scsi-host        configuration: driver=usb-storage      *-disk           description: SCSI Disk           product: Storage Device           vendor: USB Mass           physical id: 0.0.0           bus info: scsi@7:0.0.0           logical name: /dev/sdb           capabilities: removable         *-medium              physical id: 0              logical name: /dev/sdb   Any idea on what I could do to fix this problem?


I am confused on why would the propagation speed of any EM waves at ANY frequency is constant in the free space (vacuum) but they seem to disperse in any other materials as the propagation speed of EM waves in other materials depends on the frequency? Can someone give me a good proof of this phenomena with appropriate formulas?

It is well known that a  can "split light" by separating different frequencies of light:    Many sources state that the reason this happens is that the  is different for different frequencies.  This is known as .  My question is about why dispersion exists.  Is frequency dependence for refraction a property fundamental to all waves?  Is the effect the result of some sort of non-linearity in response by the refracting material to electromagnetic fields?  Are there (theoretically) any materials that have an essentially constant, non-unity index of refraction (at least for the visible spectrum)?


I am trying to show that if $$f_n(z)=1+z+\frac{z^2}{2!}+...+\frac{z^n}{n!}$$ Then $f_n(z)$ don’t have zeros inside the unitary disk.  I have tryied to use Rouche’s theorem or use that in the limit the polinomial converges to the exponential, but i dont get hoy to do this.

this is a question from a Temple prelim exam, and i'm trapped in it! We have $p_n(z)=\sum_{k=0}^n\frac{z^k}{k!}$ and we have to prove that $\forall r>0 \quad \exists N\in\mathbb{N}$ s.t. $p_n(z)$ has no zeros in $B_r(0)$ for $n>N$.  I tried to use Rouche's theorem observing that $1+\frac{z^n}{n!}$ has the nth roots of $n!$ as complex zeros, which are outside a fixed ball for n sufficiently large, but i'm having trouble proving that $|1+\frac{z^n}{n!}|>|z+\cdots+\frac{z^{n-1}}{(n-1)!}|$ in $|z|=r$ (if this is true). If anyone could help..


I am preparing for the OCP exam and I found this question in a mock exam:  Given:  class Calculator {     private AtomicInteger i = new AtomicInteger();     public void add(int value) {         int oldValue = i.get();         int newValue = oldValue + value;         System.out.print(i.compareAndSet(oldValue,newValue));     }     public int getValue() {         return i.get();     } }   What could you do to make this class thread safe?  And surprisingly, to me, the answer is: "Class Calculator is thread-safe"  It must be that I have not understood correctly the concept. To my understanding, a class is thread safe when all the methods work as expected under thread concurrency. Now, if two thread call at the same time getValue(), then call add() passing a different value, and then they call getValue() again, the 'second' thread won't see its value passed increased.  I understand that the oldValue and the newValue as local variables are stored in the method stack, but that doesn't prevent that the second call to compareAndSet will find that the oldValue is not the current value and so won't add the newValue.  What am I missing here?

Does it mean that two threads can't change the underlying data simultaneously? Or does it mean that the given code segment will run with predictable results when multiple threads are executing that code segment?


When I open some apps from the Start Screen in Windows 8.1, it just closes right away and brings me back to Start.  It won't show me why it closed at all, but I looked in Event Viewer and it says in the description of the event: Activation of app Microsoft.WindowsCalculator_8wekyb3d8bbwe!App failed with error: The remote procedure call failed. See the Microsoft-Windows-TWinUI/Operational log for additional information.  This only started happening recently. It was not right after my Windows 8.1 upgrade, it happened about a week after. I don't remember anything I did differently that could've caused this.  Update: There is a more detailed error about what happened in the Event Viewer. It looks like a message from the original process. It's not a wwahost.exe process, so there must be a native executable for the Calculator app.  Faulting application name: Numbers.exe, version: 6.3.9600.16422, time stamp: 0x5252aa2a Faulting module name: Windows.UI.Xaml.dll, version: 6.3.9600.16408, time stamp: 0x523d4b78 Exception code: 0xc000027b Fault offset: 0x0000000000a4f30a Faulting process id: 0x510 Faulting application start time: 0x01ced4f4c2172eb3 Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_6.3.9600.20278_x64__8wekyb3d8bbwe\Numbers.exe Faulting module path: C:\Windows\System32\Windows.UI.Xaml.dll Report Id: 003d791e-40e8-11e3-825f-e89a8fb9d4bb Faulting package full name: Microsoft.WindowsCalculator_6.3.9600.20278_x64__8wekyb3d8bbwe Faulting package-relative application ID: App   Update 2: The Weather app also crashes, and this one runs under wwahost.exe. I don't know if this helps anything.  Faulting application name: wwahost.exe, version: 6.3.9600.16384, time stamp: 0x5215d0bb Faulting module name: KERNELBASE.dll, version: 6.3.9600.16408, time stamp: 0x523d557d Exception code: 0x00000004 Fault offset: 0x000000000000ab78 Faulting process id: 0x5d8 Faulting application start time: 0x01ced4f76d555461 Faulting application path: C:\Windows\system32\wwahost.exe Faulting module path: C:\Windows\system32\KERNELBASE.dll Report Id: ab102e6a-40ea-11e3-825f-e89a8fb9d4bb Faulting package full name: Microsoft.BingWeather_3.0.1.203_x64__8wekyb3d8bbwe Faulting package-relative application ID: App

How do I get my Windows 8 Metro apps to load? The tiles update, but when I click on them, they spin around and show the solid splash screen, then disappear. Only the Store app opens. I've tried:   Setting user access control to one notch below the top. "Refresh My PC" (Don't do this - waste of time. Deletes all your desktop apps too.) Turned off real time scan of my McAfee anti virus. Went into Store app and updated apps. Ran sfc /scannow Ran the App Troubleshooter.   This is a new computer. I've already ran Windows update. They worked the first few days.  Here is a list of some event log errors:


I have to expose a synchronous ws that allows to acquire the same message sometimes encrypted and sometimes not. How should I do the WS? examples of outbound WS for cryptography?  Please Help me ....

I'm making integration with another system. We have provided for incoming and outgoing synchronous calls. However, the client requested that the messages exchanged between the systems are encrypted. Is it possible to implement such policies? how? I found references to Shield Platform Encryption but it seems to be about the stored data and not the exchange. Is it possible to expose a single WS to receive only part of the encrypted data and not in all the calls?


How do I solve the following limit.  $$ \lim_{x\rightarrow 0}\frac{e - (1+x)^{\frac{1}{x}}}{x}$$  The answer of the limit should be $\frac{e}{2}$.The problem is not that I’m unable to solve but the problem is that I’m even unable to think how to proceed in the first place. I am having no clue how to approach this and other problem like this.  Along with providing the solution for this problem can you please also give me some tips and tricks to handle the limits like a pro. How do you tackle such problems? What are the important things one should take care of while solving any problem on limits which prove to be helpful in solving the problem?  NOTE: I’m a high school student.

Find the following limit: $$\lim_{x\to 0}\frac{(1+x)^{1/x}-e}{x} \tag{1}$$  The following is my approach, although is full of incorrect assumptions (statements etc).  $$f(x)= \lim_{h\to 0}(1+x+h)^{1/(x+h)}\\$$  From here we can say $f(0) = e$.  $$\ln(f(x)) = \lim_{h\to 0}\frac{1}{x+h}\ln(1+x+h)$$  Near $x=0$, we can use the series of logarithm: $$\ln(f(x)) = \lim_{h\to 0}\frac{1}{x+h}\left(x+h-\frac{(x+h)^2}{2}...\right)$$  Differentiating we get:  $$\frac{f'(x)}{f(x)} = \lim_{h\to 0}-\frac{1}{2} +\frac{x+h}{3}  ... \tag{2}$$  Now we note that $(1)$ is actually $f'(0)$ (?) and so from $(2)$ we get:  $$f'(0) =\frac{-1}{2} f(0) = \frac{-e}{2}$$  While the answer is seemingly correct, the method is absolutely not. It looks like this is fluke than anything else.  I also tried computing taylor series of $(1+x)^{1/x}$ near $x=0$ but couldn't do it.


I am catching click on website and closing modal window.  But how to actually check if click occured inside or outside of modal window?      $(document).click(callself(this, function (inst, event) {         var modalElement = $(selector);         if (modalElement.css("display") == "block") {             this.closeButtonClicked();         }     }));

I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area.  Is something like this possible with jQuery?  $("#menuscontainer").clickOutsideThisElement(function() {     // Hide the menus });


I want to be able to control the master volume (not for an application, but for the current active speaker) in Python. This seems to be a tricky topic; I tried doing it in C# but I couldn't even get it to work there. Is there a way to accomplish this? (Windows 7 x64)  Please note that this question has not been answered before since my question is specifically about Python. Also, the project VonC is referring to there does't work on Windows 7.

How can I change the master volume level? Using this code  [DllImport ("winmm.dll")] public static extern int waveOutSetVolume (IntPtr hwo, uint dwVolume);  waveOutSetVolume (IntPtr.Zero, (((uint)uint.MaxValue & 0x0000ffff) | ((uint)uint.MaxValue << 16)));   I can set the wave volume but if the master volume is too low this won't have any effect.  Thanks for any help.


I want to use QSQLITE database, in my python application, however the  I found is in version 4 of PYQT and my PYQT is in version 5, I changed all imports from PYQT4 to 5 but the application does not work as expected. The application was to look like this:  But she was like this:  me when I try to add a row:  sportsconnection.py from PyQt5 import QtSql, QtGui   def createDB():     db = QtSql.QSqlDatabase.addDatabase('QSQLITE')     db.setDatabaseName('sports.db')      if not db.open():         QtGui.QMessageBox.critical(None, QtGui.qApp.tr("Cannot open database"),                                    QtGui.qApp.tr("Unable to establish a database connection.\n"                                                  "This example needs SQLite support. Please read "                                                  "the Qt SQL driver documentation for information "                                                  "how to build it.\n\n" "Click Cancel to exit."),                                    QtGui.QMessageBox.Cancel)          return False      query = QtSql.QSqlQuery()      query.exec_("create table sportsmen(id int primary key, "                 "firstname varchar(20), lastname varchar(20))")      query.exec_("insert into sportsmen values(101, 'Roger', 'Federer')")     query.exec_("insert into sportsmen values(102, 'Christiano', 'Ronaldo')")     query.exec_("insert into sportsmen values(103, 'Ussain', 'Bolt')")     query.exec_("insert into sportsmen values(104, 'Sachin', 'Tendulkar')")     query.exec_("insert into sportsmen values(105, 'Saina', 'Nehwal')")     return True   if __name__ == '__main__':     import sys      app = QtGui.QApplication(sys.argv)     createDB()  main.py import sys from PyQt5 import QtCore, QtGui, QtSql from PyQt5.QtWidgets import QApplication, QTableView, QDialog, QVBoxLayout, QPushButton import sportsconnection  def initializeModel(model):    model.setTable('sportsmen')    model.setEditStrategy(QtSql.QSqlTableModel.OnFieldChange)    model.select()    model.setHeaderData(0, QtCore.Qt.Horizontal, "ID")    model.setHeaderData(1, QtCore.Qt.Horizontal, "First name")    model.setHeaderData(2, QtCore.Qt.Horizontal, "Last name")      def createView(title, model):    view = QTableView()    view.setModel(model)    view.setWindowTitle(title)    return view      def addrow():    print(model.rowCount())    ret = model.insertRows(model.rowCount(), 1)    print(ret)      def findrow(i):    delrow = i.row()      if __name__ == '__main__':     app = QApplication(sys.argv)    db = QtSql.QSqlDatabase.addDatabase('QSQLITE')    db.setDatabaseName('sports.db')    model = QtSql.QSqlTableModel()    delrow = -1    initializeModel(model)         view1 = createView("Table Model (View 1)", model)    view1.clicked.connect(findrow)         dlg = QDialog()    layout = QVBoxLayout()    layout.addWidget(view1)         button = QPushButton("Add a row")    button.clicked.connect(addrow)    layout.addWidget(button)         btn1 = QPushButton("del a row")    btn1.clicked.connect(lambda: model.removeRow(view1.currentIndex().row()))    layout.addWidget(btn1)         dlg.setLayout(layout)    dlg.setWindowTitle("Database Demo")    dlg.show()    sys.exit(app.exec_())

Given the following code, what does the if __name__ == "__main__": do?  # Threading example import time, thread  def myfunction(string, sleeptime, lock, *args):     while True:         lock.acquire()         time.sleep(sleeptime)         lock.release()         time.sleep(sleeptime)  if __name__ == "__main__":     lock = thread.allocate_lock()     thread.start_new_thread(myfunction, ("Thread #: 1", 2, lock))     thread.start_new_thread(myfunction, ("Thread #: 2", 2, lock))


I kept seeing articles about the drawbacks of R-squared (and that's why we need to have adjusted R-squared).   One drawback is that: "Every time you add a predictor to a model, the R-squared increases, even if due to chance alone. It never decreases. Consequently, a model with more terms may appear to have a better fit simply because it has more terms." ().  Mathematically, why does this happen? And mathematically, why adjusted R-squared can solve this problem?

I was skimming through  by Cosma Shalizi (in particular, section 2.1.1 of the ), and was reminded that you can get very low $R^2$ even when you have a completely linear model.  To paraphrase Shalizi's example: suppose you have a model $Y = aX + \epsilon$, where $a$ is known. Then $\newcommand{\Var}{\mathrm{Var}}\Var[Y] = a^2 \Var[x] + \Var[\epsilon]$ and the amount of explained variance is $a^2 \Var[X]$, so $R^2 = \frac{a^2 \Var[x]}{a^2 \Var[X] + \Var[\epsilon]}$. This goes to 0 as $\Var[X] \rightarrow 0$ and to 1 as $\Var[X] \rightarrow \infty$.  Conversely, you can get high $R^2$ even when your model is noticeably non-linear. (Anyone have a good example offhand?)  So when is $R^2$ a useful statistic, and when should it be ignored?


Given the integral $\int_{0}^{\infty} \frac{e^{ax}-e^{bx}}{(1+e^{ax})(1+e^{bx})} dx$  How can I evaluate it? Thanks!

This  $$\ \int_0^{\infty} \frac{e^{ax} - e^{bx}}{(1 + e^{ax})(1+ e^{bx})}dx \text{ where } a,b > 0. $$ is a problem that showed up on a GRE practice test. I believe you're supposed to use complex contour integration, but I'm not sure which contour to use. I think it's the keyhole contour, but I wasn't able to get anything useful.


Edit: This question is related to this one:   I tried the solution given , but it enlarges the line spacing of the table as shown in the second example in the screenshot below.    \documentclass{article} \usepackage{amsmath,numprint,tabularx,xcolor}  \begin{document}  Tabularx table \textbf{without} any color: \textbf{the spacing is normal.}   \begin{tabularx}{5cm}{|*{11}{X|}} \hline \multicolumn{2}{|c|}{$\rm m^2$} &  \multicolumn{2}{c|}{$\rm dm^2$} &  \multicolumn{2}{c|}{$\rm cm^2$} &  \multicolumn{2}{c|}{$\rm mm^2$} \\ \hline &&&4,&&&& \\ &&&4&0&0&0& 0,\\ &0,&0&4&&&& \\ \hline \end{tabularx} \bigskip  Tabularx table \textbf{with} colors: \textbf{the line spacing is enlarged.}  \begin{tabularx}{5cm}{|*{11}{>{\color{blue}}X|}} \hline \multicolumn{2}{|c|}{$\rm m^2$} &  \multicolumn{2}{c|}{$\rm dm^2$} &  \multicolumn{2}{c|}{$\rm cm^2$} &  \multicolumn{2}{c|}{$\rm mm^2$} \\ \hline &&&4,&&&& \\ &&&4&0&0&0& 0,\\ &0,&0&4&&&& \\ \hline \end{tabularx} \bigskip   Table with individually placed colours. \textbf{No problem at all.}  \begin{tabularx}{5cm}{|*{11}{X|}} \hline \multicolumn{2}{|c|}{$\rm m^2$} &  \multicolumn{2}{c|}{$\rm dm^2$} &  \multicolumn{2}{c|}{$\rm cm^2$} &  \multicolumn{2}{c|}{$\rm mm^2$} \\ \hline &&&\textcolor{blue}{4,}&&&& \\ &&&\textcolor{blue}{4}&\textcolor{blue}{0}&\textcolor{blue}{0}&\textcolor{blue}{0}& \textcolor{blue}{0},\\ &\textcolor{blue}{0,}&\textcolor{blue}{0}&\textcolor{blue}{4}&&&& \\ \hline \end{tabularx}  \end{document}   How to color the text without coloring the rest of the table?

The following code shows that a \color{red} command increases the height of a tabular cell. I want to use a switch, not a command as \textcolor{red}{text}.  \documentclass{article}  \usepackage{xcolor} \usepackage{float}  \begin{document}  \begin{table}[H] \begin{tabular}{*{2}{p{0.45\textwidth}}} \hline \color{red} header & header \tabularnewline \hline  %  content  & content \tabularnewline  content  & content \tabularnewline  content  & content \tabularnewline \hline \end{tabular} \end{table}  \end{document}     How can I work around this problem?


I'm mostly interested in C++ answers for this but in addition C answers would be welcome too as they will probably vary. This is a simplified version of the real code to focus on my question so assume what I've written is correct :P  Imagine I have a function called process in a library. This function takes three parameters, a, b, and c Most of the time the function only needs the values of a and b to do it's job but in some circumstances requires c.  Now I want to call this from a main program. process(1, 2, very_expensive_call(55, 67, "Hello"));  Imagine that the value of c is very expensive to calculate. As it's probably not needed I don't want to calculate it unless I have to.  I don't want my main program to have to repeat the logic of knowing if c will be needed. I don't want the library to know about very_expensive_call.  So how can I organize my code to prevent the call to the expensive function while remaining both efficient and elegant?

C++ does not have native support for lazy evaluation (as Haskell does).  I'm wondering if it is possible to implement lazy evaluation in C++ in a reasonable manner. If yes, how would you do it?  EDIT: I like Konrad Rudolph's answer.  I'm wondering if it's possible to implement it in a more generic fashion, for example by using a parametrized class lazy that essentially works for T the way matrix_add works for matrix.  Any operation on T would return lazy instead. The only problem is to store the arguments and operation code inside lazy itself. Can anyone see how to improve this?


Basis: In the clone spell, it states clearly that      The clone is physically identical to the original and has the same personality, memories, and abilities, but none of the original’s equipment.   while simulacrum does not have this text. Simulacrum does state, however, that     Otherwise, the illusion uses all the statistics of the creature it duplicates, except that it is a construct.   The 5e SRD definition of "statistics" also refers to that as its "stat block", which consists of features like its type, race, ability scores, features, and notably, its alignment. And according to the suggested post (), it only makes mention of alignment without addressing personality or memories and does not provide me with a satisfactorily specific answer.  By the language of clone and true polymorph as examples, does a sim'd creature's statblock include its current knowledge/memories and personality?

Everything I read about this spell leaves me with more questions than answers.  Does a simulacrum have the personality of its target? How would that reconcile with a target that is fiercely independent?  If it had no orders, does it attempt to entertain itself, or does it just sit there waiting for orders as an emotionless husk? Does it beg for orders like Mr Meeseeks?  Does it perform its orders and nothing else? If you order it to wait for someone, does it sit motionless until the person arrives, or will it engage in small talk to keep itself occupied?  How specific does an order need to be? Will it follow the letter or the spirit of the order?


I am trying to pass the Latlng from MapsAutocomplete place activity to maps activity where i have the map view but when i try to pass lat lng to moveCamera method its showing null pointer exception but in my logs i am able to get the longitude and latitude can anyone help me with this problem. Thanks  The method where i pass the latlng to another activity:      private void NavigateToMaps(LatLng latLng){      Intent intent = new Intent(Maps2.this,Maps.class);     intent.putExtra("Location", latLng);     startActivity(intent);     Log.d(TAG, "NavigateToMaps: Clicked");  }   In my receiving activity where i need to show the address in the map pointer view:  @Override protected void onCreate(@Nullable Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.map_view);      getLocationPermission();     LatLng locationAdd = getIntent().getExtras().getParcelable("Location");      Log.d(TAG, "onCreate: location" + locationAdd);      double latitude1 = locationAdd.latitude;     double longitude1 = locationAdd.longitude;      moveCamera(new LatLng(latitude1,longitude1),DEFAULT_ZOOM,"SelectedLocation");   }      private void moveCamera(LatLng latLng, float zoom,String tittle){     Log.d(TAG, "location: moving the camera to: lat: " + latLng.latitude + ", lng: " + latLng.longitude );     mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoom));     MarkerOptions options = new MarkerOptions()             .position(latLng)             .title(tittle);     mMap.addMarker(options); }   In my log i am able to get latLng but null pointer is thrown:  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.moveCamera(com.google.android.gms.maps.CameraUpdate)' on a null object reference         at com.example.mappy.Maps.moveCamera(Maps.java:60)  2020-04-24 18:34:30.028 4051-4051/com.example.mappy D/Maps: onCreate: locationlat/lng: (13.007805,80.1273649) 2020-04-24 18:34:30.028 4051-4051/com.example.mappy D/Maps: location: moving the camera to: lat: 13.007805, lng: 80.1273649

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


When libreoffice calc is install in simdock libreoffice calc can not open how can you write in the correct command. Thanks.

i am new at ubuntu and i have installed simdock, and when i use edit in simdock in run command i tried enter:  soffice.bin   and this was for to make it run libreoffice writer, and my question is what to write in to edit to make it run, and i tryied sevel times that could make the icon display but not run libreoffice.


Basically I have a button on my activity that pastes text from the clipboard. My problem is that after testing it, the app crashes if there is nothing to paste from the clipboard (as in, nothing was copied to the clipboard). The paste function works if there is something in the clipboard, so I would like to know how to handle it. I tried handling this kind of crash but it doesn't work for me.  public void PasteText(View v) {     TextView mainText = (TextView) findViewById(R.id.editext);     ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);      ClipData cData = clipboard.getPrimaryClip();     ClipData.Item item;     String text = "";     if(cData.getItemCount() > 0)     {         item = cData.getItemAt(0);         text = (String) item.getText();         mainText.append(text);         return;     }     else     {         item = null;         mainText.append(text);         return;     } }   Logcat:  01-01 15:07:56.860: E/AndroidRuntime(10567): java.lang.IllegalStateException: Could not execute method of the activity  01-01 15:07:56.860: E/AndroidRuntime(10567):    at android.view.View$1.onClick(View.java:4025)  01-01 15:07:56.860: E/AndroidRuntime(10567): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.ClipData.getItemCount()' on a null object reference  01-01 15:07:56.860: E/AndroidRuntime(10567):    at com.karimo.tester.MainForm.PasteText(MainForm.java:109)  01-01 15:07:56.860: E/AndroidRuntime(10567):    ... 13 more


This was by a writer who had also made books about a plague that was found by genetically engineered humans deep underwater. Later books in that series followed the women who discovered the plague through an apocalyptic USA in search of vengeance (?). In the spaceship story, they got their energy though some kind of quantum bridge from a station in close orbit to the Sun. The vampire character had a console where every indicator was a screaming face of some kind, because that was the easiest way to gather information for him. In the end it is (implied?) that Earth has been taken over by vampires.

About a decade ago, I encountered a novel or a novella that I cannot locate.   The setting was Earth, about one century into the future.  I remember vampires and a mesh of satellites around the Earth that were burning up in the atmosphere.  This motivated a mission to deep space to find the intelligence responsible for the satellites.  Most of the novel focused on the crew of the mission — I recall that they were not "standard" humans.  They had modifications to their minds and bodies, possibly for the mission.  At the time, I had gone on a binge, reading many short stories, novellas, and novels in quick succession.  I fear that I might be combining several stories into one, especially the vampires and the deep-space first-contact mission, and so I am fully prepared for an answer of the form, "No such story exists."  Any assistance would be greatly appreciated.


I've come across this expression ((void)(obj), (size_t)0)  What purpose does this expression (that looks like half a function signature) serve here?   :   #define ers_alloc(obj,type) ((void)(obj), (type *)aMalloc(sizeof(type))) #define ers_free(obj,entry) ((void)(obj), aFree(entry)) #define ers_entry_size(obj) ((void)(obj), (size_t)0) #define ers_destroy(obj) ((void)(obj), (void)0) #define ers_chunk_size(obj,size) ((void)(obj), (void)(size), (size_t)0)


If I have a file that I want to reference or put up to ask a question on how would I do that? Bearing in mind that I'm a new user.

I posted a question and a couple of respondents asked for the source code. I could only post portions of the code.  If attachments were allowed I could have uploaded a .zip file with the whole application.  Will this be a feature in SO?


Is the function $d : \mathbb C \times \mathbb C \to \mathbb R$ defined by $d(x,y):=\dfrac {|x-y|} {\sqrt{1+|x|^2}+\sqrt{1+|y|^2}}$ a metric ? I can easily prove it is symmetric and positive-definite ; but cant make any headway towards the triangle inequality . Please help

Show that $(X,d)$ is a metric space where $X =\Bbb C $ and the distance function is defined as:   $$d(x,y) = \frac {2|x-y|}{\sqrt {1+|x|^2} +  \sqrt {1 + |y|^2}}, \text{ for } x,y \in \Bbb C.$$   I have done the proof of the first two propositions for being a metric, but I'm having a problem in proving the triangle inequality.


I'm on a 64 bit OS on a Mac with 8GB of RAM. I need to allocate 2.9GB to some arrays of bytes in a program written in Java (I simply declare them). Since by default you can't use more than 1GB of heap space for running a java project, you need to specify in the VM options if your program needs more. I am on IntelliJ Idea, so I do this by going on Help -> Edit Custom VM Options and then changing the -xmx field. But no matter how many MBs I allocate, the program can't run due to this exception: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space, as if I didn't change anything in the VM options. The PC has enough free RAM to contain arrays of 2.9GB when running the program.

I am writing a client-side Swing application (graphical font designer) on Java 5. Recently, I am running into java.lang.OutOfMemoryError: Java heap space error because I am not being conservative on memory usage. The user can open unlimited number of files, and the program keeps the opened objects in the memory. After a quick research I found  and others saying on Windows machine the JVM defaults max heap size as 64MB.  Given this situation, how should I deal with this constraint?  I could increase the max heap size using command line option to java, but that would require figuring out available RAM and writing some launching program or script. Besides, increasing to some finite max does not ultimately get rid of the issue.  I could rewrite some of my code to persist objects to file system frequently (using database is the same thing) to free up the memory. It could work, but it's probably a lot work too.  If you could point me to details of above ideas or some alternatives like automatic virtual memory, extending heap size dynamically, that will be great.


i am trying to add a new line to a file using sed :  sed -i '/<field name="Users" indexed="true"/>/a <copyField source="New_user" dest="text"/>' $RTDIR/schema.xml   i get an error: unknown command: `>'  how can i make it work? and also, the change will be permanent?  Thanks!

I am looking for a way to replace a string in a file with a string that contains a slash by using sed.  connect="192.168.100.61/foo" srcText="foo.bar=XPLACEHOLDERX" echo $srcText | sed "s/XPLACEHOLDERX/$connect"   The result is:  sed: -e Expression #1, Character 32: Unknown option for `s'


I change owner of some root files and folders like /etc/sudoers to www-data by mistake! And now I can't use "sudo" at all! How can I change them back to my user? It a ubuntu 18.04 server and I can olny access it via ssh.

I accidently ran  sudo chmod 755 -R /   instead of  sudo chmod 755 -R ./   I stopped it after few seconds, but now there is some problems such as  sudo: must be setuid root   How can I revert permissions back?


If I have incense active is there a difference in standing still or actively moving around? Would moving around make the incense ineffective or increase its effectiveness in any way?

The item "Incense" has the description:     Incense with a mysterious fragrance that lures wild Pokémon to your location for 30 minutes.   Does this mean that if I stay still, over the next 30 mins Pokémon will come to me, rather than me walking around to find them?


I have two questions related to the MWE shown:   How to append a percent sign to only cells of a column, or of a row by using siunitx package whether the tabular is defined by row or by columns. ? (I know I can put it only in the header but it's not the point). How to add a vertical space, it doesn't work with the commented \vspace*{2cm}?   PS: I am not familiar with this package yet.  Here is a simplified MWE picked from :  \documentclass[preview,border=5pt]{standalone} \usepackage{booktabs} \usepackage{siunitx}     \newcommand\mc[1]{\multicolumn{1}{c}{#1}}  \begin{document}     \begin{table} \centering %defined by rows \begin{tabular}{ l*{5}{S[input-symbols = {()},                               table-space-text-post=\ ,                               table-format=-1.2]}} \toprule \multicolumn{4}{c}{Panel A: $\beta_{\sigma,t}$} \\ \midrule & \mc{Low}  & \mc{Med}  & \mc{High} \\  \midrule MV  & 1.64  &  1.14  &  1.58  \\     & 1.17  &  0.97  &  0.87  \\ TA  & 1.90  &  1.03  &  0.88   \\ \bottomrule \end{tabular} %\vspace{2cm}  %defined by columns \begin{tabular}{ c*{4}{S[input-symbols = {()},                               table-space-text-post=\ ,                               table-format=-1.2]}} \toprule \multicolumn{4}{c}{Panel A:  $\beta_{\sigma,t}$} \\ \midrule & \mc{Low}  & \mc{Med}  & \mc{High} \\  \midrule MV  & 1.64  &  1.14  &  1.58  \\     & 1.17  &  0.97  &  0.87  \\ TA  & 1.90  &  1.03  &  0.88   \\ \bottomrule \end{tabular} \end{table}         \end{document}

Why in the following tables the results of formatting of S columns are different, i.e. dependent on, where the column is in table? Consequently those tables have different width.  \documentclass{article}                \usepackage{siunitx}     \usepackage{array}  \newcommand\mc[1]{\multicolumn{1}{c}{#1}}      \begin{document} \begin{tabular}{c c|                   *{2}{S[table-format=2.2,                        table-space-text-post=\si{\,\%}\ ]<{\,\%}|}                 }     \hline A  &    B       &   \mc{C}  &   \mc{D}  \\  \hline xx & xx xxx     &   12.34   &   56.78   \\  \hline \end{tabular}  \bigskip \begin{tabular}{c|                  *{2}{S[table-format=2.2,                        table-space-text-post=\si{\,\%}\ ]<{\,\%}|}                 c}     \hline A  &   \mc{C}  &   \mc{D}   &    B     \\   \hline xx &   12.34   &   56.78    & xx xxx   \\   \hline \end{tabular}     \end{document}     As you can see, the difference is in the space between numbers and accompanied sign \%. Probably in formatting of D columns I miss something obvious :-(


I created a Custom Post Type called News, which supports Title, Editor, Thumbnail and Custom Fields. One of the Custom Fields is URL. What I need now is to turn the Title in a external link in the loop, using the URL provided in the URL Custom Field. Any ideas?

I want to let my users submit links to my website something like reddit and digg. I added a meta_key 'syndication_permalink' which contains link to this post. How  could I change the post permalink to link this custom link not to my page?


Just loaded up after months of not touching blender. And I can't get rid of the weird shadow in the middle of the object or get materials to display. To be clear this only happens in Eevee while everything is normal in cycles. This is affecting both basic shapes I'm adding in & old blend files that would display their materials properly. Feel like I'm missing something basic but I could also swear it never used to be like this.

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


I need to load all layer names into a combo box. I did the same using esri site. But the tool is showing [missing].  import arcpy import pythonaddins   class LayersComboBoxClass(object):      """Implementation for Tools_addin.combobox (ComboBox)"""       def __init__(self):         self.editable = True         self.enabled = True      def onFocus(self, focused):         # When the combo box has focus, update the combo box with the list of layer names. if focused:         self.mxd = arcpy.mapping.MapDocument('current')         # Edit position in code         layers = arcpy.mapping.ListLayers(self.mxd)         self.items = ["item1",item2]

I am running into an error. I have a set of functions which I want to import in the python Add-In script at the time of execution, but when I built Add-In with "import stats" line then tools are unresponsive. Any suggestions whether it is possible to import functions in the Add-In script?  import arcpy import os import pythonaddins import stats  optfolder = "C:/temp"  class AoI(object): """Implementation for rectangle_addin.tool (Tool)"""     def __init__(self):         self.enabled = True         self.cursor = 5         self.shape = 'Rectangle'         os.makedirs(optfolder)      def onRectangle(self, rectangle_geometry):    """Occurs when the rectangle is drawn and the mouse button is released.     The rectangle is a extent object."""          extent = rectangle_geometry         arcpy.Clip_management(r'C:/temp/ras', "%f %f %f %f" %(extent.XMin, extent.YMin, extent.XMax, extent.YMax),                               optfolder + '/ras1', "#", "#", "NONE")         arcpy.RefreshActiveView()


I've got the following problem when i'm counting in javascript.  var processAmount = parseFloat(166.98) - parseFloat(61.58);   The result is: 105.39999999999999  Doesnt matter if I use parseFloat() or not.  How can I solve this?

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


During our ongoing research, we need to prove that $\pi e<\lceil \pi e\rceil$. Is $\pi e$ irrational?  How to prove it?  Thanks- mike

A little reading suggests:  It is known that either $\pi + e$ or $\pi \times e$ is transcendental (or possibly both), but no proof is known that one of those two numbers in particular is transcendental.  If we just want irrationality rather than transcendence, is a proof known?  Can we prove $\pi+e$ is irrational?  Can we prove $\pi \times e$ is irrational?


If I have a .class file, how do I open it/view the source code? I think I have to decompile it first, but how the heck do I do that?

What program can I use to decompile a class file? Will I actually get Java code, or is it just JVM assembly code?  On Java performance questions on this site I often see responses from people who have "decompiled" the Java class file to see how the compiler optimizes certain things.


I'm hosting a site for a "virtual event" and I want to make I have enough resources on the server. Please can someone confirm the rough requirements for the below:  Up to 2000 visitors during a 2-day event – mostly watching an 'event' page which will load two iframes – a Vimeo video stream and a polling iframe a very small marketing site running on PHP (no other fancy tech) – only using some basic PHP includes and PHP variables to set some classes  I currently have:  An VPS on Digital Ocean with 1GB of memory, with an SSD hard drive Running NGINX OPCache turned on The server is located in the same city as the virtual event that's being promoted, so in terms of server location this should be good  Are these specs enough? Should I upgrade the server (e.g. 2GB memory)? Do I need something like a load balancer?

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