VirtualMini

Everything in the world !

stack exchange - Search

The stack exchange searched through all the site information that is gathered from around the web. To view the complete news story please click on the title link.



find the missing braces in a string javascript


use an array as a stack to keep track of unresolved opening braces:function checkparanthesis(str){ var stack=[]; for(var i=0; i<str.length; i++){ if(str[i] == "(" || str[i] == "{" || str[i] == "[") stack.push(str[i]); else if(str[i] == ")") { if(stack.pop() != "(") { return false; } } else if(str[i] == "}") { if(stack.pop() != "{") { return false; } } else if(str[i] == "]") { if(stack.pop() != "[") { return false; } } } return !stack.length; } you can probably clean this up to be more readable, but basically:every time you find an opening brace, add it to the stack.every time you see a closing brace, pop the stack and see if the stack's top is a matching opening brace. if it's not, you have a mismatch, so you can immediately return false.if you make it to the end, you didn't spot any er






riddle - how did he count my money so fast?


when i was in college, each semester there were companies that would buy back your used textbooks. one semester i brought my books to the book-buyer, who said "we'll pay you $41". he grabbed a thick stack of one-dollar bills and, with the thumb of his other hand, "buzzed" off a stack of them in about 1 second. he handed them to me. sure enough, there were 41 one-dollar bills in the stack!it took me a year to figure out how he did it so quickly. how did he do it?hint: the bills were new.






riddle - how did he count my money so fast?


when i was in college, each semester there were companies that would buy back your used textbooks. one semester i brought my books to the book-buyer, who said "we'll pay you $41". he grabbed a thick stack of one-dollar bills and, with the thumb of his other hand, "buzzed" off a stack of them in less than 1/2 a second. he handed them to me. sure enough, there were 41 one-dollar bills in the stack!it took me a year to figure out how he did it so quickly. how did he do it?hint: the bills were new.






website design - why do many sites leave half of each webpage empty?


there is a reasonable limit in the amount of information the user should see at once. if the view is filled with more information than the user can imilate/understand it becomes overwhelming.it is not a matter of leaving empty space, but of using the amount of space needed, not more. this will depend on the kind of content and the way the information is shown.to use your example:as websites can make use of scroll, there is no need to put as much information as possible in a single screen. vs.as you can notice in smaller screens the need is to show the content occupying the full width of the screen:






what is this aircraft with a big gun on its back?


aviation stack exchange is a question and answer site for aircraft pilots, mechanics, and enthusiasts. join them; it only takes a minute: sign up






siunitx - writing 1 = 10^0 with \num{e0} - tex


tex - latex stack exchange is a question and answer site for users of tex, latex, context, and related typesetting systems. join them; it only takes a minute: sign up






kerning - why is the distance between plus or minus and the number different? -


tex - latex stack exchange is a question and answer site for users of tex, latex, context, and related typesetting systems. join them; it only takes a minute: sign up






tables - how to centralize a cell vertically when in the presence of \vbox with


tex - latex stack exchange is a question and answer site for users of tex, latex, context, and related typesetting systems. join them; it only takes a minute: sign up






how prejudice by whites may keep black college sports stars from getting paid


the president’s son supported start-up firms launched by a partner from utah. but the businesses tumbled, leaving behind lawsuits, unpaid taxes, and angry investors and lenders.






how prejudice by whites may keep black college sports stars from getting paid


democrats are asking whether the supreme court nominee, who is likely to be called upon to review what the president already has shown to be a broad reliance on executive power, would be able to stand up to the president who picked him.






how white racism keeps black college sports stars from getting paid


james robart, who was unanimously confirmed in 2004, issued his ruling in direct challenge to the white house, which spent an entire week defending its ban.






sears, kmart join other retailers in dropping trump-branded items


newsmax media ceo christopher ruddy said he spoke with the president friday and recommended that trump replace his chief of staff. he told cnn that priebus does not understand how federal agencies operate, and he said three cabinet secretaries later praised his criticism.






windows - what is the name of the 8 white squares surrounding views?


i e across this annoying moment while writing a howto article and realized i didn't know the name of those white squares that surround views.here some images for clarification.windows powerpoint:mac xcode:






windows - what is the name of the 8 white squares surrounding resizable views?


i e across this annoying moment while writing a howto article and realized i didn't know the name of those white squares that surround views.here some images for clarification.windows powerpoint:mac xcode:






calculate limit of function - mathematics stack exchange


