pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
30,256,865
0
<p>Unfortunately it is something related with a bad design of the class <code>InputStream</code>. If you use <a href="https://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html#read()" rel="nofollow">read()</a> you will have that problem. You should use <a href="https://docs.oracle.com/javase/7/docs/api/java/i...
33,008,910
0
Exclude some fields from being validated in $valid in AngularJS <p>I have two select boxes in which a user can move items from select box to another. Say I have <strong>SelectBox1</strong> and <strong>SelectBox2</strong>. I move all the available options from SelectBox1 to SelectBox2. Now while submitting the form I am...
16,780,639
0
Using assisted injection create a complex dependency tree <p>I have recently learned about the <em>AssistedInject</em> extension to Guice and I thought it would be a nice solution to some design issues that I have. Unfortunately it seems that this solution is limited to just a one level assisted injection. Here comes a...
23,234,037
0
how do I use new App ID & secret ID without affect the existing access token <p>First, I have use Facebook App ID &amp; Secret ID, then Login with Facebook and get Access token,</p> <p>I have changed the my Facebook App ID &amp; Secret ID, but, affect the existing user Access token.</p> <p>How do I get new Application ...
1,666,351
0
<p>You can easily invoke log4j's API programmatically, e.g.</p> <pre><code>FileAppender appender = new FileAppender(); // configure the appender here, with file location, etc appender.activateOptions(); Logger logger = getRootLogger(); logger.addAppender(appender); </code></pre> <p>The <code>logger</code> can be the r...
35,844,570
0
<p>Seems there are mixed tabs and whitespaces in your file. If you only want to replace whitespace, say so.</p> <pre><code>:7,10s/^ \{4}//g </code></pre>
12,980,067
0
<p>Yes, the problem is that D can be reached over two paths and freed twice.</p> <p>You can do it in 2 phases: Phase 1: Insert the nodes you reached into a "set" datastructure. Phase 2: free the nodes in the "set" datastructure.</p> <p>A possible implementation of that set datastructure, which requires extending your ...
36,359,833
0
<p>Where the output should be <code>0c</code>, your code only outputs the <code>c</code> part. This is because <code>printf</code> by default prints the result with the minimum number of characters possible. In this case, you should tell <code>printf</code> that the proper result always contains two hexadecimal digits...
39,309,883
0
<pre><code>printf("Address of text[0]: %p\n", text[0]); </code></pre> <p>prints the address of C string (the address first element of array points to), while:</p> <pre><code>printf("Address of text : %p\n", text); </code></pre> <p>prints the address of array's first element.</p>
30,407,326
0
<p>When the <code>JUnitXmlTestsListener</code> saves an XML element with <code>XML.save</code> the default encoding that is used is <code>ISO-8859-1</code>. It should use <code>UTF-8</code> instead.</p> <p>You can try to remove the <code>JUnitXmlTestsListener</code> from your build and <a href="https://etorreborre.git...
30,978,582
0
<p>Just point to any <code>View</code> inside the <code>Activity's</code> XML. You can give an id to the root viewGroup, for example, and use:</p> <pre><code>@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); View parentLayout = fi...
13,749,077
0
Peel away website effect with javascript only <p>I have seen corner screen peel away effects that use flash (swf files). Does anyone know of code that does this with Javascript/css alone?</p> <p>Thanks</p>
18,838,055
0
Embed HTML inside JSON request body in ServiceStack <p>I've been working with ServiceStack for a while now and recently a new need came up that requires receiving of some html templates inside a JSON request body. I'm obviously thinking about escaping this HTML and it seems to work but I would prefer consumers not to b...
40,409,409
0
Why isn't the copy constructor called twice in the following code? <p>The copy constructor is called when an object is returned from a function by value. Another case is when an object is initialized using another object. In the following code, why isn't the copy constructor called twice?</p> <pre><code>#include &lt;io...
26,228,240
0
<p>You are aborting before the view is even being rendered, so that's the expected behavior.</p> <p>Your <code>CakeResponse::send()</code> call actually has no effect (apart from possible headers being sent), and the only reason this is not causing an error is because the body that is being echoed is empty at that tim...
3,960,167
0
<pre><code> ... HAVING hits &gt; 10 </code></pre>
13,749,049
0
<p>You cannot schedule IO tasks because they do not have a thread associated with them. The Windows Kernel provides thread-less IO operations. Starting these IOs does not involve managed code and the <code>TaskScheduler</code> class does not come into play.</p> <p>So you have to delay starting the IO until you are sur...
33,395,830
0
renderUI conditioned by a reactive value <p>Today I am trying to have a renderUI for which the form and the content depend on the value of a reactiveValues. I am working on a shinydashBoard</p> <p>At initial state, users will click on the button and the form of the renderUI will change. If users click one more time I w...
14,127,904
0
WebService (WS) POST in Play 2.0 - Scala <p>When I try to pass a Map to a post, I get this error:</p> <blockquote> <p>Cannot write an instance of scala.collection.immutable.Map[java.lang.String,java.lang.String] to HTTP response. Try to define a Writeable[scala.collection.immutable.Map[java.lang.String,java.lang.String...
29,709,380
0
<p>This denotes a JSON array of three objects:</p> <pre><code>[ { ... }, { ... }, { ... } ] </code></pre> <p>So you cannot deserialize this to a single object. It needs to be deserialized to an array/list by indicating the result should be a List:</p> <pre><code>List&lt;Picture&gt; pictures = JsonConvert.DeserializeOb...
8,139,857
0
<p>First of all, there really isn't any system.out to print to in android. What you should try instead is printing to the log. For information on how to print to the log, check <a href="http://developer.android.com/reference/android/util/Log.html" rel="nofollow">this</a> out. To then see the activity of the log (inclu...
15,102,056
0
<p>Whenever you scroll the window, reposition the #one element to always be on screen. Also, #one should be position: absolute.</p> <pre><code>$(window).scroll(function () { $("#one").css({ left: $(this).scrollLeft() }); }); </code></pre> <p>Here's your fiddle with the new code: <a href="http://jsfiddle.net/9AUbj/15/"...
26,895,188
0
<p>Here's a workaround:</p> <p>Replace all the 0s in Z by NaN, calculate the min, then switch back to 0:</p> <pre><code>clear all clc close all Z(:,:,1) = [-5 0 5 0 0 0 1 0 3]; Z(:,:,2) = [1 0 2 0 0 0 0 0 0]; Z(:,:,3) = [0 0 0 -9 0 4 0 0 0]; Z(:,:,4) = [0 0 0 -2 0 0 0 0 0]; %// Assign NaN to 0 elements Z(Z ==0) = NaN;...
25,868,130
0
<p>You can access <code>$languages</code> in your template very easily.</p> <p>You would do something like this:</p> <pre><code>&lt;ul&gt; {% for element in entity.languages %} &lt;li&gt;{{ element.name }}&lt;/li&gt; {% endfor %} &lt;/ul&gt; </code></pre> <p>I recommend reading the <a href="http://twig.sensiolabs.org/...
4,377,515
0
<p><code>\S</code> matches anything but a whitespace, according to <a href="http://www.javascriptkit.com/javatutors/redev2.shtml">this reference</a>.</p>
10,366,505
0
Rotate Texture2d using rotation matrix <p>I want to rotate 2d texture in cocos2d-x(opengl es) as i searched i should use rotation matrix as this : </p> <blockquote> <p>(x = cos(deg) * x - sin(deg) * y y = sin(deg) * x + cos(deg) * y)</p> </blockquote> <p>but when i want to implement this formula i fail may code is like...
27,723,335
0
<p>One of the things I like most about Javascript is the way you can access the properties of an object with <code>object.property</code> as well as <code>object["property"]</code>. In Ruby you can only access the value of a hash with <code>hash["value"]</code>.</p> <p>To answer your question, you will need to find a ...
38,429,378
0
<p>You can do something like this,</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>$(function() { function removeNode(str, nodeName) { var pattern = '&lt;'+nodeName+'&gt;[\\s\...
6,943,171
0
<p>You can get horizontal align for this image using for tag "a":</p> <pre><code>text-align: center; </code></pre> <p>But for to get vertical align unfortunately you need to set margin-top for this image with hands using known height of parent div (or, with the same result, padding-top for "a" tag). You can use some j...
5,068,173
0
<p>You can implement expected behaviour with biltin features of MSBuild 4:</p> <pre><code> &lt;ItemGroup&gt; &lt;DeploymentProjects Include="1_deploy" /&gt; &lt;DeploymentProjects Include="2_deploy" /&gt; &lt;/ItemGroup&gt; &lt;Target Name="CopyMidTierBuildOutput" &gt; &lt;Message Text="Copying midTier Build Output" I...
27,125,961
0
<p>HTML entities like <code>&amp;amp;</code> are not a part of URI specification. As far as <a href="https://tools.ietf.org/html/rfc3986" rel="nofollow">RFC 3986</a> is concerned, <code>&amp;</code> is a sub-delimiting character, therefore if a server receives a query string like this:</p> <pre><code>foo=1&amp;amp;bar...
24,545,143
0
<p>Is the user supplied name important? </p> <p>If it is not, one technique i like to do to normalize file names in that case is to simply hash them with something like sha1 or even md5. Then add your timestamp, and ids or what not to that, this takes care of a lot of issues with special characters such as ".", "\" an...
37,154,863
1
How to multiplex python coroutines( send and receive) in a websocket based chat client via an event loop <p>I am writing a console based chat server based on websockets and asyncio for learning both websockets and asyncio without using any other frameworks like Twisted, Tornado etc .. So far I have established the conn...
1,834,685
0
<p>One thing I have noticed through the years is that people never improve their performance if you fix their mistakes. (Most of the time they won't even realize you changed it because something was wrong; they will think you are just a control freak who can't let anyone else's work stand unchanged.) Identify the prob...
20,061,640
0
<p>classpath and path are the evironment variables . usually , you have to put the jdk/bin to path so that u could use java compiler everywhere , classpath is the path of your .class files . the classpath has a default path a period(.) which means the current directory. but when u used the packages . u would either sp...
16,895,525
0
Order of Files collection in FileSystemObject <p>In VBScript, I want to get a list of files in a folder ordered by creation date. I saw that in order to do that I will need to either use a record set (seems like an overkill to me) or sort the collection myself (I think I can avoid it and I want my code to be shorter).<...
35,653,053
0
<p>Actually you can use <code>ToString()</code> , but it depends on your dll version.</p> <p>the correct approach is to use the <code>Month</code> property of the <code>Datetime</code></p> <p>Comparing two datetimes by month</p> <pre><code>Datetime1.Month == Datetime2.Month </code></pre> <p>or if your Datetime is a nu...
5,783,951
0
<p><code>NBSP</code>. You had an invisible non-standard whitespace character before your require statement. That's the only reliable way to reproduce this error.</p> <pre><code>eval( chr(0xA0) . ' require_once(1); ' ); # that's nbsp // PHP Parse error: syntax error, unexpected T_REQUIRE_ONCE in </code></pre> <p><code>...
36,195,918
0
<p>Add one anwser, which i think is more clear:</p> <pre><code>var calculateLayout = function(a,b) { console.log('a is ' + a + ' and b is ' + b); } var debounceCalculate = _.debounce(function(a, b){ calculateLayout(a, b); }, 300); debounceCalculate(1, 2); </code></pre>
30,797,701
0
<p>I've got the same issue. The cause was I'm using the Spring Java Config for Spring Security using the DSL. Using the current Spring Security 4.0.1, the Configurer will create a SessionRegistry only on demand and (it looks like) not as a registered bean component.</p> <p>I have fixed this with an explicit definition...
17,844,777
0
<p>Your Preferences in XML, even if you set <code>android:inputType="number"</code> are still stored as a String</p> <p>You have 2 choices: </p> <p>1) the 'not-so-nice': <code>Integer.parseInt( preferences.getString("defaultTip", "15"));</code></p> <p>2) Using your own type of Integer Preference. More complicated to s...
29,766,573
0
<p>For SDK 4.0 : </p> <p>U should add a button and in button action use the below code :</p> <pre><code>- (IBAction)loginButtonClicked:(id)sender { FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init]; [login logInWithReadPermissions:@[@"email"] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { ...
21,380,305
0
Server Side Paging in Kendo Grid? <p>I want client side grid paging in Kendo Grid. In grid only first 50 or 100 data will be shown in first page. And when customer click next page, other 50 or 100 data will be shown. I don't want to get all data from my server. because there will be million data in database and custome...
33,272,926
0
Determine if two unsorted arrays are identical? <p>Given two <strong>unsorted</strong> arrays <code>A</code> and <code>B</code> with distinct elements, determine if <code>A</code> and <code>B</code> can be rearranged so that they are identical. </p> <p>My strategy was as follows: </p> <ol> <li>First, use a deterministi...
25,453,708
0
<p>Each any() usage is converted into it's own subquery. If you need to combine multiple conditions you will need to write the subquery yourself.</p> <p>any() isn't a join alternative, but a subquery exists shortcut. Maybe that helps.</p>
9,534,072
0
<p>There is an example, if this is what you are looking for: <a href="http://www.dynamicdrive.com/dynamicindex8/window3.htm" rel="nofollow">Animated Window Opener Script</a></p>
36,885,038
0
<p>Just a quick shot here. Try this one, instead of existing statement</p> <pre><code>&lt;Modal ... onAfterOpen={() =&gt; this.context.executeAction(LoadUsersByDepartment, 8)} ... &gt; </code></pre> <p>What your code does is:<br> when modal is opened, execute the result from <code>this.context.executeAction(LoadUsersB...
2,517,791
0
How can I get the GUID from a PDB file? <p>Does anyone know how to get the GUID from a PDB file?</p> <p>I'm using Microsoft's Debug Interface Access SDK </p> <p><a href="http://msdn.microsoft.com/en-us/library/f0756hat.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/f0756hat.aspx</a></p> <p>and ...
16,897,503
0
Increasing Limit of Attached Databases in SQLite from PDO <p>I'm working on a project that should benefit greatly from using one database file per each table, mostly because I'm trying to <a href="http://stackoverflow.com/a/811862/89771">avoid having the database grow too large</a> but also because of <a href="http://s...
23,291,975
0
d3 - Scaling @ Normalized Stacked Bar Chart <p>I want to code a reusable chart in d3 - a "normalized" stacked bar chart. The data are scaled from 0% -100% on the Y-axis - see: <a href="http://bl.ocks.org/mbostock/3886394" rel="nofollow">http://bl.ocks.org/mbostock/3886394</a> I have understood that I need to calculate ...
11,340,086
0
<p>I can see the dots fine in IE 9. Exact version as yours. Only difference in my code is a valid HTML5 doctype at the top.</p> <p>Without a valid doctype IE could be switching its rendering for your page to quirks mode, or a rendering mode for IE8/IE7 which would not handle the pseudo selectors like first-child or ge...
13,811,471
0
<p>MySQL can handle the load, so the question now is how do you want to use the data?</p> <p>If the churches are separate, do not need to interoperate and even prefer to remain completely independent, then the multi-install case may be a good fit.</p> <p>On the other hand, if you want to integrate the data from the ch...
5,011,519
0
<p>I think the 1st answer is the best though you can use images in borders now, try using a png image with transparency (via photoshop) use the border-image property, there's so many ways to use it you may find another style you prefer in the research. </p> <p><a href="http://www.css3.info/preview/border-image/" rel="...
5,895,204
0
Is there a WPF Control that can display my overview ? How can I use it? <p>I am moving from a place with 2 rooms, to a place with 3 rooms. I need an application that generates an overview regarding the stuff I need to move. It needs to display for me, how many boxes need to be moved from one room to another. Correction...
23,602,373
0
Jquery Slider using div and with pagination <p>I'm trying to create a image slider where in images are place inside a DIV.<br> So basically, I have 3 divs, they can be control using a href html, the first one, its function will move to the first div, second move to center div, and last move to the 3rd div the last one....
36,330,094
0
<p>Please include all fonts type like you did. Create a new directory in your theme and call it fonts. Then add all your custom fonts into this directory. eg: moodle/theme/yourtheme/fonts/</p> <p>Some times " src: url([[font:theme|fontname.eot]]); ", this may not work. </p> <p>Please add path like this</p> <pre><code>...
25,911,420
0
<p>You can send the .ipa file to the testers (using Dropbox or BTSync for example). They can install it with iTunes (see : <a href="http://stackoverflow.com/questions/14127576/install-ipa-with-itunes-11">Install IPA with iTunes 11</a>)</p> <p><a href="https://crashlytics.com" rel="nofollow">Crashlitics</a> is a good a...
32,694,010
0
Curious about Format function with Phone Number <p>UPDATE (SOLVED): <a href="https://dotnetfiddle.net/6GEJyO" rel="nofollow noreferrer">https://dotnetfiddle.net/6GEJyO</a></p> <hr> <p>I used the following code to format a phone number in a loop with various formats:</p> <pre><code>string PhoneNumber = "9998675309" Stri...
31,915,923
0
<p>Yash, have you made sure that your Tomcat installation is working properly? You should be able to access the manager app (usually under localhost:8080/manager/html) and see all running applications, regardless of whether you have iteraplan deployed on the server or not. Also, to run iteraplan, you need a database (...
35,963,306
0
<p>You have (at least) a couple of options here, but the obvious one is to supply a QueryBuilder to the field which provides the required rows (see <a href="http://symfony.com/doc/current/reference/forms/types/entity.html#query-builder" rel="nofollow">Symfony docs on EntityType Field</a>)</p> <p>E.g.</p> <pre><code>//...
19,668,152
0
Google App Engine - How does datastore initialization work across sessions? <p>I'm developing my first project for GAE, and I'm wondering about how to go about setting up my connection to the datastore.</p> <p>Currently, I have the following in the header.jsp, which is included in all pages and includes a reference to ...
7,828,515
0
In PHP, are objects methods code duplicated or shared between instances? <p>In PHP, if you make an array of objects, are the object methods (not data members) copied for each instance of the object in the array, or only once? I would assume that for memory reasons, the latter is true; I just wanted to confirm with the ...
8,667,676
0
<p>QThreads can deadlock if they finish "naturally" during termination.</p> <p>For example in Unix, if the thread is waiting on a "read" call, the termination attempt (a Unix signal) will make the "read" call abort with an error code before the thread is destroyed.</p> <p>That means that the thread can still reach it'...
11,253,398
0
<p>You are probably not going to like this answer but I think if you are going to this much trouble to optimise the sql that linq is outputting then it is easier just to write it in sql.</p>
15,518,509
0
<p>There is no pagination when using the Search functionality built in the Spotify Apps API. You can increase the number of results so it returns more than 50 results (see <a href="https://developer.spotify.com/technologies/apps/docs/833e3a06d6.html" rel="nofollow">the Search page in the documentation</a>), although t...
15,818,586
0
<p>You can use 3rd party library to get log about crash and exception. I have used <a href="https://markedup.com/" rel="nofollow">MarkedUp</a>. Another way is to create own web service which sends crash log to some database.</p>
29,792,281
0
<pre><code>$updatequery = "update patient_dim set dentist_id = $dentist_id where". " patient_id = $patient_id"; </code></pre> <p>you forgot to add space after WHERE clause</p>
18,910,902
0
Adding ViewPager inside another ViewPager <p><img src="https://i.stack.imgur.com/SrvvR.jpg" alt="enter image description here"></p> <p>I'm creating an activity showing some photos with ViewPager. And I want to add another little ViewPager into any page of main ViewPager. When I swipe little ViewPager main ViewPager swi...
18,078,485
0
<p>Make necessary improvements you need. This will get you started.</p> <p><a href="http://jsfiddle.net/eTJGV/1/" rel="nofollow">http://jsfiddle.net/eTJGV/1/</a></p> <p>Use jquery change property,</p> <pre><code>$('#color').change(function(){ var color = $(this).val(); $('textarea').css('background-color',color); }); ...
33,642,413
0
<p>Have you created all the necessary columns for your associations? Your schema for your taggings table should look similar to this</p> <pre><code>create_table "taggings", force: :cascade do |t| t.integer "token_id", limit: 4 t.integer "taggable_id", limit: 4 t.string "taggable_type", limit: 255 t.datetime "created_a...
13,065,689
0
<p>As others have pointed out the problem, I thought I would suggest an easier solution</p> <pre><code>File.AppendAllText(filename, "test"); </code></pre>
23,451,782
0
<p>I don't think you really want to build your own operating system. There's already an operating system called <a href="http://www.reactos.org/" rel="nofollow">ReactOS</a> that's pretty much what you're looking to build.</p> <p>Just to reemphasize that creating an operating system isn't easy (especially one that runs...
39,966,942
0
<p>As @ivoba stated there is no native expression handling of bitwise operators for the symfony parameters.xml services.xml files or their yml equivalents.</p> <p>For others looking for a method to handle special parameters, one method is that you can use a <code>CompilerPassInterface</code> to process the parameter v...
32,725,478
0
Retrieving original class types from anonymous classes <p>Given a class with an empty constructor and a var:</p> <pre><code>class MyClass() { var myVar: Int = 0 } </code></pre> <p>When the class is instantiated with a closure, this yields an object with the underlying type of an anonymous class rather than MyClass:</p>...
14,595,661
0
<p>For simple stuff you can use <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html" rel="nofollow">SharedObject</a></p>
40,659,647
0
Can not Update A Picture Into A Database Using PDO <p>Having problems updating an image into the database. If I try to update this is what comes on the screen</p> <blockquote> <p>Notice: Undefined index: picture in C:\xampp\htdocs\churchapp\db\controller.php on line 193</p> <p>Warning: getimagesize(): Filename cannot b...
37,897,049
0
<p>I think you should use one <code>SqlDataSource</code> and change its <code>SelectCommnad</code> according to the selection of <code>dropdown</code>.</p> <pre><code>if(dropdwon.SelectedValue == "0"){ SqlDataSource1.SelectCommnad = "Your sp to search city"; GridView1.DataSourceID = SqlDataSource1; GridView1.DataBind(...
398,209
0
Actionscript 3.0, why is it missing good OOP elements? <p>Anyone who has programmed with actionscript 3.0 has most certainly noticed its lack of support for private constructors and abstract classes. There are ways to work around these flaws, like throwing errors from methods which should be abstract, but these work ar...
33,941,965
0
Android How to package as API <p>I am working on providing SDK support for another apps by opening my app UI elements into another app. Its like having Facebook SDK integrated with other apps where one when click on "Login with Facebook" facebook UI comes up. Other apps like Uber has its own SDK How can I achieve it? O...
19,547,000
0
<p>A little whitespace will go a long way...</p> <p>The opposite of <code>$0 ~ s</code> is <code>$0 !~ s</code>, so</p> <pre><code>cvs -q status | awk ' c-- &gt; 0 $0 !~ s { if (b) for (c=b+1; c&gt;1; c--) print r[(NR-c+1)%b] print c=a } b {r[NR%b]=$0} ' b=1 a=9 s='Up-to-date' </code></pre>
25,581,667
0
Match the top of the characters and the bottom baseline of the font <p>Do you know of a reliable way to have borders matching the baseline of the font and the top of the characters? </p> <p>I'm not sure it's very clear as I lack the words to explain this precisely, so here is an example: <a href="http://codepen.io/anon...
38,766,463
0
BackupManager - any "bmgr wipe" alternative? <p>The <code>bmgr wipe</code> command doesn't work. Also disabling the <code>BackupManager</code> didn't help removing the backup sets. Is there any alternative way to remove those sets?<br> Is there any option for that in the Google account settings on the web?</p>
11,719,652
0
<p>Glyph ID's do not always correspond to Unicode character values - especially with non latin scripts that use a lot of ligatures and variant glyph forms where there is not a one-to-one correspondance between glyphs and characters.</p> <p>Only Tagged PDF files store the Unicode text - otherwise you may have to recons...
38,719,861
0
What happens if rules are applied multiple time to a form <p>This is more of a generic question, please remove it if this is not a correct platform.</p> <p>My question is what happens if rules are applied to html form multiple time. like every time user clicks on button if rules are applied what will be the impact.</p>...
3,023,259
0
<p>Use <a href="http://msdn.microsoft.com/en-us/library/9h21f14e.aspx" rel="nofollow noreferrer"><code>DateTime.TryParse</code></a> with the format string you want.</p> <p>If you can accept several formats then you'll need to call each in turn until you find the one that matches - which I assume is what you mean by "t...
38,452,416
0
How do I write an MDX statement to do something differently if the current shown period is incomplete? <p>Using MDX, I need to show a "Closing" stock amount which is basically the last value for the period being shown.</p> <p>For example, if they are looking at the data by week, then the closing stock is the last day o...
34,987,254
0
iOS how to cache data when kill application? <p>I am developing a new feature for my app. I want cache all datas get from web service to read when offline. <br> Current, my app can cache data but when I killed my app It didn't work. <br> I saw an application <a href="https://itunes.apple.com/us/app/smartnews-trending-n...
26,948,236
0
Does not show/retrieve PFObjects that were created by another Parse Installation user <p>I've been working on an app for months, and in the development stage it was having no problem retrieving info from the Parse backend. However, the second that I moved the app over to distribution and put in on the app store, I disc...
21,756,516
0
<p>Assuming that the result is another <code>DataTable</code> with the aggregated data:</p> <pre><code>var aggrTable = table.Clone(); // schema only var groups = table.AsEnumerable() .GroupBy(r =&gt; new { ItemNumber = r.Field&lt;int&gt;("ItemNumber"), Cat1 = r.Field&lt;string&gt;("Cat1") }); foreach(var group in grou...
12,163,773
0
<p>Use <code>file</code>, e.g.</p> <pre><code>$ file `which git` /usr/local/bin/git: Mach-O 64-bit executable x86_64 </code></pre>
35,655,455
0
<p>Here is how I would generally do this. </p> <ol> <li>A Use the web service tester in Workday Studio. Use that and the Xml request template it creates to get the request working. Then build the same request in another tool you can automate Or </li> <li>Use SoapUi to consume the WSDL for this web service . Get the re...
29,500,214
0
<p>The error tells you exactly where the problem is. </p> <pre><code>add has_many :bookmarks to app/models/user.rb add belongs_to :user to app/model/user.rb </code></pre> <p>this should not be in a migration since they do not change the schema. You need to add these to the bookmark and user model, so</p> <pre><code>cl...
16,077,067
0
<p>I know its too late.But it will help some others. Use show and hide instead of replace.Here is a sample code.</p> <pre><code>private class MyTabListener implements ActionBar.TabListener { @Override public void onTabSelected(Tab tab, FragmentTransaction ft) { switch (tab.getPosition()) { case 0: if (frag1 == null) {...
24,533,294
0
Strange oscillating ripples in my shallow water implementation <p>I've been trying to implement the shallow water equations in Unity, but I've run in a weird bug. I get these strange oscillating ripples in my water. I made some screenshot:</p> <p><img src="https://i.stack.imgur.com/9FcuF.jpg" alt="enter image descripti...
8,969,875
0
<p>Some editions of find, mostly on linux systems, possibly on others aswell support -regex and -regextype options, which finds files with names matching the regex.</p> <p>for example</p> <pre><code>find . -regextype posix-egrep -regex ".*\.(py|html)$" </code></pre> <p>should do the trick in the above example. However...
17,276,924
0
<p>Use <code>this</code>:</p> <pre><code>jQuery(".slideheader2").click(function() { jQuery(this).prev(".slidecontent2").slideToggle(250); }); </code></pre>
37,058,213
0
<p>Since you need to start from most recently objects, you need to reverce your array:</p> <pre><code>myArray = myArray.sort_by { |obj| obj['date'] }.reverse </code></pre> <p>In Ruby more recent date is greater then less recent:</p> <pre><code>Date.today &gt; Date.today - 2 =&gt; true </code></pre>
9,576,254
0
File Upload - Add to existing Input <p>I have the following file input box that allows for multiple upload: </p> <pre><code>&lt;input name="filesToUpload[]" id="filesToUpload" type="file" multiple="" /&gt; </code></pre> <p>My users pick their files and they appear in a list. But say after picking their files a user wis...
12,571,532
0
when to use which mod_rewrite rule for self routing? <p>There are several ways to write a mod_write rule for self routing. At the moment i am using this one:</p> <pre><code>RewriteCond %{REQUEST_URI} !\.(js|ico|gif|jpg|png|css)$ RewriteRule ^.*$ index.php [NC,L] </code></pre> <p>But i also could use</p> <pre><code>Rewr...
24,069,448
0
<p>Set the offset vale false. Here is all the info you need. <a href="http://matplotlib.org/examples/pylab_examples/newscalarformatter_demo.html" rel="nofollow">Here is the tutorial link.</a></p> <pre><code>ax = plt.gca() ax.ticklabel_format(useOffset=False,useMathText=None) </code></pre> <p>Or as shown in the example...