pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
29,295,880
0
<p>Heres a tutorial-ish thing:</p> <p><a href="https://robots.thoughtbot.com/designing-for-ios-blending-modes" rel="nofollow">Blending Modes in iOS</a></p> <p>And here is the <a href="https://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CGContext/index.html#//apple_ref/doc/c_ref/CGBlendMode"...
23,215,562
0
<p>The answer suggested in the comment by @h0lyalg0rithm is an option to go.</p> <p>However, primitive options are.</p> <ol> <li><p>Use setinterval in javascript to perform a task every x seconds. Say polling.</p></li> <li><p>Use jQuery or native ajax to poll for information to a controller/action via route and have t...
6,421,694
0
Where to put the database access <p>I have an entity class which is persisted to a database via JPA and I have a Utility class which does the persisting and reading for me.</p> <p>Now I'm asking myself if that is really the way to go. Wouldn't it be clearer, if the data class would have methods for reading and writing ...
33,624,861
0
<p>Try this one, it should do exactly what you want:</p> <pre><code>let date = NSDate() let dateFormetter = NSDateFormatter() dateFormetter.dateFormat = "h:mm a" dateFormetter.timeZone = NSTimeZone(name: "UTC") dateFormetter.locale = NSLocale(localeIdentifier: "en_GB") let timeString = dateFormetter.stringFromDate(dat...
4,751,734
0
<p><strong>Example:</strong> <a href="http://jsfiddle.net/EpbVc/" rel="nofollow">http://jsfiddle.net/EpbVc/</a></p> <pre><code>var value = $('#personName').val().split(' '); var firstName = value.shift(); var restOfNames = value.join(' '); </code></pre> <p>Uses <a href="https://developer.mozilla.org/en/JavaScript/Refe...
38,504,311
0
<p>You can simple parse that date as shown below.</p> <pre><code>package com.test; import java.text.ParseException; import java.text.SimpleDateFormat; public class Sample { public static void main(String[] args) throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"); System...
19,316,023
0
<p>Short Answer : <strong>No</strong></p> <p>Workaround : Use Javascript or jQuery using <code>.toggle()</code></p> <hr> <p>If you want to stick with CSS, you can do something like</p> <pre><code>div[style*="block"] + div { display: none; } </code></pre> <p><a href="http://jsfiddle.net/nvLvU/" rel="nofollow"><strong>D...
17,969,161
0
<pre><code>update player set productName= concat("super ",productName) </code></pre>
2,328,836
0
How to average elements in one array based on values in another array? <pre><code>let tiedArray = [|9.4;1.2;-3.4;-3.4;-3.4;-3.4;-10.0|]; let sortedArray = [|-10.0;-3.4;-3.4;-3.4;-3.4;1.2;9.4|]; let sortedArrayRanks = [|1.;2.;3.;4.;5.;6.;7.|]; let desired_ranked_array = [|1.;3.5;3.5;3.5;3.5;6.;7.|] </code></pre> <p>hell...
7,810,136
0
<p>Events are raised, delegates are called. So when the button is clicked, a <code>buttonClick</code> event is raised, meaning that each delegate subscribed to the event will be called, according to the subscription order.</p>
2,156,746
0
JavaScript regular expressions - match a series of hexadecimal numbers <p>Greetings JavaScript and regular expression gurus,</p> <p>I want to return all matches in an input string that are 6-digit hexadecimal numbers with any amount of white space in between. For example, "333333 e1e1e1 f4f435" should return an array:<...
29,659,414
0
<p>No there are no operators built-in to the language specifically for generating sequences, but you can re-purpose some existing methods for sequence generation. </p> <p>For example:</p> <pre><code>[...Array(5)].map((x, y) =&gt; y*2); // Array [ 0, 2, 4, 6, 8 ] </code></pre>
25,529,862
0
<p>Your glob for your watch seems to be wrong. Try this:</p> <pre><code>gulp.watch(['app/scripts/**/*.js', '!app/scripts/dist.js'], ['scripts']).on('change', function(evt) { changeEvent(evt); }); </code></pre> <p>Use the exclude pattern for your <code>dist.js</code> to avoid an infinite loop.</p> <p>Ciao Ralf</p>
7,437,849
0
<p>Maybe they (the authors) didn't mean for you to try to compile that code, but just to understand the example and maybe implement it yourself.</p>
3,441,200
0
Change management in WordPress <p>I have a beginner question. What is the best way to address the change management issues in WordPress? I have an all-pages WordPress installation. Suppose name of some event or an entity changes from A to B, then I have to go to all the pages to make that change. Is there any better wa...
29,720,401
0
<p>Try using local storage in JavaScript. To store a string:</p> <pre><code>localStorage.setItem('Name of Value', JSON.stringify("Your String")); </code></pre> <p>To retrieve string:</p> <pre><code>var retrievedObject = JSON.parse(localStorage.getItem('Name of Value')); </code></pre>
8,651,613
0
<p>Use <code>.Distinct()</code>. Since you can't use the default comparer, you can implement one like this</p> <pre><code>class MyEqualityComparer : IEqualityComparer&lt;Comment&gt; { public bool Equals(Comment x, Comment y) { return x.Sender.Equals(y.Sender); } public int GetHashCode(Comment obj) { return obj.Sender....
10,441,434
0
<p>You haven't exactly defined how you want to use diagonal lines so you will have to write the final function as you need it, i suppose taking the path with shortest length of those that use diagonals, noting that path from a>c is shorter than path a>b>c for a,b,c in path</p> <pre><code>grid = [[False]*16 for i in ra...
5,124,407
0
<p>You would have to create your own custom <code>DialogPreference</code> for this in Java. There is no way to accomplish it through the preference XML.</p>
1,961,863
0
Why does Ruby require .call for Proc invocation? <p>I just wondered whether there is any good reason for or even an advantage in having to invoke <code>Proc</code>s using <code>proc.call(args)</code> in Ruby, which makes higher-order function syntax much more verbose and less intuitive.</p> <p>Why not just <code>proc(a...
31,711,728
0
<p>You can just use a Dart script for your settings. No point in using a different format if there is no specific reason. With a simple import you have it available in a typed way. </p>
15,274,285
0
<p>Why are you doing that, just append an image.</p> <pre><code>$("#target").append("&lt;img src='img.jpg' /&gt;"); </code></pre> <p>other way</p> <pre><code>$('&lt;img/&gt;', { src: 'img.jpg' }).appendTo("#target"); </code></pre>
23,329,738
0
<p>Vinai published a great writeup on Magento and Composer <a href="http://magebase.com/magento-tutorials/composer-with-magento/" rel="nofollow noreferrer">here</a>. </p> <p>Quoting from there</p> <blockquote> <p>Composer will use packagist.org to look where to get the libraries. Because Magento modules aren’t listed ...
10,896,509
0
<p>Sorry, I didn't understand the question exactly then.</p> <p>If you want to embed .swf files using javascript, I'd recommend you to use swfobject.</p> <p>I made an example here:</p> <p><a href="http://jsfiddle.net/ZGGCj/" rel="nofollow">http://jsfiddle.net/ZGGCj/</a></p> <p>swfobject is documented pretty well here:...
29,342,421
0
<p>You can try the regex <code>\b$</code> which ensures there's a match where a 'word' ends, and replace with <code> - digit</code> (or <code>\b(\n|$)</code> with a replacement of <code> - digit$1</code> if you don't want to use multiline)</p> <p><a href="https://regex101.com/r/kZ1gX6/1" rel="nofollow">regex101 demo</...
380,986
0
<p><a href="http://nerds.palmdrive.net/useragent/code.html" rel="nofollow noreferrer" title="User-Agent detection: The Code">User-Agent detection</a> code is quite old (stops at IE6) but should be easily extended. Should be combined with R. Gagnon code pointed by Filip, for better detection of real browser (some brows...
22,047,607
0
Github: "This email will not be used for commit blame" <p>How can I use a fake email address with Github?</p> <p>Following <a href="http://wayback.archive.org/web/20130124033702/https://help.github.com/articles/keeping-your-email-address-private">Github's since-changed instructions</a>, I had a fake email like user@ser...
22,300,705
0
<p>You can edit output name from <code>netbeans</code> project</p> <blockquote> <ol> <li>Right click on Library in netbeans</li> <li>Open Properties</li> <li>Build->Archiver->Output. At the end you will see name of lib (SomeName.a)</li> <li>Change it to suiltable name you need. </li> <li>Rebuild Project. You are good ...
38,484,119
0
<p>Like Sinan said, you need to give the form a width and height to match the image size. </p> <p>I think you can take Sinan's code and combine it with this to expand the form's width and height to match the image size.</p> <p>Let's say your image size is 1024x768, then:</p> <pre><code>form { display: block; margin: 0...
14,912,924
0
identify a solid pattern to abstract a network layer to allow testability <p>I've read various questions here on the argument like</p> <p><a href="http://stackoverflow.com/questions/741981/how-do-you-unit-test-a-tcp-server-is-it-even-worth-it">How do you unit-test a TCP Server? Is it even worth it?</a></p> <p>and other...
22,929,141
0
<p>The offending character here is “|” U+007C VERTICAL LINE, used by Google as a separator between font names; that’s a poor choice by them, since “|” is a reserved character, both by the <a href="http://url.spec.whatwg.org">“URL Living Standard”</a> (which is what the HTML5 CR cites) and by the Internet-standard STD ...
13,065,841
0
25,522,969
0
<p>null and [] are both false, a shorter and cleaner way</p> <pre><code>ng-show="myData.Address" </code></pre>
36,840,150
0
<p>Hide the button that appears inside the chart</p> <pre><code>chart: { resetZoomButton: { theme: { display: 'none' } } } </code></pre> <p>then use your own button:</p> <pre><code>$('#button2').click(function(){ chart.xAxis[0].setExtremes(Date.UTC(1970, 5, 9), Date.UTC(1971, 10, 9)); }); </code></pre> <p><a href="htt...
11,965,812
0
<p>You don't need to split anything, simply loop:</p> <pre><code>$.getJSON('data/data.json', function (ids) { for (var i = 0; i &lt; ids.length; i++) { var id = ids[i]; console.log(id); } }); </code></pre> <p>jQuery will automatically parse the string returned from the server as a javascript array so that you could di...
36,411,200
0
<p>If using ASP.NET (this includes MVC and Web API, Web Forms, etc) and AutoFac you should register all your components using the extension method <code>.InstancePerRequest()</code>. The only exception is for components that are thread safe and where you do not have to worry about errors/unexpected results occurring f...
14,483,471
0
<p>The wildcard * has to be interpreted by the SHELL. When you run subprocess.call, by default it doesn't load a shell, but you can give it <code>shell=True</code> as an argument:</p> <pre><code>subprocess.call("mock *.src.rpm".split(), shell=True) </code></pre>
27,302,366
0
<p>What you are looking for is <code>UINavigationControllerDelegate</code>.</p> <p>I believe the method that gives you the message you need is </p> <pre><code>- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated; <...
20,177,846
0
<p>The book xUnit Test Patterns offers a lot of great insights into this very question. </p>
4,827,507
0
<p>Did you change the SDK location? That may cause this issue.<br> If possible please post exact error message.</p>
40,266,033
0
<p>The system defined <code>&amp;&amp;</code> operator only supports boolean operands. The <code>&amp;</code> operator will work for enums (because it also works on all integer types, which the enums are based on). Of course, if you want an enum that represents the combination of two flag values then you'll want to OR...
12,062,096
0
SQL Connection String for another pc <p>I developed an application. It loads sql database on my pc with this connection string:</p> <pre><code>Data Source=.\SQLEXPRESS;AttachDbFilename=D:\Database\Books.mdf;Integrated Security=True;User Instance=True private void Window_Loaded(object sender, RoutedEventArgs e) { DataSe...
37,159,943
0
How to perform heroku-like deployment on shared hosting? <p>For our production server we use shared hosting. Until now, we were using FTP system to manually upload changes.</p> <p>I am looking for a technique that lets me use git to push only changes from development to production server. </p> <p>For my private project...
16,977,873
0
FrameLayout click event is not firing <p>I have used Framelayour for click event and It was working fine before 2 days but don't know wat happend now it is not working. <br> Please someone help me. <bR> My code is as below : <strong>Design :</strong></p> <pre><code>&lt;FrameLayout android:id="@+id/flWebpre" android:lay...
5,442,611
0
<p>Try to read this articles:</p> <p><a href="http://www.devx.com/getHelpOn/Article/10202/1954" rel="nofollow">Use RTTI for Dynamic Type Identification</a></p> <p><a href="http://en.wikibooks.org/wiki/C++_Programming/RTTI" rel="nofollow">C++ Programming/RTTI</a></p> <p><a href="http://en.wikipedia.org/wiki/Run-time_ty...
1,689,879
0
<p>You can use a timout in Javascript or maybe the <a href="http://plugins.jquery.com/project/timers" rel="nofollow noreferrer">timer plugin</a> from jQuery. This will allow you to create a function that removes teh message after a period of time. I haven't used the timer plugin myself but it seems pretty stable.</p> ...
16,687,633
0
<p>You can also try this code, applies for other file extensions too.</p> <pre><code>string ftpUrl = "ftp://server//foldername/fileName.ext"; string fileToUploaded = "c:/fileName.ext"; FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpUrl); request.Proxy = new WebProxy(); //-----Proxy bypassing(The requested...
35,069,582
0
Why google doesnt index my single page app properly? <p>Since some time google <a href="https://developers.google.com/webmasters/ajax-crawling/docs/learn-more" rel="nofollow">officially depreceated ajax crawling scheme</a> they came up with back in 2009 so I decided to get rid of generating snapshots in phantomJS for _...
7,919,538
0
<ol> <li>you need to check the result from <code>[Model alloc] init]</code>, make sure value is not nil.</li> <li>check your property <code>model</code> of the cell, make sure it's not assign.</li> <li>if still the <code>model</code> of <code>cell</code> is nil, please posts more codes here. </li> </ol>
19,519,833
0
<p>In ARC assign it would be released anywhere. For pointer variable "strong" only more comfortable. I modified the code in .h file by below line</p> <p>@property (nonatomic, strong) NSString *username;</p> <p>Thanks Tamilarasan</p>
40,517,134
0
CPython multiprocess fork failing with gdb/lldb attached on OS X <p>Trying to run the following code in CPython 2.7.12 with either gdb or lldb attached fails:</p> <pre><code>import multiprocessing as mp mp.Manager() </code></pre> <p>The debugger sees something like:</p> <pre><code>$ lldb -f python (lldb) target create ...
32,308,650
0
<p>Likely, with iOS8, the path that you have saved won't be valid across launches. </p> <p>The solution is to save the filename and not the complete path, and to recreate the URL or complete path, by getting the path to the Documents (or tmp) folder and appending the filename to it.</p>
36,967,891
0
<p>There are two main problems with your code:</p> <ol> <li>Enable HTML 5 mode for <a href="https://docs.angularjs.org/api/ng/provider/$locationProvider" rel="nofollow">pushState via $locationProvider</a> for URLs like <code>/dashboard</code> and <code>/page_3</code></li> <li>Fix the problem where route is configured ...
14,775,851
0
<p>I'm using JavaFX's WebPane at the moment. That's fine for my needs. Close?</p>
21,100,155
0
<p>You need to make this operation optional if <code>value</code> is empty:</p> <pre><code> if value: data.append((next(value), value)) </code></pre> <p>This change works for me:</p> <pre><code>if value: try: data.append(next(value), value) except StopIteration: pass </code></pre>
3,454,578
0
Need a way to pick a common bit in two bitmasks at random <p>Imagine two bitmasks, I'll just use 8 bits for simplicity:</p> <pre><code>01101010 10111011 </code></pre> <p>The 2nd, 4th, and 6th bits are both 1. I want to pick one of those common "on" bits at random. But I want to do this in O(1).</p> <p>The only way I've...
28,205,392
0
<p>Thanks to himmet-avsar!</p> <p>The filter can specified simply by using handlebars.</p> <pre><code>&lt;td ng-repeat="cell in structure" ng-bind="row[cell.key] | {{cell.filter}}: row[cell.rgmnt]"&gt;&lt;/td&gt; </code></pre> <p>But, this assumes that the filter property is always specified. You can use another filte...
13,197,498
0
<p>This worked perfect for me:</p> <pre><code>#import &lt;SystemConfiguration/CaptiveNetwork.h&gt; CFArrayRef myArray = CNCopySupportedInterfaces(); CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0)); // NSLog(@"SSID: %@",CFDictionaryGetValue(myDict, kCNNetworkInfoKeySSID)); NSString...
40,641,967
0
Parallax Background in div of Content <p>Is it possible to create a parallax background inside a div that has a certain width? Every tutorial I've seen has parallax backgrounds on full screen websites. My site is not full screen width, but I would still like to use the parallax effect within the content of my site. Obv...
34,438,117
0
<h2>AST</h2> <p>To avoid any chance of error in code manipulation using an <a href="https://en.wikipedia.org/wiki/Abstract_syntax_tree" rel="nofollow">Abstract Syntax Tree (AST)</a> type solution is best. One example implementation is in <a href="https://github.com/mishoo/UglifyJS2" rel="nofollow">UglifyJS2</a> which ...
21,588,596
0
<p>Try this:</p> <pre><code>tt &lt;- c(0, 1, 2, 3, 4, 5, 1, 2, 3, 4, 1, 2, 3, 4, 5) grp &lt;- cumsum(c(FALSE, diff(tt) &lt; 0)) </code></pre> <p>which gives:</p> <pre><code>&gt; grp [1] 0 0 0 0 0 0 1 1 1 1 2 2 2 2 2 </code></pre>
5,189,326
0
<p>My problem was I was passing along the same old listAccts to the array list, without saying "new". Even when I did say "new" i was passing along the accounts inside of listAccts, so the arraylist would be new, but the accounts inside of the new array list would be the ones I wanted to have backups of. What I had to...
33,305,397
0
<p>Assuming you want to copy the values of the previous block when add button is clicked, you can do this:</p> <pre><code>$scope.cloneItem = function() { var food = $scope.foods[$scope.foods.length - 1]; var itemToClone = { "selectproduct": food.selectproduct, "Quantity1": food.Quantity1, "Quantity2": food.Quantity2 }...
28,791,950
0
<p>You are reading the list wrong; <a href="https://docs.python.org/2/library/stdtypes.html#file.readline" rel="nofollow"><code>readline</code></a> does not take the line number, but the <strong>maximum number of characters per line</strong>:</p> <blockquote> <p><code>file.readline([size])</code></p> <p>Read one entir...
2,739,196
0
Login fails after upgrade to ASP.net 4.0 from 3.5 <p>I cannot log in using any of the membership accounts using .net 4.0 version of the app. It fails like it's the wrong password, and FailedPasswordAttemptCount is incremented in my_aspnet_membership table. (I am using membership with mysql membership provider.)</p> <p>...
25,979,700
0
<p>PayPal is actually better than most in terms of enabling you to do testing. There's a complete testing sandbox solution (<a href="https://developer.paypal.com/webapps/developer/docs/classic/lifecycle/ug_sandbox/" rel="nofollow">support document</a>), and when adding/editing your REST API application, you can click ...
1,846,704
0
<p>"Clear" JavaScript:</p> <pre><code>&lt;script type="text/javascript"&gt; function myKeyPress(e){ var keynum; if(window.event) { // IE keynum = e.keyCode; } else if(e.which){ // Netscape/Firefox/Opera keynum = e.which; } alert(String.fromCharCode(keynum)); } &lt;/script&gt; &lt;form&gt; &lt;input type="text" onkeypr...
35,926,716
0
<p><code>express</code> is a module that can be used to create more than one application.</p> <pre><code>var ex = require('express') </code></pre> <p>puts this module into the variable <code>ex</code>. Once you have a reference to the module, you can use it to create application. Each module has its own API. According...
1,854,313
0
<p>nothing to do with jQuery, just this:</p> <pre><code>window.location.href = 'whatever.html'; </code></pre>
30,418,162
0
ADDing Django's Q() objects and get two exclusive JOIN ONs <p>So this is the scenario:</p> <pre><code>class Person(models.Model): ... class Aktion(models.Model): ... class Aktionsteilnahme(models.Model): person = models.ForeignKey(Person) aktion = models.ForeignKey(Aktion) </code></pre> <p>The problem now is, that I'm ...
16,118,745
0
<p>Welcome to the wonderful world of Event Dispatch Thread violation (and race conditions).</p> <p>Basically, you should never update (directly or indirectly) any UI component from any thread other then the EDT.</p> <p>Basically, when you update your <code>TableModel</code>, it is firing an event, which is been caught...
32,738,943
0
VB6 read barcode while program is running in background <p>i have a problem to make a program that can read Barcode. What i want to do is a program (maybe a service? i don't know) that can capture barcode from a barcode scanner while is running in background.</p> <p>I have found that i can check if is plugged in a spec...
40,810,615
0
<p>ok, I got it working consistently between the two accounts and the key was to set the UseMachineKeyStore flag.</p> <pre><code>private static RSACryptoServiceProvider CreateRsaCypher(string containerName = DefaultContainerName) { // Create the CspParameters object and set the key container // name used to store the ...
9,130,212
0
<p>I prefer to set <strong><a href="https://docs.djangoproject.com/en/1.3/ref/settings/#date-input-formats">DATE_INPUT_FORMATS</a></strong> in settings.py and then define the field like:</p> <pre><code>dob = forms.DateField(input_formats=settings.DATE_INPUT_FORMATS) </code></pre> <p>This more DRY than setting it on a ...
14,255,220
0
<p>You can try <a href="http://tumult.com/hype/" rel="nofollow">http://tumult.com/hype/</a> for creating interactive content for a wide range of devices. Also tell your client that almost nothing is available for every device imaginable ;-)</p>
6,444,612
0
<p><code>width, height = im.size</code></p> <p>According to the <a href="http://effbot.org/imagingbook/image.htm">documentation</a>.</p>
25,723,954
0
<p>Why not try wrapping your collection in an object (which acts as a service state) to allow binding to occur on the object, rather than by exposing functions. For example:</p> <pre><code>app.factory('healthService', function() { var state = { healths: [...] }; return { getState: function() { return state; }, updateH...
2,996,780
0
<p>The response from the SOAP interface is already parsed. The englighten() method returns an XML string. When you call it with SOAP, this response is wrapped within even more XML. The SOAP library already parses the outer SOAP XML and returns the result of the enlighten() method, which is also XML.</p>
16,122,623
0
<p>If you want to run asynchronous process programmatically go for it. That is, use the lower level functions.</p> <pre><code>(set-process-sentinel (start-process "pdflatex" "*async pdflatex*" "pdflatex" filename) (lambda (process event) (cond ((string-match-p "finished" event) (kill-buffer "*async pdflatex*")) ((stri...
17,957,443
0
<p>Well, for starters you'd have to avoid the client's navigation cache (often a back/forward doesn't actually pull the page back down).</p> <p>After that hurdle you can look at (ironically) using a session variable to store if it's been viewed [output] and only dump it to the page once.</p> <p>if that seems to much, ...
30,012,708
0
<p>for data transfer you can use the library Emmet</p> <p><a href="https://github.com/florent37/emmet" rel="nofollow">https://github.com/florent37/emmet</a></p> <p>We can imagine a protocol like this</p> <pre><code>public interface SmartphoneProtocole{ void getStringPreference(String key); void getBooleanPreference(St...
40,852,741
0
<p>@jon-m answer needs to be updated to reflect the latest changes to paperclip, in order for this to work needs to change to something like:</p> <pre><code>class Document has_attached_file :revision def revision_contents(path = 'tmp/tmp.any') revision.copy_to_local_file :original, path File.open(path).read end end </...
5,415,236
0
<p>You can delete the files and/or directories prior to publishing like so:</p> <pre><code>&lt;RemoveDir Directories="$(MyDirectory)" Condition="Exists('$(TempDirectory)')" /&gt; &lt;Delete Files="$(MyFiles)" Condition="Exists('$(MyFiles)')" /&gt; </code></pre>
23,446,627
0
<p>I did it. Thanks for your help</p> <pre><code> declare @name varchar(100) set @name='Sharma,Ravi,K' select CASE WHEN CHARINDEX(' ',REPLACE(@name,',',' '), CHARINDEX(' ',REPLACE(@name,',',' ')) + 1) &gt;0 THEN SUBSTRING(REPLACE(@name,',',' '), CHARINDEX(' ',REPLACE(@name,',',' ')) + 1,(LEN(@name)-CHARINDEX(' ',REVER...
4,170,290
0
jQuery Templates and Razor? <p>Can someone shed some light on how these compare/complement each other in the context of an ASP.NET MVC application? </p>
35,225,955
0
Overlap of labels for MarkerWithLabel on custom marker on Google Maps <p>I initially used an InfoBox to create a label for a marker with a custom icon. For the scenario of overlapping markers, the labels became illegible and so I had to look for a solution or alternative. </p> <p>It was suggested in a <a href="http://s...
1,267,031
0
What does fragmented memory look like? <p>I have a mobile application that is suffering from slow-down over time. My hunch, (In part fed by <a href="http://developer.sonyericsson.com/site/global/techsupport/tipstrickscode/java/p_avoidingmemoryfragment.jsp" rel="nofollow noreferrer">this article</a>,) is that this is du...
10,794,632
0
List Sorted incorrectly <p>i have following code </p> <pre><code>List&lt;TimeZoneInfo&gt; timeZoneList = new List&lt;TimeZoneInfo&gt;(TimeZoneInfo.GetSystemTimeZones()); timeZoneList.Sort((item1, item2) =&gt; { return string.Compare(item2.Id, item1.Id); }); </code></pre> <p>but it does not sort the list correctly. (usi...
2,598,329
0
<p>They are buffered, but I don't know on what level or what the limit is.</p> <p><a href="http://tangentsoft.net/wskfaq/" rel="nofollow noreferrer">http://tangentsoft.net/wskfaq/</a> is a great resource you might find useful for any winsock related issue.</p>
39,122,445
0
<p>Constructor taking classes to register refreshes context internally - try to set class and refresh manually after setting parent context.</p> <pre><code>private void createChildContext() { final AnnotationConfigEmbeddedWebApplicationContext childContext = new AnnotationConfigEmbeddedWebApplicationContext(); childCo...
16,456,194
0
<p>You may have to use a callback here</p> <pre><code>var list = document.getElementById('SomeList'); var items = list.getElementsByTagName('li'); var i = 0; var myFunction1 = function() { if ( i &lt; items.length ) { // Do some code with items[i] i++; setTimeout(myFunction1, 1500); } else { // No more elements return...
15,863,381
0
django formset - not able to update entries <p>I want to update a formset that can have different entries. I will able to present the formset pre populated with the correct data, however I'm doing something wrong since it does not update but creates a new instance..</p> <p>I'm seen <strong>inlineformset_factory</strong...
40,025,364
0
Cannot perform LINQ complex object search in Entity Framework <p>I have entities in the DB which each contain a list of key value pairs as metadata. I want to return a list of object by matching on specified items in the metadata.</p> <p>Ie if objects can have metadata of KeyOne, KeyTwo and KeyThree, I want to be able ...
37,687,231
0
Java jersey validation <p>I'm using the validation in Java Jersey, and i'm building an application where it should be possible to save a draft of something. But before it is published, i would like it to be valid, using the annotations in the view model. When publishing, the same savemethod, for draft, is invoked. Ther...
24,696,399
0
<p>Did you try:</p> <pre><code>&lt;base target="_parent" /&gt; </code></pre> <p>?</p>
604,885
0
<p>Just check to see if the ID passed to the controller methods is an integer.</p> <pre><code>if params[:id].is_a?(Integer) @user = User.find params[:id] else @user = User.find_by_login params[:id] </code></pre> <p>No need to add special routes.</p>
25,439,091
0
Java matrix library using direct memory access <p>Are there any matrix libraries for Java/Scala that wrap blas/lapack and that use direct memory access, either ByteBuffers or unsafe.getFloat access? It seems like this approach would avoid all the copying of arrays that occurs when crossing the JNI boundary. </p>
4,619,620
0
<p>you can certainly do block selection by hold down the Alt key while doing a selection</p>
15,267,182
0
Trigger Disable User <p>I have a problem and question. The SQL trigger in my SQL Server has been disabled. And I want to learn who disable this triger. Is there any way to get username who disable MSSQL trigger? By SQL query or like that? Regards.</p>
19,521,497
0
Convert google map url to coordinates <p>I want to convert this google map url "http//maps.google.com/maps?f=q&amp;q=14.674518%2C120.549043&amp;z=16" to just value of latitude and longitude.</p> <p>Here's my code:</p> <pre><code>$string='http://maps.google.com/maps?f=q&amp;q=14.674518%2C120.549043&amp;z=16'; $regex=' ,...