a bit messy, but the numerator can be rationalized. if $a=\sqrt{1+4x}$ and $b=\sqrt[3]{1+6x}$, multiply numerator and denominator by $a^5+a^4b+a^3b^2+a^2b^3+ab^4+b^5$. then the problem becomes$$\lim_{x\to0}\frac{a^6-b^6}{x^2(a^5+a^4b+a^3b^2+a^2b^3+ab^4+b^5)}$$ignoring that mess in the denominator for a bit, let's work with the numerator.$$a^6-b^6=(1+4x)^3-(1+6x)^2=64x^3+48x^2+12x+1-(36x^2+12x+1)=$$ $$64x^3+12x^2$$ now we can cancel $x^2$ from numerator and denominator to get$$\lim_{x\to0}\frac{64x+12}{a^5+a^4b+a^3b^2+a^2b^3+ab^4+b^5}$$ now that the discontinuity has been removed, we should be able to try substituting $0$ for $x$. when $x=0,a=b=1$. so we're left with $\frac{12}6=2$






how could a focke-wulf 190 pilot see anything at all from his cockpit?


as one can see from the images below, the seat seems to be placed so low on the cabin, i cannot figure out how the pilot could see anything.can anyone explain how a focke-wulf 190 pilot would be able to see out of the cockpit?sourcesource






trump jokes with sheriffs about destroying a texas legislator’s career over et f


america got a civics lesson last night when senate republicans used an obscure rule to shut down a speech by sen. elizabeth warren. the rule states that senators may not “directly or indirectly, by any form of words impute to another senator or to other senators any conduct or motive unworthy or unbecoming a senator.” in this case, warren had been talking about sen. jeff sessions.






footnotes - why is the first footnotemark symbol (asterisk) missing? - tex


with the current tu default encoding, \textasteriskcentered is mapped to u+2217 asterisk operator which times new roman happens to miss.the old eu1/eu2 encodings are based on xunicode that mapped \textasteriskcentered to u+002a asterisk, which was the wrong thing to do, since the output when used as a footnote marker is definitely bad:compare with the output we get with tex gyre termesif i add\undeclaretextcommand{\textasteriskcentered}{tu} \declarerobustcommand{\textasteriskcentered}{% \iffontchar\font"2217 \char"2217 \else\loweredasterisk\fi } \newcommand\loweredasterisk{\raisebox{-.5ex}{*}} to the preamble, i get, with times new roman,which is still not very good, but definitely better than the previous output.






geometry - find 7 solutions


you have three flat pieces, as shown:arrange them flat, without overlap, such that the shape formed by the black parts is congruent to the shape formed by the white parts. rotation and reflection are allowed.find at least 7 solutions.if you find a single one, feel free to post a partial.quick note to clarify the aim of this puzzle: this is not a trick question where you need to stack the shapes/make a 3d shape etc. it's exactly what it appears to be. the solutions are just really hard to find.






geometry - find 7 solutions


you have three flat pieces, as shown:arrange them flat, without overlap, such that the shape formed by the black parts is congruent to the shape formed by the white parts. rotation and reflection are allowed.find at least 7 distinct solutions.if you find a single one, feel free to post a partial.quick note to clarify the aim of this puzzle: this is not a trick question where you need to stack the shapes/make a 3d shape etc. it's exactly what it appears to be. the solutions are just really hard to find.






how can this aircraft be stable/manoeuvrable?


the new wave of electric vtol aircraft concepts (joby aviation, zee, lilium, airbus a$^3$, etc...) has produced some audacious unconventional designs.now my question is how lilium's concept can be stable and/or manoeuvrable, given the following configuration:what strikes me is a lack of a surface that creates a force to counteract the moment generated by the distance between the wing's lift and the gravity force.and although control around the yaw axis seems possible with differential thrust, i wonder how the aircraft is controlled around the pitch axis.from the forward part of the fuselage some canard-like surfaces with integrated propellers are deployed to provide hovering capabilities, however it seems these are supposed to be retracted during forward flight.edit: some might suggest the






geometry - find 77777 solutions


you have three flat pieces, as shown:arrange them flat, without overlap, such that the shape formed by the black parts is congruent to the shape formed by the white parts. rotation and reflection are allowed.find at least 77777 distinct solutions.if you find a single one, feel free to post a partial.quick note to clarify the aim of this puzzle: this is not a trick question where you need to stack the shapes/make a 3d shape etc. it's exactly what it appears to be. the solutions are just really hard to find.






