I am trying to run the cron jobs based on specific conditions using spring boot. Ex: if(bankName=="Sbi") then run the sbi job scheduler, if(bankName =="City") then run the city job scheduler and so on.  I am getting bank name through the database (service which fetch the bank details by customer account number) and I am not able to run the job based on the specified condition.  I am expecting output as bank name is 'sbi' then run task1 job and bank name is 'city' then run task2 job. But it run task3 job(bank name is 'hdfc') also even the if condition not met.  Please find below code snippet.  Note: I have put the break-point in SchedulingTask.java file for debugging purpose but it seems not hitting this break point. Please guide me how I can fix this problem.       @SpringBootApplication             @EnableScheduling             public class SpringBootApp {                 public static void main(String[] args) {                      SpringApplication.run(SpringBootApp.class, args);                     // new SchedulingTask();                 }             }              @Configuration             @EnableScheduling             public class SchedulingTask {             /* I have to get the Bankname from database  for testing i am hard-coding the name*/                     String [] bankName = {"Sbi","City"};                              void  foo(String[] bankName) {                         for (String name : bankName) {                             setBankName(name);                         }                            }                  public  void setBankName(String name) {                     if(name.equalsIgnoreCase("sbi")) {                           new Task1();                     }                      else if(name.equalsIgnoreCase("City")) {                                 new Task2();                     }                      else if(name.equalsIgnoreCase("Hdfc")) {                                  new Task3();                     }                 }                }  @Configuration @EnableScheduling public class Task1 {      @Bean     @ConditionalOnProperty(value = "Sbi", matchIfMissing = true, havingValue = "true")     public SchedulingTask1 scheduledSbiJob() {         return new SchedulingTask1();     }  }  @Configuration @EnableScheduling public class Task2 {      @Bean     @ConditionalOnProperty(value = "City", matchIfMissing = true, havingValue = "true")     public SchedulingTask2 scheduledCityJob() {         return new SchedulingTask2();     }  }  @Configuration @EnableScheduling public class Task3 {      @Bean     @ConditionalOnProperty(value = "Hdfc", matchIfMissing = true, havingValue = "true")     public SchedulingTask3 scheduledHdfcJob() {         return new SchedulingTask3();     }  }  @Component public class SchedulingTask1 {     @Scheduled(cron="*/2 * * * * ?")     public void sbiTask() {         System.out.println("sbiTask method excuted at every 2 seconds.  Current time is :: " +new Date());     } }  @Component public class SchedulingTask2 {     @Scheduled(cron="*/4 * * * * ?")     public void cityTask() {         System.out.println("cityTask method excuted at every 4 seconds.  Current time is :: " +new Date());     } }  @Component public class SchedulingTask3 {     @Scheduled(cron="*/6 * * * * ?")     public void hdfcTask() {         System.out.println("hdfcTask method excuted at every 6 seconds.  Current time is :: " +new Date());     } }

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?


Consider the following command:  echo ’.dump’ | sqlite bacula.db > bacula.sq   What is it doing and what does | do?  Maybe someone could point me to a manual about piping, or explain what is going on. Thanks.

I don't quite understand pipes in Linux command line.  I noticed that:  ll - R | grep *.pdf   will list files ending with  .pdf  But   locate *.pdf | du -h   will not calculate the size of files ending with .pdf. Rather it will list the size of files in the current directory.  What is going wrong here?   What I have in mind is the output of the first command is the input of the next.


This is my string   username=john903?fullname=john&smith   This is my regex so far  =([^?]*)   I am trying to capture "john903"  However this currently returns "=john903"

I want to match a portion of a string using a  and then access that parenthesized substring:  var myString = "something format_abc"; // I want "abc"  var arr = /(?:^|\s)format_(.*?)(?:\s|$)/.exec(myString);  console.log(arr);     // Prints: [" format_abc", "abc"] .. so far so good. console.log(arr[1]);  // Prints: undefined  (???) console.log(arr[0]);  // Prints: format_undefined (!!!)   What am I doing wrong?    I've discovered that there was nothing wrong with the regular expression code above: the actual string which I was testing against was this:  "date format_%A"   Reporting that "%A" is undefined seems a very strange behaviour, but it is not directly related to this question, so I've opened a new one, .    The issue was that console.log takes its parameters like a printf statement, and since the string I was logging ("%A") had a special value, it was trying to find the value of the next parameter.


Looking for a replacement for Sketchup in Ubuntu.  Simple is good.  I only really need to draw plan view.

I would like to know the various tools available in Ubuntu similar to Google Sketchup.  I dont like to install Sketchup using wine in Ubuntu.


I found an old archive filled with old folders on my pc. I would like to know how to make a copy of this archive, but keeping everything intact, including their date of creation

I need to a copy file and after that I need to change the timestamp attributes as the original file. How can I do it with the terminal or any other way?


I basically want to save state of some object to restore it later, these objects are not attached to the DOM and are not html elements, just objects in Javascript. I am not interested in a debugger/visualization tool.  But I need the actual code of the custom event listeners that are also attached to the object.   These event listeners were attached via jQuery and the functions were anonymous and provided by the user.  Is there anyway to accomplish this?

I have a page where some event listeners are attached to input boxes and select boxes. Is there a way to find out which event listeners are observing a particular DOM node and for what event?  Events are attached using:    Event.observe; DOM's addEventListener; As element attribute element.onclick.


I'm getting the message E: Malformed line 1 in source list /etc/apt/sources.list.d/bitdefender.list (dist) E: The list of sources could not be readwhen I try to open software centre through terminal and a red stop sign at the top of my screen.>  I know the reason for the problem, I tried installing a free bitdefender security, but don't know how to fix it and delete the malformed line, any help would be greatly appreciated.

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


Let $S$ be the collection of closed intervals in the real line whose lengths are positive rational numbers. Determine the cardinality of $S$. Justify your answer  As I understand, $S$ will be an infinite set of positive rationals. Would that mean that its cardinality will be equal to $c$?

What is the cardinality of the set S of all closed intervals on the real number line with rational (positive) lengths?  I believe the number of intervals with a specific fixed length but varying start points is |R|, and the number of intervals with a fixed start point but varying lengths is |Q| = |N|. I think the answer to the question would then be |S| = |R x N| = |R|? I'm not quite sure how to prove the last equality though. Would I have to define a bijective function that maps elements of (R, N) to R? How would I approach doing so?


Prove that there is no simple group of order $216=2^{3}\cdot 3^{3}$.   I feel like I am supposed to use the Index Theorem here but when I use Sylow's Third Theorem I have that $n_{3}\in\{1,4\}$. I am not sure how to rule out the possibility that $n_{3}=4$. If I could then could use the fact that the unique Sylow 3-subgroup is normal in G to factor it and apply the Index Theorem. Any suggestions?

How can we prove that "Every Group of order $216$ contains a normal subgroup of order $27$ or $9$ ?".  MY TRY: $216=2^3.3^3$.So possible order of sylow $3$ subgroup is $1$ or $4$ and similarly for sylow $2$ subgroup is of order $1,3,9\,\text{or}\,27$.Then how to proceed $?$Thank you


I want to prove that the closed interval [0, 1] has same cardinality as Real Numbers. I was able to figure out (0, 1), but need help with proving the closed part. What I have so far is:  the function $y = tan x$ gives us a bijection between $(−π/2, π/2)$ and $R$, and that the function $y = (2x − 1)π/2$ gives a bijection between $(0, 1)$ and $(−π/2, π/2)$. Therefore $y = tan (2x − 1)π/2$ gives a bijection between (0, 1) and $R$.  How do I finish this off for the closed aspect?

Assuming we know that the cardinality of $(0,1)$ is $c$. Can we from this determine the cardinality of $[0,1]$? Is it valid to say that $[0,1]$ also has cardinality c because adding a finite number of elements to $(0,1)$ (i.e. including the boundaries) does not affect the cardinality?


How can I run through the tabs in Notepad++ easily?  I would like to use Ctrl+PgUp/PgDn like in Firefox.

How can I switch to the document to the left or right of the current document in Notepad++?   For example, if I have documents A, B, and C open, and I'm currently editing B, I would like a shortcut to be able to:   switch to document A, like. . . (Alt-LeftArrow or Ctrl-Pageup)    OR   switch to document C, like. . . (Alt-RightArrow or Ctrl-PageDown).    All I've found is a way to switch to next or previous documents based on the "history" of when the document was last opened, for example:  (Ctrl-Tab and Ctrl-Shift-Tab)  The examples I have found are useful, but not what I want.  Is what I am asking for possible?


$x,y,z$ $\in\mathbb  R$ then $|x-y| \leq|x-z|+|y-z|$  Prove this statement.  I thought it was the triangle inequality, but I can't seem to end up with the correct order.

Let $a,b,c$ real numbers. Prove the inequality $|a-b| \leq |a-c| + |c-b|$. Prove that equality holds if and only if $a \leq c \leq b$ or $b \leq c \leq a$.   I've tried starting with just $a \leq c$ and using field properties to reconstruct the inequality, however I haven't been able to make it work. I also tried making the negatives positive and stripping the inequalities and making something happen but again I don't know if that's a proper rule and it didn't seem to get me anywhere.


Brand new to c++ and im having difficulty splitting on a string. I have seen some examples of this on stack overflow, but I could not get the samples to work when looping in the for loop.  Essentially I have an array of strings that looks like.       const string userData[] =    {"A1,John,Smith,smithJ@mail.com,42",    "B2,Jane,Doe,jd@gmailcom,121,2",    "C3,Mickey,Mouse,mouseman@mail.com,20"    };      Below is the closest I have gotten to a solution myself   string s;  vector<istringstream> streamV;  vector<string> stringV;  for(const auto& str : userData)  {       istringstream nasa { str };       getline(nasa, s, ',');       stringV.push_back(s);   }  cout << stringV[0] << endl;  cout << stringV[1] << endl;   Output  A1 B1   Desired goal: I want to have each comma separated value added to a vector. Then, call out class constructors doing some inline typecasting for the last value from a string to an int.  Edit1  I understand my question is similar to  The main difference was that the solutions provided did not work well with a comma separated list, and as well iterating through an array/vector.

I'm trying to iterate over the words of a string.  The string can be assumed to be composed of words separated by whitespace.  Note that I'm not interested in C string functions or that kind of character manipulation/access. Also, please give precedence to elegance over efficiency in your answer.  The best solution I have right now is:  #include <iostream> #include <sstream> #include <string>  using namespace std;  int main() {     string s = "Somewhere down the road";     istringstream iss(s);      do     {         string subs;         iss >> subs;         cout << "Substring: " << subs << endl;     } while (iss); }   Is there a more elegant way to do this?


I am trying to understand the following solution to  question. The question was  Let $\alpha \in (0,1)$. Find a Borel subset $E$ of $[-1,1]$  s.t. $$\lim_{r\to 0^{+}} \frac{m(E\cap [-r,r])}{2r}=\alpha.$$  and one of the response to this question was  You can get any density $\alpha\in (0,1)$ you want. The idea is first to consider a decreasing sequence of positive numbers $x_n \to 0$, such that $\frac{x_n}{x_{n+1}}\to 1$ ($x_n=\frac{1}{n}$ works). Then in every interval $I_n=(x_{n+1}, x_n)$ place a segment of $E$ in proportion $\alpha$ (if $\alpha=\frac{1}{3}$ say take the middle third). Now consider $E$ the union of all the pieces in the intervals $I_n$. Do this symmetrically in the negative side of $0$. You got your set $E$.  I am taking $\alpha = 1/3$. Now, I am having trouble verifying the answer. How can I show that it is indeed the case that $\lim_{r\to 0^{+}} \dfrac{m(E\cap [-r,r])}{2r}=1/3$ for the $E$ I have above? Most importantly, I am having trouble analyzing what $m(E\cap [-r,r])$ would amount to. Any hints or help would be greatly appreciated!

Let $\alpha \in (0,1)$. Find a Borel subset $E$ of $[-1,1]$  s.t.    $$\lim_{r\to 0^{+}} \frac{m(E\cap [-r,r])}{2r}=\alpha.$$   In fact, for a similar result in $\mathbb{R}^d$ also holds: $$D_{E}(x)=\lim_{r\to 0} \frac{m(E\cap B(r,x))}{m(B(r,x))}$$ we just consider the unit circle and $E$ is a sector with angle $2\pi \theta$ where $\theta\in(0,1)$, then $$D_{E}(x)=\frac{2\pi \theta }{2\pi}=\theta$$  But how about the $\mathbb{R}$?


I read this story a couple of years ago but can't seem to find it since.It's a short story.  The story starts with a programmer debugging a program and not being able to find the bug. Frustrated, he decides to disassemble the program and look at the assembly and found instructions that can't possibly come from the original source code. He then looks at the compiler for the source of the bug and even recompiles the compiler but the alien code still managed to make it into the program.  Then he decides to actually see what the alien code does and finds that it's trying to do something simple like adding two numbers but doing it in a completely non-intuitive way. He concludes that no human would do it that way and starts suspecting a virus.  Later he finds alien code everywhere from the compiler (not in the source of the compiler) to the assembler to the OS down even to the router in his office at which point he begins to suspect that the alien code may even be part or the CPU itself (modern CPUs after all are designed on computers).  The story ends with the programming team receiving a letter from another engineering team (I forget if it's Geneva or Tokyo or somewhere else) stating that they've found the same thing but every effort they've tried to publish their findings got censored by the emerging AI (hence the handwritten letter).

I am looking for a short story I read online a few years ago, about artificial lifeform, with a hard sci-fi taste.  A couple of software engineers were trying to identify a strange program behavior on a new system in development, but digging through the outer layers of software source didn't explain the seemingly random issues they observed. After hours of debugging, they identified unexpected output at the compiler level.  One of the developers manages to craft a workaround, only to see additional issues appear around the fixes, and he begins to fear a backdoor might have been planted in the compiler, which seemed tainted much like the Ken Thompson hack. As this might eventually jeopardize the entire project, they spend more and more time on the issue itself, but as time passes, the deeper bugs they discover and fainter they become.  In the end, it seems like some artificial intelligence tried to emulate evolutionary pressure by establishing a form of communication channel, and having groups of humans around the world fixing the most obvious software outer layers. Even computer-assisted hardware design could be contaminated at this time, but in such complex a way they might go undetected for a long time, now adapted to the silicon environment.  I've been literally searching this story for months, and begin to believe I dreamt of it and should start writing myself.


Hoping someone might have experienced this and know the culprit code. This keeps appearing below some pages intermittently. Only on logged in members.

My site working very effectively on my localhost, but when I move the working site's all folders and files to Live Server i.e to cPanel, Its only display unexpected symbols that are given below.  ‹Ý0M™å‘/ðë¥R!ŒH6L¨½¯Tl³/)4-/`4A‹.iÌ$³·†1‚š–b·Ê¹¢jZ-"¯i!¶=Ç¡Wô¶Ö¢c.kžu›pW:W_R–ÚF½¶™Õj!jWÒj5ƒ°µöÃb‚¹hB:=ú…4Íçÿ Ÿ>ÿ’ubK-NeýS¥#™Ú÷<‘FªR%•ûöËÝÍÍ—õm{£òùÅ<CR€u"Ôµ±/”hŒJ¨w}F{¼”Zï¦‘‡oýùZ,Oä¿G{ð&i:¯y`ðŠkë#o¥ F`xMû&©Lh¥26ˆÊaäÁ(•¤l¬æ š×+8]r¯Bš%êðÐ¸¢Zœ%<_I6Ðq¤*dÏÔ¡zssSyAþƒT²É¶iDƒ¡âž™r t%K,¡¨²,i©LLùzxI{¨å‘ÀŸêŸG°²ƒ#ˆÔ    ¬Ë$KÔk¾„÷À;ÈB;ß^¬gå‘%éZÀ£kÒOX·™sß—“fêIùk—†<6©{[õzuÃüçà5¸W} µ—Em«(½‚öWEm·^¯„ÍŠv²Ï˜ªS6“„*°iY2qh·HÈ|NÁõÕúG§¤HšëÖHñµ’):àR âÈ¡–}j.•¬†E»êv×µ@1G³”Êb“–ÈêÂ¶N€Ê]™’q'”±P‹ØM¹ø‘¦1Ãº‰+n;Øûxm%ø}ð0úG,_VŒ6q;zVLsÌ½k–Ô6j¯1ç]Îß`5å•pˆl›Â½ÆkàUÏÜ'¬00Ø½~öY‰¬©Ëœ”“z´XRVŽ6?õÊÅ•“€È&aEaµè!Î‹c¹}ËìóˆÉL%j[®HÓ]Htd¦ôÜ®/wI†,qÖ¥i F®*kèèþÕøDqºÙW3ß`þ©êˆ.Úw=Y.½fž2ëÌKZÖñ¦GÉ<Ÿˆ9$Ø¡pù#gk> W%!:Žçèt©#ÆÔ"ƒƒU~–¸’¿šµÚVù<±"ä"òXNas•øý$i€¨3Õ¬·>i¦_Õ6WÅõrQËªåQ‡C%œÙyÙ)…lÒòºmŽ™OÅÉ”s¼•Ÿ“ìý|ò÷ÑC'ÔÚwùõ'Ygçô8Ú<áZ›í_¯ò´J- .xwø„*¾‹…œ€õ‘â;°`Ð|Ê£íí» ‡ƒþmÛql»ÕøñÓÁáþåþ'ÇiaãÚÕ_õ´‹üõC³OI¦”I„~µ0ÑpFUßÚ³ÚŽUµb(Ÿ%¬Ëo¡ê¸ý`FìBUX{_--ô#uGG‰kA÷ÎÇƒóð ÷ã«wÿ•þ>è½ ¶w½_Þ~<Œ/6?ü1ŒÞ}8í¥ÁÕ[  °WQã:l"ko£:Þ–mà¥Žbç-µe;¦nÑúoã´s÷ÒßÝÚS›Ý`±KÆ–K³7ª»Éd©vO³?´ó ¢=‡X–Ü»Ï‡›ðÃíŽ¹4 %‡:…Ò,†öÄj0üL;Ã‡€—ÙRà…Z ªì@XXÍ·ª…\¹âM¢¬=™4Êž3¨HúÝ1j”Ì[8°HÒÍ7Q=‘S{àR\‰“Û.ò`í"v/âÍÌt’k\:_• o²WóI%¢ÚÓy©qôFö1‘GJÕù£v)´`}fùv‘j¥ˆî   ™e|ÚÙŸ{BëtN{,±sÈ}KÞŸÌƒ˜9?È>÷ðU Ó!”Ù&lýDK¿\Ù‹DÄòÉrŒ¼wjÿžÊï#:£|R¿[ý\hD¼§ùö Ûs]èŒæeŽ`s‹À¶4tŠ<ì¾6:òÉQwä‰~€ÿ²ž¿áyQKÅpümÓfLå'Ù7x†¬¼¨yœf«á+Ûp#%ºÙ%Ä [·@ÿ /¡ôØoY!ûŽ¿ð)Ià¦øÚŽp¿iåXD?‹lZƒµ(ˆG4°Ç›•&«uÐ"¶¬9seN   UP’Cú¸§Ë˜FÅÞ Vk#\ë÷£“äŸÿìC7î³†ß‰i79ó—S#%Æ Ê––r¬nÊ”Œ",–Ð J5)ÓViavy"a· ’Ï|â'"öÅY§ÙR„¹ˆ;" 8.Ï,—©ob ,ãÓð“Õº\ãú…•É”ŽíP«zmŽ$*ÈÌábÈîZÑ—}FD4‡Ï äßÓ4!X¼×"(´š0†úÄÏR€×È‚f…ûOhŒc«u†Ÿ»&o¶ô¿ø,åÐÎq!‚²&£ÂÖkhÏÜ½¬CŸ7=e§_‡Õ*McÑ¢AÌÚ5˜Âl}cqáæ–5¬ÍPÚû¤dó` ¢žQü37öqëâòã#²rHÞì_¼{zBÞœž“w§¿5œx;S•¢˜LÞó ivtà`AŒ(f[zI–IxžLÃßÌ+õ9ÆªsYF=›£;%ý¬«´d   §5¼µ¡a  Má˜Ð!   „ˆg…ý ~Çc;/³Pã-+‹guƒƒ Ï@ë8]lxº7Ì Ç  ë–™”…{–«ÝÈÊTm~¯Éz¹Y‡c˜Îm6Íúœcgƒ….øÇÉ.oºh8šØLM8F3¬ÖÑ¨§Ì}F„¾8hÏVÔÏ¥Õ×ÎÊ¥Q„âåÔ¬ˆõ§ýó÷ót]J&¤¡-K%þ.Üá!œÓî“NÌ_u9>·É!í3ù€Î†9$Ï?Ò—·§¾¸PÍ7¨ùP%…¸B¹â@ïÈf”Ev]ˆ   ÈduYYÃ!^gø¾ß©ß%å´=˜fúcšÌ&Ü{“Êö&Ø_‹mj´/¹ø«iáÿÑÍéUi) Ì-LpüÂò‹i´–fÇyk‹ñéãRZ`RùË¡¤=]éB›g°K»©·¼t1œå6Æáf³ùÀe5Ó°vfÖtÙ¬&Oókw»¸g6ª3Œõ¹wžöì×‚ª•ûð9æõ×¾#ƒùHô\,s.ÇKÛÚ]æ¶5Ó=(0ö8ÓË/’¦.Ë²_áÖW0w;¼ïnŸû‘×É1lI×Ççwïÿ¼&ºí¦RD]æê© ôóÜ~o8K`UàwüîŸÑüâÄ÷”„ åÿ¹c¼IÂb&žÍðVÝv…POðšcc³dÿ†FÄsB[¼…Û|l3ÚÆß>7f2ÏiD'-ñí‚¥SH‚ÂaÊüÜšÁq!ÓÌ¾,16S¦9I7)‰S®Ìºb”Kç §¯ŠÜ`œðõ†¶ÄgßxYˆ9YÝD.ò¦±Äé\ ÄPÚPó¹¾ˆ±Z—ØBþ†ñ/ä h¿/¾¬+ÀÎ_ ‚kPiÙ±¸7Ä+&ÓžÑ8×½äL÷N¤9—°Ò¼_Ö§–Y‹mÏ0õÙ¶¸1f‹*b7šÈ4ô»güS+x;Añíû(NÕQHy°’¥.ÞœºŒ(ADš|c0|cB!lëN‹,oÖ£‡½ööŸÂ¶Iþ'uÀƒ$a‘g±)sY„j9ñ  ™ê*RùJ FTÄB”Çbe{}šHŒ±>\¾±w,æ1]ëñà’C¢K˜Ã³ñ^¿&E¯3i_žkXYÏ‘þŽïD:Á?ö’0¿¸¿ìs<1#z(äÝ5«õïÅu1   °YŽVTz`„‘ÍþŠ)hê›uÉÿ_ÌÅ…ô´ÓÃÜÜÆæŽ5Æâ##î\4fí”©ÂDÀ!ªD7o0”E\Ð½MY™L>ÞiáísßgQŽGvÜ”~ö‹£†?<¦    lÀ'[gþßøûm/¾Ýýø×ôìXþöúUxö·íŸÅîéÉka„¸ƒJ  ÿÈx:Úx:zÀvI ›ZÚ\×™µY>ÜóLÄ-žˆ‡ÙMÊ?ÿ›Œÿ‰©r ³v¶!7|ªïKðdý/oþŽ¿;K   I also change the permissions of index.php but nothing works for me. Also my index.php works, when I write die('test') in index.php it displays "test" on the page. I think the problem is in these two lines of code in index.php,  drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); menu_execute_active_handler();    If any one know how to fix this error, Please let me know I'll be very thankful to all of you. Thanks in Advance...


I was thinking about this problem:      How much work is required to hold an object stationary in a gravitational field?    or:      How much energy is required to keep an object stationary in a gravitational field, i.e. how many J/s are required?    and I realized I could not come up with a satisfactory answer.  Let's setup an example to limit our scope: First of all let's consider an mini-copter of mass m=10 kg on earth which uses its' rotor blades to reach altitude of h=1 meter. The work required to get it there is roughly:  mgh = 9.82 m/s  * 10 kg * 1 m.   Which means we spent 98.2 Joules of energy getting it there. So if this work was done under the time t= 2s the effect of the mini-copter engine would be roughly $mgh/t$ ~ 98.2 Joules / 5s ~ 19.64 watt.  Now, obviously the engine would have to keep on running to keep the quadrocopter at the height of 1m, roughly how much effect would be required?  So this is kind of a high-school level question but I can't seem to wrap my head around it.

I read the definition of  as  $$W ~=~ \vec{F} \cdot \vec{d}$$  $$\text{ Work  =  (Force) $\cdot$ (Distance)}.$$ If a book is there on the table, no work is done as no distance is covered. If I hold up a book in my hand and my arm is stretched, if no work is being done, where is my energy going?


tried: sudo apt-get install git-hg doesn't work.

Simple enough question: is there some shell command (or GUI method) I can use that, given the path to a file on my system, tells me what package put it there? Assuming the file did in fact come from a package, that is.  Bonus question: what if it's a file that isn't installed on my system? Is there, say, a website that will let me look up a file and see what packages, if any, provide it?


I'm solving cs50 pset1, I need first 2 decimal places. I'm trying to get it by converting the float I get from the user to int, then substracting it from float and then multiplying by 100 to get 2 decimal places  for ex input 9.41 after subustracting i get .410000 but when multiplying by 100 i get 40.9999 as output whereAS I need exact 41 so i can convert to int      #include<stdio.h>     #include<cs50.h>     #include<math.h>      int main(void)     {         int i = 0;         float number = get_float("Enter change: ");         printf("%f \n",number);         int integer = (int)number;         printf("%i \n",integer);         float change = number - integer;         printf("%f \n",change);         change = change * 100;         printf("%f \n",change);         int n = (int)change;          printf("%i \n",n);     }   expected:   Enter change: 9.41 9.410000  9  0.410000  41.000000  41    actual:  Enter change: 9.41 9.410000  9  0.410000  40.999985  40

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


Can someone show me how to set-up an auto reply for one day a week every week? using Outlook 2010. Basically we have some employees that only work certain days of the week and I want them to have an out of office on those days every week.  EDIT: It is for one day every week.  answer is not what I am looking for as it doesn't allow for a specific day of the week every week. The rules that is. You can only have a date range and not one every Friday for example.

In Outlook, is there a way (or an add-on that can do it) to schedule a recurring out-of-office message?  I work 4 10's, so I'm out of the office every Monday, and it's a bit of a pain to have to reset my out-of-office message every single week.


Two people are playing a game, one round after another. Let the probability of person A winning be p, and the probability of person B winning be q, wherein 0<p<1, p+q=1. There is no draw, and person A will gain 1 point when they win one round, person B will gain 1 point when they win one round, neither will lose points. The game will stop when one of the two has two more points than the other player. What's the average number of rounds before the game stops? The answer I have is $2/(p^2+q^2)$, I thought that I should try to make it into a probability distribution since that's the topic I'm currently on, but I'm not sure where to start... Thank you!

Calvin and Hobbes play a match consisting of a series of games, where Calvin has probability p of winning each game (independently). They play with a “win by two”” rule: the first player to win two games more than his opponent wins the match. What is the expected number of games played? My attempt: I use Markov chains. Let $S$ denote that starting state, $W$ and $L$ denote the states where Calvin and Hobbes win respectively. Then, I have $$\mu_S = 1+ p\mu_W+q\mu_L $$ $$\mu_W = 1+ q\mu_S $$ $$\mu_L = 1+ p\mu_S $$ where $\mu_j$ denote the expected number of games from state $j$. Solving the system, I get the solution $\mu_S = \frac{2}{1-2pq}$ which I think is correct. I however would like to know how to approach it with geometric distribution instead of Markov chains. I read one solution where the number of games is given as $1+\text{Geom}(p^2+q^2)$ but I do not understand it. My understanding is that for the game to stop, the required probability is $p^2 + q^2$ since this is the probability that either Calvin or Hobbes win two games in a row. How to use this information in a Geometric random variable? Thanks.


I am confused about the statement below about the equal comparison operator ==     If the two operands are not of the same type, JavaScript converts the operands then applies strict comparison. If either operand is a number or a boolean, the operands are converted to numbers if possible; else if either operand is a string, the other operand is converted to a string if possible. If both operands are objects, then JavaScript compares internal references which are equal when operands refer to the same object in memory.    However both alert(true == "true") and alert(false == "false") returns false. Why is this so?     If either operand is a number or a boolean, the operands are converted to numbers if possible   In what case does JavaScript converts true and "true" to a number? The previous example doesn't convert them to numbers.  I have more doubts when looking at these examples:  ''        ==   '0'           // false 0         ==   ''            // true 0         ==   '0'           // true false     ==   'false'       // false false     ==   '0'           // true    '' is false and '0' is true, but why the output is false? 0 would be interpreted as false, and '' is also false. Then it becomes true. I can understand this. Why does a '0' interpreted as true when 0 is false? Why is false interpreted as false and '0' interpreted as true?   Could someone explain in more detail how the == operator works?

I'm using  to go through JavaScript, and it's returning many suggestions to replace == (two equals signs) with === (three equals signs) when doing things like comparing idSele_UNVEHtype.value.length == 0 inside of an if statement.  Is there a performance benefit to replacing == with ===?   Any performance improvement would be welcomed as many comparison operators exist.  If no type conversion takes place, would there be a performance gain over ==?


I'm trying to build an HTTP server, I searched the net to solve this problem, but I did not find anything like that.  I'm trying to customize an inputstream to fit read requests and HTTP responses directly from inputstream. The class, which implements an interface) that generates the null pointer exception is as follows (n = in.available ();):  public class MyHTTPInputStream extends HTTPInputStream{  public InputStream in = null;  public String request, reply, dataIn;      // dataIn:= data read from InputStream  public HTTPMyRequest myRequest;  public HTTPMyReply myReply;   public MyHTTPInputStream(InputStream is) {      super(is);      // TODO Auto-generated constructor stub  }   @Override  protected void setInputStream(InputStream is) {      // TODO Auto-generated method stub      // initialize the variable      this.in = is;      request = null;      reply = null;      dataIn = null;  }   @Override  public HTTPRequest readHttpRequest() throws HTTPProtocolException {      request = readFromStream();    // read from inputStream      System.out.println(request);      myRequest = new HTTPMyRequest(request);      return myRequest;  }   @Override  public HTTPReply readHttpReply() throws HTTPProtocolException {      reply = readFromStream();      // read from inputStream      myReply = new HTTPMyReply(reply);      return myReply;  }   @Override  public void close() throws IOException {      // TODO Auto-generated method stub      in.close();  }   public String readFromStream(){      // read data from InputStream to String      int n = 0;      try {          n = in.available();  // ******null pointer exception          System.out.println("n: "+n);      } catch (IOException e) {          // TODO Auto-generated catch block          e.printStackTrace();      }      System.out.println("n: "+n);      byte[] bytes = new byte[n];      try {          in.read(bytes, 0, n);      } catch (IOException e) {          // TODO Auto-generated catch block          e.printStackTrace();      }      String req = new String(bytes, StandardCharsets.UTF_8);      System.out.println(req);      return req;  } }   In the constructor super(is); , refers to this in the interface:  public HTTPInputStream( InputStream is ) {         this.setInputStream(is);     }   This is part of my main class (testServer) to call up the object:  ... /* *  TEST INPUTSTREAM */ System.out.println("_____HTTP Inputstream_____"); // read HTTP request from file request.txt InputStream isReq = new FileInputStream(new File("src\\source\\request.txt")); MyHTTPInputStream myIsReq = new MyHTTPInputStream(isReq); HTTPMyRequest myRequest =(HTTPMyRequest) myIsReq.readHttpRequest(); System.out.println("_______Read request_______"); ...   the file request.txt is in the src directory and is a simple string containing an http request, I also managed to print it on screen without problems in the main class, but in the class readFromStream() it generates this exception(I hid the path with ...):     _____HTTP Inputstream_____      Exception in thread "main" java.lang.NullPointerException at   ....MyHTTPInputStream.readFromStream(MyHTTPInputStream.java:59) at   ....MyHTTPInputStream.readHttpRequest(MyHTTPInputStream.java:35) at   ....testServer.main(testServer.java:88)

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


I have object  var emailData = new {}; emailData.Id; emailData.EmailAddress;   later in code I'm populating array with emailData objects   var emailDataArr = new Array();  emailDataArr.push(..someobject...);   how can I check does any object on property EmailAddress inside emailDataArr array is equal to some string?

What is the most concise and efficient way to find out if a JavaScript array contains a value? This is the only way I know to do it: function contains(a, obj) {     for (var i = 0; i < a.length; i++) {         if (a[i] === obj) {             return true;         }     }     return false; }  Is there a better and more concise way to accomplish this?


I ran a command that ended up executing as  sudo chown -R /   Can I revert / to default permissions?

So I was working and there was a directory that I was periodically changing to my user in  a root terminal so that I could open the files in text editors, but I accidentally pressed / instead of . and this was the command I put out:  chown -R emil.emil /   Then immediately panicked ^C and put in another command, as I thought I could always change back the files I needed to access:  chown -R root.root /   So now I can't do su from emil to even try to fix this, as I'm getting permission denied error. I'm on Ubuntu could someone tell me if there is a way I could fix this, without absolutely reinstalling the whole thing.  TIP  If you are trying to get root access, and are getting this permission denied error when using su try this command:  gksu gnome-terminal   It will prompt you for the root password and open a new root terminal for some reason this works and gives me root access, when su doesn't.


I am making caramel. The recipe calls for 2 - 12oz. cans of evaporated milk. I want to use sweetened condensed milk. Do I use the same amount?

I have a recipe for Thai Green Curry that calls for evaporated milk, which I don't have. I do have sweetened condensed milk, will that do?


I'm new to Java (and to programming in general). I have a program that is supposed to run a method on two variable strings, but only if the strings are the same length and are not identical.   I've tried using  while(i < n){     if (string1.length() == string2.length() && string1 != string2){         compare(string1, string2);         i++     } }   but it still runs the compare method even if the strings are identical.  I've also tried using  while(i < n){     if (string1.length() == string2.length(){         if (string1 == string2){             continue;         }         compare(string1, string2);     }     i++ }   but this also still runs the compare method regardless of whether or not the strings are identical.  Is there an issue with my formatting, or perhaps misused keywords? Thanks!

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


I've resolved numerous fights with C# not being able to resolve two lambdas in a conditional expression used to initialize a var. However today I faced what was seemingly a pretty easy and straight-forward pair of lambdas which I could not fight the compiler into accepting as the two results on a conditional expression. The compiler had no problem with them separately using an if-then-else construct instead.  Thus I decided to reduce the code down to as bare minimum as possible to show the problem, and discovered I could reduce it to pretty rock bottom and still get the error.  The compiler is issuing the usual error:  CS0173 Type of conditional expression cannot be determined because there is no implicit conversion between 'lambda expression' and 'lambda expression'  The following code is three examples of pretty rock-bottom code that still generates the error. The first line (test1) being what should be reasonably usable enough.  The other lines being efforts to clarify through precedence and explicit typing.  Considering I have successfully used conditionals to select between two somewhat more complex (although not very complex) lambdas before, I was surprised to discover these extremely simple examples don't work.  Anybody know what's going on here?  In my case it's a C# UWP project set to build using C# 7.3. Visual Studio is not reporting any pending updates.  Func<int, int> test1 = true ? (a) => 0 : (a) => 0;  Func<int, int> test2 = true ? ((int a) => (int)0) : ((int a) => (int)0);  Func<int, int> test3 = true ? ((int a) => { return (int)0; }) : ((int a) => { return (int)0; });

Generally, when using the conditional operator, here's the syntax:  int x = 6; int y = x == 6 ? 5 : 9;   Nothing fancy, pretty straight forward.  Now, let's try to use this when assigning a Lambda to a Func type. Let me explain:  Func<Order, bool> predicate = id == null     ? p => p.EmployeeID == null     : p => p.EmployeeID == id;   That's the same syntax, and should work? Right? For some reason that doesn't. The compiler gives this nice cryptic message:     Error  1   Type of conditional expression cannot be determined because there is no implicit conversion between 'lambda expression' and 'lambda expression'   I then went ahead and changed the syntax and this way it did work:  Func<Order, bool> predicate = id == null     ? predicate = p => p.EmployeeID == null     : predicate = p => p.EmployeeID == id;   I'm just curious as to why it doesn't work the first way?  (Side note: I ended up not needing this code, as I found out that when comparing an int value against null, you just use object.Equals)


I need a way to get/copy data from clipboard to a variable in Bash. Is there such one?

Is there a command to output the current value of the clipboard?  Example (this command doesn't exists, it's just an example of what I'm looking for:  cat clipboard > Hello world!   Also, if the clipboard is stored somewhere, where is it located?


I was wondering if the following statement is true or not. Let $G$ a group and $H \triangleleft  G$  $$ G/H \cong G  \implies H = \left \{ 1 \right \}$$  I know it is true if $G$ is a finitely generated abelian group, as you can see . Nevertheless, my intuition says it should be not true in the general case. Actually, I was trying to find a counterexample, taking G as a free group. However, I haven't found anything.

Let $G$ be any group such that  $$G\cong G/H$$ where $H$ is a normal subgroup of $G$.  If $G$ is finite, then $H$ is the trivial subgroup $\{e\}$. Does the result still hold when $G$ is infinite ? In what kind of group could I search for a counterexample ?


I have a class that contains 4 Calendar variables:  public class Ponto {     Calendar entrada;     Calendar saidaAlmoco;     Calendar entradaTarde;     Calendar saida;      public Ponto(Calendar entrada, Calendar saidaAlmoco, Calendar entradaTarde, Calendar saida) {         this.entrada = entrada;         this.saidaAlmoco = saidaAlmoco;         this.entradaTarde = entradaTarde;         this.saida = saida;     }      public void setEntrada(Calendar entrada) {         this.entrada = entrada;     }      public void setSaidaAlmoco(Calendar saidaAlmoco) {         this.saidaAlmoco = saidaAlmoco;     }      public void setEntradaTarde(Calendar entradaTarde) {         this.entradaTarde = entradaTarde;     }      public void setSaida(Calendar saida) {         this.saida = saida;     } }   Then when I try to send the values via set() function i it gives the error:  Attempt to invoke virtual method 'void pt.eu.metaloapp.Ponto.setEntrada(java.util.Calendar)' on a null object reference;  This is the code:  Calendat picagem = Calendar.getInstance(); String hora = sdf.format(picagem.getTime()) + "h";  switch (verificarPonto()) {       case 1:          txtHoraEntrada.setText(hora);          ponto.setEntrada(picagem);          break;       case 2:          txtHoraSaidaAlmoco.setText(hora);          ponto.setSaidaAlmoco(picagem);          break;       case 3:          txtHoraEntradaTarde.setText(hora);          ponto.setEntradaTarde(picagem);          break;       case 4:          txtHoraSaida.setText(hora);          ponto.setSaida(picagem);          break;        }   Is there any problem with sending Calendar values to a class or something?


Is orientate a word and if so how is it different than orient? I found  of it says "Generally considered an error in American English." does this mean it is not wrong for British English?  I'm not sure if there's a right or wrong answer to this, but is it incorrect to use British English in North America? For example is it flat out poor English if a British man was giving a speech and referred to the "boot of the car" or is somehow more right since he is British?

What are the origins of the word orientated?  As far as I know, the correct spelling is oriented and orientated is not an alternative spelling but an error that is in common use.  Is it for example more commonly used in a certain country or by a certain people? Is there a reason for people choosing to say or write orientated instead of oriented?


I need to monitor the network activities of a process and the bandwidth of the connection. So I decided to use nethog and netperf combine with grep and awk to write the values to a file.   nethog command: nethogs -t  eth0 | grep firefox | awk '{ print $3 }' (I want to take the upload/download speed). The 1st problem is that command doesn't print anything.  More detail: command: nethogs -t  eth0 | grep firefox output:  usr/lib/firefox/firefox-bi�)/4956/1000  0.338867    0.239063 /usr/lib/firefox/firefox-bi�)/4956/1000 0.543555    0.274219 /usr/lib/firefox/firefox-bi�)/4956/1000 0.794531    0.489844 /usr/lib/firefox/firefox-bi�)/4956/1000 0.794531    0.489844 /usr/lib/firefox/firefox-bi�)/4956/1000 0.749023    0.589844 /usr/lib/firefox/firefox-bi�)/4956/1000 1.30098 3.47617 /usr/lib/firefox/firefox-bi�)/4956/1000 1.90449 8.0127 /usr/lib/firefox/firefox-bi�)/4956/1000 5.31641 25.0033 /usr/lib/firefox/firefox-bi�)/4956/1000 8.60762 42.0176   I want the two values at the bottom right. But as you can see the output ain't consistent (the space), add | awk '{print $3}' most of the time return nothing. And I can't fix this.  netperf command: netperf -H 192.168.1.10 and the output is:  Recv   Send    Send                           Socket Socket  Message  Elapsed               Size   Size    Size     Time     Throughput   bytes  bytes   bytes    secs.    10^6bits/sec    524288 524288 262144    10.00    **718.62**   I want to print the value on the bottom right but have no idea how to. That's the 2nd problem   Can you guys help me out? Any ideas will be appreciated!

I need to monitor the network activities of a process and the bandwidth of the connection. So I decided to use nethog and netperf combine with grep and awk to write the values to a file.   nethog command: nethogs -t  eth0 | grep firefox | awk '{ print $3 }' (I want to take the upload/download speed). The 1st problem is that command doesn't print anything.  More detail: command: nethogs -t  eth0 | grep firefox output:  usr/lib/firefox/firefox-bi�)/4956/1000  0.338867    0.239063 /usr/lib/firefox/firefox-bi�)/4956/1000 0.543555    0.274219 /usr/lib/firefox/firefox-bi�)/4956/1000 0.794531    0.489844 /usr/lib/firefox/firefox-bi�)/4956/1000 0.794531    0.489844 /usr/lib/firefox/firefox-bi�)/4956/1000 0.749023    0.589844 /usr/lib/firefox/firefox-bi�)/4956/1000 1.30098 3.47617 /usr/lib/firefox/firefox-bi�)/4956/1000 1.90449 8.0127 /usr/lib/firefox/firefox-bi�)/4956/1000 5.31641 25.0033 /usr/lib/firefox/firefox-bi�)/4956/1000 8.60762 42.0176   I want the two values at the bottom right. But as you can see the output ain't consistent (the space), add | awk '{print $3}' most of the time return nothing. And I can't fix this.  netperf command: netperf -H 192.168.1.10 and the output is:  Recv   Send    Send                           Socket Socket  Message  Elapsed               Size   Size    Size     Time     Throughput   bytes  bytes   bytes    secs.    10^6bits/sec    524288 524288 262144    10.00    **718.62**   I want to print the value on the bottom right but have no idea how to. That's the 2nd problem => solved by  fedorqui!  Can you guys help me out? Any ideas will be appreciated!


I'm very new to blender but I've recently watched hundreds of tutorials showing me how to import svg files.  It seems very easy, a simple 1, 2 step posseces but for some odd reason I'm having no luck getting it to work.  At first I thought maybe I'm not saving my file correctly so I when on google and seached SVG files formatted down to the t.  I still have NO LUCK at all even gettin one out of the 20 professional svg files to work.  I'm starting to think maybe blender file might be corrupted.  Is there anyone eles who has had this problem where they were unable to get a single SVG file to import into the program.  I would love to hear how I can resolve this issue so that I can enjoy making countless of projects I have in mind

I've tried multiple times to  import a SVG file from illustrator CS5.5 to Blender 2.71 and 2.73. However, I do not see a mesh, curve, or anything pop up in my "Outliner" window. So I know its not so small I can't see it. I even made sure under user preferences that the "import and export of SVG 1.1 format" is "checked." I've tried even just importing text from illustrator and I'm still getting no where. What can I do to resolve this problem? If this is common error with this version of Blender, then what can I do to transform an image into a 3D object in Blender?


My break function is not working even though it is in the loop. Please, someone, explain in detail, because I'm new to Python.  q1 = input('want a question?: ') if q1 == 'yes':     print("let's get started!, press enter")     a1 = input() else:     print('why did you even start me ?!')     break   Here I expect break to stop the program from going any further.

I am aware of the die() command in PHP which exits a script early.  How can I do this in Python?


I am trying to create a script which scrapes a website for phrases which gets saved to a list and then displayed in a randomized manner. Here's the code-  from bs4 import BeautifulSoup import requests import random  url = 'https://www.phrases.org.uk/meanings/phrases-and-sayings-list.html' page = requests.get(url) soup = BeautifulSoup(page.content, 'html.parser')  for phrase in soup.find_all(class_='phrase-list'):     phrase_text = phrase.text     print(phrase_text)   This shows up the entire list of phrases that are scraped. How can I randomly show one phrase from the list of all phrases?

Assume I have the following list:  foo = ['a', 'b', 'c', 'd', 'e']   What is the simplest way to retrieve an item at random from this list?


I have a place where the density of air at sea level is $\rho_0$ and the atmospheric pressure is $P_0$. Now suppose I want to calculate the pressure of air at a certain height h above the sea level, say at a height of 10 km above the sea level. Let the actual pressure be P.  I realise that I need to use this relation: $$P_0 - P = \rho gh$$  However this would work only for small heights as the value of $g$ and $\rho$ vary with height.  Suppose for some sufficiently large height, I keep the value of $g$ constant and vary $\rho$ with height, I get a pressure, say $P_1$  Next, I keep the value of $\rho$ constant and vary $g$, and I get a value $P_2$  Lastly, I vary both $g$ and $\rho$, and get a pressure say $P_3$  I am interested to know what would be the order of the pressures, like which would yield me the highest value among $P,P_1,P_2,P_3$ and among them which one would be closest to the actual value $P$  PS: For a height like 10 km, can I keep the value of $\rho$ constant? For g, I think I can keep it constant since 10 << 6400  Thanks in advance

I am going to ask a simple question, for sure.  The pressure with respect to the altitude is given by this formula    Where    sea level standard atmospheric pressure p0 = 101325 Pa sea level standard temperature T0 = 288.15 K Earth-surface gravitational acceleration g = 9.80665 m/s2. temperature lapse rate L = 0.0065 K/m universal gas constant R = 8.31447 J/(mol·K) molar mass of dry air M = 0.0289644 kg/mol   ( from  )  In addition to this, we have $L = \frac{g}{C_p}$ where $g = 9.80665\ m/s^2$ and $C_p$ is the constant pressure specific heat $ = 1007\ J/(Kg\ K)$  Understood and thence the above formula can be written in this simple way:  $$\boxed{P = P_0\left(1 - \alpha h\right)^{\beta}}$$  where  $\alpha = \frac{g}{C_p\ T_0} \approx 3.3796\cdot 10^{-5}\ m^{-1}$  $\beta = \frac{C_p\ M}{R} \approx 3.5081971$  On the other side we learnt from the elementary physics that the formula for the pressure is also given by  $$\boxed{P = P_0 + \rho g h}$$  Where $\rho$ is the air density $(1.23\ kg/m^3)$.  The question  First thing first: I assumed that  $$h = h_1 - h_0$$  is that correct? I mean it's the difference between two heights (maybe from a table and the ground, just to say).  Since the two formulae seems quite different, I tried with a numerical example in calculating the pressure in two points, with a difference of height about $0.18$ m and I got a really similar result.  Since the first formula is more technique, I think it's the correct formula but I would like to understand if one could pass from the first to the second or vice versa somehow.  Also I would like to know if there are cases in which I can use only the second formula or only the first formula!


Can I tell if someone copied files and folders from my computer to a usb or to the network ? I'm working on windows 8

Is it possible to find out which files are transferred to an external usb flash drive in certain period of time?   To be more clear. If I/someone have a flash drive and take some data from me. How do I know which files are copied? Finding out file copy hostory could be also a work around.


My code:  a = '2.3'   I wanted to display a as a floating point value.  Since a is a string, I tried:  float(a)   The result I got was :  2.2999999999999998   I want a solution for this problem. Please, kindly help me.  I was following .

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


i am running a blender script where it takes command line arguments which are these  parser = ArgumentParserForBlender() parser.add_argument('--bvhFile',type=str,help='provide bvh file path',required=True) parser.add_argument('--mhx2File',type=str,help='provide mhx2 model file path',required=True) parser.add_argument('--fps',default=15,type=int,help='Please provide frame rate for Animation(default=15)',required=True) parser.add_argument('--FramesToRetarget',type=int,help="How many frames do you wanna retarget(default=All the frames present in bvh file)") parser.add_argument('--videoFormat',default='FFMPEG',help='video format in which animation will be generated(default=FFMPEG)',choices=['FFMPEG','AVI_JPEG','AVI_RAW'],required=True) parser.add_argument('--Animation',default=False,type=lambda x: (str(x).lower() == 'true'),help='True if you want to get animation video(default False)') parser.add_argument('--Point_tracking',default=False,type=lambda x: (str(x).lower() == 'true'),help='True if you want to get point tracking of vertices(default=False)') parser.add_argument('--camera_location',default="(0,-3,0)",type=str,help='specify a camera location as in format-(x,y,z),default is (0,-3,0)')  args = parser.parse_args() bvhFile = args.bvhFile mhx2File =args.mhx2File fps = args.fps EndFrame = args.FramesToRetarget videoFormat =args.videoFormat bool_animation = args.Animation bool_pointtracking = args.Point_tracking camera_loc = args.camera_location   and i am running this with this code  $ bash run_render.sh --bvhFile "C:/Users/Vikram Jain/Downloads/demo_bvh.bvh" --mhx2File "characters/John.mhx2" --fps 15 --FramesToRetarget 2 --videoFormat FFMPEG --Animation True   the problem is ocurring because i am not giving camera location argument, but i defined it as optional argument then why this problem occurs?  usage: blender.exe [-h] --bvhFile BVHFILE --mhx2File MHX2FILE --fps FPS                [--FramesToRetarget FRAMESTORETARGET] --videoFormat                {FFMPEG,AVI_JPEG,AVI_RAW} [--Animation ANIMATION]                [--Point_tracking POINT_TRACKING]                [--camera_location CAMERA_LOCATION] blender.exe: error: unrecognized arguments:   if i provide --camera_location than the error disappears.

Let's say we have a Python script my_script.py that does some data processing with Blender. This script accepts some arguments (e.g. arg1 arg2). How can I forward arguments to the script when using it with the CLI?  blender --background --python my_script.py   The only trick I could find was :  echo "arg1 arg2" > my_input.txt && blender --background --python my_script.py   Is this really the only way to do that?  Update  I found a  on Stack Overflow.


I've noticed that he word "up" seems to be one of the most common "extra words" used in short English phrases. Some examples are:   Look up Shut up Finish up   Another one is "over" as in:   turn over look over come over   Is there a part of speech name for these types of "extra" words? I call them "extra" because they don't seem to change the meaning of the word that precedes it. "Turn over" seems to be redundant as when you turn something, you see the "over" or other side. Are these words nouns, prepositions, or what?

I need to know what down in this specific sentence means. I don't know if it is a preposition or an adverb.


What I have: A scatter chart(plot) of PCA. Plotted in JS. I have Rtools that Ive used to push PCA data to the client side.  Assumption : The author in  draws confidence ellipses around the iris groups   What I'm trying to do: Get a confidence ellipse formula and/or get the raw data for the ellipse.  I can't seem to find a straight forward formula for the CI ellipse. I came across a lot of theory and a lot of examples in R which give you the end result - an ellipse (One can use ggplot or CRAN to plot it). But Im looking for a formula that I could use in the client side to plug my scatter chart points and calculate the ellipse or even better a function in R that would give me a formula for the ellipse. I have the covariance matrix and Eigen vectors as well (calculated in R).  Since PCA is a new thing for me please be patient and maybe explain your answer a bit. Looking for a formula dependant on point coordinates (x,y)  All suggestions much appreciated.

Could someone come up with R code to plot an ellipse from the eigenvalues and the eigenvectors of the following matrix  $$ \mathbf{A} = \left( \begin{array} {cc} 2.2 & 0.4\\ 0.4 & 2.8 \end{array} \right) $$


We know that the first request to Asp.net MVC web aplication causes the aplication to start and Application_start event to run.  I want to know when the Application is closed.thus a new request will trigger Application_start event(something like AplicationTimeout not SessionTimeout).  If available ,is it Adjustable by developer or related to iis settings?

Can anybody tell me when Application_End is triggered in a lifecycle of an application? When all sessions are ended, will Application_End be triggered automatically? + Are there any other reasons why Application_End could be triggered?


I have a script that loops through several input files however, since the input files contains a underscore int he name, I cannot use $FILE to call the files, as it has to be a dot. The $FILE_2 is not recognised correctly, has to be $FILE.2. How do i overcome this? files.txt ERR23442 ERR25453 ERR25353  script: mapfile -s 1 -t files < files.txt echo "${files[@]}" for FILE in ${files[@]}; do  wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR318/FILE$/$FILE_2.fastq.gz; done

I have a variable for color. I use it to set color to strings, by evaluating it inside the string. However, I need to include space after the name(so that the name doesn't contain part of the text). This sometimes looks bad.  How can I avoid using(printing) this space?  Example(Let's say that Red=1 and NC=2):  echo -e "$Red Note: blabla$NC".   Output:  1 Note: blabla2.   Expected output:  1Note: blabla2.


In most Variational Autoencoder architectures I have seen the following forward path: x = torch.nn.Linear(in_features,hidden_features)(input) x = nn.ReLU()(x) x_mean = torch.nn.Linear(hidden_features,code_features)(x) x_logvar = torch.nn.Linear(hidden_features,code_features)(x)  where in the last part we get log variance. So my question is: Why do we get log variance from the encoder? My understanding is, that we might get negative numbers after torch.nn.Linear(hidden_features,code_features)(x) and for numerical stability we need positive numbers. Am I correct? If you have more complete answer, you are welcome to add/correct me.

In theory the encoder in VAE (assuming that variational family is Gaussian) generates the $\mu$ and $\sigma$ (or $\sigma^2$). But, in practice, I have seen people assuming the output is $\log\sigma^2$. Why this is necessary or useful?


I want to create deck of cards using a for loop and my Factory class method. I have setup the suit and face values as enums. How should i aproach this? public static class FactoryClass {     public static Card CreateCard(CardFace face, CardSuit suit) {           return new Card(face, suit);             }     }        public enum CardFace {     A, _2, _3, _4, _5, _6, _7, _8, _9, _10, J, Q, K }       public enum CardSuit {     Spades, Hearts, Clubs, Diamonds }   public void Deck() {                 for (int i = 0; i < 13; i++) {             for (int j = 0; j < 4; j++) {                 _cards.Add(FactoryClass.CreateCard();             }         }     }

How can you enumerate an enum in C#?  E.g. the following code does not compile:  public enum Suit {     Spades,     Hearts,     Clubs,     Diamonds }  public void EnumerateAllSuitsDemoMethod() {     foreach (Suit suit in Suit)     {         DoSomething(suit);     } }   And it gives the following compile-time error:     'Suit' is a 'type' but is used like a 'variable'   It fails on the Suit keyword, the second one.


Since light is affected by gravity, it seems like it is made of massive particles. So what happens to that mass when the photon is absorbed by a material?

I understand that a black hole bends the fabric of space time to a point that no object can escape.   I understand that light travels in a straight line along spacetime unless distorted by gravity. If spacetime is being curved by gravity then light should follow that bend in spacetime.  In Newton's Law of Universal Gravitation, the mass of both objects must be entered, but photon has no mass, why should a massless photon  be affected by gravity in by Newton's equations?  What am I missing?


Im trying to write a script that can search the current directory for empty files, followed by a count of the empty files. I would also prefer the files to be one per line of the output. For example the program output would look like:   Empty files are: file1.pdf file4.cpp example-file Number of empty files: 3

Let's say that in my folder ~/list I have a large amount of folders each with their own sub-folders and sub-sub-folders etc, and there are lots of files almost on each level. However some of these files and folders are empty, so how can I recursively search through them all to find the empty files and folders? And then have them displayed in a list of file locations so that I know where each one is (it should also be clear which is a file and which is a folder because not all files have file extensions). I am running Ubuntu GNOME 15.10 with GNOME 3.18.  Please note that it would also be very useful if it would also tell me if a file looked empty but wasn't (for instance if it had spaces or linebreaks in it or something). And would differentiate between a real empty file and one that just looks empty in the output.


I use the following code using the tikz-feynman package.  \tikzfeynmanset{     every vertex/.style={red, dot},     every particle/.style={blue},     every blob/.style={draw=green!40!black, pattern color=green!40!black}, } \feynmandiagram [horizontal=a to b] {     a [particle={\(\gamma, Z\)}] -- [boson] b [blob],     c -- [fermion] b -- [fermion] d, };   However, I get an output in which the lines are drawn haphazardly.  Is there a way to correct this?

Today I downloaded and installed the new  package to draw Feynman diagrams. I included the packages   \usepackage{tikz}  \usepackage{tikz-feynman} \tikzfeynmanset{compat=1.0.0} \usetikzlibrary{shapes,arrows,positioning,automata,backgrounds,calc,er,patterns}   into my preamble (changed them already many times).  However, already a simple sample code like  \begin{tikzpicture} \begin{feynman} \vertex (a) {\(\mu^{-}\)}; \vertex [right=of a] (b); \vertex [above right=of b] (f1) {\(\nu_{\mu}\)}; \vertex [below right=of b] (c); \vertex [above right=of c] (f2) {\(\overline \nu_{e}\)}; \vertex [below right=of c] (f3) {\(e^{-}\)}; \diagram* { (a) -- [fermion] (b) -- [fermion] (f1), (b) -- [boson, edge label'=\(W^{-}\)] (c), (c) -- [anti fermion] (f2), (c) -- [fermion] (f3), }; \end{feynman} \end{tikzpicture}   directly gives the error:     Package pgfkeys Error: I do not know the key '/graph drawing/node distance'.   Can you please help me? Thanks in advance!


//a.c #include<stdio.h> int main() {     printf("%d \n",sizeof'A');   //the result is 4     return 0; }   why the result of sizeof'A' is 4 in c? I run it in windows 7 X64,vs2010.  //a.cpp #include<stdio.h> int main() {     printf("%d \n",sizeof'A');   //the result is 1     return 0; }   in a .cpp file the rusult is 1.why?

In C++, sizeof('a') == sizeof(char) == 1. This makes intuitive sense, since 'a' is a character literal, and sizeof(char) == 1 as defined by the standard.  In C however, sizeof('a') == sizeof(int). That is, it appears that C character literals are actually integers. Does anyone know why? I can find plenty of mentions of this C quirk but no explanation for why it exists.


I finished installing Ubuntu 16.04.3 alongside Windows 10. I made sure to turn off Hibernate and Fast Shutdown on Windows, made my BIOS UEFI and unsecured. When I boot I still can't find Ubuntu. I also tried going to the live version on my USB and running the boot repair with no help. Ubuntu made a new partition in my hard drive the size it said it was going to, but I have no idea how to access this. I can get into Windows and only Windows. I keep seeing that Grub Loader or something should let me choose which OS to load, but I haven't seen anything even close to that. I can't even choose Ubuntu from the BIOS menu when I hit F12. I have no idea what to do and all of the articles I have read haven't helped me at all. A little more information is that I am running on an Acer Aspire Laptop. I look forward to any help anyone can provide.

I've installed Ubuntu 16.04 LTS along side with Windows 10 (I shrinked my Disk using Windows Disk Management) on my Acer laptop (ES1-531-C13G), but when I restart/reboot my system no menu (Grub screen) appears from where I can select the operating system that I want to boot with, but instead, system takes me into Windows 10 everytime. I've tried several things from internet including :    Ran bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi from windows command prompt.  Reset  Bootorder i.e. first Ubuntu then Windows from Ubuntu terminal (after successful Ubuntu installation) etc, but nothing works for me so far. Please guide me !


I'm working on a project which aims at analyzing the social relations between users on stackexchange. Hence, I'm pretty interested in the user IDs of votes in each post.  Although the votes can be accessed in the data dumps released by stackexchange, User IDs are only visible for votes whose type are 'favorite'. I was wondering if it is possible to access the user ID of all types of votes. My research is for academy only and the user IDs will be hashed for privacy concern.

I am interested in analyzing directed voting behavior of users in relation to their reputation on stackoverflow. Since voting is an anonymous activity for obvious reasons, I was hoping that I could get, in addition to voting data, the relative userID information (to preserve anonymity) for the voter and voted along with their reputations. My aim is to develop a who-votes-for-who network of signed nodes based on the difference in users' reputations.   If anyone knows if this can be achieved with the current data, please let me know! Otherwise, I hope this request can be taken into consideration.  Thanks a lot in advance!


I'm currently runing Ubuntu 15.04, and I would love to be able to put a video file (currently in webm format, but can be converted if neccesary) as my wallpaper. I am in love with the DreamScene feature Microsoft introduced (then brutally murdered) and i would love to have it on my Linux-Powered PC. If it's for any help, it's  wallpaper.  I've already seen a lot of questions about how to put a video file as a wallpaper on ubuntu, but the answers were all outdated. therefore im asking it again for Ubuntu 15.04

Is there a way to set an mp4 as an ubuntu wallpaper? Or any other format as long as it is an animation?


For a computer graphics problem I have a shape that is defined by a constant distance to a line segment:    I tried to find a name for this shape, but my Google skills have failed me. Does it have a dedicated name?

I'm talking about the shape made up of a rectangle with a semi-circle at each end.  Does it have a particular name? Does it begin with e?


This is what I have an  Intel® Celeron(R) CPU E3300 @ 2.50GHz × 2   What would be the best version?  I've installed Ubuntu 12.04 but it's very slow.

For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and  such as:    with a lighter desktop than the usual Gnome and Unity  with the even lighter LXDE desktop   Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements?


Compute the value of $$\sum_{n=1}^\infty n^2x^n$$  whenever the series is convergent. I used the ratio test to determine that the series is convergent at $|x|<1$. I used Wolfram Alpha to compute the value and it gave me this $$\sum_{n=1}^\infty n^2x^n = \frac{-x(x+1)}{(x-1)^3}$$  How did Wolfram Alpha get this answer?

The question I've been given is this:  Using both sides of this equation:  $$\frac{1}{1-x} = \sum_{n=0}^{\infty}x^n$$  Find an expression for $$\sum_{n=0}^{\infty} n^2x^n$$ Then use that to find an expression for $$\sum_{n=0}^{\infty}\frac{n^2}{2^n}$$  This is as close as I've gotten:  \begin{align*} \frac{1}{1-x} & = \sum_{n=0}^{\infty} x^n \\ \frac{-2}{(x-1)^3} & = \frac{d^2}{dx^2} \sum_{n=0}^{\infty} x^n \\ \frac{-2}{(x-1)^3} & = \sum_{n=2}^{\infty} n(n-1)x^{n-2} \\ \frac{-2x(x+1)}{(x-1)^3} & = \sum_{n=0}^{\infty} n(n-1)\frac{x^n}{x}(x+1) \\ \frac{-2x(x+1)}{(x-1)^3} & = \sum_{n=0}^{\infty} (n^2x + n^2 - nx - n)\frac{x^n}{x} \\ \frac{-2x(x+1)}{(x-1)^3} & = \sum_{n=0}^{\infty} n^2x^n + n^2\frac{x^n}{x} - nx^n - n\frac{x^n}{x} \\ \end{align*}  Any help is appreciated, thanks :)


I have a switch Statement in JavaScript in which the keyup event handler doesn't return the callback to my variable (var test in this case).  It is the last case (110) that doesnt work.  Here is the code. Hope you can help to enlight me:  var getDateRange;  $(".nav-reports").append(   '
' +   '<select id="daterange">' +   '<option value="0">Choose duration:</option>' +   '<option value="10">Today</option>' +   '<option value="20">Yesterday</option>' +   '<option value="30">This week</option>' +   '<option value="40">Last week</option>' +   '<option value="50">This month</option>' +   '<option value="60">Last month</option>' +   '<option value="70">This year</option>' +   '<option value="80">Last year</option>' +   '<option value="100">Everything</option>' +   '<option value="110">Last x days</option>' +   '</select>' +   '
' );  getDateRange = function () {   var test;   var dateString = "yyyy-MM-dd";   var selectedOption = parseInt($('#daterange').change().val());   $('.daterange-input').detach();   switch (selectedOption) {     case 10: // works             break;     case 20: // works             break;     case 30: // works             break;     case 40: // works             break;     case 50: // works             break;     case 60: // works             break;     case 70: // works             break;     case 80: // works             break;     case 100: // works             break;     case 110: // doesnt't work             $('#daterange-container').append('<input class="daterange-input" type="text" maxlength="4">');             $('.daterange-input').keyup(function () {               test = '/' + Date.today().addDays(-parseInt($(this).val())).toString(dateString) + '/' + Date.today().toString(dateString);             });             break;   }   return test; };   Thank you in advance.  I call the getDateRange function here:  $('.' + report.description).click(function () {                     var dateRange = getDateRange(); // some more code not in relation                 })

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


explain how one could use tex4ht to convert tex to html with MathJax reading the math. One (of several) problem(s) I am having is that my document uses \cancel from the cancel package. Even if I alter my tex4ht configuration file so that  is loaded in the head of the html file, it's too late. htlatex has already converted things like \cancel{2} in the tex file into image files and inserted img elements for them, instead of converting \cancel{2} into some kind of mathml equivalent.  Is there a way to have htlatex leave math environments untouched? If the delimiters like \[, \(, \begin{align}, etc., and the commands inside them like \cancel{2} were left alone when htlatex makes the conversion, then MathJax should process the contents as they are, using their raw LaTeX commands and structure (as long as there aren't too many complications.)

I'm using tex4ht for conversion of heavily maths loaded LaTeX files into HTML to be able to serve them in a web app. Can successfully convert all equations to MathML and jsMath. But as equations are not web optimized, some of them are rendered wrongly or dont even get rendered as they are in original PDF's. So I decided to use maths as LaTeX as I think Mathjax can handle LaTeX equations better than jsMath or MathML.  Have already seen ,  and   I can manage to leave inline maths as they are but struggling with aligned standalone maths.  For example:  After a time $t$, the ground state $\ket{g}$ and the excited state $\ket{e}$ will each have accumulated a phase that is proportional to their energies: \begin{align} \ket{\psi(0)} \to \ket{\psi(t)} = \frac{e^{-iE_1 t/\hbar}}{\sqrt{2}} \ket{g} + \frac{e^{-iE_2 t/\hbar}}{\sqrt{2}} \ket{e}\, . \end{align} We can take out the factor $e^{-iE_1 t/\hbar}$ as a global unobservable phase, and obtain \begin{align}\label{eq:atomequator} \ket{\psi(t)} = \frac{1}{\sqrt{2}} \ket{g} + \frac{e^{-i(E_2 - E_1)t/\hbar}}{\sqrt{2}} \ket{e}\, . \end{align}   So I can get tex4ht not to convert $\ket{g}$ in first line into image but having issues with maths within {align}.   I'm using michal-h21's .cfg file described in this answer:   any help would be greatly appreciated.  PS: I'm not a LaTeX expert and did not write the documents myself. So I somehow need to find a way to workout the LaTeX I have without modifying or with minimum amount  of modification.


Noob Alert  I was trying to copy the displayed <this.state.response> which is inside an
. The
 tag should act as the copy button for which I would like to give the copy action. I tried using react-copy-to-clipboard package but failed as I already have some states defined in my code.
     //content to be copied
 {this.state.response}
      //acts as the copy button
Copy to clipboard

   Home.js    import React, { Component } from "react"; import { Container, Row, Col, ButtonGroup, Button } from "reactstrap"; import {CopyToClipboard} from 'react-copy-to-clipboard'; import Header from "./Header.js"; import Footer from "./Footer.js";  import "./Home.css";   export default class Home extends Component {   state = {      response: ''   };     componentDidMount() {     this.callApi()       .then(res => this.setState({ response: res.chunk }))       .catch(err => console.log(err));   }      callApi = async () => {     const response = await fetch('/password-api');     const body = await response.json();      if (response.status !== 200) throw Error(body.message);      return body;   };    handleClick = async () => {     await this.callApi()        .then(res => this.setState({ response: res.chunk }))  };       render() {     return (
                   <Container>           <Row>             <Col sm="12" md={{ size: 8, offset: 2 }}>

 {this.state.response}

Copy to clipboard

                                                    {/* <ButtonGroup>             <Button>Secure</Button>             <Button>Complex</Button>               </ButtonGroup> */}             </Col>           </Row>           <Row>             <Col sm="12" md={{ size: 8, offset: 2 }}>               <button onClick={this.handleClick} id="get-pass-button" className="button">                 Generate Password               </button>             </Col>           </Row>         </Container>
     );   } }     I believe this question is related to npm react-copy-to-clipboard!

What is the best way to copy text to the clipboard (multi-browser)? I have tried: function copyToClipboard(text) {     if (window.clipboardData) { // Internet Explorer         window.clipboardData.setData("Text", text);     } else {         unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");         const clipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);         clipboardHelper.copyString(text);     } }  But in Internet Explorer it gives a syntax error. In Firefox, it says unsafeWindow is not defined. A nice trick without using :


Let $X,Y$ topological spaces, $f:X\rightarrow Y$ a function, with $Y$ compact. I need to show that, if $f$ is continuous, so $$G_{f}:=\{(x,f(x)):x\in X\}$$ is closed in $X\times Y$.  I saw that question with $Y$ Hausdorff, so is easy to prove that for every $(x,y)$ with $y\neq f(x)$, there is an open set $U\times V$ such that $U\times V\subset (G_{f})^{c}$ by taking a neighborhood $V$ of $y$ in $Y$ with $f(x)\notin V$.   Can I do that for $Y$ compact? If not, how can I solve this question?

Given a function $f:X\to Y$, we define the graph of $f$ as the set   $$G(f)=\{(x,f(x)),x\in X\}$$ Show that if $X$ is compact then $f$ is a   continous function if and only if $G(f)$ is a closed subset of   $X\times Y$.   I know that a set $X$ is called compact when every open cover of $X$ have a finite subcover. Then I need to show that   If $f$ is continous then $G(f)$ is a closed subset of $X\times Y$. If $G(f)$ is a closed subset of $X\times Y$ then $f$ is continous.   How I can show that?


My name is Manoj.  I have a 16 GB sony pendrive. When I plugged it, it shows 12 GB of it is filled. But there where no files in it. I tried even unchecking hide system files in folder options. Then I found a folder named FOUND.000 which contains FILE000.CHK to FILE312.CHK which constitutes 12 GB of memory. I am unable to delete them even in cmd diskpart. Whenever I try to format or access the pendrive, it changes from state 1 to state 2 shown in pics.. Pls help to recover my pendrive.  pic of state-1:   pic of state-2:

I have a USB flash drive which is no longer recognized by my computer. Windows Disk Management and DiskPart report No Media with no storage space (0 bytes) on the drive and I cannot partition or format the drive:     If the drive appears in Windows Explorer, trying to access it returns an error message indicating that there is no disk inserted, such as the following:     Please insert a disk into drive X:.   Various disk partitioning and data recovery utilities don't recognize the drive or only give a generic name for the drive and cannot access the contents of the drive.  What can I do? How do I recover data from the drive?     This question comes up often and the answers are usually the same. This post is meant to provide a definitive, canonical answer for this problem. Feel free to edit the answer to add additional details.


I've multiple packages with absolutely independent pieces of java code. Some packages contain tests that run 5-6 second to complete. Right now, my tests execute sequentially which takes a lot of time to complete all tests in the whole project. However, I quite sure that it's possible to execute tests in package#1/package#2/package#3/.../package#10 simultaneously.   What should I do in order that all my tests from different packages execute at the same time ( without waiting for completion of each other )?

I'm using JUnit 4.4 and Maven and I have a large number of long-running integration tests.  When it comes to parallelizing test suites there are a few solutions that allow me to run each test method in a single test-class in parallel. But all of these require that I change the tests in one way or another.  I really think it would be a much cleaner solution to run X different test classes in X threads in parallel. I have hundreds of tests so I don't really care about threading individual test-classes.  Is there any way to do this?


This might sound like a stupid question but I would really like to know how I would work out how many IP's I've got available on this network range:   196.44.198.32/29  Can someone explain it to me, what the /29 means and how you calculate it.  The amount of IP's you've got available, the one that would be use to broadcast ect.    Kind regards Conrad

This is a  about IPv4 Subnets.      Related:               How does Subnetting Work, and How do you do it by hand or in your head?  Can someone explain both conceptually and with several examples? Server Fault gets lots of subnetting homework questions, so we could use an answer to point them to on Server Fault itself.   If I have a network, how do I figure out how to split it up? If I am given a netmask, how do I know what the network Range is for it? Sometimes there is a slash followed by a number, what is that number? Sometimes there is a subnet mask, but also a wildcard mask, they seem like the same thing but they are different? Someone mentioned something about knowing binary for this?


This is what RAMMON is showing; Ram Type    DDR3    Not Populated Maximum Clock Speed (MHz)   666.67 (JEDEC) Maximum Transfer Speed (MHz)    DDR3-1333 Maximum Bandwidth (MB/s)    PC3-42600 Memory Capacity (MB)    8192      This is what I see in Windows 7 task manager; physical memory (mb) total 3241 cached 433 available 498 Free 77  system information; installed memory 4gb (3.17gb usable)  32 bit operating system.  Is this normal? what's going on? Thanks.  Edit: thanks for the reponses. I am more asking about why is it only 3gb usable that I am seeing not the max 4gb for a 32bit OS? And see that it was answered by the first comments, thanks

Possible Duplicate:             According to , Win 7 only supports 4 GB of RAM. I, however have been reading some forums and some say they are using 8 GB RAM with good performance. I am wondering if I can use 8 GB before I purchase.


Instead of a list with some objects in it, I get [...] whenever I run my code. I'd like to know what it means, in order to debug my code.

So I was writing up a simple binary tree in Python and came across [...]  I don't believe this to be related to the Ellipsis object, more it seems to have something to do with an infinity loop (due to Python's shallow copy?). The source of this infinity loop and why it doesn't get expanded while expanding when accessed is something I'm completely lost to, however   >>> a [[[[[], [], 8, 3], [[], [], 3, 2], 6, 3], [], 1, 4], [[], [], -4, 2], 0, 0] >>> Keys(a)#With a+b [0, 1, 6, 8, 3, -4] >>> Keys(a)#With [a,b] [8, [...], [...], 3, [...], [...], 6, [...], [...], 1, [...], [...], -4, [...], [...], 0, [...], [...]] >>> Keys(a)[1]#?? [8, [...], [...], 3, [...], [...], 6, [...], [...], 1, [...], [...], -4, [...], [...], 0, [...], [...], 8, [...], [...], 3, [...], [...], 6, [...], [...], 1, [...], [...], -4, [...], [...], 0, [...], [...]]     Version using a+b  def Keys(x,y=[]):     if len(x):y+=[x[2]]+Keys(x[0],y)+Keys(x[1],y)#Though it seems I was using y=y[:]+, this actually outputs an ugly mess     return y   version using [a,b]  def Keys(x,y=[]):     if len(x):y+=[x[2],Keys(x[0],y),Keys(x[1],y)]     return y   So what exactly is [...]?


I have written this APEX class to use as a controller on a VFP. I need to write a TEST class for this. Can someone help with the test class for the below code ? Thank-you (The use case is to auto associate leads to the campaigns on the press of a button using VFP on campaign detail page)   public class CampaignLeads { public List<AddLeads> addFewLeads{get; set;} public List<CampaignMember> campMems ; public List<Id> ids; public Campaign camp; public CampaignLeads(ApexPages.StandardController sc) { ids = new List<Id>(); camp = new Campaign(); addFewLeads = new List<AddLeads>();  for(Lead lead: [SELECT Id, LastName FROM Lead WHERE Id NOT IN (SELECT LeadId FROM CampaignMember WHERE CampaignId =: ApexPages.currentPage().getParameters().get('id')) LIMIT 50 ]) { AddLeads objAddLeads = new AddLeads(lead); addFewLeads.add(objAddLeads); } campMems = new List<CampaignMember>(); }  public void insertLead() { Campaign camp = new Campaign(); System.Debug('FewLeads : ' + addFewLeads); List<Campaign> campList = [SELECT Id FROM Campaign WHERE Id =: ApexPages.currentPage().getParameters().get('id')]; System.Debug('Campign Id : ' + campList); if(addFewLeads.size() > 0 && campList.size() > 0 ) { camp = campList[0]; for(AddLeads addLead : addFewLeads) { if(addLead.selected == true) { CampaignMember campMem = new CampaignMember(); campMem.CampaignId = camp.Id; campMem.LeadId = addLead.lead1.Id; campMems.add(campMem); } } } if(campMems.size() > 0) { insert campMems; } }  public class AddLeads { public Lead lead1{get; set;} public Boolean selected{get; set;} public AddLeads(Lead wrpLead) { lead1 = wrpLead; selected = false; } } }  this is the VFP used: <apex:page standardController="Campaign" extensions="CampaignLeads" >     <apex:form id="formID">         <apex:pageBlock >     <apex:pageBlockButtons >             <apex:commandButton value="Associate" reRender="formID" action="{!insertLead}" oncomplete="CampaignPage()" />     </apex:pageBlockButtons> <apex:pageBlockTable value="{!addFewLeads}" var="le" columns="4">         <apex:column headerValue="Select">             <apex:inputCheckbox value="{!le.selected}"/>         </apex:column> <apex:column value="{!le.lead1.LastName}"> </apex:column> </apex:pageBlockTable>         </apex:pageBlock>     </apex:form> <script> function CampaignPage() { window.top.location='/{!Campaign.Id}'; } </script> </apex:page>

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How do I start writing my first unit test?  How do I unit test this code?  I need help writing this unit test.   Salesforce Stack Exchange looks for detailed, specific questions that the community can help you with, and can't write tests on your behalf. We feel that working with the resources below can help you get started, and we encourage you to make an attempt to write your test and return to SFSE with your specific questions when you encounter challenges you can't resolve.


Let f be the  aka the popcorn function. Use the epsilon-delta to prove that f is continuous for all irrational numbers and discontinuous for all rational numbers.

Consider the function:  $f(x)= \begin{cases}  1/n \quad &\text{if $x= m/n$ in simplest form} \\ 0 \quad &\text{if $x \in \mathbb{R}\setminus\mathbb{Q}$}  \end{cases} $  Prove that the function is continuous at every irrational point and also that the function is not continuous at every rational point.  Also, we can say that the function is continuous at some point $k$ if $\displaystyle\lim_{x \to k} f(x)=f(k)$.  I was thinking of doing an epsilon delta proof backwards using the fact that $\mathbb{Q}$ is dense in $\mathbb{R}$ for rational points and irrational points.  Any ways on how to expand on this are welcome.


I recently moved to Ubuntu 14.04 from Windows 8.1. I have quite a problem with my WiFi speed dropping. When I checked it at speedtest.net it went from 30Mbps to less than 1Mbps then goes up again to about 18Mbps in just a few seconds. That's happening all the time making video calls impossible as well as streaming music and watching videos on YouTube. The problem is not existent in when running Windows. I have a "Integrated 10/100 BASE-T Ethernet LAN" with just the stock driver on a HP Pavilion 15. The power management of wlan0 is off. I have almost no knowledge of the terminal so if you help me please explain it like I'm a complete noob (which is true). Cheers!    lspci -vnn | grep Network:  08:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8188EE Wireless Network Adapter [10ec:8179] (rev 01)

I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible.   What are the steps to install Broadcom wireless drivers for a BCM43xx card?  I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc.    lspci -vnn | grep Network showed:   Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b]      iwconfig showed:  lo        no wireless extensions. eth0      no wireless extensions.   NOTE: Answer below is updated every time new information is added and confirmed working.


I need to move cursor one position to right in input field, if backspace was pressed. But I can't get it how to move it   Code:      const [input, setInput] = useState('');     const onKeyDown = e => {     const startPos = Number(e.target.selectionStart);     const endPos = Number(e.target.selectionEnd);     //if backspace was pressed     if (e.keyCode === 9) {       e.preventDefault();       e.stopPropagation();       //here should be some function       setInput(e.target.value.substring(2, startPos) + e.target.value.substring(endPos));     }   };   <input onKeyDown={onKeyDown} onInput={e => setInput(e.target.value)}/>

Does anybody know how to move the keyboard caret in a textbox to a particular position?  For example, if a text-box (e.g. input element, not text-area) has 50 characters in it and I want to position the caret before character 20, how would I go about it?  This is in differentiation from this question:  , which requires jQuery.


I'm wondering whether the ability to downvote questions in the currently implemented way is the best way to handle bad questions. I'm ignoring meta sites for this, as they're far more complicated and voting works differently there.  The benefit of downvoting answers is very obvious to me, if an answer is wrong or simply not a good answer, downvoting it pushes it to the bottom and lets better answers rise above it. For questions it is not as obvious to me, especially as it's far more nebulous what actually defines a bad answer. For questions there is also a parallel quality control mechanism in close votes. And downvoting questions doesn't let better questions rise to the top in the same way it works for answers, it doesn't do anything for question lists or specific tag views, only for the frontpage.  One important aspect of downvotes is that they feed certain automated mechanisms designed to reduce moderator burden and clean up the site, the automatic question bans/throttling and the automated deletion of questions after a certain time.   One drawback of the current way downvoting works is that it is often perceived as very hostile, probably to a largely irrational degree. Even as an experienced SE user I still get a bit frustrated when I receive downvotes that I don't consider justified. And this effect is certainly much worse for newer users. I don't want to open this specific discussion here, but the perceived hostility is a significant issue in my opinion because it likely reduces the number of new users starting to participate, and a steady stream of new active users is necessary to sustain an SE site.  In my subjective observation there is also plenty of spurious voting on posts that are not actually bad. There is no general agreement on several aspects that people consider to make a question a bad question. A single downvote doesn't mean anything, there is too much noise in downvotes to gain any information from it.  Another issue I have with the current downvote mechanism is that there's often an excessive amount of downvotes for really not that terrible questions. The amount of downvotes is driven by attention (just like upvotes), and it often feels like kicking a user again when they're already down when you drive their question far into the negative score.  To me, closing is the primary way of moderating questions. Downvoting questions feels like an inferior parallel moderation system to me. The advantage of closing is that it actually explains to the user what is wrong with their question and gives them a chance to fix it, even though few take it. Downvotes don't tell you what is wrong.  The negative reputation penalty of downvotes also doesn't serve any useful purpose in my opinion. It's too small to have a serious effect on people that ask crappy questions, and it's large enough to simply annoy people.   What would happen if we remove the ability to downvote questions entirely? The question ban and the automated deletion script would likely not work well anymore. I'm not sure the experience for answerers would substantially change. The frontpage would also show questions that would have been below -4 score previously, and the worst possible score would be 0 for any question, so you would not quickly distinguish questions with no feedback from questions with negative feedback (but still unclosed). The asker would receive less feedback that their question might be bad, but only in cases where people don't post that feedback as comments and also don't close the question.  If we assume that community moderation in terms of closing questions works well, I don't see many drawbacks in eliminating downvotes on questions. This is a rather big "if", but maybe more an argument for improving the close system than having a lesser, parallel moderation system in downvotes.  Do we actually need downvotes on questions, or are they a superfluous parallel moderation system alongside close votes?

I understand the purpose of up/downvoting answers -- some answers are better than others, some answers may be wrong, .etc.  With regard to questions, though, there are other mechanisms to deal with "bad" questions:  comments, close, flag.  A poorly written question should be improved.  A bad question should be closed/deleted.  Often, though I see poorly written questions downvoted. I'm not sure what this accomplishes.  I get loss of rep for offensive or spam questions, but for an off-topic question?  or one that is just poorly written?   Why?  It seems to me that rep ought to be based more on answers on a site of this type.   Fundamentally, it seems that rep ought to be based on what you add to the site, not what you ask of it.  A particularly good question does add to the site, but a poor question doesn't really detract from it in the same way that a bad (wrong) answer does. Sure, go ahead and give people more rep for asking a particularly good question, but why punish people for asking bad questions when there are other ways of handling that.  Why not handle questions more like comments and allow upvotes, but not downvotes?  It seems to me that many, if not most, of the downvoted questions are first timers.  It's more likely that your first introduction to the site will be in asking a question, rather than answering. There is a significant risk to alienating new users when their questions are downvoted -- there's a visceral response to seeing that negative number next to your question.  Why not let the close/flag system weed out questions that don't belong and the comment system work to improve poorly worded questions.


I have a delete button. When clicking on the button, I want to generate a second button to confirm that the user really wants to delete something. BUT: When clicking on the second button, the $('.deleteConfirmed').click(function() { does not trigger.  I'm not exactly sure how JQuery works, but my guess is that this happens because the click listener was created before the second button existed, correct? If that is true, what would be a solution to make clicking the second button call deleteEntityConfirmed(id)?  I guess you could probably do it with HTML's onclick attribute on the second button, but does JQuery offer a more elegant solution for this scenario?  Here is some code showing my scenario, I tried to keep only relevant parts in.  HTML:  <button class="delete" data-id="5">   Delete </button>

   JS:  $(function() {   $('.delete').click(function() {     var id = $(this).data('id');     $('#somewhere').empty().append('<button class="deleteConfirmed" data-id="' + id + '">I\'m sure I want to delete</button>');   });     $('.deleteConfirmed').click(function() {     alert("debug message"); // we don't get here when clicking the second button. It seems to not be listening to it     var id = $(this).data('id');     deleteEntityConfirmed(id);   });  });  function deleteEntityConfirmed(id){     // If we'd get here after clicking the second button, this would be full success     alert("Deleting id " + id); }

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


I thought of the following little problem. Given numbers $f_1,\dots f_n$, what is the determinant of the symmetric matrix $I_n+(f_if_j)_{i,j}$? I have found a cute combinatorial-style proof that it is $1+\Sigma_i f_i^2$. using the sum over permutations formula for the determinant. Here $F(\sigma)$ denotes the set of fixed points of $\sigma$.  Does anyone have a faster/more elegant method?

I am convinced that the following identity is true: \begin{equation} \det\begin{bmatrix}  1+a_1^2 & a_1 a_2 & a_1 a_3 & \ldots & a_1a_n \\  a_1a_2 & 1+a_2^2 & a_2a_3 & \ldots & a_2a_n \\  \ldots &\ldots &\dots & \ldots & \ldots \\ a_na_1 &a_na_2 & a_na_3 &\ldots &1+a_n^2 \end{bmatrix}= 1+ a_1^2+a_2^2+\dots+a_n^2. \end{equation} Can you help me proving it?    This determinant comes out in the computation of the volume form on a n-dimensional surface on $\mathbb{R}^{n+1}$ described by the equation  \begin{equation} x_{n+1}=f(x_1\ldots x_n). \end{equation} The volume form is given by $\sqrt{g}dx_1\ldots dx_{n}$, where $g$ is the determinant above with $a_j=\partial_{x_j}f$. The result proven in this question & answer shows that the volume form is  $$ \sqrt{1+\sum_{j=1}^n \left(\frac{\partial f}{\partial x_j}\right)^2}\, dx_1\ldots dx_n.$$


While installing Ubuntu 13.04 I accidentally deleted the Windows 8 system entirely!How and where can i get Windows 8 back?

I have a Toshiba satellite A-200 laptop with a Vista OS on it with 4 NTFS partitions  (C:) Vista  (D:) Entertainment  (E:) Work  (F:) Sources   and I wanted to start using Ubuntu instead. So I tried it first from the live CD and everything was OK and all the partitions were shown and working and so I decided to install Ubuntu to replace Vista on the (C:) drive. After I did that I can no longer find my folders and files on the (D:), (E:), (F:) partitions and the only file system that is shown is one 198 GB although my HDD is 320 GB.  I can't access the lost data on the remaining 120 GB which I hope is still there and not totally lost  I am now working from the live CD but I am unable to install testdisk. Can I recover the Vista partitions by the product recovery CD to get my laptop back to the factory settings? Can I recover the NTFS partitions using a recovery program for Windows or will that make the problem worse?   I need these data badly as I don't have a backup for them.