pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
14,790,223
0
<p>You almost get the answer from <strong>Matthew</strong>, all you need to do is to add cast :</p> <pre><code>Select CAST(SUM(timediff(timeOut, timeIn)) as time) as totalhours FROM volHours WHERE username = 'skolcz' </code></pre>
24,761,177
0
<p>That's not gonna work. What I would do is creating a block in layout that should contain boxes and then embed the boxes in page1.twig and page2.twig.</p> <p>The embed tag works exactly like include with added benefit of allow extending the blocks defined in the embedded template. What you get after embedding doesn'...
34,952,550
0
Boost Spirit Qi : Is it suitable language/tool to analyse/cut a "multiline" data file? <p>I want to apply various operations to data files : algebra of sets, statistics, reporting, changes. But the format of the files is far from code examples and a bit weird. There are differents sorts of items, items type, and some o...
2,601,346
0
<p><a href="http://hsqldb.org/web/hsqlFeatures.html" rel="nofollow noreferrer">HSQL</a> also provides support for interpreting csv files as <code>ResultSet</code>s.</p>
24,099,151
0
<p><a href="http://swift-lang.org/tryswift/" rel="nofollow">http://swift-lang.org/tryswift/</a> doesn't look like it's anything to do with Apple Swift. The "try Swift" page you're using is for <a href="https://en.wikipedia.org/wiki/Swift_%28parallel_scripting_language%29" rel="nofollow">Swift</a>, not <a href="https:/...
13,219,045
0
<p>Whether or no a thread can process a timer callback within its own context depends entirely on how the timer expiry can be communicated to the thread. The thread must call the callback itself upon the receipt of some inter-thread comms, (eg. a WM_TIMER message received by a Windows GUI thread when it is waiting on ...
2,239,266
0
Unit Testing Machine Learning Code <p>I am writing a fairly complicated machine learning program for my thesis in computer vision. It's working fairly well, but I need to keep trying out new things out and adding new functionality. This is problematic because I sometimes introduce bugs when I am extending the code or t...
35,875,484
0
ember adapter url - find by id pattern - nested api resources <p>I've got an api with specific url structure. How do I pass the ID to the url string using an adapter or something? There's only one model, <code>patient</code> but I need to query each of these items plus more. I've seen where you can place the id at the ...
16,468,270
0
<p>In Scala, a <code>List</code> is of immutable length. It can work like a <code>LIFO</code> (last in, first out) structure, but it cannot behave like a Java <code>ArrayList</code>.</p> <p>You are doing this:</p> <pre><code>val lst = List[Int]() </code></pre> <p>which gives your <code>lst</code> a size of <code>0</co...
38,799,961
0
<p>I recommend this. If you have a emulator preview connected first go inside Android Wear app to the emulator and choose FORGET.</p> <p>Later use the commands all are using</p> <pre><code>adb forward tcp:4444 localabstract:/adb-hub adb connect localhost:4444 </code></pre> <p>That work for me.</p>
40,584,251
0
Azure portal metrics weird numbers <p>I'm trying to view our peak bytes received/sec count for an eventhub in order to scale it properly. However, the portal is showing vastly different results from the "daily" view to the "hourly" view. This is the graph using the "hourly" view: <a href="https://i.stack.imgur.com/EU76...
2,452,979
0
<p>I assume that on page load, you are setting up var sncro=1; and when some data changes, you adjust this value. Here is the quick check:</p> <pre><code>window.onbeforeunload = function (evt) { if (sncro != 1) { var message = 'Are you sure you want to leave, cause there are some unsaved changes?'; if (typeof evt == '...
3,876,476
0
Unit Testing in .Net with Endeca Objects <p>Most or all of Endeca's objects have internal constructors. I'm working on a good project that lacks great test coverage around the Endeca API, are there any good strategies to unit testing the interactions with Endeca?</p> <p>So far the best we have is kind of a poor man's a...
28,882,718
0
<p>To get the next object, first filter to get all objects with a higher priority:</p> <pre><code>objects = MyObjects.objects.filter(priority__gt=12) </code></pre> <p>then order the results by priority:</p> <pre><code>objects = objects.order_by('priority') </code></pre> <p>finally select the first item in the queryset...
12,788,738
0
<p>The h values need to be adjusted for the three cases prior to calculating the cos values dependent on them. i.e.:</p> <pre><code> if(h&lt;(2.0f*pi/3.0f)){ y = in*( 1.0f + (s*cos(h) / cos(pi/3.0f-h)) ); b = x; r = y; g = z; }else if(h&lt;(4.0f*pi/3.0f)){//&amp;&amp;2pi/3&lt;=h h -= 2*pi/3; y = in*( 1.0f + (s*cos(h) ...
17,434,988
0
<p>In your .htaccess, add the following for each type of file type:</p> <p><code>AddType application/zip .zip</code></p> <p>See: <a href="http://www.htaccess-guide.com/adding-mime-types/" rel="nofollow">http://www.htaccess-guide.com/adding-mime-types/</a> </p>
17,126,869
0
<p>Following on @Arun's comment, you can easily create a single data frame with another column indicating the party in question: </p> <pre><code>A = read.table(text="item Alice Bob apples 3 7 pears 1 2 cookies 10 4 grapes 238 483 watermelon 0 1", header=T) B = read.table(text="item Alice Bob grapes 13 26", header=T) C...
4,842,429
0
<p>You (probably) can't communicate in a <em>cross-platform</em> (and cross-browser) way from a web client to a local process, in any other way than you could with a web service.</p> <p>In other words, I think your main idea is the way to go - set up a local HTTP server that will serve the client, and then have that p...
780,863
0
<p>The <a href="http://nhibernate.info" rel="nofollow noreferrer">nhibernate.info</a> website has lot of docs.</p>
35,179,719
0
<p>you need both <code>hidden.bs.collapse</code> and <code>shown.bs.collapse</code></p> <pre><code>$(document).ready(function() { function toggleChevron(e) { $(e.target) .prev('.panel-heading') .find("i") .toggleClass('fa-question fa-angle-up'); } $('#accordion').on('hidden.bs.collapse shown.bs.collapse', toggleChevro...
16,732,621
0
JSON Mapping in my Spring MVC 3.2 Application Works for Only One of My Methods <p>I am working on a Spring 3.2 MVC application. It's setup fairly typically, but my problem is that I am getting a 406 status error when I attempt to return a JSON object from my controller methods. </p> <p>The frustrating part is that I ge...
21,991,956
0
<p>In your case, we decided to expose our web app functionality as web services, because of:</p> <ul> <li>The client code is easily generated by your favorite WS library</li> <li>The server code is just an annotated POJO and every stub is generated by the same library (say you can choose CXF for both things but there ...
15,538,626
0
add column dynamically to handsontable <p>I am trying to dynamically add a column to a handsontable. I don't see a sample anywhere nor o i see a method to do so in the API. Has anyone figured out a way to overcome this or have some sample code that I can look at that would help. </p> <p>Thank you.</p>
422,156
0
What would be a good framework to develop a web application for guitar software? <p>I would love to design a web application for a guitar tablature editor. There are a few desktop apps such as Guitar Pro and Tuxguitar that are great. They basically allow you to load a tablature file, and then the software allows you to...
35,649,112
0
<p>Since Android 6 there is a Backup API. See <a href="http://developer.android.com/training/backup/autosyncapi.html" rel="nofollow">http://developer.android.com/training/backup/autosyncapi.html</a></p>
15,088,343
0
<p><a href="http://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient.getstream.aspx" rel="nofollow">TcpClient.GetStream()</a> will throw an exception if the socket is not or no longer connected.</p> <p>Wrap the code in a try..catch block:</p> <pre><code>try { NetworkStream networkStream = clientSocket.GetS...
2,542,265
0
<p>Ari,</p> <p>A good reference to how to accomplish "invisible" instance variable declarations can <a href="http://cocoawithlove.com/2010/03/dynamic-ivars-solving-fragile-base.html" rel="nofollow noreferrer">be found here</a> with credit respectfully given to Matt Gallagher.</p> <p>Hope it helps, Frank</p>
40,379,264
0
How to cancel replica request through softlayer API <p>I have setup of replication, where i have source volume at one site &amp; replica at another site. Now i want to cancel the replica request through Softlayer python API.(not through portal) I have checked there are 2 services related to billing;</p> <pre><code>Soft...
7,055,612
0
functions in update panel <pre><code>&lt;asp:UpdatePanel ID="UpdatePanel10" runat="server"&gt; &lt;ContentTemplate&gt; &lt;center&gt; &lt;asp:GridView ID="gridInboxMessage" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="LinqDataSource1" OnSelectedIndexChanged="gridInboxM...
20,937,864
0
How to do an accent insensitive grep? <p>Is there a way to do an accent insensitive search using grep, preferably keeping the --color option ? By this I mean <code>grep --secret-accent-insensitive-option aei</code> would match àei but also äēì and possibly æi.</p> <p>I know I can use <code>iconv -t ASCII//TRANSLIT</cod...
16,599,481
0
<p>Since you want to update a part of the page you will need to use ajax to accomplish that. You have two options there:</p> <ol> <li><p>User @Ajax.ActionLink (<a href="http://stackoverflow.com/questions/7295835/how-can-i-load-partial-view-inside-the-view">How can i load Partial view inside the view</a>)</p></li> <li>...
40,578,500
0
<p>you can append text into slide item with images</p> <p>For example, slider item template:</p> <pre><code>&lt;div&gt;&lt;!-- slide 1 --&gt; &lt;img src=""&gt; &lt;p&gt;text&lt;/p&gt; &lt;/div&gt; &lt;div&gt;&lt;!-- slide 2 --&gt; &lt;img src=""&gt; &lt;p&gt;text2&lt;/p&gt; &lt;/div&gt; </code></pre> <p>See on fiddle...
36,921,291
0
<p>You're writing the updated document text to <code>StreamWriter sw</code> but then not doing anything with it. You are then setting the session variable to your original, unedited byte array <code>memoryStream</code> (which is presumably why you're returning a document with no changes).</p> <p>You need to convert <c...
22,185,121
0
Are @@variables in a Ruby on Rails controller specific to the users session, or are all users going to see the same value? <p>I have a controller in which there is a "viewless" action. That controller is used to set a variable called <code>@@ComputedData={}</code>. But the data is computed based on a csv file a user of...
1,750,786
0
In nHibernate, can I map an abstract base class to a collection? <p>I have a base class for content items in a CMS I'm building. It's currently marked abstract because I only want derived classes to be instantiated. Derived classes like BlogPost, Article, Photo, etc. are set up as a joined subclass to my ContentBase cl...
17,032,756
0
<p>With a layout as shown in the example and the range in Sheet1 named <code>array</code> <code>=VLOOKUP(A2,array,2,FALSE)</code> should show in ColumnC the value from the Sheet1 cell immediately to the right of the value as specified in <code>A2</code> (of Sheet2). The same formula in <code>D2</code> with <code>,2,</...
6,760,105
0
Does innodb_flush_method affects read operation? <p>If I set innodb_flush_method=O_DIRECT, will the read operation of innodb bypass the system cache? Thanks!</p>
4,534,018
0
Fluent Nhibernate fails during insert <p>I have problem using Fluent Nhibernate, I have following model. When I try to save Hotel with has new Geography I getting foreign key exception, looks like Nhibenate fails to save data in correct order, is it something I can correct via Fluent Nhibernate ?</p> <pre><code>public ...
38,577,055
0
Custom Control Initialization exception <p>I have a custom windows control that inherits from <code>Window</code> class which I am trying to use in my other project. I have overwritten the <code>OnInitialized()</code> method inside my custom window class. My problem is <code>base.OnInitialized();</code> line, that's wh...
25,659,084
0
<p>The thing is that character classes treat characters inside them as individual characters, unless when using a range. So, what:</p> <pre><code>[2, 3, 4, 5, 8, 9, 10, 18, 19] </code></pre> <p>Will match is: <code>2</code>, <code>,</code>, , <code>3</code>, <code>,</code> (again), [...], <code>1</code>, <code>9</code...
10,639,629
0
proper way to start and interface with a service and statusbar/notification <p>I have a broadcast receiver that works fine but now I want to send send notifications to status bar. Since BroadcastReceiver cannot do it directly it looks like I need to create a service to do that for me correct?</p> <p>So I created a serv...
35,238,331
0
RegEx for css class name <p>I want to have a class <code>cX</code> where x is a number between 0 and 100. I could add <code>c0</code> to <code>c100</code> to my css. But well, I'd like to avoid that.</p> <p>I know there are ways to match element attributes like <code>h2[rel="external"]</code>. But is it also possible t...
1,987,518
0
<p>Your problem is thinking of the state as being all the permutations of what people can see. In general you should just be thinking of the state as the facts of the situation, and calculate individual views of those facts as they are needed.</p> <pre><code>// pseudocode - make it properly object oriented for best re...
17,535,954
0
<p>Have you tried setting up a TCP server on the device and then sending to the pc with the pc as a client?</p>
9,465,404
0
<p>Hope this helps</p> <pre><code>$url="http://www.gonzaga.edu/../../../../Files/ About/Images/300x200/baseball_panorama_hz.jpg" $url=str_replace('../','', $url); </code></pre>
30,602,857
0
<p>Move <code>ion-footer-bar</code> should be outside of <code>ion-content</code> will solve your issue.</p> <p><strong>Markup</strong></p> <pre><code>&lt;ion-popover-view&gt; &lt;ion-header-bar&gt; &lt;h1 class="title"&gt;Show Columns&lt;/h1&gt; &lt;/ion-header-bar&gt; &lt;ion-content&gt; ..content here &lt;/ion-cont...
1,404,833
0
<p>The answer suggested; [theTableView reload] definitely works fine. If you update the table every view seconds, however, your users will going to hate you and down-vote your app. No question.</p> <p>Try to capture the reloading data in a notification handler. In that handler, check if the updated data belongs somewh...
40,229,606
0
<p>I believe it's because you've written <code>#dialogmodal</code> when you meant to write <code>#dialog-modal</code> on the second line of your JS code.</p>
23,146,775
0
Unity Bootstrapper (Unity.Mvc), Unity 3, MVC 5, EF6 Receiving Error: Parameterless Public Constructor on Controller <p>Ok, after searching Google, here and several ASP/MVC forums I am bound to have to ask what the hell I am doing wrong here.</p> <p>I have a good start to my application, an ok understanding of DI, IoC a...
11,429,995
0
what is difference between creating webservice in http and https <p>I am working on creating rest service in java using Jersey. I am new at this, so I am a bit confused about what is the difference between creating services in http and https.</p> <p>Do we need to take care of creating services. Please guide properly.</...
22,235,021
1
How to avoid Pylint warnings for constructor of inherited class in Python 3? <p>In Python 3, I have the following code:</p> <pre><code>class A: def __init__(self): pass class B(A): def __init__(self): super().__init__() </code></pre> <p>This yields the Pylint warning:</p> <blockquote> <ul> <li>Old-style class defined. ...
26,863,454
0
<p>Bootstrap datepicker (the first result from bootstrap datepickcer search) has a method to get the selected date.<br> <a href="http://bootstrap-datepicker.readthedocs.org/en/release/methods.html#getdate">http://bootstrap-datepicker.readthedocs.org/en/release/methods.html#getdate</a> </p> <p>getDate:<br> Returns a lo...
31,355,478
0
<p>If you need to do AJAX request, turn-off the <strong>VerifyCsrfToken</strong> middleware on your <strong>Kernel.php</strong> file.</p> <p>You can also edit your <strong>VerifyCsrfToken.php</strong> middleware file to exclude certain URLs like this way:</p> <p><code>/** * The URIs that should be excluded from CSRF v...
37,400,766
0
<p>I sort of experienced the same problem and it let me to this SO post. I got sporadic SIGPIPE signals causing crashes of my fastcgi C program run by nginx. I tried to <code>signal(SIGPIPE, SIG_IGN);</code> without luck, it kept crashing.</p> <p>The reason was that nginx's temp dir had a permission problem. Fixing th...
8,134,485
0
is IBM MQ Message Segmentation possible using JMS? <p>Is it possible to implement message segmentation using JMS as it is in using Native IBM API as <a href="http://www-01.ibm.com/support/docview.wss?uid=swg21405730" rel="nofollow">shown here</a>. One posible solution I have read is message grouping for JMS. is anyone ...
4,720,366
0
<p>In the shell, use db.collection.stats(). If a collection is capped:</p> <pre><code>&gt; db.my_collection.stats()["capped"] 1 </code></pre> <p>If a collection is not capped, the "capped" key will not be present.</p> <p>Below are example results from stats() for a capped collection:</p> <pre><code>&gt; db.my_coll.sta...
27,029,136
0
Spring security ldap connection management <p>I am using spring security to authenticate users logging into a webapp. Authentication is currently done with ldap.</p> <p>Between my webapp and my ldap server lies a firewall. After 50 minutes of inactivity, the firewall flushes idle ldap connections.</p> <p>Spring securit...
34,179,719
0
<p>I came up with a similar solution, here's the general gist. (I've got a working example at the bottom too)</p> <pre><code>var year = [], yearWatch = 2015; Year[2015] = ["Jan", "Feb", "Sep", "Dec"]; Year[2016] = ["Apr", "May", "Oct", "Nov"]; disableFromVar = function() { $('#txtCalendar .month').removeClass('disable...
33,974,711
0
<p>Your thinking too hard, you should take it simple when programming. You don't need the type when calling a method, only do this when you declare it.</p>
10,793,101
0
<p>In the "Guide to Active Record Associations", I recommend reading section 2.8: Choosing Between has_many :through and has_and_belongs_to_many</p> <blockquote> <p>The simplest rule of thumb is that you should set up a has_many :through relationship if you need to work with the relationship model as an independent en...
24,467,231
0
friend url on wildcard subdomains htacces, not working <p>i have wildcard subdomains sets already and works fine, now i wish have friends url for the content in thats subdomains, the structure of my site is if the user type subdomain.maindomain.com and the .htaccess redirect to </p> <pre><code>blogs/index.php?user=subd...
22,030,053
0
<p>The problem is that your <code>ORDER BY</code> clause is not in the correct place in the query. It should be after the closing bracket that closes the WHERE clause:</p> <pre><code>CONSTRUCT { ?s ?p ?o } WHERE { GRAPH ?g { ?s ?p ?o } ?s &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://lod.isi.edu/o...
7,971,178
0
find out if text of JLabel exceeds label size <p>In Java when the text of the JLabel could not be displayed due to lack of space the text is truncated and "..." is added in the end.</p> <p>How can I easily find out if currently JLabel displays full text or the truncated?</p> <hr> <p>EDIT:</p> <p>I see that there is a w...
39,472,199
0
<pre><code>Banner.frame = CGRect(x:0.0, y:self.view.frame.size.height - Banner.frame.size.height, width:Banner.frame.size.width, height:Banner.frame.size.height) </code></pre>
30,093,039
0
<p>No need to join, use <code>LAG</code> function to track previous.<br> If you would like to know about Lag function. Please visit below link. <a href="http://www.techonthenet.com/oracle/functions/lag.php" rel="nofollow noreferrer">http://www.techonthenet.com/oracle/functions/lag.php</a>. I have taken below as input....
3,594,733
0
<p>The answer is correct in a certain context, for simple select statements over a DB link, you'll get this error:</p> <blockquote> <p><strong>ORA-22992</strong>: cannot use LOB locators selected from remote tables.</p> </blockquote> <p>From the errors manual:</p> <blockquote> <p><strong>Cause</strong>: A remote LOB c...
23,129,832
0
Find command not working <pre><code>find . ! -name . -prune -name "*.dat" -type f -cmin +60 </code></pre> <p>The command is working in one directory but not in another directory even if the <code>.dat</code> files are there in both directories. Also, this command is working with other file extensions in both directorie...
22,823,794
0
How do you close JOptionPane after a radiobutton has been selected? <p>I am new to programming and just started last week, so all the java mumbojumbo is quite confusing to me. I was able to create a option pane for my BMI program that asks which unit system(metric/imperial) with radiobuttons and this determines which c...
22,093,549
0
Can I download extension from my existing opencart website <p>Sorry if my question is not good.</p> <p><strong>Question :</strong> I install revolution slider extension in my opencart website. Now I need that slider in an other website of opencart. Can I download that slider extension from my existing website.</p> <p><...
22,289,419
0
<pre><code>SELECT name, location, SUM(total_points) AS total_points FROM ( SELECT name, location, COALESCE(SUM(points), 0) AS total_points FROM players p LEFT JOIN games g ON p.name = g.player GROUP BY name, location UNION ALL SELECT name, location, COALESCE(SUM(points2), 0) FROM players p LEFT JOIN games g ON p.name ...
23,811,305
0
<p>you can use <a href="http://www.cplusplus.com/reference/algorithm/replace/" rel="nofollow"><code>std::replace</code></a> </p> <pre><code>std::replace (test.begin(), test.end(), "bird", "book"); </code></pre>
30,081,195
0
running NN software with my own data <p>New with Matlab.</p> <p>When I try to load my own date using the NN pattern recognition app window, I can load the source data, but not the target (it is never on the drop down list). Both source and target are in the same directory. Source is 5000 observations with 400 vars per ...
35,285,501
0
Mouse Leaving the window alert Pop-Up--Moodle <p>I have developed an online exam using the Moodle software which is written in PHP. Now I want to restrict the person who is taking the test without being able to navigate to other tabs or other windows by generating a mouserover pop-up.</p> <p>Following is the I have a c...
4,387,695
0
Getting equal symbol expected while using jstl <p>I am getting </p> <blockquote> <p>org.apache.jasper.JasperException: /WEB-INF/AllClientBatchDetails.jsp(54,103) equal symbol expected</p> </blockquote> <p>And here is the jsp</p> <pre><code>&lt;%@ page contentType="text/html;charset=UTF-8" language="java" import="java.u...
7,407,194
0
<p>This loops through all items of an ASP combobox:</p> <pre><code>DataTable dt = (DataTable)comboBox1.DataSource; for(int i = 0; i &lt; dt.Rows.Count; ++i) { string displayText = dt.Rows[i][comboBox1.DisplayMember].ToString(); string valueItem = dt.Rows[i][comboBox1.ValueMember].ToString(); } </code></pre>
14,235,394
0
Bluetooth connection with Android <p>In my App I need to connect a smartphone with an 4.0 low power Bluetooth-module. Then the module sends frequenly data to the phone.</p> <ul> <li>Do you know some good tutorials for programming Bluetooth connection with Android?</li> <li>Can you give me some links where the basics of...
35,637,885
0
<p>Hyperlink tag doesn't have a close tag <code>&lt;/a&gt;</code>, if you want to close it make it like this:</p> <pre><code>&lt;a target="_blank" href="http://url.com" style="text-decoration: underline; color: #000001;"&gt; Call To Action &lt;img src="image/path/triangle.png" border="0" /&gt; &lt;/a&gt; </code></pre>...
6,005,801
0
Setting up environment for C++/Boost libs (netbeans or eclipse) <p>I've followed so many tutorials now and I can't get this basic, fundamental thing right. I'm getting started with C++ and moving on from the standard intro stuff (after two books) and I'm working through "Beyond the C++ Standard Library ~ An Introductio...
18,156,020
0
<p>I'm not sure I understand fully what is happening in this scenario but here is a solution to your problem:</p> <pre><code>... casper.then(function() { casper.page.close(); casper.page = require('webpage').create(); }); casper.thenOpen('http://www.yahoo.com/', function(response) { this.wait(1000, function() { this.e...
33,575,749
0
<p>Maybe like that? </p> <pre><code>start1 &lt; end2 and start2 &lt; end1 </code></pre> <p>This means: each of the two words begins <em>earlier</em> than the other word ends, so they do overlap </p>
14,750,533
0
<p>I have tidied up your query a little (although this won't make a massive amount of difference to performance, and there may be typos as I don't have VS to hand). From your edit it seems you are a little confused by deferred execution in LINQ. <code>callDetailsForNodes</code> does not represent your results - it is ...
5,062,074
0
How can I capture and stream video from the iPhone's camera? <p>What's the best, most convenient, and most Apple-permitted way of streaming video from the iPhone's camera to a server on the Internet (or local network)?</p> <p>uStream, Qik, Justin.tv, etc.. Are all able to do it, but I'm finding very little love from my...
37,296,847
0
Type definitions for JavaScript libraries <p>I tried to convert a simple React project from JavaScript to TypeScript, but somehow this doesn't seem to work.</p> <p>First VSCode shows me sometimes that <code>react</code> isn't a module, even if I installed it with typings and added the <code>typings/index.d.ts</code> to...
20,786,199
0
<p>By keeping a circular buffer of runes, you can minimise allocations. Also note that reading a new key from a map returns the zero value (which for int is 0), which means the unknown key check in your code is redundant.</p> <pre><code>func Parse(text string, n int) map[string]int { chars := make([]rune, 2 * n) table...
23,920,228
0
<p>I found a solution that works, though I admit I am not sure exactly how it works. I added the line <code>context.Configuration.ProxyCreationEnabled = false;</code> to my method that returns the object collection and all my objects were returned. I got the code from the following <a href="http://stackoverflow.com/qu...
32,203,454
0
<p>Implement a custom <code>XmlResolver</code> and use it for reading the XML. By default, the <code>XmlUrlResolver</code> is used, which automatically downloads the resolved references.</p> <pre><code>public class CustomResolver : XmlUrlResolver { public override object GetEntity(Uri absoluteUri, string role, Type of...
35,090,925
0
<p>The code with completion block should like this:</p> <pre><code>func getSectionsFromData(completion: ([Sections]? -&gt; Void)){ var sectionsArray = [Sections]() let animals = Sections(title: "Animals", objects: ["Cats", "Dogs", "Birds", "Lions"]) Alamofire.request(.GET, url).validate().responseJSON { response in sw...
12,561,167
0
<blockquote> <p>When i click "Cook" it shows an alert "Error occurred [object Object]".</p> </blockquote> <p>The alert method can not display object structures, so you just get <code>[object Object]</code> in that debug attempt.</p> <p>Use <code>console.log(response.error)</code> instead, and then have a look into you...
16,822,378
0
<p>I didn't understand your question, do you want dynamic columns? If so, you can do that on the XMLP report or cross table in crystal... Using peopletools, you will have to write a HTML area</p>
28,987,529
0
How to make a ListView in Windows Phone 8.1 where i can put a handler in each item i choose <p>I'm trying to create a ListView in XAML file by this example:</p> <pre><code>&lt;ListView x:Name="listView1" SelectionChanged="ListView_SelectionChanged"&gt; &lt;x:String&gt;Item 1&lt;/x:String&gt; &lt;x:String&gt;Item 2&lt;/...
12,864,532
0
<p>Email address is accessible for the authenticated user as long as you request "r_emailaddress" permissions upon authorization.</p> <p>Take a look at the Oauth Login Dialog that's presented to the user to authorize the application. Notice how "email address" isn't presented as one of the profile fields that the appl...
12,684,381
0
<p><code>\</code> denotes the start of an escape sequence, so it has to be escaped with another <code>\</code>.</p> <p>To replace globally, you need to use regex, which requires even more character escaping:</p> <pre><code> &gt; 'C:/TEST/'.replace(/\//g, '\\') "C:\TEST\" </code></pre>
27,546,567
0
What in this code is causing a Seg fault? <p>I am very new to Assembly programming and to learn NASM I decided to try and write a prime number testing. I wrote the code for the <code>is_prime</code> function in 32-bit elf NASM and wrote a wrapper in c++ that uses externs the NASM function. When I compiled both programs...
3,655,236
0
<p>After trying all of the other solutions here without success, I skeptically tried the solution found in <a href="http://www.thescube.com/blog/chrome-background-colour-image-not-showing/" rel="nofollow noreferrer">this article</a>, and got it to work.</p> <p>Essentially, it boils down to removing <code>@charset "utf...
28,978,759
0
Length check in a handlebars.js {{#if}} conditional <p>Is there a way in <a href="http://handlebarsjs.com/" rel="nofollow">handlebars</a> JS to check length of a value? Something like this:</p> <pre><code>{{#if value.length &gt; 20} ..do something {{else}} ..do something {{/if}} </code></pre>
10,277,663
0
How to handle exception in wicket <p>my code:</p> <pre><code>try { LinkedDataForm form = webService.process(searchForm, path); add(new ExternalLink("url", form.getUrl(), form.getUrl())); } catch (Exception e) { add(new Label("error", e.getMessage())); } </code></pre> <p>where: </p> <pre><code>@SpringBean(name = "webSer...
11,571,834
0
How to remove duplicate users from a list but amalgamate their roles <p>Say I have a list of People who have a name and a list of roles:</p> <p>Each item in the list is of type PersonDetails:</p> <pre><code>public class PersonDetails { public int Id { get; set; } public string Name { get; set; } public List&lt;Role&gt;...
16,929,265
0
<p>You should just join tables <br></p> <pre><code>SELECT * FROM `affiliate_information` a_i LEFT JOIN `affiliate_tasks` a_t ON a_i.`username` = a_t.`username` WHERE a_i.`username` = 'SomeUsername' </code></pre>
20,131,926
0
<p>Here's a working example made from following <a href="https://developers.facebook.com/docs/plugins/like-button/" rel="nofollow">Facebooks developer guidelines for the Like button</a>. Place this right after the opening body tag: </p> <pre><code> &lt;div id="fb-root"&gt;&lt;/div&gt; &lt;script&gt;(function(d, s, id)...
23,091,328
0
cannot find javax.swing.JPanel <p>I'm a novice in java coding. Just downloaded the JDK 8 and Eclipse java ee ide.</p> <p>eclipse cannot find JPanel.</p> <p>the error says the JPanel has an access restriction. </p> <p>how do I fix this?</p> <p>here is my program</p> <pre><code>import java.awt.*; import java.awt.event.*;...