is it ok to remove my own low quality question with decent/good answers?


no. the system will actually prevent you from removing questions with at least one up-voted (i.e. helpful) answer. habitually removing your posts may even flag that content for moderator attention.the reason is that once you post a question or answer to this site, those posts become part of the collective efforts of others who have also contributed to that content. posts that are potentially useful to others should not be removed except under extraordinary circumstances. even if the post is no longer useful to the original author, that information is still beneficial to others who may run into similar problems in the future.this is an underlying philosophy of stack exchange.






code golf - attack, decay, sustain, release


sound synthesizers use envelope generators to control how certain parameters of the sound (such as overall loudness) change with time. in many synthesizers an envelope is defined by four parameters, as represented in the following figure from wikipedia:attack time (a): time taken for the envelope to reach its maximum level, starting from zero, when the key is first presseddecay time (d): time taken for the envelope to reach the specified sustain levelsustain level (s): level which is maintained, after the initial attack and decay, for as long as the key is being pressed.release time (r): time taken for the envelope to reach zero when the key is releasedthe challengeinput the four parameters a, d, s, r and plot the envelope.parameters will be integer values between from 0 to 127.the maximum






integration by parts - mathematics stack exchange


forget cute (or weird) acronyms or tables. you are focusing on the wrong thing: differentiation is easy, while integration is hard, so you should ask not what to pick as $u$, but what to pick as $dv$. the answer is: choose as $dv$ the most complicated expression in the integrand that you currently know how to integrate. for example, you asked about integrating $x^2e^x$. between $x^2$ and $e^x$ the factor $e^x$ is more sophisticated and you can integrate it, so let $dv = e^x dx$ and then $u = x^2$. you also asked about integrating $\sqrt{x}\ln x$. for students the antiderivative of $\sqrt{x}$ is known but the antiderivative of $\ln x$ is not, so let $dv = \sqrt{x} dx$ and then $u = \ln x$.when this tip of how to pick $dv$ rather than $u$ was p ed on to me, i never had a problem applying int






table of contents - how to explicitly split long toc in beamer? - tex


my suggestion is avoid split the toc in several frames. alternatives:1) start only showing the sections (without subsections): \begin{frame}{toc} \setcounter{tocdepth}{1} \tableofcontents % \setcounter{tocdepth}{2} % allow subsequent tocs *with* subsections \end{frame} simplicity is power in a presentation.2) not incompatible with the previos point, show the toc starting each section, but highliting the current section and optionally showing the subsections of this section only: % in the preamble!! \atbeginsection {\begin{frame}{toc} \tableofcontents[currentsection,hideothersubsections] \end{frame}} \begin{document} and set tocdepth counter to 2 if yo left the frame of point 1!in some cases (e.g. showing the 3th section) this is not enough because there are 10 subsections. then these are m






footnotes - why is the first footnotemark symbol (asterisk) missing? - tex


with the current tu default encoding, \textasteriskcentered is mapped to u+2217 asterisk operator which times new roman happens to miss.the old eu1/eu2 encodings are based on xunicode that mapped \textasteriskcentered to u+002a asterisk, which was the wrong thing to do, since the output when used as a footnote marker is definitely bad:compare with the output we get with tex gyre termesif i add\undeclaretextcommand{\textasteriskcentered}{tu} \declarerobustcommand{\textasteriskcentered}{% \iffontchar\font"2217 \char"2217 \else\loweredasterisk\fi } \newcommand\loweredasterisk{\raisebox{-.5ex}{*}} to the preamble, i get, with times new roman,which is still not very good, but definitely better than the previous output.an altogether different solution: use tex gyre termes for the symbol. you cou






how trump’s first batch of executive actions stack up against obama’s


colorado federal appeals court judge is favorite of conservative legal establishment“it is the role of judges to apply, not alter, the work of the people’s representatives,” said gorsuch, 49, who was nominated to fill the opening created last year by the death of justice antonin scalia.like scalia, gorsuch believes in an “originalist” interpretation of the constitution, but he’s described as being more interested in winning over colleagues than scalia, who was just as likely to go it alone as to compromise.by robert barnes9 hours ago






how trump’s first batch of executive actions stack up against obama’s


colorado federal appeals court judge is favorite of conservative legal establishment“it is the role of judges to apply, not alter, the work of the people’s representatives,” said gorsuch, 49, who was nominated to fill the opening created last year by the death of justice antonin scalia.like scalia, gorsuch believes in an “originalist” interpretation of the constitution, but he’s described as being more interested in winning over colleagues than scalia, who was just as likely to go it alone as to compromise.by robert barnes11 hours ago






