pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
20,117,802
0
Open links in webview android html <p>I am developing a webbased app for android, winpho and ios. One of the sections has a link to download a pdf.</p> <p>In winpho and ios, keep pressing for a second open a menu to open, download or save document but in android, seems to do nothing. I can't open just pressing once the button or open in another window or nothing.</p> <p>I don't know if I have to declare the button in other way in html or it just doesn't work in android. </p> <p>Any idea about what is the problem? If you need my html code, just ask but it is just a normal link with href=url.</p> <p>I added the android part in which I open the webpage: </p> <pre><code>mywebview = (WebView) findViewById(R.id.webview); if (savedInstanceState == null){ mywebview.loadUrl(url); } </code></pre> <p>The url is a normal webapage with a button on in. Clicking that button, the pdf is opened. In android chrome, it works. </p>
33,249,412
0
<p>Remove the align left and right and white space between image tags. </p> <pre><code>&lt;div class="feat"&gt; &lt;img src="nirvana.jpeg" style="width:50%;height:50%;"&gt;&lt;img src="pup.jpg" style="width:50%;height:50%;"&gt; &lt;/div&gt; </code></pre> <p>Read up <a href="https://css-tricks.com/fighting-the-space-between-inline-block-elements/" rel="nofollow">this blog post</a> about white space. Here is a working plunkr (without your images, obviously): <a href="http://embed.plnkr.co/sytM7HeFUVDPT1p3HoXN/preview" rel="nofollow">http://embed.plnkr.co/sytM7HeFUVDPT1p3HoXN/preview</a></p>
32,339,034
0
<p>I've tested this and found that <code>HttpUtility.UrlDecode("%E9")</code> returns question mark that You mentioned. It seems that it You have to manually specify appropriate encoding for this to work correctly with <code>%E9</code> encoded value.</p> <p>You can try:</p> <pre><code>HttpUtility.UrlDecode("%E9", System.Text.UnicodeEncoding.Default); </code></pre> <p>or</p> <pre><code>HttpUtility.UrlDecode("%E9", System.Text.UnicodeEncoding.UTF7); </code></pre> <p>Both should return the character decoded as You expected.</p>
40,798,771
0
Message Box hidden in Windows form. How to display message box in desktop <p>I have win form application. Main form to invisible mode. Only Loading Panel visible to user. </p> <p>Application using <strong>interop</strong> functionality. At the application running time show excel, word. after Excel or Word close event display at dialog box.</p> <p>The dialog box shown at Task bar. How to display at desktop. If I am giving to Desktop Only Mode. Yes or No button not working properly. Always press yes button.</p> <p>Need to show dialog at desktop</p> <pre><code>MessageBox.Show("Do you want save", "Confirmation", MessageBoxButton.YesNoCancel, MessageBox.Questions MessageBoxDefaultButton.Button1); </code></pre>
3,952,289
0
<p>First of all you need to create a catch all subdomain which will send all requests to your single VirtualHost:</p> <pre><code>ServerAlias *.website.com </code></pre> <p>Then you can either:</p> <ol> <li>Inspect the HTTP host at the application level and do whatever needs to be done (either serve content from the virtual subdomain, or do a 301 redirect to the www.</li> <li>Use a single mod_rewrite rule to rewrite the URL as you initially suggested.</li> </ol>
10,969,732
0
multiple form within one HTML table <p>Out of a really long product list I am creating a table. Each row should be possible to update. HTML is not valid if I put multiple forms within one table. A solution would be to create for each row a single table, but the format would be really ugly.</p> <p>I would like to make this:</p> <pre><code>&lt;table&gt; &lt;tr&gt;&lt;form&gt;&lt;td&gt;&lt;input type=\"text\" name=\"name\" value=\"".$row['name']."\" /&gt;&lt;/td&gt;\n"; </code></pre> <p>.... .... . . . </p> <p>It is not vaild. What I could do?</p>
8,778,008
0
<p>The trouble here is that the underlying .NET dataset designer isn't properly schema-aware. In the Visual Studio dataset designer, you must 'manually' enter the schema prefix into each datatable definition's properties. After that, NDbUnit should properly work with tables in other schemas.</p> <p>For more detail, see <a href="http://code.google.com/p/ndbunit/issues/detail?id=23" rel="nofollow">http://code.google.com/p/ndbunit/issues/detail?id=23</a></p>
11,990,860
0
<pre><code>NSString *htmlString = [NSString stringWithFormat: @"&lt;html&gt;" @"&lt;body&gt;" @"&lt;meta name = \"viewport\"content = \"initial-scale = 1.0, user-scalable = no\"/&gt;" @"&lt;iframe src=\"http://player.vimeo.com/video/8118831title=0&amp;amp;byline=0&amp;amp;portrait=0&amp;amp;color=008efe&amp;amp\";autoplay=1&amp;amp;loop=1 width=\"320\" height=\"480\" frameborder=\"0\"&gt;" @"&lt;/iframe&gt;" @"&lt;body style=\"background:#000;margin-top:0px;margin-left:0px\"&gt;" @"&lt;/object&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;",@"http://www.vimeo.com/8118831" ]; </code></pre> <p>Now just use <code>loadHTMLString</code> to play the video in your application.</p>
2,471,838
0
<p>You edited your original question to add this second question.</p> <blockquote> <p>Also, how could I change func QR to accept parameter values? What I'd like for it to do is accept a command-line flag in place of req *http.Request.</p> </blockquote> <p>If you read <a href="http://golang.org/doc/go_spec.html" rel="nofollow noreferrer">The Go Programming Language Specification</a>, <a href="http://golang.org/doc/go_spec.html#Types" rel="nofollow noreferrer">§Types</a>, including <a href="http://golang.org/doc/go_spec.html#Function_types" rel="nofollow noreferrer">§Function types</a>, you will see that Go has strong static typing, including function types. While this does not guarantee to catch all errors, it usually catches attempts to use invalid, non-matching function signatures.</p> <p>You don't tell us why you want to change the function signature for <code>QR</code>, in what appears to be an arbitrary and capricious fashion, so that it is no longer a valid <code>HandlerFunc</code> type, guaranteeing that the program will fail to even compile. We can only guess what you want to accomplish. Perhaps it's as simple as this: you want to modify the <code>http.Request</code>, based on a runtime parameter. Perhaps, something like this:</p> <pre><code>// Note: flag.Parse() in func main() {...} var qrFlag = flag.String("qr", "", "function QR parameter") func QR(c *http.Conn, req *http.Request) { if len(*qrFlag) &gt; 0 { // insert code here to use the qr parameter (qrFlag) // to modify the http.Request (req) } templ.Execute(req.FormValue("s"), c) } </code></pre> <p>Perhaps not! Who knows?</p>
39,970,531
0
Should I Add String Conditional Method to Helper or Model or ...? <p>What is the best way to do this?</p> <p>I have this in a view <code>&lt;%= badges(challenge) %&gt;</code> or <code>&lt;%= challenge.badges %&gt;</code> depending on if I put <code>badges</code> in a helper or the model.</p> <p>I was told to put it in a helper. I put it in so like this:</p> <pre><code>module ChallengesHelper def badges(challenge) if challenge.name == "Read 20 Min" ActionController::Base.helpers.image_tag("read.png", class: "gold-star") elsif challenge.name == "Exercise 20 Min" ActionController::Base.helpers.image_tag("exercise.png", class: "gold-star") elsif challenge.name == "Meditate 10 Min" ActionController::Base.helpers.image_tag("meditate.png", class: "gold-star") elsif challenge.name == "Stretch 5 Min" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Write 500 Words" ActionController::Base.helpers.image_tag("write.png", class: "gold-star") elsif challenge.name == "Walk 5,000 Steps" ActionController::Base.helpers.image_tag("walk.png", class: "gold-star") elsif challenge.name == "Eat Fruit &amp; Veg" ActionController::Base.helpers.image_tag("fruit-and-vegetable.png", class: "gold-star") elsif challenge.name == "Plan Day" ActionController::Base.helpers.image_tag("plan.png", class: "gold-star") elsif challenge.name == "After Waking, Guzzle Water" ActionController::Base.helpers.image_tag("water.png", class: "gold-star") elsif challenge.name == "Track Food Consumption" ActionController::Base.helpers.image_tag("track-food.png", class: "gold-star") elsif challenge.name == "Random Act of Kindness" ActionController::Base.helpers.image_tag("random-kindness.png", class: "gold-star") elsif challenge.name == "Write 3 Gratitudes" ActionController::Base.helpers.image_tag("gratitude.png", class: "gold-star") elsif challenge.name == "Juice Fast" ActionController::Base.helpers.image_tag("juice.png", class: "gold-star") elsif challenge.name == "Not Smoke" ActionController::Base.helpers.image_tag("not-smoke.png", class: "gold-star") elsif challenge.name == "Not Drink Alcohol" ActionController::Base.helpers.image_tag("not-drink.png", class: "gold-star") # GOAL CHALLENGES elsif challenge.name == "Live Abroad" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Long Road Trip" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Tour Capital Building" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Karaoke" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "See New York Skyline" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Run 5K" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Write Memoir" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Lose 10 Pounds" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Join Club" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Skydive" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Start a Blog" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Donate $100 to Charity" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Create Independent Income Stream" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Paint a Picture" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif challenge.name == "Give a Public Speech" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") else ActionController::Base.helpers.image_tag("gold-star-maze.png", class: "gold-star") end end end </code></pre> <p>I'm only concerned because it seems more "wordy" in the helper than the model.</p> <pre><code> def badges if name == "Read 20 Min" ActionController::Base.helpers.image_tag("read.png", class: "gold-star") elsif name == "Exercise 20 Min" ActionController::Base.helpers.image_tag("exercise.png", class: "gold-star") elsif name == "Meditate 10 Min" ActionController::Base.helpers.image_tag("meditate.png", class: "gold-star") elsif name == "Stretch 5 Min" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Write 500 Words" ActionController::Base.helpers.image_tag("write.png", class: "gold-star") elsif name == "Walk 5,000 Steps" ActionController::Base.helpers.image_tag("walk.png", class: "gold-star") elsif name == "Eat Fruit &amp; Veg" ActionController::Base.helpers.image_tag("fruit-and-vegetable.png", class: "gold-star") elsif name == "Plan Day" ActionController::Base.helpers.image_tag("plan.png", class: "gold-star") elsif name == "After Waking, Guzzle Water" ActionController::Base.helpers.image_tag("water.png", class: "gold-star") elsif name == "Track Food Consumption" ActionController::Base.helpers.image_tag("track-food.png", class: "gold-star") elsif name == "Random Act of Kindness" ActionController::Base.helpers.image_tag("random-kindness.png", class: "gold-star") elsif name == "Write 3 Gratitudes" ActionController::Base.helpers.image_tag("gratitude.png", class: "gold-star") elsif name == "Juice Fast" ActionController::Base.helpers.image_tag("juice.png", class: "gold-star") elsif name == "Not Smoke" ActionController::Base.helpers.image_tag("not-smoke.png", class: "gold-star") elsif name == "Not Drink Alcohol" ActionController::Base.helpers.image_tag("not-drink.png", class: "gold-star") # GOAL CHALLENGES elsif name == "Live Abroad" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Long Road Trip" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Tour Capital Building" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Karaoke" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "See New York Skyline" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Run 5K" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Write Memoir" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Lose 10 Pounds" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Join Club" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Skydive" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Start a Blog" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Donate $100 to Charity" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Create Independent Income Stream" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Paint a Picture" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") elsif name == "Give a Public Speech" ActionController::Base.helpers.image_tag("stretch.png", class: "gold-star") else ActionController::Base.helpers.image_tag("gold-star-maze.png", class: "gold-star") end end </code></pre> <p>Why is one spot better than the other? And what is the best practice for something like this where their are a lot of string conditions?</p>
32,437,218
0
How to remove or hide "Leave this page" button in confirm navigation of browsers? <p>I want to remove/hide "Leave this page" button or want to trigger "Stay this page" button in confirm navigation of browsers?</p> <pre><code>window.onbeforeunload = function () { return "Please close the another tabs to logout.."; }; </code></pre>
40,558,405
0
<p>The problem was not Nancy, it was <code>app.UseStageMarker(PipelineStage.MapHandler);</code> which I removed. This is an Owin question so I'm closing.</p>
21,744,550
0
Random number generator without repeating numbers <p>I am trying to create a random number generator without repeating numbers {0 - 7}.</p> <p>im getting a seg fault error here, and im pretty sure im allocating all the memory correctly there. One solution that i found that works occasionally is if i set shuffledbracket parameter size to 9. however since it has one extra memory it puts in an extra 0. any ideas on how i could get my array to only have a parameter size of 8 without a seg fault error?</p>
2,386,873
0
JVM benchmarking application <p>We want to compare general performance (CPU, I/O, network, ...) of different JVMs for the same Java version (1.5) in different environments (Windows, Solaris, ...). </p> <p>Do you know of any JVM benchmarking application which can be used to compare results from different JVMs?</p> <p>Thank you very much.</p>
5,221,920
0
<p>The others already answered how to truncate a file. Removing parts in the middle of a file is not possible, though. For this, you'd need to rewrite the whole file.</p>
28,479,843
0
<p>By default, Spring Boot 1.1 uses Flyway 3.0 which does not support <code>COPY FROM STDIN</code>. Support <a href="https://github.com/flyway/flyway/commit/7b9b2d141cb9ff63f6ec01baec2e46f519b19ee4" rel="nofollow">was added</a> in 3.1. You can either upgrade to Spring Boot 1.2 (which uses Flyway 3.1 by default) or stick with Spring Boot 1.1 and try overriding the version of Flyway to 3.1.</p>
8,722,233
0
available.packages by publication date <p>Is it possible to get the publication date of CRAN packages from within R? I would like to get a list of the k most recently published CRAN packages, or alternatively all packages published after date dd-mm-yy. Similar to the information on the <a href="http://cran.r-project.org/web/packages/available_packages_by_date.html">available_packages_by_date.html</a>? </p> <p>The available.packages() command has a "fields" argument, but this only extracts fields from the DESCRIPTION. The date field on the package description is not always up-to-date.</p> <p>I can get it with a smart regex from the <a href="http://cran.r-project.org/web/packages/available_packages_by_date.html">html page</a>, but I am not sure how reliable and up-to-date the this html file is... At some point Kurt might decide to give the layout a makeover which would break the script. An alternative is to use timestamps from the <a href="ftp://cran.r-project.org/pub/R/src/contrib/">CRAN FTP</a> but I am also not sure how good this solution is. I am not sure if there is somewhere a formally structured file with publication dates? I assume the HTML page is automatically generated from some DB.</p>
17,233,800
0
Devise -- password doesn't match its confirmation for some reason <p>I'm using <code>devise</code> and I can't add an user neither via no via <code>seeds.rb</code>. Here is a rails console:</p> <pre><code>irb(main):100:0&gt; a = User.new =&gt; #&lt;User id: nil, email: "", encrypted_password: "", reset_password_token: nil, reset_password_sent_at: nil,......etc&gt; irb(main):111:0&gt; a.email = "[email protected]" =&gt; "[email protected]" irb(main):116:0&gt; a.password = "1234a" =&gt; "1234a" irb(main):117:0&gt; a.password =&gt; "1234a" irb(main):119:0&gt; a.password_confirmation = "1234a" =&gt; "1234a" irb(main):120:0&gt; a.password_confirmation == a.password =&gt; true irb(main):121:0&gt; a.save! (0.8ms) BEGIN User Load (1.2ms) SELECT "users".* FROM "users" WHERE "users"."reset_password_token" = 'M9Xg7pYuPkgysuirxoj8' LIMIT 1 User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."reset_password_token" = '4y8Vdn9b7nsC2QqtkCSs' LIMIT 1 User Exists (0.7ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = '[email protected]' LIMIT 1 User Exists (0.8ms) SELECT 1 AS one FROM "users" WHERE LOWER("users"."login") = LOWER('login1') LIMIT 1 User Exists (0.6ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = '[email protected]' LIMIT 1 (0.4ms) ROLLBACK ActiveRecord::RecordInvalid: Validation failed: Password doesn't match confirmation </code></pre>
14,790,157
0
<p>Have you tried getting rid of the <code>try/catch</code> statement completely?</p> <pre><code>string clientLanguage = null; var userLanguages = filterContext.HttpContext.Request.UserLanguages; if (userLanguages != null &amp;&amp; userLanguages.Length &gt; 0) { var culture = CultureInfo .GetCultures(CultureTypes.AllCultures) .FirstOrDefault( x =&gt; string.Equals( x.Name, userLanguages[0].Name, StringComparison.OrdinalIgnoreCase ) ); if (culture != null) { clientLanguage = culture.TwoLetterISOLanguageName; } } </code></pre> <p>Use try/catch only for handling exceptions that are out of your control. As their name suggests exceptions should be used for handling exceptional cases.</p> <p>In this case you are doing standard parsing so it is much better to do defensive programming instead of trying, throwing, catching, ... </p>
5,745,690
0
<p>From your code, it seems you have just assigned values to sigevent, instead of using any where in code.</p> <blockquote> <p>static struct sigevent sevp; </p> <pre><code>memset (&amp;sevp, 0, sizeof (struct sigevent)); sevp.sigev_value.sival_ptr = NULL; sevp.sigev_notify = SIGEV_THREAD; sevp.sigev_notify_attributes = NULL; sevp.sigev_signo = SIGUSR1; sevp.sigev_notify_function=threadFunction; </code></pre> </blockquote> <p>To invoke threadFunction, call this from your signal handler.</p> <pre><code>&gt; void sig_handlerTimer1(int signum) &gt; { &gt; printf("Caught signal: %d\n",signum); &gt; threadFunction(signum); &gt; } </code></pre> <p>If you want to use <strong>sevp</strong>, use something like timer_create() and timer_settime(). Check this link: <a href="http://ptgmedia.pearsoncmg.com/images/0201633922/sourcecode/sigev_thread.c" rel="nofollow">http://ptgmedia.pearsoncmg.com/images/0201633922/sourcecode/sigev_thread.c</a></p>
39,502,586
0
<p>Because you're not waiting for the mouse button to be released before you trigger your buttons.</p> <ul> <li>When <code>pause()</code> starts, it brings up two buttons.</li> <li>User moves mouse to <code>Main Menu</code>.</li> <li>User clicks mouse.</li> <li>As soon as the mouse button is depressed, <code>game_intro()</code> is called, which puts a <code>Quit</code> button in the same place.</li> <li>The mouse button is <em>still</em> depressed, so the game quits.</li> </ul>
39,332,135
0
Preseeding Ubuntu with primary partitions <p>I'm attempting to preseed a Xenial image and it works just fine, aside from the partitioning. cloud-init can only grow the root partition, and that doesn't work when the image is built with the root filesystem inside of an extended partition:</p> <pre><code>NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sr0 11:0 1 382K 0 rom xvda 202:0 0 60G 0 disk ├─xvda1 202:1 0 1.9G 0 part / ├─xvda2 202:2 0 1K 0 part └─xvda5 202:5 0 2.1G 0 part </code></pre> <p>My partman recipe currently looks like this:</p> <pre><code>d-i partman-auto/expert_recipe string \ all-root :: \ 1 1 1 free \ method{ biosgrub } \ . \ 750 1000 2000 ext4 \ $primary{ } $bootable{ } \ mountpoint{ / } \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext4 } \ . </code></pre> <p>I cannot for the life of me see a way of just ending up with xvda1 by itself - is there anything obscure in the docs I may have missed?</p>
6,613,807
0
<p>When you changed from classic pipeline to integrated pipeline, you essentially turned control over to .NET, meaning .NET will call up the ASP Parser. This adds the ability for custom HTTPModules coded in .NET Managed code that can change the output of the response or in the case of elmah, give you logging details.</p> <p>I would look at the log, see what user agent <a href="http://www.useragentstring.com/pages/Googlebot/" rel="nofollow">googlebot</a> is using at the time when the error occurrs and follow the exact same path it did with your user agent changed.</p> <p><a href="http://www.mozilla.com/en-US/firefox/new/" rel="nofollow">Mozilla Firefox</a> is the best browser for this with the <a href="https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/" rel="nofollow">User Agent Switcher</a> addon</p>
20,935,779
0
<p>Try this,</p> <pre><code> &lt;script&gt; $(document).ready(function() { $('#p-load').fadeIn(10000); }); &lt;/script&gt; </code></pre> <p>It provides duration of 10sec(10000 m.sec) </p> <p><a href="http://jsfiddle.net/4L2Aj/1/" rel="nofollow"><strong>FIDDLE</strong></a></p>
2,594,107
0
<p>Here is a great article on the subject <a href="http://www.codeproject.com/KB/ajax/autosuggestextender.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/ajax/autosuggestextender.aspx</a></p> <p>I've also written a follow-up article explaining how to call an asynchronous server side auto post back event on a user's selection: <a href="http://www.codeproject.com/KB/webforms/PostbackAutoCompleteExten.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/webforms/PostbackAutoCompleteExten.aspx</a></p>
25,983,520
0
<p>What you can use is the <a href="https://parse.com/docs/js_guide#queries-compound" rel="nofollow"><code>Parse.Query.or</code></a> function.</p> <pre><code>var currentUser = Parse.User.current(); var FriendRequest = Parse.Object.extend("FriendRequest"); var queryOne = new Parse.Query(FriendRequest); queryOne.equalTo("fromUser", currentUser); var queryTwo = new Parse.Query(FriendRequest); queryTwo.equalTo("toUser", currentUser); var mainQuery = Parse.Query.or(queryOne, queryTwo); mainQuery.equalTo("status", "Connected"); mainQuery.find({ /* ... */ }); </code></pre>
39,220,727
0
<p>Terraform supports a bunch of <a href="https://www.terraform.io/docs/providers/index.html" rel="nofollow">providers</a> but the vast majority of them are public cloud based.</p> <p>However, you could set up a local <a href="http://www.vmware.com/uk/products/vsphere.html" rel="nofollow">VMWare VSphere</a> cluster and use the VSphere provider to interact with that to get you going. There's also a provider for <a href="https://www.openstack.org/" rel="nofollow">OpenStack</a> if you want to set up an OpenStack cluster.</p> <p>Alternatively you could try using something like <a href="http://www8.hp.com/uk/en/cloud/helion-eucalyptus.html" rel="nofollow">HPE's Eucalyptus</a> which provides API compatibility with AWS but on premise.</p> <p>That said, unless you already have a datacenter running VMWare, all of those options are pretty awful and will take a lot of effort to get setup so you may be best waiting for your firewall to be opened up instead.</p> <p>There isn't unfortunately a nice frictionless first party implementation of a Virtualbox provider but you could try this <a href="https://github.com/ccll/terraform-provider-virtualbox" rel="nofollow">third party Virtualbox provider</a>.</p>
30,837,108
0
<p>Removed bottom:0; and position:absolute in footer</p> <pre><code>footer { bottom: 0; height: 60px; position: absolute; width: 100%; } </code></pre>
25,873,828
0
<p>You might find this formula helpful, it will check for a null value in either column</p> <p><code>{=IF(OR(A1:B1=""),"Null Value",IF(A1=B1,"Not Translated","Translated"))}</code></p> <p>Leave out the curly braces and enter the function using <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Enter</kbd></p> <p>You can drag that down for the following results</p> <p><code> a a Not Translated b c Translated d Null Value e Null Value Null Value f f Not Translated </code></p>
4,625,988
0
<p>I use David Strattons second solution (run as Administrator) because my application requires administrator privileges (-> elevated). Another solution could be to start the application as the user and use "Debug | Attach to process..."</p>
993,418
0
LogonUser works only for my domain <p>I need to impersonate a user using C#. I use the LogonUser Win32 API. This works fine when impersonating users from the same domain as the currently logged-in user. However I get "false" as response when I try to impersonate users from other domains.</p> <p>What can cause this?</p>
5,363,460
0
CUDA pointers to device constants <p>I have the following constant defined on the CUDA device:</p> <pre><code>__constant__ int deviceTempVariable = 1; </code></pre> <p>Now I tried getting the address of <code>deviceTempVariable</code> using two methods, and I'm getting different results. The first is a direct memory access from a CUDA kernel as follows:</p> <pre><code>__global__ void cudaPointers(pointerStruct* devicePointer) { devicePointer-&gt;itsPointer = &amp;deviceTempVariable; } </code></pre> <p>The other is through host code as follows:</p> <pre><code>cudaGetSymbolAddress((void**) &amp;pointerCuda, "deviceTempVariable"); </code></pre> <p>I was curious and checked the address values; the first gives something like <code>00000008</code>, and the second is <code>00110008</code>. The offset seems to be the same in all cases (the number 8), but the rest is different. What's going on here, and which address would I have to use?</p>
3,858,284
0
<p>Google uses the hash-trick. Notice that all the parameters are after</p> <pre><code>http://www.google.com/# </code></pre> <p><strong>Edit:</strong> If you entered the page with other parameters, the <code>#</code> may be further out in the link.</p>
490,919
0
<p>Locking is platform and device specific, but generally, you have a few options:</p> <ol> <li>use flock(), or equivilent (if your os supports it). This is advisory locking, unless you check for the lock, its ignored.</li> <li>Use a lock-copy-move-unlock methodology, where you copy the file, write the new data, then move it (move, not copy - move is an atomic operation in Linux -- check your OS), and you check for the existence of the lock file.</li> <li>Use a directory as a "lock". This is necessary if you're writing to NFS, since NFS doesn't support flock().</li> <li>There's also the possibility of using shared memory between the processes, but I've never tried that; its very os-specific.</li> </ol> <p>For all these methods, you'll have to use a spin-lock (retry-after-failure) technique for acquiring and testing the lock. This does leave a small window for mis-synchronization, but its generally small enough to not be an major issue.</p> <p>If you're looking for a solution that is cross platform, then you're better off logging to another system via some other mechanism (the next best thing is the NFS technique above). </p> <p>Note that sqlite is subject to the same constraints over NFS that normal files are, so you can't write to an sqlite database on a network share and get synchronization for free.</p>
3,149,993
0
<p>Check out <a href="http://php.net/basename" rel="nofollow noreferrer"><code>basename()</code></a>.</p>
38,217,401
0
Unit tests only fail when run by maven <p>I'm currently facing the problem that my unit tests are passing when run by eclipse but failing when run by maven.</p> <p>This is the repository (+ pom.xml): <a href="https://github.com/thorstenwagner/ij-trajectory-classifier" rel="nofollow">https://github.com/thorstenwagner/ij-trajectory-classifier</a></p> <p>Here is the build log: <a href="https://travis-ci.org/thorstenwagner/ij-trajectory-classifier" rel="nofollow">https://travis-ci.org/thorstenwagner/ij-trajectory-classifier</a></p> <p>This is the output of mvn -v:</p> <pre><code>Apache Maven 3.3.9 (NON-CANONICAL_2015-11-23T13:17:27+03:00_root; 2015-11- 23T11:17:27+01:00) Maven home: /opt/maven Java version: 1.8.0_92, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-8-openjdk/jre Default locale: de_DE, platform encoding: UTF-8 OS name: "linux", version: "4.6.3-1-arch", arch: "amd64", family: "unix" </code></pre> <p>I've tried to change my java version from 1.7 to 1.6 but this didn't help.</p> <p>I appreciate any suggestions</p> <p>Best, Thorsten</p>
3,547,104
0
log4j:ERROR with Tomcat 6 <p>I programmed a Web Application with Java EE. I am using log4j and Tomcat 6.0.28. When I am starting my app at tomcat following error message appears every 3 seconds at my console:</p> <pre><code>log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository. </code></pre> <p>Has somebody an idea what that means? Is there maybe a problem with log4j.xml? I can post more code/configfiles if nessecary. </p> <p>The application works, but I am a little bit worried. Thank you...</p>
6,039,605
1
TypeError: 'str' object is not callable (Python) <p><strong>Code:</strong></p> <pre><code>import urllib2 as u import os as o inn = 'dword.txt' w = open(inn) z = w.readline() b = w.readline() c = w.readline() x = w.readline() m = w.readline() def Dict(Let, Mod): global str inn = 'dword.txt' den = 'definitions.txt' print 'reading definitions...' dell =open(den, 'w') print 'getting source code...' f = u.urlopen('http://dictionary.reference.com/browse/' + Let) a = f.read(800) print 'writing source code to file...' f = open("dic1.txt", "w") f.write(a) f.close() j = open('defs.txt', 'w') print 'finding definition is source code' for line in open("dic1.txt"): if '&lt;meta name="description" content=' in line: j.write(line) j.close() te = open('defs.txt', 'r').read().split() sto = open('remove.txt', 'r').read().split() print 'skimming down the definition...' mar = [] for t in te: if t.lower() in sto: mar.append('') else: mar.append(t) print mar str = str(mar) str = ''.join([ c for c in str if c not in (",", "'", '[', ']', '')]) defin = open(den, Mod) defin.write(str) defin.write(' ') defin.close() print 'cleaning up...' o.system('del dic1.txt') o.system('del defs.txt') Dict(z, 'w') Dict(b, 'a') Dict(c, 'a') Dict(x, 'a') Dict(m, 'a') print 'all of the definitions are in definitions.txt' </code></pre> <p>The first <code>Dict(z, 'w')</code> works and then the second time around it comes up with an error:</p> <pre><code>Traceback (most recent call last): File "C:\Users\test.py", line 64, in &lt;module&gt; Dict(b, 'a') File "C:\Users\test.py", line 52, in Dict str = str(mar) TypeError: 'str' object is not callable </code></pre> <p>Does anyone know why this is?</p> <p>@Greg Hewgill: </p> <p>I've already tried that and I get the error:</p> <pre><code>Traceback (most recent call last): File "C:\Users\test.py", line 63, in &lt;module&gt; Dict(z, 'w') File "C:\Users\test.py", line 53, in Dict strr = ''.join([ c for c in str if c not in (",", "'", '[', ']', '')]) TypeError: 'type' object is not iterable </code></pre>
816,157
0
<p>I've never tried a thumb drive, but I use external USB drives for virtual machines all the time. I use VirtualPC 2007 and have had no problems. In fact, sometimes if the host machine is on the weaker side, having the VM on an external drive increases performance. I recommend the external USB drive route.</p>
7,225,487
0
CSS 100% - 300px? <p>So far I have </p> <pre><code>&lt;div id="wrapper"&gt; &lt;div id="shoutbox"&gt; shoutbox &lt;/div&gt; &lt;div id="groups"&gt; testgroups &lt;/div&gt; &lt;div id="users"&gt; testusers &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I want it to take up the entire screen. The users and groups div will always be 150px, and I want the shoutbox to take up the rest. I know this is probably very simple, but I don't know what I would search for to find it.</p>
8,828,045
0
<p>You need to fire the event on the form element itself, not on a jQuery selection. (In fact, you weren't even selecting the form element – inside <code>setTimeout</code>, <code>this</code> is the global object.)</p> <p>Cache a reference to the form (<code>this</code>) and call its <code>submit</code> method:</p> <pre><code>$('form').submit( function(event) { var formId = this.id, form = this; mySpecialFunction(formId); event.preventDefault(); setTimeout( function () { form.submit(); }, 300); }); </code></pre> <p>Note that I have also replaced your inefficient <code>$(this).attr('id')</code> call with <code>this.id</code>. Note also that you have to call the DOM form element's submit method, not the jQuery method, so that the jQuery event handler is not triggered, which would cause an infinite (and totally ineffectual) loop.</p>
2,811,443
0
<p>I would suggest that you don't add your functionality on top of the selected property of the cell, which has slightly different behaviour than you expect.</p> <p>Just add your own <code>BOOL expanded</code> property, and see how that works. You should probably call it from the <code>UITableView delegate</code> methods, too.</p>
2,751,416
0
<p>That's perfectly correct. But it depends on what you want, perhaps you mean <code>&amp;&amp;</code> instead of <code>||</code></p>
19,397,738
0
<p><code>maven</code> is a tool for build processes. You really don't have to use it.</p> <ol> <li>What you need is to write tests with a testing framework, for exapmle <code>junit</code></li> <li>The dependencies you need (<code>spring</code>, <code>junit</code>) must be in your classpath. If you're not using <code>maven</code> then any other way you prefer.</li> <li>You can use <a href="http://stackoverflow.com/questions/2235276/how-to-run-junit-test-cases-from-the-command-line">this question</a> to run tests from command line if that's what you need.</li> </ol> <p>To make it clear in other words - <code>maven</code> provides you with a build cycle that downloads your dependencies and put them in your classpath. This is something that you can do manually (configure your classpath and put needed jars in the classpath). The second thing <code>maven</code> gives you is the <code>test</code> life-cycle. But you don't have to use it and you can run unit-tests from command line according to the link I put in bullet 3 or running through the IDE. Most of <code>eclipse</code> and <code>Intellij</code> versions come with built-in support for running tests.</p>
21,924,669
0
<p>If you know jQuery, you can use:</p> <pre><code>$('input[type=radio]').click(function() { var $this = $(this); $('.square').css('background', $(this).next().text()); }) </code></pre> <p><strong><a href="http://jsfiddle.net/m8fxw/3/" rel="nofollow">Updated Fiddle</a></strong></p>
2,114,596
0
<p>No, I don't know of any. Because NHibernate is popular and very good at what it does, and EF is likely to pick up most of the remainder (particularly devs that don't want to stray from Microsoft-supplied frameworks), the barrier to entry for a new player is very high. Another ORM would need to add something significant over and above what NHibernate currently offers in order to get any reasonable level of interest. </p> <p>If there was an open source project that wanted to deliver better Linq support in an ORM, in my opinion it would have greater success contributing to NHibernate Linq rather than attempting to build its own framework from scratch.</p>
29,337,099
0
UPDATE _field1 = _feild2 for every row <p>Is there a way to update a Table, and move the data from one row to another? For example, could I use the following syntax?</p> <pre><code>UPDATE _tablename SET _field1 = _field2; </code></pre> <p>Normally <code>UPDATE</code> queries require a <code>WHERE</code> parameter don't they?</p>
40,626,971
0
<p>Technically yes, you can consume API given by private operators like Pay2All or directly by Yes Bank</p> <p>Links : <a href="http://www.pay2all.in/money-transfer-api" rel="nofollow noreferrer">http://www.pay2all.in/money-transfer-api</a></p> <p><a href="https://www.yesbank.in/corporate-banking/product-and-services/digital-banking/api-banking" rel="nofollow noreferrer">https://www.yesbank.in/corporate-banking/product-and-services/digital-banking/api-banking</a></p>
3,169,296
0
DBus: Performance improvement practices <p><strong>What are some good practices to obtain better time performance in applications that heavily utilize <a href="http://en.wikipedia.org/wiki/D-Bus" rel="nofollow noreferrer">DBus</a>?</strong></p> <p>Here are a few that our team has learned through the school of hard knocks:</p> <ul> <li>Try to combine data entities together into a single, large structure/object to send over DBus IPC.</li> <li>Try to have all DBus traffic come into a single proxy at a single point in your application/process, rather than having them spread throughout your application/process.</li> </ul>
26,553,004
0
CentOS Apache2 -- All files forbidden <p>This might be a bad place to post this, and I know <i>sooooo</i> many people have asked about it, but I've looked a lot of different places and I just can't figure it out. Please look at my below <code>httpd.conf</code> file and tell me what's wrong:</p> <pre><code>ServerRoot "/etc/httpd" PidFile run/httpd.pid Timeout 60 KeepAlive Off MaxKeepAliveRequests 1000 KeepAliveTimeout 15 &lt;IfModule prefork.c&gt; StartServers 8 MinSpareServers 5 MaxSpareServers 20 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 4000 &lt;/IfModule&gt; &lt;IfModule worker.c&gt; StartServers 4 MaxClients 300 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 &lt;/IfModule&gt; Listen 80 LoadModule auth_basic_module modules/mod_auth_basic.so LoadModule auth_digest_module modules/mod_auth_digest.so LoadModule authn_file_module modules/mod_authn_file.so LoadModule authn_alias_module modules/mod_authn_alias.so LoadModule authn_anon_module modules/mod_authn_anon.so LoadModule authn_dbm_module modules/mod_authn_dbm.so LoadModule authn_default_module modules/mod_authn_default.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule authz_owner_module modules/mod_authz_owner.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_dbm_module modules/mod_authz_dbm.so LoadModule authz_default_module modules/mod_authz_default.so LoadModule ldap_module modules/mod_ldap.so LoadModule authnz_ldap_module modules/mod_authnz_ldap.so LoadModule include_module modules/mod_include.so LoadModule log_config_module modules/mod_log_config.so LoadModule logio_module modules/mod_logio.so LoadModule env_module modules/mod_env.so LoadModule ext_filter_module modules/mod_ext_filter.so LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule expires_module modules/mod_expires.so LoadModule deflate_module modules/mod_deflate.so LoadModule headers_module modules/mod_headers.so LoadModule usertrack_module modules/mod_usertrack.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule mime_module modules/mod_mime.so LoadModule dav_module modules/mod_dav.so LoadModule status_module modules/mod_status.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule info_module modules/mod_info.so LoadModule dav_fs_module modules/mod_dav_fs.so LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule dir_module modules/mod_dir.so LoadModule actions_module modules/mod_actions.so LoadModule speling_module modules/mod_speling.so LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule substitute_module modules/mod_substitute.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule cache_module modules/mod_cache.so LoadModule suexec_module modules/mod_suexec.so LoadModule disk_cache_module modules/mod_disk_cache.so LoadModule cgi_module modules/mod_cgi.so LoadModule version_module modules/mod_version.so Include conf.d/*.conf # # ExtendedStatus controls whether Apache will generate "full" status # information (ExtendedStatus On) or just basic information (ExtendedStatus # Off) when the "server-status" handler is called. The default is Off. # #ExtendedStatus On # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # . On SCO (ODT 3) use "User nouser" and "Group nogroup". # . On HPUX you may not be able to use shared memory as nobody, and the # suggested workaround is to create a user www and use that user. # NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET) # when the value of (unsigned)Group is above 60000; # don't use Group #-1 on these systems! # User apache Group apache ### Section 2: 'Main' server configuration # # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # &lt;VirtualHost&gt; definition. These values also provide defaults for # any &lt;VirtualHost&gt; containers you may define later in the file. # # All of these directives may appear inside &lt;VirtualHost&gt; containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # ServerAdmin: Your address, where problems with the server should be # e-mailed. This address appears on some server-generated pages, such # as error documents. e.g. [email protected] # ServerAdmin root@localhost UseCanonicalName Off # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "/var/www/html" # # Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories). # # First, we configure the "default" to be a very restrictive set of # features. # &lt;Directory /&gt; Options FollowSymLinks AllowOverride None &lt;/Directory&gt; # # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # This should be changed to whatever you set DocumentRoot to. # &lt;Directory "/var/www/html"&gt; # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None # # Controls who can get stuff from this server. # Order allow,deny Allow from all &lt;/Directory&gt; # # UserDir: The name of the directory that is appended onto a user's home # directory if a ~user request is received. # # The path to the end user account 'public_html' directory must be # accessible to the webserver userid. This usually means that ~userid # must have permissions of 711, ~userid/public_html must have permissions # of 755, and documents contained therein must be world-readable. # Otherwise, the client will only receive a "403 Forbidden" message. # # See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden # &lt;IfModule mod_userdir.c&gt; # # UserDir is disabled by default since it can confirm the presence # of a username on the system (depending on home directory # permissions). # UserDir disabled # # To enable requests to /~user/ to serve the user's public_html # directory, remove the "UserDir disabled" line above, and uncomment # the following line instead: # #UserDir public_html &lt;/IfModule&gt; # # Control access to UserDir directories. The following is an example # for a site where these directories are restricted to read-only. # #&lt;Directory /home/*/public_html&gt; # AllowOverride FileInfo AuthConfig Limit # Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec # &lt;Limit GET POST OPTIONS&gt; # Order allow,deny # Allow from all # &lt;/Limit&gt; # &lt;LimitExcept GET POST OPTIONS&gt; # Order deny,allow # Deny from all # &lt;/LimitExcept&gt; #&lt;/Directory&gt; # # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # # The index.html.var file (a type-map) is used to deliver content- # negotiated documents. The MultiViews Option can be used for the # same purpose, but it is much slower. # DirectoryIndex index.php # # AccessFileName: The name of the file to look for in each directory # for additional configuration directives. See also the AllowOverride # directive. # AccessFileName .htaccess # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # &lt;Files ~ "^\.ht"&gt; Order allow,deny Deny from all Satisfy All &lt;/Files&gt; # # TypesConfig describes where the mime.types file (or equivalent) is # to be found. # TypesConfig /etc/mime.types # # DefaultType is the default MIME type the server will use for a document # if it cannot otherwise determine one, such as from filename extensions. # If your server contains mostly text or HTML documents, "text/plain" is # a good value. If most of your content is binary, such as applications # or images, you may want to use "application/octet-stream" instead to # keep browsers from trying to display binary files as though they are # text. # DefaultType text/plain # # The mod_mime_magic module allows the server to use various hints from the # contents of the file itself to determine its type. The MIMEMagicFile # directive tells the module where the hint definitions are located. # &lt;IfModule mod_mime_magic.c&gt; # MIMEMagicFile /usr/share/magic.mime MIMEMagicFile conf/magic &lt;/IfModule&gt; # # HostnameLookups: Log the names of clients or just their IP addresses # e.g., www.apache.org (on) or 204.62.129.132 (off). # The default is off because it'd be overall better for the net if people # had to knowingly turn this feature on, since enabling it means that # each client request will result in AT LEAST one lookup request to the # nameserver. # HostnameLookups Off # # EnableMMAP: Control whether memory-mapping is used to deliver # files (assuming that the underlying OS supports it). # The default is on; turn this off if you serve from NFS-mounted # filesystems. On some systems, turning it off (regardless of # filesystem) can improve performance; for details, please see # http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap # #EnableMMAP off # # EnableSendfile: Control whether the sendfile kernel support is # used to deliver files (assuming that the OS supports it). # The default is on; turn this off if you serve from NFS-mounted # filesystems. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile # #EnableSendfile off # # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a &lt;VirtualHost&gt; # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a &lt;VirtualHost&gt; # container, that host's errors will be logged there and not here. # ErrorLog logs/error_log # # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # LogLevel warn # # The following directives define some format nicknames for use with # a CustomLog directive (see below). # LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common LogFormat "%{Referer}i -&gt; %U" referer LogFormat "%{User-agent}i" agent # "combinedio" includes actual counts of actual bytes received (%I) and sent (%O); this # requires the mod_logio module to be loaded. #LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio # # The location and format of the access logfile (Common Logfile Format). # If you do not define any access logfiles within a &lt;VirtualHost&gt; # container, they will be logged here. Contrariwise, if you *do* # define per-&lt;VirtualHost&gt; access logfiles, transactions will be # logged therein and *not* in this file. # #CustomLog logs/access_log common # # If you would like to have separate agent and referer logfiles, uncomment # the following directives. # #CustomLog logs/referer_log referer #CustomLog logs/agent_log agent # # For a single logfile with access, agent, and referer information # (Combined Logfile Format), use the following directive: # CustomLog logs/access_log combined # # Optionally add a line containing the server version and virtual host # name to server-generated pages (internal error documents, FTP directory # listings, mod_status and mod_info output etc., but not CGI generated # documents or custom error documents). # Set to "EMail" to also include a mailto: link to the ServerAdmin. # Set to one of: On | Off | EMail # ServerSignature Off # # Aliases: Add here as many aliases as you need (with no limit). The format is # Alias fakename realname # # Note that if you include a trailing / on fakename then the server will # require it to be present in the URL. So "/icons" isn't aliased in this # example, only "/icons/". If the fakename is slash-terminated, then the # realname must also be slash terminated, and if the fakename omits the # trailing slash, the realname must also omit it. # # We include the /icons/ alias for FancyIndexed directory listings. If you # do not use FancyIndexing, you may comment this out. # Alias /icons/ "/var/www/icons/" &lt;Directory "/var/www/icons"&gt; Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted &lt;/Directory&gt; # # WebDAV module configuration section. # &lt;IfModule mod_dav_fs.c&gt; # Location of the WebDAV lock database. DAVLockDB /var/lib/dav/lockdb &lt;/IfModule&gt; # # ScriptAlias: This controls which directories contain server scripts. # ScriptAliases are essentially the same as Aliases, except that # documents in the realname directory are treated as applications and # run by the server when requested rather than as documents sent to the client. # The same rules about trailing "/" apply to ScriptAlias directives as to # Alias. # ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" # # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # &lt;Directory "/var/www/cgi-bin"&gt; AllowOverride None Options None Order allow,deny Allow from all &lt;/Directory&gt; # # Redirect allows you to tell clients about documents which used to exist in # your server's namespace, but do not anymore. This allows you to tell the # clients where to look for the relocated document. # Example: # Redirect permanent /foo http://www.example.com/bar # # Directives controlling the display of server-generated directory listings. # # # IndexOptions: Controls the appearance of server-generated directory # listings. # IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8 # # AddIcon* directives tell the server which icon to show for different # files or filename extensions. These are only displayed for # FancyIndexed directories. # AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType (TXT,/icons/text.gif) text/* AddIconByType (IMG,/icons/image2.gif) image/* AddIconByType (SND,/icons/sound2.gif) audio/* AddIconByType (VID,/icons/movie.gif) video/* AddIcon /icons/binary.gif .bin .exe AddIcon /icons/binhex.gif .hqx AddIcon /icons/tar.gif .tar AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip AddIcon /icons/a.gif .ps .ai .eps AddIcon /icons/layout.gif .html .shtml .htm .pdf AddIcon /icons/text.gif .txt AddIcon /icons/c.gif .c AddIcon /icons/p.gif .pl .py AddIcon /icons/f.gif .for AddIcon /icons/dvi.gif .dvi AddIcon /icons/uuencoded.gif .uu AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl AddIcon /icons/tex.gif .tex AddIcon /icons/bomb.gif core AddIcon /icons/back.gif .. AddIcon /icons/hand.right.gif README AddIcon /icons/folder.gif ^^DIRECTORY^^ AddIcon /icons/blank.gif ^^BLANKICON^^ # # DefaultIcon is which icon to show for files which do not have an icon # explicitly set. # DefaultIcon /icons/unknown.gif # # AddDescription allows you to place a short description after a file in # server-generated indexes. These are only displayed for FancyIndexed # directories. # Format: AddDescription "description" filename # #AddDescription "GZIP compressed document" .gz #AddDescription "tar archive" .tar #AddDescription "GZIP compressed tar archive" .tgz # # ReadmeName is the name of the README file the server will look for by # default, and append to directory listings. # # HeaderName is the name of a file which should be prepended to # directory indexes. ReadmeName README.html HeaderName HEADER.html # # IndexIgnore is a set of filenames which directory indexing should ignore # and not include in the listing. Shell-style wildcarding is permitted. # IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t # # DefaultLanguage and AddLanguage allows you to specify the language of # a document. You can then use content negotiation to give a browser a # file in a language the user can understand. # # Specify a default language. This means that all data # going out without a specific language tag (see below) will # be marked with this one. You probably do NOT want to set # this unless you are sure it is correct for all cases. # # * It is generally better to not mark a page as # * being a certain language than marking it with the wrong # * language! # # DefaultLanguage nl # # Note 1: The suffix does not have to be the same as the language # keyword --- those with documents in Polish (whose net-standard # language code is pl) may wish to use "AddLanguage pl .po" to # avoid the ambiguity with the common suffix for perl scripts. # # Note 2: The example entries below illustrate that in some cases # the two character 'Language' abbreviation is not identical to # the two character 'Country' code for its country, # E.g. 'Danmark/dk' versus 'Danish/da'. # # Note 3: In the case of 'ltz' we violate the RFC by using a three char # specifier. There is 'work in progress' to fix this and get # the reference data for rfc1766 cleaned up. # # Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl) # English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de) # Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja) # Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn) # Norwegian (no) - Polish (pl) - Portugese (pt) # Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv) # Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW) # AddLanguage ca .ca AddLanguage cs .cz .cs AddLanguage da .dk AddLanguage de .de AddLanguage el .el AddLanguage en .en AddLanguage eo .eo AddLanguage es .es AddLanguage et .et AddLanguage fr .fr AddLanguage he .he AddLanguage hr .hr AddLanguage it .it AddLanguage ja .ja AddLanguage ko .ko AddLanguage ltz .ltz AddLanguage nl .nl AddLanguage nn .nn AddLanguage no .no AddLanguage pl .po AddLanguage pt .pt AddLanguage pt-BR .pt-br AddLanguage ru .ru AddLanguage sv .sv AddLanguage zh-CN .zh-cn AddLanguage zh-TW .zh-tw # # LanguagePriority allows you to give precedence to some languages # in case of a tie during content negotiation. # # Just list the languages in decreasing order of preference. We have # more or less alphabetized them here. You probably want to change this. # LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW # # ForceLanguagePriority allows you to serve a result page rather than # MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback) # [in case no accepted languages matched the available variants] # ForceLanguagePriority Prefer Fallback # # Specify a default charset for all content served; this enables # interpretation of all content as UTF-8 by default. To use the # default browser choice (ISO-8859-1), or to allow the META tags # in HTML content to override this choice, comment out this # directive: # AddDefaultCharset UTF-8 # # AddType allows you to add to or override the MIME configuration # file mime.types for specific file types. # #AddType application/x-tar .tgz # # AddEncoding allows you to have certain browsers uncompress # information on the fly. Note: Not all browsers support this. # Despite the name similarity, the following Add* directives have nothing # to do with the FancyIndexing customization directives above. # #AddEncoding x-compress .Z #AddEncoding x-gzip .gz .tgz # If the AddEncoding directives above are commented-out, then you # probably should define those extensions to indicate media types: # AddType application/x-compress .Z AddType application/x-gzip .gz .tgz # # MIME-types for downloading Certificates and CRLs # AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl .crl # # AddHandler allows you to map certain file extensions to "handlers": # actions unrelated to filetype. These can be either built into the server # or added with the Action directive (see below) # # To use CGI scripts outside of ScriptAliased directories: # (You will also need to add "ExecCGI" to the "Options" directive.) # #AddHandler cgi-script .cgi # # For files that include their own HTTP headers: # #AddHandler send-as-is asis # # For type maps (negotiated resources): # (This is enabled by default to allow the Apache "It Worked" page # to be distributed in multiple languages.) # AddHandler type-map var # # Filters allow you to process content before it is sent to the client. # # To parse .shtml files for server-side includes (SSI): # (You will also need to add "Includes" to the "Options" directive.) # AddType text/html .shtml AddOutputFilter INCLUDES .shtml # # Action lets you define media types that will execute a script whenever # a matching file is called. This eliminates the need for repeated URL # pathnames for oft-used CGI file processors. # Format: Action media/type /cgi-script/location # Format: Action handler-name /cgi-script/location # # # Customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects # # Some examples: #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" #ErrorDocument 402 http://www.example.com/subscription_info.html # # # Putting this all together, we can internationalize error responses. # # We use Alias to redirect any /error/HTTP_&lt;error&gt;.html.var response to # our collection of by-error message multi-language collections. We use # includes to substitute the appropriate text. # # You can modify the messages' appearance without changing any of the # default HTTP_&lt;error&gt;.html.var files by adding the line: # # Alias /error/include/ "/your/include/path/" # # which allows you to create your own set of files by starting with the # /var/www/error/include/ files and # copying them to /your/include/path/, even on a per-VirtualHost basis. # Alias /error/ "/var/www/error/" &lt;IfModule mod_negotiation.c&gt; &lt;IfModule mod_include.c&gt; &lt;Directory "/var/www/error"&gt; AllowOverride None Options IncludesNoExec AddOutputFilter Includes html AddHandler type-map var Order allow,deny Allow from all LanguagePriority en es de fr ForceLanguagePriority Prefer Fallback &lt;/Directory&gt; # ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var # ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var # ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var # ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var # ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var # ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var # ErrorDocument 410 /error/HTTP_GONE.html.var # ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var # ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var # ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var # ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var # ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var # ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var # ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var # ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var # ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var # ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var &lt;/IfModule&gt; &lt;/IfModule&gt; # # The following directives modify normal HTTP response behavior to # handle known problems with browser implementations. # BrowserMatch "Mozilla/2" nokeepalive BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 BrowserMatch "RealPlayer 4\.0" force-response-1.0 BrowserMatch "Java/1\.0" force-response-1.0 BrowserMatch "JDK/1\.0" force-response-1.0 # # The following directive disables redirects on non-GET requests for # a directory that does not include the trailing slash. This fixes a # problem with Microsoft WebFolders which does not appropriately handle # redirects for folders with DAV methods. # Same deal with Apple's DAV filesystem and Gnome VFS support for DAV. # BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully BrowserMatch "MS FrontPage" redirect-carefully BrowserMatch "^WebDrive" redirect-carefully BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully BrowserMatch "^gnome-vfs/1.0" redirect-carefully BrowserMatch "^XML Spy" redirect-carefully BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully </code></pre> <p>My index.php is in <code>/var/www/html/</code> and it just gives me "forbidden".</p>
34,659,567
0
<p>You have to enable the "USB Debugging Mode" after enabling "Developer Options</p> <p>Check this post for more details :: <a href="http://stackoverflow.com/questions/18103117/how-to-enable-usb-debugging-in-android">Enabling USB Debugging Mode</a></p>
13,126,961
0
<p>Alright, I found out that the problem was in another function that was still expecting the dictionary to be a list. The reason I couldn't see it right away is that Django left a very cryptic error message. I was able to get a better one using <code>python manage.py shell</code> and importing the module manually.</p> <p>Thanks for your help everyone.</p>
13,700,284
0
How do I implement circular constraints in PostgreSQL? <p>I want to enforce that a row in one table must have a matching row in another table, and vice versa. I'm currently doing it like this to work around the fact that you can't REFERENCE a table that hasn't been created yet. Is there a more natural way that I'm not aware of?</p> <pre><code>CREATE TABLE LE (id int PRIMARY KEY); CREATE TABLE LE_TYP (id int PRIMARY KEY, typ text); ALTER TABLE LE ADD CONSTRAINT twowayref FOREIGN KEY (id) REFERENCES LE_TYP (id) DEFERRABLE INITIALLY DEFERRED; ALTER TABLE LE_TYP ADD CONSTRAINT twowayref_rev FOREIGN KEY (id) REFERENCES LE (id) DEFERRABLE INITIALLY DEFERRED; </code></pre>
19,199,631
0
<p>It looks like your jQuery is referencing files of a different casing than what is on the server.</p> <p>For example, your jQuery reads:</p> <pre><code>$(this).attr("src","images/abouthover.jpg"); </code></pre> <p>However, the file on the site is listed as images/abouthover.JPG</p> <p>If you alter your jQuery to:</p> <pre><code>$(this).attr("src","images/abouthover.JPG"); </code></pre> <p>Or change your file name for the file to images/abouthover.jpg</p> <p>Your code should work.</p> <p>My guess as to why it works on your computer but not on your hosted site is that your personal computer is a windows machine which is not case specific whereas your hosting server is a Unix machine which IS case specific.</p> <p>I hope this sorts out your issue.</p>
4,272,965
0
<p>Try following the manual, it's working great for me:<br> <a href="http://book.cakephp.org/view/1110/Running-Shells-as-cronjobs" rel="nofollow">http://book.cakephp.org/view/1110/Running-Shells-as-cronjobs</a></p>
38,985,318
0
HTTP Load Balancer ClientIP affinity not working <p>I can't seem to get the session affinity behavior in the GCP load balancer to work properly. My test has been as follows:</p> <ul> <li>I have a Container Engine cluster with 2 node pools (different zones) with 2 nodes each.</li> <li>I have a deployment which is set to replica: 8, and it's (almost) evenly spread between the 4 nodes.</li> <li><p>I have a service exposed as follows (ips redacted)</p> <pre><code>Name: svc-foo Namespace: default Labels: app=foo Selector: app=foo Type: NodePort IP: .... Port: &lt;unset&gt; 8080/TCP NodePort: &lt;unset&gt; 31015/TCP Endpoints: ...:8080,...:8080,...:8080 + 5 more... Session Affinity: ClientIP No events. </code></pre></li> <li>I have a load balancer with a backend service that has 2 backends pointed at port 31015. It has a healthcheck which passes and a route to get to that backend service.</li> <li>Finally, I have the Session affinity set to ClientIP on that backend service as well.</li> </ul> <p>After curling a route and checking the logs in stackdriver, I see <code>container.googleapis.com/pod_name:</code> in the metadata of the logs with a bunch of different pod names. In the Kubernetes ui, I also see that all the pods have a little cpu spike, indicating I'm alternating and hitting each one. A weird part is that in GCP, when I look at the monitoring of the backend service, the graph shows me requests per second only to one of the pools (even though the logs and cpu graphs from k8s show the other pool being hit as well).</p>
2,068,088
0
C++ method only visible when object cast to base class? <p>It must be something specific in my code, which I can't post. But maybe someone can suggest possible causes.</p> <p>Basically I have:</p> <pre><code>class CParent { public: void doIt(int x); }; class CChild : public CParent { public: void doIt(int x,int y,int z); }; CChild *pChild = ... pChild-&gt;doIt(123); //FAILS compiler, no method found CParent *pParent = pChild; pParent-&gt;doIt(123); //works fine </code></pre> <p>How on earth?</p> <p>EDIT: people are talking about shadowing/hiding. But the two versions of doIt have different numbers of parameters. Surely that can't confuse the compiler, overloads in child class which can't possibly be confused with the parent class version? Can it?</p> <p>The compiler error I get is: <strong>error C2660: 'CChild::doIt' : function does not take 1 argument</strong></p>
27,794,841
0
<p>try like this</p> <pre><code>CREATE OR REPLACE FUNCTION truncate_schema(_schema character varying) RETURNS void AS $BODY$ declare selectrow record; begin for selectrow in select 'TRUNCATE TABLE ' || quote_ident(_schema) || '.' ||quote_ident(t.table_name) || ' CASCADE;' as qry from ( SELECT table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE' AND table_schema = _schema )t loop execute selectrow.qry; end loop; end; $BODY$ LANGUAGE plpgsql </code></pre>
22,467,631
0
<p>as far as I know, you shouldnt create two body tags. Instead in a body you can add two tags, and and put your contents inside divs. If you want to round the border of divs, you should use some css code.</p> <pre><code> &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;style&gt; #up { border:2px solid #a1a1a1; padding:10px 40px; background:#dddddd; width:90%; margin:5px; border-bottom-left-radius:2em; border-bottom-right-radius:2em; } #down { border:2px solid #a1a1a1; padding:10px 40px; margin:5px; background:#dddddd; width:90%; border-top-left-radius:2em; border-top-right-radius:2em; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id='up'&gt; MAIN PART 1 The border-radius property allows you to add rounded corners to elements. &lt;/div&gt; &lt;div id='down'&gt; MAIN PART 2 The border-radius property allows you to add rounded corners to elements. &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
24,720,362
0
Splash Screen and Mdi Application c# vs 2010 <p>I have never had the need to create a splash screen and wondered what is the best way to do it.</p> <p>I have an mdi application that when the MDIParent loads it makes few database calls and displays.</p> <p>What I would like to do is </p> <ol> <li>Launch a SplashScreen </li> <li>Mdi Loads in the background and NOT VISIBLE</li> <li>When finish loading splash screen dissapears.</li> </ol> <p>I have done as follows but the problem i have is that the mdi still does the work when the splashscreen dissappears.I want the mdi to be fully loaded once the splash screen is gone.</p> <pre><code> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var splashForm = new SplashFormView(); splashForm.IntervalTime = 5000; --prop to decide how long the splashScreen should display splashForm.ShowDialog(); SetupUnityContainer(); } private static void SetupUnityContainer() { using (IUnityContainer container = new UnityContainer()) { container.RegisterType&lt;IMyService2, MyService2&gt;(); Application.Run(container.Resolve&lt;MdiParent&gt;()); } } </code></pre> <p>Should run the splashscreen on a background thread? How can I make the MDIForm to be called and not visible till all loaded?</p> <p>Many thanks</p>
16,655,852
0
<p>You may be having the same issue as is mentioned here: <a href="http://stackoverflow.com/questions/9471448/android-market-this-item-is-not-compatible-with-your-device/16655736#16655736">Android Market: &quot;This item is not compatible with your device.&quot;</a></p> <p>In a nutshell, for 10 inch tablets, like the Samsung Galaxy Tab, you also have to set <code>xlargeScreens</code> to true.</p> <p>It does appear, as was just mentioned in this discussion by Key, that Google Play recently implemented stricter filtering rules, and this <code>xlargeScreens</code> may be just one example.</p>
12,184,049
0
AsyncTask already started onCreate <p>When I try to execute an AsyncTask from a button click, my app says the task is already started. I don't execute the task anywhere in onCreate or onResume or anything like that. Can a task be started when my activity is created without me executing it programatically? </p> <pre><code> // Login button Button loginButton = (Button) findViewById(R.id.loginBtn); loginButton.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { loginTask.execute(""); } }); // Background login thread private AsyncTask&lt;Object, String, String&gt; loginTask = new AsyncTask&lt;Object, String, String&gt;(){ @Override protected String doInBackground(Object... arg0) { Log.v(TAG, "Login task started"); LoginManager lm = new LoginManager(); String username = emailText.getText().toString(); String password = passwordText.getText().toString(); loginBundle = new Bundle(); loginBundle.putString(Constants.LOGIN_HANDLER_ID, lm.login(username, password)); loginMessage = Message.obtain(null, 0); loginMessage.setData(loginBundle); loginHandler.sendMessage(loginMessage); return ""; } }; </code></pre> <p>This is the only place I call execute, and it's a button that I'm creating in the onCreate() method. When the task is executed, I get a task already started error.</p> <p>I thought maybe I'm not cancelling the thread correctly, and so I rebooted my Motrola Xoom. I ran the app once the Xoom was started, and I still got this error. What can I do? The app is using Android SDK 8... and I'm running on a Motorola Xoom.</p>
12,351,210
0
<p>Use event <a href="https://developer.mozilla.org/en-US/docs/DOM/window.onbeforeunload" rel="nofollow noreferrer">window.onbeforeunload</a>, which fires when the page is unloaded and return string <em>"You have pending unsaved changes. Do you really want to discard them?"</em></p> <p>Browser shows native dialog:</p> <p><img src="https://i.stack.imgur.com/kVQiv.png" alt="enter image description here"></p> <p>This is AFAIK the only way to stop navigation.</p> <p>jsFiddle: <a href="http://jsfiddle.net/phusick/R6EJ3/show/light/" rel="nofollow noreferrer">http://jsfiddle.net/phusick/R6EJ3/show/light/</a></p>
22,855,351
0
Tasktracker logs <p>when i try to view logs of tasktracker i am facing below error...</p> <p>can any one pls help me out:</p> <blockquote> <p>Network Error (dns_unresolved_hostname) </p> <p>Your requested host "d04-7d-7b-a5-e9-2e.hdfs.target.com" could not be resolved by DNS. </p> <p>For assistance, contact your network support team.</p> <p>Your request was categorized by Blue Coat Web Filter as 'Shopping'. If you wish to question or dispute this result, please click here.</p> </blockquote>
24,149,039
0
<p>Give your <code>textarea</code> an id, then access it by its id.</p> <pre><code>&lt;textarea id="text1"&gt;&lt;/textarea&gt; .... WebBrowser1.Document.All("text1").innerText = "New text" </code></pre>
30,077,324
0
<p>Assuming your Job can only have one worker that is set when a Proposal is accepted, you'd want something like this:</p> <pre><code>class Job &lt; ActiveRecord::Base belongs_to :poster, class_name: 'User', foreign_key: 'poster_id' belongs_to :worker, class_name: 'User', foreign_key: 'worker_id' has_many :proposals, dependent: :destroy end class User &lt; ActiveRecord::Base has_many :posted_jobs, class_name: 'Job', foreign_key: 'poster_id', dependent: :destroy has_many :current_jobs, class_name: 'Job', foreign_key: 'worker_id' has_many :proposals, through: :jobs end class Proposal &lt; ActiveRecord::Base belongs_to :job belongs_to :user end </code></pre> <p>With this approach, you can get user.posted_jobs and user.current_jobs.</p> <p>See this: <a href="http://stackoverflow.com/questions/5294775/same-model-for-two-belongs-to-associations">Same Model for Two belongs_to Associations</a></p>
5,012,358
0
<p>Why do you need to block the button? If it's some kind of evil plot to make developers only use the device for developing, the home button IS important: you must test what happens when the real user do that.</p>
36,109,267
0
<p>You're not assigning the event handlers to the <code>BackgroundWorker</code> events:</p> <pre><code> static void Main(string[] args) { worker = new BackgroundWorker(); worker.DoWork += Worker_DoWork; //here worker.ProgressChanged += Worker_ProgressChanged; //and here worker.WorkerReportsProgress = true; worker.RunWorkerAsync(); Console.ReadLine(); } </code></pre> <p>Cheers</p>
33,845,067
0
Android navigation drawer max number of items <p>What is the max limit for number of items for android navigation drawer?</p>
5,356,255
0
<p>Just did an iPhone project hitting a REST service. To consume, try <a href="http://allseeing-i.com/ASIHTTPRequest/" rel="nofollow">asihttprequest</a>. Very good and used by many other apps.</p> <p>How to use it (<a href="http://allseeing-i.com/ASIHTTPRequest/How-to-use" rel="nofollow">examples</a>)</p>
27,215,030
0
<pre><code>create table test(year1 int,quarter1 int,sales int) insert into test select 2011 ,1 ,10 UNION ALL select 2011 ,2 ,5 UNION ALL select 2011 ,5 ,30 UNION ALL select 2012 ,4 ,30 UNION ALL select 2012 ,5 ,2 </code></pre> <p>Try this:</p> <pre><code> SELECT a.year1 , a.quarter1 , SUM(b.sales) AS total FROM test a INNER JOIN test b ON a.quarter1 &gt;= b.quarter1 AND a.year1 = b.year1 GROUP BY a.year1 , a.quarter1 ORDER BY a.year1 </code></pre> <p><strong>OUTPUT</strong></p> <pre><code>2011 1 10 2011 2 15 2011 5 45 2012 4 30 2012 5 32 </code></pre>
35,982,731
0
Qt is there somthing better then QMAKE_POST_LINK for post build actions? <p>In my pro file I do somthing like:</p> <pre><code>QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$PWD/*.xml) $$quote($$OUT_PWD) $$escape_expand(\\n\\t) </code></pre> <p>To copy files into the target area ready for deployment. This could be a default config file or some other resource.</p> <p>When I build the code this works fine, the file is copied. However if I then modify the the config file (lets just call is config.xml) and re-build then since no source files are changed, the build returns "nothing to do ..." and therefore there is no post-linker stage and my updated config.xml file is not copied to the target area.</p> <p>So to test my changes I have to modify a source file and then re-build... its a bit annoying and when I forget it often causes a few minutes of wasted time...</p>
4,583,144
0
<p>An <code>@</code>, followed by any number of any characters, to the end.</p> <pre><code>result = subject.gsub(/@.*$/, ""). </code></pre>
1,667,365
0
<p>As far as I know there is no problems to work with Variant variable type in other languages. But it will be great if you export the same functions for different variable types.</p>
39,807,070
0
<p>what about this:</p> <pre><code>$http.post(linkdate).then(function(data) { $scope.response= data.data; }) </code></pre>
21,061,396
0
<p>You could use <code>array_map</code> instead of loops and pass-by-reference. You avoid mutation this way. For example:</p> <pre><code>$add = function($x) { return function($y) use($x) { return $x + $y; }; }; $firstArray = array_map($add(3), $firstArray); $secondArray = array_map($add(7), $secondArray); </code></pre>
39,468,433
0
<p>I believe the advice was to delete the view on which the timeline is based. That is, if you have All Tasks view with Timeline above it, you need to delete All Tasks view and recreate it.</p>
8,547,868
0
<p>You haven't initialized <code>it</code>. Try this:</p> <pre><code>std::vector&lt;Enemy*&gt;::iterator it; for(it=tracked.begin();it!=tracked.end();it++){ (*it)-&gt;update(timeSinceLastFrame); } </code></pre>
2,419,979
0
<p>Try using the <a href="http://www.php.net/manual/en/function.iconv.php" rel="nofollow noreferrer">iconv</a> to convert the encoding.</p>
32,347,930
0
Java error trying to add admob <p>It shows red errors and I followed the instruction in Google site. Only prob in Java</p> <blockquote> <p>mAdView.loadAd(adRequest) Unknown class:'adRequesr' Cannot resolve symbol loadAd </p> </blockquote>
2,533,815
0
Solr range query for specefic id like /solr/select?q=x:[1,2,5,11,64589] <p>I have some specific id like 1,2,5,11,64589 in solr (int type)</p> <p>I want to qet query like ttp://localhost:8983/solr/select?q=x:[1,2,5,11,64589] but does not work (get error). how can do it ??? </p> <p><strong>Note:</strong> i can implement with "<strong>OR</strong>" but i want simple way (and other problem limit in max url char length)</p>
30,913,203
0
<p>I will clarify the thread-safety point. The other points are well described in older questions.</p> <p>It's quite rare case when <code>StringBuffer</code> suits your needs. While it's thread-safe it doesn't mean you will get what expected when using it from different threads. For example, suppose you have the following code:</p> <pre><code>StringBuffer buf = new StringBuffer(); public void appendMessage(String message) { buf.append("INFO: ").append(message).append(System.lineSeparator()); } </code></pre> <p>If you are using it in multithread environment it will not fail, but you may end up having content like this:</p> <pre><code>INFO: INFO: thread1 message thread2 message </code></pre> <p>That's because individual <code>append</code> calls are synchronized, but the whole sequence is not.</p> <p>In order to ensure that your messages are separately added, you must have an external synchronization like this:</p> <pre><code>Object lock = new Object(); StringBuilder buf = new StringBuilder(); public void appendMessage(String message) { synchronized(lock) { buf.append("INFO: ").append(message).append(System.lineSeparator()); } } </code></pre> <p>Here the whole sequence of calls is synchronized, so you will have the whole message appended at once. And as you are using the external synchronization, <code>StringBuilder</code> will work fine as well.</p> <p>So in general <code>StringBuffer</code> should not be used in the most of situations.</p>
35,083,026
0
<p>use the <code>container</code> class</p> <pre><code>&lt;div class ="container"&gt; &lt;div class = "header_site"&gt; &lt;h1&gt;&lt;span class = "header"&gt;ABC Company&lt;/span&gt;&lt;/h1&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
31,715,355
0
<p>From the <a href="https://docs.python.org/2/library/webbrowser.html#webbrowser.open" rel="nofollow">doc</a>.</p> <blockquote> <p>The webbrowser module provides a high-level interface to allow displaying Web-based documents to users. Under most circumstances, simply calling the open() function from this module will do the right thing.</p> </blockquote> <p>You have to import the module and use <code>open()</code> function.</p> <p><strong>To open in new tab:</strong></p> <pre><code>import webbrowser webbrowser.open('nabinkhadka.com.np', new = 2) </code></pre> <p><strong>Also from the doc.</strong></p> <blockquote> <p>If new is 0, the url is opened in the same browser window if possible. If new is 1, a new browser window is opened if possible. If new is 2, a new browser page (“tab”) is opened if possible</p> </blockquote> <p>So according to the value of new, you can either open page in same browser window or in new tab etc.</p> <p>Also you can specify as which browser (chrome, firebox, etc.) to open. Use <strong>get()</strong> function for this.</p>
28,196,027
0
<p>The problem you're having is not related to GWT <em>per se</em>, but with Java itself. When you do:</p> <pre><code>private void setMuplDef(MultiUploader muplDef, ...) { muplDef = new MultiUploader(); </code></pre> <p>... you must remember that in Java you always copy the reference of the parameter when you call a method (more about that in <a href="http://stackoverflow.com/questions/40480/is-java-pass-by-reference-or-pass-by-value">here</a>). In that matter, you can't pass your <code>muplDefPdf</code> field as parameter expecting it to be instantiated inside the method.</p> <p>For your code to work properly, you need to do:</p> <pre><code>public MyClass() { muplDefPdf = new MultiUploader(); setMuplDef(muplDefPdf, "pdf", onFinishUploaderHandlerPdf, onCancelUploaderHanderPdf); muplDefJpg = new MultiUploader(); setMuplDef(muplDefJpg, "jpg", onFinishUploaderHandlerJpg, onCancelUploaderHanderJpg); initWidget(uiBinder.createAndBindUi(this)); } </code></pre> <p>... and remove the <code>muplDef = new MultiUploader();</code> line inside the <code>setMuplDef</code> method.</p>
1,414,434
0
<p>If I remember correctly, the FileUpload component does not work inside UpdatePanel (without additional coding, at least)</p>
39,502,274
0
<p>This took me so long to fix but the problem was that the Assets folder was removed from the build phases/copy bundle resources folder.</p>
7,135,252
0
<p>By setting RightToLeft to Yes, you are asking the Windows text rendering engine to apply the text layout rules used in languages that use a right-to-left order. Arabic and Hebrew. Those rules are pretty subtle, especially because English phrases in those languages are not uncommon. It is not going to render "txeT emaN" as it normally does with Arabic or Hebrew glyphs, that doesn't make sense to anybody. It needs to identify sentences or phrases and reverse those. Quotes are special, they delineate a phrase.</p> <p>Long story short, you are ab-using a feature to get alignment that was <em>really</em> meant to do something far more involved. Don't use it for that.</p>
20,971,464
0
<h1>Update related to your comment:</h1> <pre><code>from itertools import count, repeat def statistiken(request): # Get all members members = Member.objects.all() # Get maximum number of related events max_n_events = max(member.event_set.all().count() for member in members) # Create a list to hold table data table_data = [] for member in members: # Get all related events for the member events = member.event_set.all() # Get number of events n = events.count() # Append a iterator with member instance, event instances, and # repeating empty strings to fill up the table table_data.append(chain([member], events, repeat('', max_n_events-n))) context = {'table_data': table_data} return render(request, 'anwesenheitsapp/statistiken.html', context) </code></pre> <p>and your template to this:</p> <pre><code>&lt;table&gt; &lt;tr&gt; {% for row in table_data %} {% for col in row %} &lt;td&gt;{{ col }}&lt;/td&gt; {% endfor %} {% endfor %} &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>The strings in the table will be the result of <code>__unicode__()</code> for your member and events, followed by empty cells.</p> <hr> <h1>(old answer)</h1> <p>To access all related Events from a Member instance, use <code>event_set.all()</code>.</p> <p>Your template could look something like this:</p> <pre><code>&lt;table&gt; {% for member in all_members %} &lt;td&gt;{{ member }}&lt;/td&gt; {% for event in member.event_set.all %} &lt;td&gt;{{ event }}&lt;/td&gt; {% endfor %} {% endfor %} &lt;/table&gt; </code></pre> <p>Which should produce this table</p> <pre><code>| member0 | related_event00 | related_event01 | ... | related_event_0n| | member1 | related_event10 | related_event11 | ... | related_event_1n| | .... | | memberm | related_eventm0 | related_eventm1 | ... | related_event_mn| </code></pre> <p>(n could be different from member to member of course)</p>
16,364,102
0
php variable not being passed to mail() "to line" parameter <p>long time listener, first time caller...</p> <p>I have recently started working through O'Reilly's "Head First" books on PHP, and this is one of their exercises - the code may look familiar to some of you. </p> <p>The goal of the lesson was to demonstrate how the "mail" function in php works, and to that end they gave the following code to use as an example (edited for brevity/context):</p> <pre><code>$email = $_POST['email']; $to = '[email protected]'; $subject = 'Abduction report'; $message = "$name . was abducted $when_it_happened and was gone for $how_long . \n" . "Number of aliens: $how_many \n" . "Alien description $alien_description\n" . "What they did: $what_they_did \n" . "Fang spotted: $fang_spotted \n" . "Other comments: $other"; mail($to, $subject, $message, 'From:' . $email); </code></pre> <p>----------------------------------EDIT-----------------------------------</p> <p>Per request, here is the results of <code>phpinfo()</code>:</p> <pre><code>System: Linux infong 2.4 #1 SMP Thu Feb 14 13:02:49 CET 2013 i686 GNU/Linux Build date: Apr 10 2013 13:38:50 Configure Command: '../configure' '­­program­suffix=5' '­­with­pear=/usr/lib/php5' '­­with­ config­file­path=/usr/lib/php5' '­­with­libxml­dir' '­­with­mysqli' '­­with­kerberos' '­­with­imap­ssl' '­­enable­soap' '­­with­xsl' '­­enable­mbstring=all' '­­with­curl' '­­with­mcrypt' '­­with­gd' '­­with­pdo­mysql' '­­with­freetype­dir' '­­with­libxml­dir' '­­with­mysql' '­­with­zlib' '­­enable­debug=no' '­­enable­safe­mode=no' '­­enable­discard­path=no' '­­with­png­dir' '­­enable­track­vars' '­­with­db' '­­with­gdbm' '­­enable­force­cgi­redirect' '­­enable­fastcgi' '­­with­ttf' '­­enable­ftp' '­­enable­dbase' '­­enable­memory­limit' '­­enable­calendar' '­­enable­wddx' '­­with­jpeg­dir=/usr/src/kundenserver/jpeg­6b' 'enable­bcmath' '­­enable­gd­imgstrttf' '­­enable­shmop' '­­enable­mhash' '­­with­mhash' '­­with­openssl' '­­enable­xslt' '­­with­xslt­sablot' '­­with­dom' '­­with­dom­xslt' '­­with­dom­exslt' '­­with­imap' '­­with­iconv' '­­with­bz2' '­­with­gettext' '­­enable­exif' '­­with­idn' '­­with­sqlite' '­­enable­sqlite­utf8' '­­enable­zip' '­­with­tidy' '­­enable­gd­native­ttf' Server API: CGI/FastCGI Virtual Directory Support: disabled Configuration File (php.ini) Path: /usr/lib/php5 Loaded Configuration File: /usr/lib/php5/php.ini Scan this dir for additional .ini files: (none) additional .ini files parsed: (none) PHP API: 20041225 PHP Extension: 20060613 Debug Build: no Thread Safety: disabled Zend Memory Manager: enabled IPv6 Support: enabled Registered PHP Streams: https, ftps, compress.zlib, compress.bzip2, php, file, data, http, ftp, zip Registered Stream Socket Transports: tcp, udp, unix, udg, ssl, sslv3, sslv2, tls Registered Strem Filters: zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed </code></pre> <p>Everything works as expected except that I would receive no emails after filling out and submitting the form. </p> <p>After removing the $to variable from "mail()" and replacing it with a static string ('[email protected]') I did get a properly formatted email. </p> <p>I also concatenated the "$to" variable to the body of the message and it displayed correctly from within the email body. </p> <p>So I am at a loss as to why it cannot be used in the mail's "to" line. What am I missing here?</p>
15,783,060
0
<p>You can use Json.NET for that. Check out this article: <a href="http://sixgun.wordpress.com/2012/02/09/using-json-net-to-generate-jsonschema/">http://sixgun.wordpress.com/2012/02/09/using-json-net-to-generate-jsonschema/</a></p>
13,763,076
0
<p>There's a bug in your calculation: For <code>1000</code> activities and <code>200</code> resources, you don't have <code>200*1000</code> possible allocations but <code>200^1000</code> possible allocations (so more than <code>10^2000</code> possible allocations). Are you sure your optimization engine scales that much?</p> <p>Have you looked into doing resource allocation with <a href="http://docs.jboss.org/drools/release/5.5.0.Final/drools-planner-docs/html_single/index.html" rel="nofollow">Drools Planner</a> instead? Drools Planner can handle such allocation sizes and much bigger too. It searches for the best solution (and scales out well) and it uses Drools to calculate the score (= negative of the number of forbidden allocations) for each solution it evaluates.</p>
6,086,670
0
<p>In a DataTemplate, the DataContext is set by default to the item that is represented by the DataTemplate (in that case, the Car object). If the EditCar command is on the main viewmodel (which also contains the MyCars collection), you need to explicitly set the Source of the Binding to that object. This would be (assuming that you are using the MVVM Light's ViewModelLocator and that your VM is named Main) {Binding Source={StaticResource Locator}, Path=Main.EditCar}</p> <p>Cheers, Laurent</p>
27,234,480
0
Can I color table columns using CSS without coloring individual cells? <p>Is there a way to color spans of columns all the way down. See, starting example below:</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table border="1"&gt; &lt;tr&gt; &lt;th&gt;Motor&lt;/th&gt; &lt;th colspan="3"&gt;Engine&lt;/th&gt; &lt;th&gt;Car&lt;/th&gt; &lt;th colspan="2"&gt;Body&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;4&lt;/td&gt; &lt;td&gt;5&lt;/td&gt; &lt;td&gt;6&lt;/td&gt; &lt;td&gt;7&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;7&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;4&lt;/td&gt; &lt;td&gt;5&lt;/td&gt; &lt;td&gt;6&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;</code></pre> </div> </div> </p> <p>And I am looking for a better way (less code, non-individual coloring) to color, for example, "Engine" and "Body" spans, including all the cells underneath them in <code>#DDD</code></p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;style&gt; .color { background-color: #DDD } &lt;/style&gt; &lt;table border="1"&gt; &lt;tr&gt; &lt;th&gt;Motor&lt;/th&gt; &lt;th colspan="3" class="color"&gt;Engine&lt;/th&gt; &lt;th&gt;Car&lt;/th&gt; &lt;th colspan="2" class="color"&gt;Body&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;1&lt;/td&gt; &lt;td class="color"&gt;2&lt;/td&gt; &lt;td class="color"&gt;3&lt;/td&gt; &lt;td class="color"&gt;4&lt;/td&gt; &lt;td&gt;5&lt;/td&gt; &lt;td class="color"&gt;6&lt;/td&gt; &lt;td class="color"&gt;7&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;7&lt;/td&gt; &lt;td class="color"&gt;1&lt;/td&gt; &lt;td class="color"&gt;2&lt;/td&gt; &lt;td class="color"&gt;3&lt;/td&gt; &lt;td&gt;4&lt;/td&gt; &lt;td class="color"&gt;5&lt;/td&gt; &lt;td class="color"&gt;6&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;</code></pre> </div> </div> </p>
30,964,061
0
mysql: grant command denied for user <p>I need help regarding mysql grant command. I need to grant select command on a table to a user which is from different host.</p> <p><code>GRANT SELECT on db.table TO [email protected] AT password</code> (xx.xx.xxx is ip address of other server and user is username at that server)</p> <p>The above statement is giving me error:</p> <blockquote> <h1>1174 - Grant command denied to user</h1> </blockquote> <p>It is working fine in the localhost phpmyadmin. But when I do it in cpanel phpmyadmin it gives error.</p> <p>Thanks</p>
266,574
0
<p>John Resig (jQuery) <a href="http://ejohn.org/blog/html5-doctype/" rel="nofollow noreferrer">has a say</a> in that matter. Additionally, a DocType helps make MSIE6 <a href="http://msdn.microsoft.com/en-us/library/bb250395.aspx#cssenhancements_topic2" rel="nofollow noreferrer">use the right box model</a>, and it also eases the pain of validating your site (this is a <strong>good</strong> thing for development; think of it as debugging).</p>
2,245,486
0
<p>The XmlReader does not by default (but see Colin's and dh's suggestion) assume that it is the only one using a stream, so the first option is the only Dispose safe one. </p>
8,563,439
0
Android Stop toast notification programatically? <p>Is there a way I can stop a toast message programatically? </p> <p>Say I have a button which I click to scroll through toast messages, and in the onclick event I wanted to stop all in the queue and just show the new one, how would I do that?</p> <p>Thanks,</p> <p>Ben</p> <p>A simplified version of my code is below - Code:</p> <pre><code>public class Help extends Activity{ LinearLayout background; int screenNo = 1; Toast toast; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.help); background = (LinearLayout) findViewById(R.id.helpLayout); ImageButton next = (ImageButton) findViewById(R.id.imageButtonNext); next.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { toast.cancel(); showNextScreen(); }}); } private void showMessageBox(String title, String msg) { AlertDialog.Builder b = new AlertDialog.Builder(this); b.setTitle(title); b.setMessage(msg); b.setPositiveButton("Next", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { showNextScreen(); }}); b.setNegativeButton("Quit Help", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { returnHome(); }}); b.show(); } private void showNextScreen() { int time = 7000; String tstMsg = "error"; switch (screenNo) { case 1: break; case 2: break; case 3: break; case 4: break; case 5: toast.cancel(); returnHome(); break; default: break; } if(screenNo &lt; 5) { toast=Toast.makeText(this, tstMsg, time); toast.setGravity(Gravity.BOTTOM, 0, 0); toast.show(); screenNo++; } } } </code></pre>
17,147,231
0
<p>Ok, solved the proplem. It has nothing to do with the installation process. Anyway it was related to a very weird Windows behaviour. I'll try to explain:</p> <p>On the developer machine (PC1) the language setting is German(Germany). At the machine where the app is installed (PC2) the language was German(Austria). With these slight but important difference I got a FormatException when parsing a string to a double value at PC2 (',' &lt;-> '.'). After changing the language settings at PC2 the issue was solved.</p> <p>Without remote debugging I wouldn't have detected this behaviour.</p>
17,945,901
0
PHP Template - Using extract() and access vars by object. Array is given <p>I want something like this in my template file:</p> <pre><code>&lt;ul&gt; &lt;?foreach($friends as $var):?&gt; &lt;li&gt; &lt;?=$var-&gt;name?&gt; &lt;/li&gt; &lt;?endforeach ?&gt; &lt;/ul&gt; </code></pre> <p>I use this in my model.php:</p> <pre><code>$data = array('friends' =&gt; array( array('name' =&gt; 'testname'), array('name' =&gt; 'testname2') )); // missing code here ? extract($data, EXTR_SKIP); include('template_file.html'); </code></pre> <p>How can I use $var->name to access 'name' as an object in my template file?</p> <p>$data = array() is set.</p> <p>Update:</p> <p>Its because, I dont want to use <code>&lt;?=$var['name']?&gt;</code> in my template.</p>