{"id":7291,"date":"2014-06-03T23:35:50","date_gmt":"2014-06-03T23:35:50","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/06\/03\/problem-about-braces-collection-of-common-programming-errors\/"},"modified":"2014-06-03T23:35:50","modified_gmt":"2014-06-03T23:35:50","slug":"problem-about-braces-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/06\/03\/problem-about-braces-collection-of-common-programming-errors\/","title":{"rendered":"problem about braces-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c5a5dbe1de5aa77c9f57c8fac34f5cfb?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDigitalTrauma<br \/>\nbash grouping parentheses semicolon braces<br \/>\nI know the difference in purpose between parentheses () and curly braces {} when grouping commands in bash.But why does the curly brace construct require a semicolon after the last command, whereas for the parentheses construct, the semicolon is optional?$ while false; do ( echo &#8220;Hello&#8221;; echo &#8220;Goodbye&#8221;; ); done $ while false; do ( echo &#8220;Hello&#8221;; echo &#8220;Goodbye&#8221; ); done $ while false; do { echo &#8220;Hello&#8221;; echo &#8220;Goodbye&#8221;; }; done $ while false; do { echo &#8220;Hello&#8221;; echo &#8220;Goodbye&#8221; }; done bash: syntax er<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/04edbbf48df9b0613f942cc0690fd76b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMatt B<br \/>\nobjective-c square braces<br \/>\nThis question already has an answer here:Performance difference between dot notation versus method call in Objective-C5 answersI&#8217;m currently learning objective-c. What exactly do the square braces around things signify and is there any difference between using that and using a period (I&#8217;m from a .NET world so this would be simpler for me).Thanks.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6eb2d58a613015ccde3f2002ace4e08e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nChad<br \/>\nphp mysql braces<br \/>\nI know this topic has been beaten into the ground, but I&#8217;m really stumped. I can&#8217;t figure out why I&#8217;m getting an unexpected } error. My problem is with a code snippet I&#8217;ve added to a Paypal credit card terminal script. It captures the form data into a MySql database so we can keep track of billing address information, etc. It works until I add an IF statement that is supposed to only send the data to MySQL if Paypal successfully successfully captures the card info. I want to do it this way becau<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/05a4af380b658d62c0324907b8625cee?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nB3ret<br \/>\nbraces xkeyval<br \/>\nI have defined my own figure command using xkeyval and I want to pass arguments for the nested \\includegraphics as one of its keyvalues (maybe I stripped too much code, but I hope you get the idea):\\makeatletter\\define@key[foo]{bar}{options}{\\def\\FooBarOptions{#1}}\\define@key[foo]{bar}{label}{\\def\\FooBarLabel{#1}}\\define@key[foo]{bar}{caption}{\\def\\FooBarCaption{#1}} \\makeatother%\\MySpecialFigure[keyvals]{filename} \\newcommand{\\MySpecialFigure}[2][]{%\\begingroup\\setkeys[foo]{bar}{options={}, lab<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5cb59abb7842c534650c51169a09a355?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ninfensus<br \/>\nregex arguments token braces<br \/>\nA token can be like this {num} or {num:2} (2 being an arg)I would like to achieve matching like this:\/\/ no args [0] = num\/\/ args (anything after the colon and before the closing brace as one match is fine) [0] = num [1] = 2I managed to match anything in the braces that was easy but my regex is too noob to get anything more complex than that! Thanks.FYI I am using javascript and \\{(.*?)\\} matches all the contents within.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1acbd519b1237f7a6103862a5119dec8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nkovibear<br \/>\nc++ if-statement braces<br \/>\nAlright, so I&#8217;m in the process of learning C++, and I&#8217;ve hit a strange effect while working with one of the tutorials, and I don&#8217;t quite get while it&#8217;s happening..For the tutorial (copied from the example offered), I have written a function within a class template specialization that checks if the char is lowercase, and then makes it uppercase:char uppercase () {\/\/checks to see if &#8220;element&#8221;(char) is a lower-case letter between &#8216;a&#8217; and &#8216;z&#8217;if ((element &gt;= &#8216;a&#8217;) &amp;&amp; (element &lt;= &#8216;z&#8217;)){\/\/<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n<p>I discovery a place to host code\u3001demo\u3001 blog and websites.<br \/>\nSite access is fast but not money<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.m5zn.com\/newuploads\/2014\/01\/30\/jpg\/e7da807964b1fff.jpg\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DigitalTrauma bash grouping parentheses semicolon braces I know the difference in purpose between parentheses () and curly braces {} when grouping commands in bash.But why does the curly brace construct require a semicolon after the last command, whereas for the parentheses construct, the semicolon is optional?$ while false; do ( echo &#8220;Hello&#8221;; echo &#8220;Goodbye&#8221;; ); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7291","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7291"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7291\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}