how trump’s first batch of executive actions stack up against obama’s


nominee is favorite of conservative legal establishment“it is the role of judges to apply, not alter, the work of the people’s representatives,” said gorsuch, 49, a jurist on the court of appeals based in colorado, who was nominated to fill the opening created last year by the death of justice antonin scalia.like scalia, gorsuch believes in an “originalist” interpretation of the constitution, but he’s described as being more interested in winning over colleagues than scalia, who was just as likely to go it alone as to compromise.by robert barnes7 hours ago






how trump’s first batch of executive actions stack up against obama’s


nominee is favorite of conservative legal establishment“it is the role of judges to apply, not alter, the work of the people’s representatives,” said gorsuch, 49, a jurist on the court of appeals based in colorado who was nominated to fill the opening created last year by the death of justice antonin scalia.like scalia, gorsuch believes in an “originalist” interpretation of the constitution, but he’s described as being more interested in winning over colleagues than scalia, who was just as likely to go it alone as to compromise.by robert barnes4 hours ago






how trump’s first batch of executive actions stack up against obama’s


nominee is favorite of conservative legal establishment“it is the role of judges to apply, not alter, the work of the people’s representatives,” said gorsuch, 49, a jurist on the court of appeals based in colorado who was nominated to fill the opening created last year by the death of justice antonin scalia.like scalia, gorsuch believes in an “originalist” interpretation of the constitution, but he’s described as being more interested in winning over colleagues than scalia, who was just as likely to go it alone as to compromise.by robert barnes5 hours ago






what is the best way to plot coordinates in latex? - tex


