pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
18,122,185
0
Capistrano: How to disable "try_sudo" from a task <p>I'm currently using capistrano for deploy scripts. I'm working in a constrained environment where sudo does not have certain permissions, namely to create symlinks. The capistrano task create_symlink calls try_sudo by default. Is there a way I can add a condition to ...
5,416,030
0
How can I get return value when using awk in perl script? <p>I am trying submit to $process the result of this <strong>system call</strong> </p> <pre><code>my $process= system "adb shell ps | egrep adb | awk '{print $1}' "; </code></pre> <p>but when <code>print " $process \n";</code> I have got zero</p> <p>Any suggesti...
20,648,266
0
<p>Your "less than" symbol in your for loop is backwards. As such, your loop is exiting without running the code inside.</p>
3,031,818
0
<p>You'll have to do quite a bit of drawing by yourself. This MSDN section deals with <a href="http://msdn.microsoft.com/en-us/library/kxys6ytf%28v=VS.100%29.aspx" rel="nofollow noreferrer">Custom Control Painting and Rendering</a> and the documentation for <a href="http://msdn.microsoft.com/en-us/library/system.windo...
33,543,346
0
Can I simplify WebRTC signalling for computers on the same private network? <p>WebRTC signalling is driving me crazy. My use-case is quite simple: a bidirectional audio intercom between a kiosk and to a control room webapp. Both computers are on the same network. Neither has internet access, all machines have known sta...
39,453,787
0
SQL Server 2008 R2: trigger after update <p>This is my first post so please bear with me. Here are the tables I'm working with and I'm only showing the relevant columns:</p> <p><strong>Movement</strong>:</p> <pre><code> id cnt_tare_weight chassis_tare_weight </code></pre> <p><strong>Stop</strong>:</p> <pre><code> movem...
15,646,109
0
Running gearman on a Heroku Worker <p>I have a PHP app running on heroku (cedar stack). I'm at the point where I need to start passing jobs off to workers. </p> <p>I've looked a both RabbitMQ and gearman. It seems like the best / simplest solution for my app would to use gearman. </p> <p>So I'm guessing the gearman ser...
18,035,156
0
Use transient keyword in not Serializable class <p>Would it make sense to use the <code>transient</code> keyword in a class that does not implement <code>Serializable</code>? </p> <p>Because classes that do not implement <code>Serializable</code> could still be serialized by the <code>ObjectOutputStream</code>.</p>
8,175,367
0
iphone UIview animation resize in like disappear in water and comes back floating <p>I don't want to fade in and fade out like most common solution for the uiview animation. I would like to have the uiview resize to small until it disappear and comes back the same way. Another way to say it is having a camera pointing ...
15,071,133
0
<p>As far as I know the content isn't loaded when the div's display style is set to none.</p> <p>Try setting something like this</p> <pre><code>&lt;div style="width: 1px; height: 1px; position: absolute; top: -9999px; left: -9999px;"&gt; &lt;div id="player"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre>
4,076,169
0
How remove "installed twice" errors in RCP Product <p>I have an RCP product based on 2 features: my product feature and the org.eclipse.rcp feature. It worked perfectly at export time and at run time.</p> <p>Last week I decided to add the error log view to my product. I simply added the view to my "persective" and the ...
33,088,122
0
<p>my suggestion is: just keep codding the way it is, until a problem rises or an extremely need for the change appears.</p>
21,736,951
0
Saving a CSV into a blob <p>I would like to save CSV files that users upload to a blob. I would than like to retrieve the CSV file out of the blob in a format that I can use with the ruby CSV library. Any ideas on how I can accomplish that? </p>
32,955,638
0
How to rewrite this on jQuery <p>I have ul with 5 li inside, need to select one of them with index [curSlide-1], I writed it on JS, but can't do that on jQuery:</p> <pre><code>var $bullets = $("ul").find(".bullet"); var curSlide = 5; document.getElementsByClassName("bullet")[curSlide-1].className = "bullet active-bulle...
18,277,818
0
Is it possible to change the min-height of Google+ comment on Blogger? <p>I just created a new <strong>Blogger blog</strong> and successfully incorporated the <strong>Google+ comment</strong> using the Blogger built-in feature. But I noticed that a <code>div id="widget_bounds"</code> is consuming too much of empty spac...
1,937,038
0
Set mouse cursor as hand on textInput without losing text selection <p>I want to have the mouse cursor to be changed to hand when used for <em>entering</em> the <code>&lt;mx:textInput&gt;</code>. When the field is already on focus, text selection should be available.</p> <p>I tried any combination of <code>useHandCurso...
11,333,623
0
Rails app using stripe for payments: can't transmit plan_id from app to stripe website <p>I'm trying to integrate stripe into my app. I'm following a Railscast (#288) but I'm getting the impression there a are few things that Ryan isn't mentioning explicitly.</p> <p>My problem is that the plan_id on my app doesn't get ...
24,914,838
0
<p>Test this version, updated using C++11 features. Tested in GCC 4.9.0 with <code>-std=c++11</code>. Tested on Celeron 1.6&nbsp;GHz, 512&nbsp;MB RAM.</p> <p>Times in my PC:<br> Original: <strong>Duration (milliseconds): 12658</strong><br> First Version: <strong>Duration (milliseconds): 3616</strong><br> Optimized Ver...
3,228,075
0
HashSet of Strings taking up too much memory, suggestions...? <p>I am currently storing a list of words (around 120,000) in a HashSet, for the purpose of using as a list to check enetered words against to see if they are spelt correctly, and just returning yes or no.</p> <p>I was wondering if there is a way to do this ...
2,988,920
0
Getting list of states/events from a model that AASM <p>I successfully integrated the most recent AASM gem into an application, using it for the creation of a wizard. In my case I have a model order</p> <pre><code>class Order &lt; ActiveRecord::Base belongs_to :user has_one :billing_plan, :dependent =&gt; :destroy name...
5,522,604
0
Are there any tutorials on coding a parser for SVG files to be used by box2D? <p>I am trying to create an iPhone game with fairly large levels. Hard coding the platforms and physics objects is very time consuming. I have seen some people have made their own parsers for svg files to use in box2D, and Riq is selling leve...
18,210,830
0
<p>You have to print the <code>$value</code> bacause <code>$value</code> have original array value not index. And you are getting array in <code>$stdlist</code> from exploding this post variable <code>$_POST['stdlist']</code>.</p> <pre><code>foreach($stdlist as $value) { echo "&lt;br&gt;"; echo $value; } </code></pre>...
39,772,900
0
<p>I figured out my problem, I set margin to my <code>AppCompatSpinner</code> and set top gravity to it with specific hight.</p> <pre><code>&lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="bottom" android:orientation="horizontal"&gt; &lt;android.support.v7.widg...
19,799,914
0
<p>I was able to solve this by setting the id of the layout that is inflated within each fragment to its position.</p> <p>What you would have to do is simply change the method onCreateView in you ContainerFragment class to:</p> <pre><code>@Override public View onCreateView(LayoutInflater inflater, ViewGroup container,...
1,117,281
0
<p>Give a look to the <a href="https://developer.mozilla.org/En/Window.setInterval" rel="nofollow noreferrer">setInterval</a> core function and to the jQuery's <a href="http://docs.jquery.com/Effects/toggle" rel="nofollow noreferrer">Effects/toggle</a> function:</p> <pre><code>setInterval(function(){$('#myDiv').toggle...
33,463,619
0
<p>The problem may be here: </p> <p>/** MySQL hostname */ define('DB_HOST', 'www.abc.com'); //before 'localhost'</p> <p>Databases are almost always hosted at 'localhost' not at you domain.</p> <p>Try reverting to:</p> <p>/** MySQL hostname */ define('DB_HOST', 'localhost');</p> <p>MORE DETAILED ANSWER</p> <ol> <li><p>...
40,290,896
0
<p>I believe your call is matching the wrong overload of the helper method.</p> <p>As written, it will match this signature:</p> <pre><code>public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, object routeValues, object htmlAttributes) </code></pre> <p>Notice there is ...
33,207,359
0
<p>I would like to mention two things </p> <ol> <li><p>AngularJs is not about DOM Manipulation.</p></li> <li><p>working concept of directive ,it must be purely independent from the controller and all, must be working in all place.</p></li> </ol> <p>In my view the directive triggering must be on the basis of data.</p> ...
39,956,718
0
<p>Here is a sample in JS to match your require, another language should the same.</p> <pre><code>/^gs:\/\/(.+?)\/(.+)$/ </code></pre> <p>Check result <a href="http://scriptular.com/#%5Egs%3A%5C%2F%5C%2F(.%2B%3F)%5C%2F(.%2B)%24%7C%7C%7C%7C%7C%7C%7C%7C%5B%22gs%3A%2F%2Fbucket%2Ffolder1%2Ffolder2%2Ftest.csv%22%5D" rel="n...
10,959,181
0
<p>I would definitely avoid putting binaries in source control. You'd be far better off creating your own nuget repository containing your preferred versions of packages and either using nuget restore or some other way of "rehydrating" your dependencies for building. I use a simple batch file called nuget-update.bat w...
33,061,971
0
Selecting MediaRoute on behalf of user works but MediaRoute button is in disconnected state <p>I'm building an app that will launch a chromecast receiver application automatically without the user clicking the mediaroute button and selecting a route. The user has already selected their desired route, and my app attempt...
31,962,848
0
how to do real time notification in my (own)app? <p>i am new to android. i need develop notification to my application. i have seen gcm (android hive) example and simple example of notification. </p> <p>i was confused with that example. please guide me how to do real time notication?</p> <pre><code> mn = (NotificationM...
19,385,963
0
<p>Try this : <code>(?&lt;=\bHOUSE\s)(?:\d+-\w|\d+\s\w|\d+)\b</code></p> <p>NB. the order on a conditional statement is important, and the first successful match is taken, so if you have <code>\d+|\d+-\w</code> it will only match <strong>4</strong> in <strong>4-C</strong> but <code>\d+-\w|\d+</code> will match <strong...
25,785,778
0
<p>You aren't injecting it. There is no autowiring for the <code>RememberMeConfigurer</code>. Also why are you configuring so many beans?</p> <p>The <code>RememberMeAuthenticationProvider</code> is already created for you, if you want to use a different key specify it using <code>key("KEY")</code>. This in turn will b...
36,156,051
0
Scheduled mapreduce job on Google Cloud Platform <p>I'm developing a node.js application that basically <strong>stores user event logs in a database and shows insights about user action</strong>s. For achieving this event logs must be analyzed by using a <strong>Mapreduce</strong> job which would run <strong>once a day...
29,027,373
0
<p>Solved it by using the following steps:</p> <ul> <li>Open an InputStream to the image as normal</li> <li>Write the stream to a ByteArrayOutputStream</li> <li>Compare the length of the ByteArrayOutputStream to the Content-Length header from the HttpURLConnection</li> <li>If mismatch then you've lost data in transit<...
3,906,270
0
<p>You have to start <code>wait</code> by acquiring synchronization on the wait variable, e.g.</p> <pre><code>synchronized( this ) { this.wait( ); } </code></pre> <p>Please read the javadoc for <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html#wait%28%29" rel="nofollow">wait</a> carefully and...
21,489,225
0
<p>Convert your month and year columns to strings concatenated with '-'s and add '-01' to the end. Then convert to a date.</p> <pre><code>UPDATE t SET t.[Date] = convert(date, convert(varchar(4), t.[Year]) + '-' + convert(varchar(2), t.[Month]) + '-01') FROM Table t </code></pre> <p>This will create a date for all rec...
13,222,409
0
C# How to handle TCP packets/segments <p>A couple of questions about TCP. </p> <p>I know that the packet will be "split" or fragmented if it hits a network device with lower MTU etc. But the problems I have is understanding how I "rebuild" my payload in the application. (I've been trying for 2-3 hours now, but can't se...
526,231
0
<p>If you just want to see how it can be achieved...</p> <p><a href="http://www.codeproject.com/KB/dotnet/Call_ironpython__in_C_.aspx" rel="nofollow noreferrer">Here's</a> one example to do that.</p>
15,671,833
0
Show/hide div when clicked on marker <p>I'm new to javascript and no idea where to start digging information how to implement my idea. I want to open a div like a pop-up over the map when a marker is clicked. I have around 15 markers and every marker has different content and images. The pop-up layout will stay the sam...
20,303,123
0
Verdana font issue <p>I must implement a website css from psd file. In psd some text is in Verdana, but when I use Verdana in css it appears thicker in a browser than Verdana in the psd file. Does anyone know the reason?</p>
2,269,515
0
<p>Although it is not object-oriented, <a href="http://www.haskell.org/" rel="nofollow noreferrer"><strong>Haskell</strong></a> offers a significant number of the features that interest you:</p> <ul> <li><p>Syntax support for list comprehensions, plus <code>do</code> notation for a wide variety of sequencing/binding c...
1,915,934
0
<p>Yes, NUnit tests are supposed to be isolated and it is <strong>your</strong> responsibility to make sure they are isolated. The solution would be to reset ObjectFactory in the TearDown method of your test fixture. You can use ObjectFactory.EjectAllInstancesOf() for example.</p>
8,286,918
0
<p>try adding the following to your .htaccess file in the root of your domain</p> <pre><code>RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !^/[^/]{2}/product/ [NC] RewriteCond %{REQUEST_URI} ^/([^/]{2})/([0-9]+.*)$ [NC] RewriteRule . /%1/product/%2 [L,R=301] </code></pre>
9,026,192
0
<p>I don't think there is an out-of-the-box solution to have 2 background colors.</p> <p>The best solution would be to use <strong><a href="http://www.graphviz.org/content/attrs#kcolorList" rel="nofollow noreferrer">gradient</a></strong> fills (<code>fillcolor="orange:yellow"</code>) - but though this is in the docume...
9,760,596
0
How to use scala 2.10 trunk with sbt 0.11.0? (Unresolved dependencies) <p>What's the right way to use sbt with 2.10 trunk? I tried the obvious:</p> <pre><code>james@James-Moores-iMac:~/workspace/Deleteme3$ cat build.sbt scalaVersion := "2.10.0-SNAPSHOT" </code></pre> <p>But that gives:</p> <pre><code>james@James-Moores...
20,915,957
0
<p>Thanks to all. The additional AND condition worked. I had actually tried that earlier but it didn't work when I was testing, in my haste I had not yet added the "completed" column to the table yet. Thanks again. </p>
20,678,586
0
Spring REST MultipartFile file is always null when do upload file <pre><code>@RequestMapping(value = "{fileName:.+}", method = RequestMethod.POST, consumes = { MediaType.MULTIPART_FORM_DATA_VALUE}) public ResponseEntity&lt;ResponseEnvelope&lt;String&gt;&gt; uploadFile( @RequestParam("ownerId") Long ownerId, @PathVariab...
2,085,942
0
How to display attached properties in Property Browser of blend for silverlight? <p>I created couple of custom controls and their childresn correctly shows the attached properties in Property Browser for WPF, but in silverlight none of the attached properties appear in Property Brower.</p> <p>How to add design time sup...
27,783,083
0
<p>Just import them as usual. When running the tests, Maven will create a classpath which will make everything in <code>src/main/java</code> visible to the test classes.</p>
10,946,490
0
<p>For those having troubles like these accessing the soap web services and using a https protocol, we managed to solve the issue by configuring the RTM CRM 2011 deployment with Claims based authentication and IFD access thanks to <a href="http://www.youtube.com/watch?v=ZD5qaa-G99E" rel="nofollow">this tutorial</a>.</...
40,803,902
0
<p>You need samsung certificate. Application with Certificate that created in Tizen Studio can be run only Emulator. Use Samsung Certificate if you want to run application on real device.</p> <p>Refer <a href="http://stackoverflow.com/questions/40742515/how-to-install-app-on-gear-s2-via-tizen-studio/40755444#40755444"...
21,324,210
0
<p>Try this:</p> <pre><code>jQuery(function ($) { if (typeof (window.localStorage) != "undefined") { // will get value of specific id from the browser localStorage and set to the input $("input[type=text]").val(function () { return localStorage.getItem(this.id); }); // will set values in browser localStorage for furth...
30,771,239
0
Array of Protocol instances won't work with contains method <p>I have a protocol that I am using to define what makes up the content of a note. A note can have many different content types, so a protocol seemed like the best way to go.</p> <pre><code>public protocol Content { var contentType: String { get } } </code></...
23,162,806
0
<p>There's a better way.</p> <p>jQuery documentation for <a href="https://api.jquery.com/deferred.promise/" rel="nofollow">Deferred.promise([target])</a> says :</p> <blockquote> <p>If target is provided, <code>deferred.promise()</code> will attach the methods onto it and then return this object rather than create a ne...
5,922,713
0
Is there a way to get Mysql to make the unique ID generate with letters and numbers? (or PHP) <p>Is there a way i could make the unique id (primary key) in Mysql generate with numbers and letters to keep the id as short as possible? If I cant do this in Mysql how could i get PHP to generate this? Thanks :)</p>
29,017,782
0
How do you extend a class with a jQuery wrapped set? <p>The following almost works...</p> <pre><code>$el = -&gt; $el:: = $ '#test' new class extends $el constructor: -&gt; @append '&lt;h1&gt;Worked!&lt;/h1&gt;' # this will overflow the stack @find('[role=test2]').append '&lt;h2&gt;Also Worked!&lt;/h2&gt;' </code></pre>...
9,583,911
0
jquery form field message on submit <p><a href="http://jsfiddle.net/XeELs/24/" rel="nofollow">http://jsfiddle.net/XeELs/24/</a></p> <p>I'm having problems with this Fiddle is not working the message Error. I'm using the CSS3-html5 form validation and I need to implement it within CSS possibly <code>valid</code> and <co...
14,940,003
0
<p>Reserved words are a moving target. If the dbms doesn't expose them through a public interface, there isn't usually a good programmatic way to get to them.</p> <p>If you don't want to guard them with brackets, you risk incorporating symbols that are not reserved in your currently used version of SQL Server, but <em...
3,927,498
0
<p>As far as I know, mongodb doesn't support queries against dynamic values. But you could use a javascript function:</p> <pre><code>scope :unresolved, :where =&gt; 'this.updated_at &gt;= this.checked_at' </code></pre> <p>To speed this up you could add an attribute like "is_unresolved" which will be set to true on upd...
11,653,698
0
How do I tie in my image handler with an image control? <p>I've been looking around and reading about handlers, but I don't fully understand how to implement them for my situation.</p> <p>I want display a screenshot from the user's clipboard. I already have code that retrieves the image from the clipboard into a bitmap...
13,303,978
0
<p>Get rid of that new at the beginning. It's <code>Charts.newColumnChart()</code>, not <code>new Charts.newColumnChart()</code>.</p>
21,111,770
0
Aggregate intraday data <p>As from my previous question, I have this query to perform data aggregation from intraday to daily data</p> <pre><code>SELECT symbol, date, MAX(high) AS high, MIN(low) as low, SUM(volume) as volume, (select open from A2A a2 where a1.symbol = a2.symbol and a1.date = a2.date order by time limit...
5,681,585
0
<p>If you have a dual-core computer and a process that's taking 50%, it means it's using one core, at its maximum capability.</p> <p><br> Compiling is a complex operation ; and it doesn't surprise me that it'd use a full CPU for some time <em>(depending on the size of your project)</em>.</p> <p>Using a CPU at its maxi...
7,751,588
0
<p>Try changing</p> <pre><code>exec('gpg --homedir $path --recipient $recipient --output $encrypted_file --encrypt $plain_file --yes --always-trust', $answer, $rtn); </code></pre> <p>To</p> <pre><code>exec("gpg --homedir $path --recipient $recipient --output $encrypted_file --encrypt $plain_file --yes --always-trust",...
25,112,397
0
How can I make ExtUtils::Manifest include empty directories? <p>I am trying to build a Perl module for distribution. The directory structure looks like this:</p> <pre><code>demo demo/files demo/examples/example1.pl demo/scripts lib </code></pre> <p>I used this command to generate the MANIFEST file:</p> <pre><code>perl ...
29,694,944
0
<p>This should work:</p> <pre><code>@ECHO OFF FOR /F "tokens=*" %%a IN ('ver') DO ( SET ver=%%a ) SET v1=%ver:~27,1% SET v2=%ver:~29,1% IF %v1% LSS 6 GOTO JUMPTO IF %v2% LSS 2 GOTO JUMPTO ECHO doing something PAUSE GOTO:EOF :JUMPTO ECHO Windows version too old! PAUSE </code></pre>
4,880,888
0
How to Circumvent Perl's string escaping the replacement string in s///? <p>I'm not sure what exactly to call this, but I've been able to reproduce my problem with two one-liners.</p> <p>Starting from a file 'test.txt' containing the following:</p> <pre><code>foo </code></pre> <p>After running the following command (in...
9,263,743
0
<p>Another caveat was running Android SDK Manager in Windows 7 without administrator privileges. It would try to install support package, but would always fail, and the actual package never got downloaded to</p> <blockquote> <p>C:\Program Files (x86)\Android\android-sdk\extras\android\support\v4\android-support-v4.jar...
10,150,139
0
Bug in JavaScript V8 regex engine when matching beginning-of-line? <p>I have a pretty nifty tool, <a href="https://github.com/ddopson/underscore-cli" rel="nofollow">underscore-cli</a>, that's getting the strangest behavior when printing out the help / usage information.</p> <p>In the usage() function, I do this to inde...
25,688,324
0
Number of comboboxes increase after the first set of results <pre><code>I am populating my datagrid based on a value in the textbox. </code></pre> <p>One of the field values in my grid view is a combobox.On a particular text box entry it shows me the correct results but wen I give another value in the text box, the com...
19,344,785
0
<blockquote> <p>Any suggestions which api or util to use for that purpose in JAVA?</p> </blockquote> <p>Main suggestion ... don't do it. It should be up to the end user to think up a passphrase. Any systematic scheme you implement for generating passphrases will be vulnerable to someone attacking your system.</p> <p>I...
38,353,235
0
<pre><code>/**** get some dates to play with ****/ data dates(keep=i thisdate); offset = input('01Jan2015',DATE9.); do i=1 to 100; thisdate = offset + round(599*ranuni(1)+1); *** within 600 days from offset; output; end; format thisdate date9.; run; /**** BTW: intnx('month',thisdate,1)-1 = first day of next month. Ded...
6,956,515
0
<p>Why are you replacing it with <code>\n</code>? </p> <p>Try to replace it with an <strong>empty string</strong> instead, like <code>''</code>. Try to replace <code>\r\n</code> with <code>""</code> and <code>\n</code> with <code>""</code></p>
2,987,260
0
<p>you have to MIME-encode your post: a binary post in an NNTP newsgroup is like a mail with an attachment. </p> <p>the file has to be encoded in ASCII, generally using the <code>base64</code> encoding, then the encoded file is packaged iton a multipart MIME message and posted...</p> <p>have a look at the <a href="htt...
16,713,231
0
<p>It seems that you name table <code>products AS p</code> and then later also <code>product_fields AS p</code>. Try this:</p> <pre><code>SELECT p.*, c.value AS color, g.value AS gender, p.value AS price FROM products p LEFT JOIN product_fields c ON c.product_id = p.id AND c.name = 'color' LEFT JOIN product_fields g O...
37,709,922
0
<p>Probably the problem is rather server-side. Your server have to redirect all the routes to <code>index.html</code> to let Angular make its job. </p>
9,160,042
0
<p>In cake2 you can use a cleaner approach - with or without the new response object: <a href="http://www.dereuromark.de/2011/11/21/serving-views-as-files-in-cake2/" rel="nofollow">http://www.dereuromark.de/2011/11/21/serving-views-as-files-in-cake2/</a></p> <p>The headers will be set by cake itself from the controlle...
33,394,491
0
<p>Given your image, you can target this with pure CSS:</p> <pre><code>.institution-selector li { /*this is all list items */ } .institution-selector li li { /*this is all second or third level list items */ } .institution-selector li li li { /*this is all third level list items */ } .institution-selector li:last-chil...
39,622,541
0
i am trying to update my data with an image updation too but the image isset would not work in php <p>Hey guys i have created a register form with an image upload too but when i try to update this form i try to get the id but the isset of my image is not working so it just wont run my update query do check it out </p> ...
15,244,567
0
<p>Your issue seems to be caused by the line break (which insert a space in the rendered html document). If you don't need that space b/w those two element then you can float both those element to left, it will ignore the space.</p>
26,956,393
0
Java plugin library shading <p>I'm building a Java based HTTP Server with a bukkit-like (minecraft) plugin system. And I want to load plugin libraries in such a way that they don't interfere with each other, e.g. if two plugins package the same library in their jar something might go wrong.</p> <p>I know this can be do...
30,817,189
0
<p>Right click on the Module --><code>Open Module Settings</code> --> Select <code>Dependencies</code> tab --> Click on <code>add(+)</code> button --> Select <code>Library dependency</code> --> Now from list select <code>Play service</code> --> Click <code>Apply</code> --> Clock <code>Ok</code></p> <p><strong>Update</...
9,476,616
0
<p>Create a new <code>Map</code> with refnum as key and qty as value.</p> <pre><code>Map&lt;String,Integer&gt; qtyMap=new HashMap&lt;String,Integer&gt;(); </code></pre> <p>while iterating, try</p> <pre><code>String refNum=transItem.getRefNum(); // Mark for removal ? if this is not the first item in the list with the r...
17,431,892
0
<p>I think the problem you are having is that the <code>getQueryString</code> method you are using is looking for the "?" operator in the URL, as in a traditional GET request (e.g. <code>?id=1</code>). Instead, try passing the domain as a parameter in the controller method. For example:</p> <p>In your <code>routes</co...
23,815,659
0
Timer thread has exited with code 259 (0x103) <p>I want to make a clock which display UTC and Local together. So, I used Timer class from System.Threading like below:</p> <pre><code>private static object _lockObj = new object(); static bool isDisplaying = false; public MainWindow() { InitializeComponent(); System.Threa...
9,503,007
0
<p>It's because the font is missing hinting, as already noted. Mac OS always strips away the hinting data anyway, as its rasterizer "auto-hints" the font itself.</p> <p>However, there is a great little software which uses the automatic hinting of FreeType and embeds the data into the file, i.e. it auto-hints the font ...
32,852,770
0
<p>When you run Spark in <strong>client mode</strong>, the driver process runs <strong>locally</strong>. In <strong>cluster mode</strong>, it runs <strong>remotely</strong> on an ApplicationMaster.</p> <p>In other words you will need all the nodes to see each other. Spark driver definitely needs to communicate with al...
3,940,706
0
<p>Use a regex like this:</p> <pre><code>string input = "\"John Smith\" Pocahontas"; Regex rx = new Regex(@"(?&lt;="")[^""]+(?="")|[^\s""]\S*"); for (Match match = rx.Match(input); match.Success; match = match.NextMatch()) { // use match.Value here, it contains the string to be searched } </code></pre>
36,159,798
0
<p>You can accomplish this with ::before and ::after without knowing the width of container or background color, and to achieve greater styling of the line breaks. For example, this can be modified to make double-lines, dotted lines, etc.</p> <p><a href="https://jsfiddle.net/z8jddc0o/1/">JSFiddle</a></p> <p>CSS, and H...
30,586,123
0
elasticsearch bool filter should clause performance <p>first query:</p> <pre><code> { "query" : { "filtered" : { "filter" : { "bool" : { "must" : [ {"term" : {"user1_id" : "1"}}, {"range" : {"day" : {"gte" : "2015-04-01", "lte" : "2015-04-30"}}} ] } } } } </code></pre> <p>In relational SQL, the first query equals to SQ...
40,095,673
0
Incrontab not processing IF statement <p>First off I'm a Windows guy but getting tasked with Linux now. I am using <code>incrontab</code> to watch a directory on an Oracle Linux server. </p> <p>I am trying to modify it so that if it sees file <code>F078311</code> it will echo Test to the log file. Otherwise it will che...
7,405,278
0
DDD: how to keep a complex value object immutable? <p>I'd like to model an <code>Address</code> as a value object. As it is a good practice to make it immutable, I chose not to provide any setter, that might allow to modify it later.</p> <p>A common approach is to pass the data to the constructor; however, when the val...
34,393,884
0
How to get image URL property from Wikidata item by API? <p>I've made an android app that uses the JSON Google image search API to provide images but I have noticed that Google have stopped supporting it. I have also discovered that Wikidata sometimes provides a image property on some items, however I can't seem to get...
395,834
0
<p>Be careful of code snippets you find on the web. Often they contain sql in html, which is bad practice, as well as security vulnerabilities such as sql injection. I've seen few that use prepared statements, which is good for security.</p>
711,966
0
<p>I think you'll have to use an XmlWriter. Or ToString.</p> <p>Just found <a href="http://msdn.microsoft.com/en-us/library/bb387027.aspx" rel="nofollow noreferrer">this article</a> which seems to agree.</p>
14,819,212
0
before_filter doesn't seem to "kick in" <p>I'm trying to get before_filter to work on the actions that requires the user to be logged in, however something must be wrong because it's not.</p> <p>I use a helper file called 'session_helper.rb' for login/logout as well as for checking if the user is logged in (signed_in?)...
6,432,324
0
<p>Ooo, a good question :)</p> <p>As far as I know, Mark and Sweep is only used for reference counting event listeners since they're the only ones that can have 'weak listeners'. Everything else is straight up memory reference counting. Essentially, your biggest problem would be cleaning up event listeners, but if the...
14,214,733
0
XSLT looping though XML to check if value exists <p>XML:</p> <pre><code>&lt;amenities&gt; &lt;record&gt; &lt;thekey&gt;77&lt;/thekey&gt; &lt;thevalue&gt;Balcony&lt;/thevalue&gt; &lt;/record&gt; &lt;record&gt; &lt;thekey&gt;75&lt;/thekey&gt; &lt;thevalue&gt;Cable&lt;/thevalue&gt; &lt;/record&gt; &lt;record&gt; &lt;theke...