pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
34,803,357
0
<p>For every touch, you just need create and add(you missed this step) square in touch begin (or touch end), don't do in touch move.</p> <pre><code> override func touchesBegan(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) { let touch = touches.first location = touch!.locationInView(self.view) person.center =...
26,937,596
0
<p><strong>Use Ajax for this :</strong></p> <p>Add this code to main page where you want to display table data</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script&gt; function dashboard() { var query_parameter = document.getElementById("name").value; var dataString = 'parameter=' + query_parameter; // AJAX code to exe...
6,359,127
0
<p>Can't you just create a hash map that has a string key and store whatever numeric value you want? I.e. </p> <pre><code>Map&lt;String, Integer&gt; m = new HashMap&lt;String,Integer&gt;(); m.put(makeKey(3,2), 2); // where makeKey returns something like "[3,2]" </code></pre> <p>EDIT: </p> <p>The downside is you don't ...
19,454,923
0
<p>Most people would prevent the form from submitting by calling the <a href="https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault" rel="nofollow"><code>event.preventDefault()</code></a> function. </p> <p>Another means is to remove the onclick attribute of the button, and get the code in <code>process...
26,986,591
0
Angularjs: access template in directive <p>What I want to do is to append compiled template to some other DOM element in Angualrjs directive. Is it possible? How? </p> <p>I know you can use transclude to include the template and keep content in the tag, but how do I attach my compiled template to other DOM element?</p>...
25,883,058
0
<p>Use the option <code>-I/Users/myuser/anaconda/include/python2.7</code> in the <code>gcc</code> command. (That's assuming you are using python 2.7. Change the name to match the version of python that you are using.) You can use the command <code>python-config --cflags</code> to get the full set of recommended compil...
24,585,454
0
How to convert glRotatef() to multiplication matrice for glMultMatrixd() <p>I need to perform some operations with different openGL functions.</p> <p>There for I have a cube initialized as glList. What I'm doing is some transformation with glu standard functions and I like to do exactly the same operations with matrix ...
31,756,697
0
<p>I've got no idea how FactoryBoy works, but this strategy usually works for me when I need dynamic properties on fields in Django models:</p> <pre><code>def FooContainerFactory(factory.Factory): def __init__(self, count=20, *args, **kwargs): self.foos = factory.List([Foo() for _ in range(20)]) super(FooContainerFact...
30,694,527
0
Is it safe to pass req as a variable in res.render in expressJs? <p>I'm using NodeJs+ ExpressJs + Handlebars to build a website. When rendering a page I need to pass 3 things everytime : isAuthenticated, userEmail, and FlashMsg. Instead of This :</p> <pre><code>res.render('/webPage', {isAuthenticated: req.isAuthenticat...
26,230,328
0
<p>Try changing it to this;</p> <pre><code>&lt;% @events.each do |e| %&gt; &lt;%= link_to '&lt;i class=icon-trash&gt;&lt;/i&gt;'.html_safe, account_show_path(@context, @event), :confirm =&gt; 'Are you sure?', :method =&gt; :delete %&gt; &lt;% end %&gt; </code></pre> <p>Make sure you have the following in your header;<...
3,243,204
0
WPF Why the assigned background cannot override setter value in style triggers? <p>I have a <code>Style</code> for a <code>TextBox</code> like this:</p> <pre><code>&lt;Style x:Key="TextBox_Standard" TargetType="{x:Type TextBoxBase}" &gt; &lt;Setter Property="Control.FontFamily" Value="/#Calibri" /&gt; &lt;Setter Proper...
19,977,766
0
<p>Looking at your desired output, you are looking for the <code>crossprod</code> function:</p> <pre><code>crossprod(table(test1)) # product # product p1 p2 p3 p4 # p1 4 1 1 0 # p2 1 3 1 0 # p3 1 1 4 1 # p4 0 0 1 2 </code></pre> <p>This is the same as <code>crossprod(table(test1$user, test1$product))</code> (reflectin...
31,518,924
0
XML to JSON merges tags <p>I am working on a small project and I have encountered an issue for which I cannot find a solution myself or locate something similar on internet. So, I am retrieving information from API in XML format, when I call my own API through JavaScript to retrieve this XML document the data gets conv...
39,833,233
0
NUnit: Can I use an empty TestCaseSource and still have a test pass? <p>I currently have some unit tests running against all of our controllers and actions, and an additional test for some "temporary exemptions" that we allow (but that receive other checks as a result). </p> <p>We were able to remove all of our tempora...
27,775,846
0
<p>I have solved the issue by changing this line:</p> <pre><code>lblImageName = [[UILabel alloc] initWithFrame:CGRectMake(cell.frame.origin.x, cell.frame.origin.y, 200, 200)]; </code></pre> <p>to:</p> <pre><code>lblImageName = [[UILabel alloc] initWithFrame:CGRectMake(0,0, 200, 200)]; </code></pre>
11,592,139
0
MySQL snafoo with GROUP_CONCAT <p>This works:</p> <pre><code>SELECT DISTINCT HEX(group_uuid) AS hexid FROM schema.table &gt;9B3D8DE01E1E049DA9F17D42B324AA66 &gt;CDF112D740CE14EA08CA90E3C937DE8D </code></pre> <p>as does this</p> <pre><code>SELECT GROUP_CONCAT('\'', HEX(group_uuid), '\' ') AS hexid FROM schema.table &gt;...
22,399,177
0
<p>Get them all at once:</p> <pre><code>Select e1.Employername From Employer e1 Where e1.Salary &gt; (Select avg(e2.Salary) from Employer e2 Where e2.WorkingPosition = e1.WorkingPosition)) </code></pre>
41,067,701
0
<p>If <code>list2</code> is ordered, then simply use your second solution optimized:</p> <pre><code>var exceptIndex = 0; var newList = new List&lt;T&gt;(); for (var i = 0; i &lt; list1.Length; i++) { if (i != list2[exceptIndex]) newList.Add(list1[i]); else exceptIndex++ } return newList; </code></pre>
25,048,112
0
Recaptcha Bug Loop <p>I started to work on recaptcha file but this one keeps looping (don't know why). </p> <pre><code> &lt;?php if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser header('Location: ../'); exit; } class qa_recaptcha_captcha { var $directory; function load_module...
40,219,559
0
How to read latest email from Yahoo mail using pop3 c# <p>I want to read email from my yahoo mail account. I am using "OpenPop.Pop3" to read email from my yahoo mail account, I am using below code :-</p> <pre><code>using OpenPop.Pop3; public DataTable ReadEmailsFromId() { DataTable table = new DataTable(); try { using ...
6,528,617
0
<p>just extend <code>AndroidTestCase</code> instead of <code>ProviderTestCase2</code> AND use <code>getContext()</code></p>
1,279,464
0
<p>This is one of my favorite metaphors to describe software engineering:</p> <ul> <li><p>Imagine you're building a house. You'd have to have plans for the house, and decide what materials to build, and how to organize the building process. (Most people have had work done on their house so they have some rough concept...
15,775,598
0
<pre><code>$array = array($one, $two, $three, $four, $five); foreach ($array as $value) { if ($example === $value) { something; } } </code></pre>
12,074,727
0
<p>This would be where you use Left Join and Group By. If all you need is the count of items from b, that is.</p> <pre><code>SELECT a.id id,a.price price,a.stock stock, a.max_per_user max_per_user,a.purchased purchased, COUNT(b.quantity owned) as quantity_owned FROM shop_items a LEFT JOIN shop_inventory b ON b.iid=a.i...
33,720,823
0
<p>you could have a list of letters and then filter on that - e.g:</p> <pre><code>var letters = new[] {"H","I", "J", "K", "L"}; var Artists = context.GetTable&lt;Artist&gt;().Where (a =&gt; letters.Any (l =&gt; a.Name.StartsWith(l))); </code></pre>
1,476,139
0
<p>I would second <a href="http://www.jqtouch.com/" rel="nofollow noreferrer">jQTouch</a>. It uses native CSS animations and behaves reasonably smoothly on my iPod Touch.</p>
20,134,891
0
SKPhysicsBody bodyWithPolygonFromPath memory leaks <p>I have a strange memory leaks when creating Sprite Kit physics bodies with custom shapes. This is how my implementation looks:</p> <pre><code>CGFloat offsetX = self.frame.size.width * self.anchorPoint.x; CGFloat offsetY = self.frame.size.height * self.anchorPoint.y;...
12,042,217
0
can you append(add) space and/or hyphen characters to the end of match in regex? <p>exactly as the question sounds, I want to know if you can append or add a space character at the end of all matches or just certain matches</p> <p>regex code I have</p> <pre><code>${Brand Name}${Colour}${Product Description}${ID} </code...
23,066,290
0
MySQL - Query performance issues - taking 25+ seconds <p>I've been trying to figure out why this query is taking so long. Before, it was executing in approx 150ms to 200ms but now it's taking 25 seconds or longer. And this was between last night and this mroning. The only thing that's changed is add data to tables.</p>...
6,272,043
0
How to get custom attributes on .to_json method? <p>For example, i've this model:</p> <pre><code>class User &lt; ActiveRecord::Base def foo bar end end </code></pre> <p>When i do this: &lt;%= User.all.to_json %></p> <p>I get this:</p> <p>[{"user":{"created_at":"2011-06-07T17:40:21-03:00","login":"abcd", "password":"123...
29,792,746
0
<p>This maybe a difficult one for someone with limited Alfresco knowledge, so hopefully you'll understand it.</p> <ol> <li>You'll need to create a repository webscript which takes as input a site and uses siteService methods to get the members and groups. You can peak at the siteMembers Share page which probably uses ...
961,085
0
<p>There are exactly two relations with no attributes, one with an empty tuple, and one without. In <a href="http://en.wikipedia.org/wiki/The_Third_Manifesto" rel="nofollow noreferrer">The Third Manifesto</a>, Date and Darwen (somewhat) humorously name them <code>TABLE_DEE</code> and <code>TABLE_DUM</code> (respective...
17,089,584
0
Why can't I emplace ifstreams in a vector? <p>The following example program doesn't compile for me on either clang 3.1 or gcc 4.8:</p> <pre><code>#include &lt;fstream&gt; #include &lt;vector&gt; using namespace std; int main() { vector&lt;ifstream&gt; bla; bla.emplace_back("filename"); return 0; } </code></pre> <p>Howe...
23,913,212
0
<p>Please change your </p> <pre><code>default_validation_class = UTF8Type to default_validation_class = LongType </code></pre> <p>It should work.</p>
5,907,853
0
<p>@jason;</p> <p>i saw it in IE may you have to define <code>width</code> <code>like width:200px;</code> to your #footerdetails div because in IE7 it's take <code>width 100%</code> of the screen.</p> <p>css</p> <pre><code>#footerdetails { color: #FFFFFF; display: block; height: 100px; left: 0; position:fixed; text-al...
17,796,347
0
<p>Unfortunately, no, this isn't currently possible in an official or supported way. These shared links don't offer any metadata or API for access like this.</p>
1,797,502
0
Is there a scala identity function? <p>If I have something like a <code>List[Option[A]]</code> and I want to convert this into a <code>List[A]</code>, the standard way is to use <code>flatMap</code>:</p> <pre><code>scala&gt; val l = List(Some("Hello"), None, Some("World")) l: List[Option[java.lang.String]] = List(Some(...
7,171,015
0
<p>Well you could use python itself to reverse the line through the filter command. Say the text you had written was: </p> <pre><code>Python </code></pre> <p>You could reverse it by issuing.</p> <pre><code>:1 ! python -c "print raw_input()[::-1]" </code></pre> <p>And your text will be replaced to become:</p> <pre><cod...
19,262,644
0
How to pass a NSMutableArray including NSManagedObjects to another view controller? <p>I embedded 'Core Data' into my app. I use a predicate and fetch the result. I use a mutableArray called "fetchedObjects" to get the (predicated and then fetched) result. Now I need to pass this result to another view controller. How ...
12,114,308
0
Table view button shows up after I scroll down page one time <p>I am trying to add a custom radio button to each cell in a table view. When I first view the table view, I can't see any radio button. But when I scroll down I can see radio buttons on each cell underneath the initial cells that are seen when the view is f...
38,828,203
0
<p>I solved it by going with gulp-tap.</p> <pre><code>conf.plugScss.files.forEach(function (file, index, files) { gulp.src(file) .pipe(rename({ prefix: "_", extname: ".scss" })) .pipe(tap(function (file, t) { file.contents = Buffer.concat([ new Buffer('HEADER'), file.contents ]); var fileCheck = function(err, stat) { ...
16,823,573
0
netbeans c++ with mysql windows <p>I am using netbeans 7 (c++) to connect to mySQL using Boost libraries (boost_1_53_0) and the required mySql C++ libraries (include and Lib) I added the path of the libraries in the project properties->C++ Compiler->include directories.</p> <p>I also added the path of the libraries in ...
39,631,439
0
Receiving Domain Emails using Amazon AWS SES <p>I am using AWS SES for sending emails using my domain name. The sending works fine. But now I want to receive all the emails sent using my domain like abc@example.com in SES.</p> <p>I am trying to receive emails using rule set defined to execute Lambda function or to stor...
19,320,063
0
Installing ElasticSearch on Nitrous.io? <p>I'm trying to use Elasticsearch on Nitrous.io.</p> <p>I'm following <a href="https://shellycloud.com/blog/2013/10/adding-search-and-autocomplete-to-a-rails-app-with-elasticsearch" rel="nofollow">this tutorial</a> but when trying to reindex the model I get this error</p> <pre><...
23,318,854
1
Python program using lists <p>I am trying to write a program that displays an employee's id, their hours, payrate, and wages. </p> <p>The second part of the program requires that the user enter an employee's Id so that their wage will be displayed. </p> <p>The first part of my program works fine up until <code>pay=inpu...
7,667,601
0
<p>Why not store the passwords in the database with SHA1, then use HMAC with a client specified key for the communication?</p> <p>Have the server generate a random key and send it with the login request. The client computes the SHA1 hash of the password, then computes the HMAC SHA1 hash of that using the server-specif...
25,063,655
0
<p>I've had this had this problem too. I save most of my SVG files from Adobe Illustrator. For whatever reason it tacked in <code>overflow="scroll"</code> in the SVG tag on a few of my files. Removing this fixed the problem for me.</p>
24,859,051
0
<p>It is a shorthand way to reference to the route, by using</p> <pre><code>@Html.RouteLink("Privacy"); </code></pre> <p>Here an article on ASP.NET about routing, which helped me a lot...</p> <p><a href="http://www.asp.net/mvc/tutorials/older-versions/controllers-and-routing/asp-net-mvc-routing-overview-cs">ASP.NET MV...
33,462,384
0
<p>The <code>tsplot</code> of seaborn is not meant to plot a simple timeseries line plot, but to plot uncertainties, see:<a href="https://stanford.edu/~mwaskom/software/seaborn/generated/seaborn.tsplot.html">https://stanford.edu/~mwaskom/software/seaborn/generated/seaborn.tsplot.html</a>. </p> <p>For a line plot, you ...
27,330,514
0
Continuing sessions using JSESSIONID <p>I have a web application which requires <code>username and password authentication</code> to enter.</p> <p>What I am doing is, authenticate a user from a stand alone <code>Java app</code>, which would do so by making <code>Http</code> request to the server using <code>username</c...
21,812,622
0
<p>Try with something like this</p> <pre><code>db.collectionName.find({:barsIds =&gt; {"$in" =&gt; BSON::ObjectId("5300c6ba4a5ce5614bcd5d9a")}}) </code></pre>
17,836,637
0
<p>If you're happy to just update the database at the end, you can get the job name and run time from the <code>IJobExecutionContext</code>:</p> <pre><code>public void JobWasExecuted(JobExecutionContext context, JobExecutionException jobException) { var sql = @"INSERT INTO MyJobAuditHistory (JobKey, RunTime, Status, E...
39,790,991
0
<p>The best way to do this (in my opinion) is to actually combine @serge1peshcoff's two options. Write the call as a function that calls itself when the response fails, <em>and</em> set a timeout when doing so. For most purposes, you don't want to send another request immediately after the previous one, you want to wa...
37,114,120
0
<p>Use this <a href="http://stackoverflow.com/questions/35050746/web-scraping-how-to-access-content-rendered-in-javascript-via-angular-js">link</a> to get a better overview. <br/> To answer your question more precisely, <strong>Paytm</strong> gets data in js files about the product. Following link gives data about any...
16,272,185
0
<p>I ran into this over the weekend at a hackathon on Mac OSX - took me a solid 4 hours to piece everything together despite having a few reference materials (mentioned at the end). I didn't find an easy walk-through, so I decided to post one while it is fresh in my mind.</p> <p>I'm not sure of the compatibility with ...
34,579,890
0
<p>The wording is a bit confusing. The whole paragraph is talking about the case where no prototype has been declared for the function at the time it is called, so the section you highlighted is for the case where no prototype is declared when the function is called, but a prototype is used when the function is define...
18,886,564
0
<p>You can inspect the page to find out all the fields need to be posted. There is <a href="http://discover-devtools.codeschool.com/" rel="nofollow">a nice tutorial</a> for <code>Chrome DevTools</code>. Other tools like <code>FireBug</code> on FireFox or <code>DragonFly</code> on Opera also do the work while I recomme...
13,235,095
0
Centered table and margins are not working? <p>I have noticed that this forum I have written is fine in most browsers although in IE8 its to the left and not centered.</p> <p>Its CSS is <code>margin: auto auto</code>, which works in most browsers.</p> <p>I don't want to resort to going old fashioned and putting align="...
30,752,481
0
Different views with different code behinds but one binary in Windows 10 <p>I have been reading <a href="http://visuallylocated.com/post/2015/04/02/Creating-different-page-views-for-Windows-Apps-based-on-the-device.aspx" rel="nofollow">this</a> which suggests that in windows 10 you can use different xaml views (with th...
20,061,078
0
Finding cache cpi time <p>I need a formula or to at least be pointed in the right direction it involves cache and cpi time. I have a base machine that has a 2.4ghz clock rate it has L1 and L2 cache. L1 is 256k direct mapped write through . 90% read without a hit rate without penalty, miss penalty costs 4 cycles all wri...
19,855,766
0
<p>No, you can't do this. Everything you can do is add argument to command line to manage the heap size. </p> <p>A dirty solution can be to spawn another process with different heap size, but I don't think this is what you are looking for. <strong><a href="http://www.dreamincode.net/forums/topic/96263-how-to-set-heap-...
39,460,190
0
<p>When chaining observables you need to use <code>flatMap()</code>.</p> <pre><code>Observable.fromPromise(this.storage.get('accessToken')) .flatMap(accessToken =&gt; this.http.post('http://1234/user/login', {'accessToken': accessToken}) ) .subscribe( result =&gt; console.log(result), error =&gt; console.log(error) );...
20,144,030
0
<p>Currently there are 2 options for Git Source Control in Visual Studio (2010 and 12):</p> <ol> <li><a href="http://visualstudiogallery.msdn.microsoft.com/63a7e40d-4d71-4fbb-a23b-d262124b8f4c">Git Source Control Provider</a> </li> <li><a href="http://visualstudiogallery.msdn.microsoft.com/abafc7d6-dcaa-40f4-8a5e-d672...
17,810,363
0
<p>The lambda solution would be the idomatic C++11 way:</p> <pre><code>auto a = [&amp;]( int x ){ return superComplexAlgorithm( 3, 4, 5, x ); }; for( unsigned int i = 0; i &lt; 100; ++i ) do_stuff_with( a ); </code></pre> <p>The advantage of using a hand written functor is that you can:</p> <ol> <li>Move arguments int...
40,169,916
0
iOS - presentViewController like the image (Open iMessages app store in Messages) <p><img src="https://i.stack.imgur.com/MZnz9m.jpg" alt="Open iMessages app store in Messages Screenshot"></p> <p>I want present a <code>UINavigationController</code> like the image above, I use</p> <pre><code>nvc.modalPresentationStyle = ...
30,548,400
0
<p>Twitter's Tweet Web Intent doesn't provide this functionality. You'd have to build a solution using either the REST or Streaming APIs. Even that would only work if the user's Tweets are public, or if they give you read access to their timeline.</p>
23,930,126
0
How to find the Config File location via ConfigurationManager? <p>How to find the Config File location via ConfigurationManager?</p> <p>I have the ConfigurationManager class in code and I'm debugging it. I'd like to know to which config file it's pointing to (web.config or app.config, etc).</p> <p>Is there any property...
4,286,075
0
Brightness Screen Filter <p>Does anyone have an idea how to implement an Brightness Screen Filter like the one here:</p> <p><a href="http://www.appbrain.com/app/screen-filter/com.haxor">http://www.appbrain.com/app/screen-filter/com.haxor</a></p> <p>I need a starting point and I can't figure out how to do it.</p>
32,465,762
0
<p>I've found a solution. The problem was:</p> <pre><code> Intent intent = new Intent(myContext, myActivityClass); String s = stackTrace.toString(); //you can use this String to know what caused the exception and in which Activity intent.putExtra("uncaughtException", "Exception is: " + stackTrace.toString()); intent.p...
31,700,296
0
How to copy files with one extension to another extension <p>I have a.s b.s c.s d.s files in my current directory on my linux machine, I want to copy them to new extension .S like a.S b.S c.S d.S</p> <p>Please help me to do this.</p>
4,640,041
0
<p>You can somehow try to compress the information somehow. You need to show the user if he has read a post, only if the user logs on, so you should store the information somewhere near the user. The user might look throught your posts in a date sorted way, so read-post-information of nearly dates should ly nearby, fo...
33,746,828
0
<p>There's an old joke about two people at a natural history museum wondering how old a dinosaur fossil is. A guard overhears them and says, "Oh, it's five-hundred million and seven years old". One of the people says, "that's an astonshing number, how was it determined?" The guard says, "Well, I was told it was five-h...
7,892,197
0
<p>How often these images change is not up to Amazon but depends entirely on the publishers.</p> <p>I work for a publishing house and I can tell you from personal experience that a book cover can change quite frequently before going into print. Once it's available as physical product though (i.e. no more pre-order), i...
17,730,157
0
<p>To animate you'll need to define a starting state, and a target (or finished) state and an easing function to control the rate of change.</p> <p>Rather than start from scratch I'd suggest leveraging an existing solution, there is a LOT of code out there to help you do this.</p> <p>Check out: <a href="https://github...
38,831,165
0
<p>You could also download Unity Remote 4 for your Mobile phone. It really helped me a lot : <a href="http://docs.unity3d.com/Manual/UnityRemote4.html" rel="nofollow">http://docs.unity3d.com/Manual/UnityRemote4.html</a></p> <p><strong>edit</strong>:</p> <ol> <li>Download &amp; install Unity Remote 4 on your device.</l...
34,707,711
0
How do I get two things to hit each other and then remove one from the scene? <p>I have four colored bars aligned horizontally. I also have some of the exact colors falling from the top of the screen which need to be matched with the bars at the bottom and then removed from the scene on contact. (If falling yellow bar ...
15,935,282
0
breadth first search trouble [solved it] <p>Working on a breadth first search but cant seem to get it to work. The bfs is searching through an array of linked lists (an adjacency matrix). I followed the algorithm in my text book as well as looked over a few on the internet, but i think since that I am using an array of...
25,357,876
0
Replacing double quotes while sending parameter to javascript function <p>This is JSFiddle :</p> <p><a href="http://jsfiddle.net/5kdek3vn/" rel="nofollow">http://jsfiddle.net/5kdek3vn/</a> </p> <p>I have button as follows:</p> <pre><code>&lt;button class="buttoncss" title="Modify This Artifact File" onclick="setFileDes...
12,863,141
0
<p>Do it programmatically at runtime? (In your <code>-applicationDidFinishLaunching:</code> delegate method)</p>
12,561,289
0
<p>you should use <a href="http://regexkit.sourceforge.net" rel="nofollow">Regexkit Framework</a>, i found it the best solution for regex in iOS</p>
5,480,611
0
<p>Just took a look, and its actually Adobe who owns it, and they sell it for money. So, my <em>best</em> guess is no, you couldn't legally use it for free. I have no idea if Adobe licenses it, though. Maybe you could try and find one that's licensed for web use, and is similar to Helvetica?</p>
17,622,590
0
<p><em>I've moved the most important points from the comments.</em></p> <ol> <li><p>Yep, that's the normal behavior. Nginx's master process needs root privileges to manage listening sockets on the machine. <a href="http://forum.nginx.org/read.php?2,159000,159015#msg-159015" rel="nofollow">This</a> forum thread states ...
31,617,310
0
Check if there are more than 1 argument <p>I have a simple program that encrypts message using <code>Caesar Cipher</code>.</p> <p>The program works well, but I am unable to check whether the user is entering more than 1 argument. If he is, I need to break and prompt the user to enter the correct number of arguments whi...
4,246,473
0
<p>50 decimal is 32 hexadecimal.</p> <p>Apart from that, the <a href="http://www.cplusplus.com/reference/clibrary/cstdio/printf/" rel="nofollow">documentation</a> should tell you all you need to know.</p>
34,727,887
0
<p>Fixed it using some of the suggestions below.</p> <pre><code>$startDate = new DateTime(date("2012-4-1")); $endDate = new DateTime(date("Y-m-t", strtotime($startDate-&gt;format("Y-m-d")))); echo "The start date should be 2012-4-1: " . $startDate-&gt;format("Y-m-d") . "&lt;br /&gt;"; echo "The end date should be 2012...
5,447,072
0
<p>The equality operator will attempt to make the data types the same before making the comparison. On the other hand, the identity operator requires both data types to be the same as a prerequisite.</p> <p>There are quite a few other posts out there similar to this questions. See:</p> <p><a href="http://stackoverflow...
4,639,592
0
<p>If you wanted to go down the route of iteratively testing each public method in the controller, you could do something like:</p> <pre><code>SomeController.public_instance_methods(false).each do |method| it "should do something" end </code></pre> <p>However, I think a shared example group (see about half way down th...
20,214,430
0
SSRS Date Parameter Not working <p>I have two parameters for the report "StartDate" and "EndDate" respectively. They work fine in the chart filter expressions , however when I use the same in the series expression as CDate(Parameters!Startdate.Value) > CDate(Fields!InAck.value) of the chart to compare against a date co...
37,695,583
0
Sorting conversations with belongs_to/has_many relationship <p>i have the following models:</p> <pre><code>class Post &lt; ActiveRecord::Base has_many :conversations end class Conversation &lt; ActiveRecord::Base belongs_to :user belongs_to :post has_many :messages end class Message &lt; ActiveRecord::Base belongs_to :...
38,853,562
0
Viewpager snaps to the wrong page after taking a photo <p>I am currently using a <strong>Viewpager</strong> implementation in my android app. In each of the fragment, there is a <strong>button</strong> that takes a photo and uploads it to an online database. However, due to the new permissions requirement, I needed to ...
27,476,257
0
Trouble with layer(geom="line") in ggplot <p>I would like to plot a line chart in ggplot2. Here is how my data look like</p> <pre><code>query,trace,precision,recall safe.order.q3.txt,rstr_oper_50000_100m,49.8406,24.9156 safe.order.q3.txt,sstr_cpu_50000_100m,49.774,24.8442 safe.order.q3.txt,sstr_oper_50000_100m,49.8735,...
1,772,088
0
<p>I often add collection-based update_multiple and destroy_multiple actions to an otherwise RESTful controller.</p> <p>Check out this <a href="http://railscasts.com/episodes/52-update-through-checkboxes" rel="nofollow noreferrer">Railscast</a> on Updating Through Checkboxes. It should give you a good idea how to appr...
23,935,035
0
<p>You can use following doc type. However I find some discrepancy in the code you have copied. Are you sure of INSERT and SELECT statements. I hope its copy mistake</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybat...
23,093,328
0
Can Visual Studio 2013 show mixins from referenced files <p>When I hover over a mixin it shows me the properties, which is awesome!</p> <p>However, I have many referenced files and it does not show those. It says, "Undeclared mixin". Seems this would be a standard feature considering that many break up styles into like...
32,415,813
0
<p>As Luksprog mentioned in the comment, ListAdapter is not filterable, you would have either have to create a customAdapter by extending the listadapter and implementing filterable in that object, or use an adapter provided by the sdk that implementals filterable</p>
6,742,928
0
<p>Here are a few links that you might find interesting. There is an example of creating a two-activity application, and then implementing fragments into it. </p> <p><a href="http://mobile.tutsplus.com/tutorials/android/android-sdk_fragments/">Android User Interface Design: Working With Fragments</a></p> <p><a href="h...
23,457,152
0
Will calling window.setInterval open a new thread in chrome? <p>I've read that all browsers except chrome have javascript code running in a single thread. I'm not even sure if this is still true, but assuming it is: Will calling window.setInterval multiple times open multiple threads in chrome?</p>
13,727,776
0
Sampling HBase table keyspace <p>I'd like to build random samples of a HBase table's rowkey space.</p> <p>Say, I'd like to have roughly 1% of the keys from HBase that are randomly distributed across the table. What's the best way of doing this?</p> <p>I suppose I could write a MapReduce job that processed all the data ...
17,706,796
0
recording uplink and downlink separately in different file at once <p>Have anyone tried saving uplink and downlink separately at once in different file? Or saving uplink and uplink+both side in different file.</p> <p>I found that in a different post that it might be possible using thread because recording channel stays...
36,819,186
0
Cloud Foundry compatibility with DBs <p>I have a set of restful services connecting to Oracle , MySQL and Phoenix DBs. These are running on tomcat. I have to migrate these services to pivotal cloud foundry. Is it sufficient if I externalize the connection parameters potentially using cloud config server or env variable...