data points can be directly entered using the data command from the datavisualization library. the same applies if you have the function instead of the data points. here are some examples adapted from the tikz-pgf manual:\documentcl [border=2mm,tikz]{standalone} \usetikzlibrary{datavisualization} \begin{document} \begin{tikzpicture} \datavisualization [school book axes, visualize as smooth line] data { x, y -1.5, 2.25 -1, 1 -.5, .25 0, 0 .5, .25 1, 1 1.5, 2.25 }; \end{tikzpicture} \end{document} changing the axes style to scientific, e.g., can give a different look:\datavisualization [scientific axes, all axes={grid}, visualize as smooth line] also, if you have the function at hand, this can be quite easy:\documentcl [border=2mm,tikz]{standalone} \usetikzlibrary{datavisualization.formats.f






the moon - which apollo "mystery" was said to be finally solved by a better rend


nvidia rendered aldrin descending to the surface and discovered that, just as the conspiracies claimed, it couldn't be reproduced with direct light from the sun as the sole light source. of course as in photos on earth, indirect light (reflected, scattered...) is an important source of scene illumination and must be taken into account.after adding the indirect, scattered light from the lunar soil and parts of the spacecraft, aldrin could be seen in the simulation, but still he was darker than in the photograph.the following are screen captures gif from the nvida video linked in the article.however, once nvida included the the highly reflective space suit worn by the photographer himself (armstrong) the simulation matched the photograph.the key here is the low albedo (reflectivity) of the l






pay dm fees at al ansari exchange


municipality signs agreement with exchange house with 170 branches in uaepublished: 19:34 february 5, 2017 staff reportdubai: dubai municipality has signed an agreement with al ansari exchange for facilitating its service payments through the exchange’s branches. the agreement was signed earlier this week by rashid saif al shamsi, director of finance department at dubai municipality and rashed ali al ansari, general manager, al ansari exchange. customers will be able to make their payments for dubai municipality transactions through the 170 branches of al ansari exchange spread across the uae instead of visiting the municipality office.






integration - convolution formulas - mathematics stack exchange


i have a doubt about convolution.i have found this definition :$$(f*g)(t)=\int_{-\infty}^{+\infty} f(t-\alpha) \ g(\alpha) \ d\alpha$$this integral does not converge:$$\cos(t)*t=\int_{-\infty}^{+\infty} \cos(t-\alpha) \ \alpha \ d\alpha$$contrariwise: $$ \mathscr{l} \{ \cos(t) * t \} =\mathscr{l} \{ \cos(t) \} \ \mathscr{l} \{t \}=\frac{1}{s^3+s}$$partial fraction decomposition:$$\frac{1}{s^3+s}=\frac{a}{s}+\frac{b}{s-i}+\frac{c}{s+i}$$$$a=\lim_{s\rightarrow 0} \ \frac{1}{s^2+1}=1$$ $$b=\lim_{s\rightarrow i} \ \frac{1}{s^2+is}=-\frac{1}{2}$$ $$c=\lim_{s\rightarrow -i} \ \frac{1}{s^2-is}=\frac{1}{2}$$$$\frac{1}{s^3+s}=\frac{1}{s}+\frac{-\frac{1}{2}}{s-i}+\frac{\frac{1} {2}}{s+i}$$$$\mathscr{l}^{-1} \{ \frac{1}{s}+\frac{-\frac{1}{2}}{s-i}+\frac{\frac{1}{2}}{s+i} \}=1-\frac{1}{2} \ e^{it}+\fr






how to generate a mesh with quadrilateral elements?


this is a bit of a but it works for this example:generate separate rectangle meshes -- note the connected edge nodes must be exactly coincident.<< ndsolve`fem` m1 = toelementmesh[rectangle[{-10, 0}, {0, 10}], "meshelementtype" -> quadelement, maxcellmeasure -> 4, "meshorder" -> 1]; m2 = toelementmesh[rectangle[{-20, 10}, {0, 30}], "meshelementtype" -> quadelement, maxcellmeasure -> 4, "meshorder" -> 1]; show[{m1["wireframe"] /. edgeform[graylevel[0]] -> edgeform[red], m2["wireframe"]}] join the node lists and shift the second mesh to the new list index:allnodes = join[m1["coordinates"], m2["coordinates"]]; common = intersection[m1["coordinates"], m2["coordinates"]]; m2el = map[[email protected]["coordinates"] + # &, m2["meshelements"] , {2}]; now point the duplicate






how to generate a mesh with quadrilateral elements?


this is a bit of a but it works for this example:generate separate rectangle meshes -- note the connected edge nodes must be exactly coincident.<< ndsolve`fem` m1 = toelementmesh[rectangle[{-10, 0}, {0, 10}], "meshelementtype" -> quadelement, maxcellmeasure -> 4, "meshorder" -> 1]; m2 = toelementmesh[rectangle[{-20, 10}, {0, 30}], "meshelementtype" -> quadelement, maxcellmeasure -> 4, "meshorder" -> 1]; show[{m1["wireframe"] /. edgeform[graylevel[0]] -> edgeform[red], m2["wireframe"]}] all of this works fine for "meshorder"->2 btwjoin the node lists and shift the second mesh to the new list index:allnodes = join[m1["coordinates"], m2["coordinates"]]; common = intersection[m1["coordinates"], m2["coordinates"]]; m2el = map[[email protected]["coordinates"] + # &, m2[






how to generate a mesh with quadrilateral elements?


this is a bit of a but it works for this example:generate separate rectangle meshes -- note the connected edge nodes must be exactly coincident.<< ndsolve`fem` m1 = toelementmesh[rectangle[{-10, 0}, {0, 10}], "meshelementtype" -> quadelement, maxcellmeasure -> 4, "meshorder" -> 1]; m2 = toelementmesh[rectangle[{-20, 10}, {0, 30}], "meshelementtype" -> quadelement, maxcellmeasure -> 4, "meshorder" -> 1]; show[{m1["wireframe"] /. edgeform[graylevel[0]] -> edgeform[red], m2["wireframe"]}] all of this works fine for "meshorder"->2 btwjoin the node lists and shift the second mesh to the new list index:allnodes = join[m1["coordinates"], m2["coordinates"]]; common = intersection[m1["coordinates"], m2["coordinates"]]; m2el = map[[email protected]["coordinates"] + # &, m2[






c# - roommodel cl - code review stack exchange


what's the point of a roommodel cl with only private fields?this is waaay too many arguments: public roommodel(bool clubonly, int doorpositionx, int doorpositiony, int wallheight, double doorpositionz, int doordirection, string modelheightmap, string modelfurnimap, string poolmap). instead, have publicly available properties so your code becomes much clearer:var roommodel = new roommodel { clubonly = clubonly, doorpositionx = doorpositionx // etc. } this also avoids errors.your constructor is 50+ lines. that's far too long, imho. some of it should be moved to private methods, but i'd urge you to keep roommodel lean and move the logic in your constructor to a separate "creator" cl .i'd make parsemodelsquare() into a cl of its own as well. (why is this a public method?) perhaps also look at