Unnamed: 0 int64 65 6.03M | Id int64 66 6.03M | Title stringlengths 10 191 | input stringlengths 23 4.18k | output stringclasses 10
values | Tag_Number stringclasses 10
values |
|---|---|---|---|---|---|
4,297,771 | 4,297,772 | how to read an image file in asp.net c# using asp:fileupload? | <p>I used the code below for upload an image. Please let me know that why this code does not work at all. I am also using updatePanal and multiview control for tab controlling.</p>
<pre><code><asp:FileUpload ID="fuPhoto" runat="server"/>
<div style="margin-top:20px;text-align:center;">
<asp:Button I... | c# | [0] |
3,152,864 | 3,152,865 | How to import csv files as data for bootstrapping | <p>I'm trying to import a csv file to my grails project, what I'm trying to do is to build a map based on that csv file which is a list of countries (countries.csv) and use the map as a bootstrap data.</p>
<p>any ideas would be much appreciated</p>
| java | [1] |
2,423,462 | 2,423,463 | Distance Between Two GEO Locations | <p>I have two GEO locations. How can I calculate the distance between them?</p>
| javascript | [3] |
4,983,877 | 4,983,878 | Access Denied error on reading a Message Queue | <p>I have a private message queue and when I want to read its messages I get a access denied error and it crashes.
Previously for learning purposes I had written two separate applications, put a button on each of them, press the button on this one, create a queue and put a message in it, now click on the button on the... | c# | [0] |
2,875,155 | 2,875,156 | Reading lines from Python queues | <p>I'm dipping my toes into Python threading. I've created a supplier thread that returns me character/line data from a *nix (serial) /dev via a Queue.</p>
<p>As an exercise, I would like to consume the data from the queue one line at a time (using '\n' as the line terminator).</p>
<p>My current (simplistic) solutio... | python | [7] |
5,636,296 | 5,636,297 | instanceof Vs getClass( ) | <p>I see gain in performance when using getClass () and == operator over instanceOf operator.</p>
<pre><code> Object str = new Integer("2000");
long starttime = System.nanoTime();
if (str instanceof String) {
System.out.println("its string");
}else {
if (str instanceof Integer) {
... | java | [1] |
4,447,128 | 4,447,129 | Licensing/Securing an asp .net web application | <p>Basically I have an asp.net application which is installed on clients servers to work alongside an existing desktop application. What can I do to stop a client copying the files and installing somewhere else and running it so they can't stop paying but continue to use the system?</p>
| asp.net | [9] |
194,162 | 194,163 | Filter contentresolver query by date and time - Android | <p>I'm using the "MediaStore.Images.Media.EXTERNAL_CONTENT_URI" to query for photos stored on the sd-card. Now I only want photos that were added after some specific date. I'm using the "contentResolver.query()" method to query but I don't understand how to filter by Date_ADDED or DATE_MODIFIED. Can this be done?</p>
... | android | [4] |
60,871 | 60,872 | Slidetoggle called when dropdown option is focused | <p><a href="http://jsfiddle.net/EhTJF/" rel="nofollow">http://jsfiddle.net/EhTJF/</a></p>
<p>Linked is an example of the issue I am running into.
When an element is hovered over, slidetoggle() is called to show a drop down list. When attempting to select an option in the ddl, slidetoggle() is called again and forces t... | jquery | [5] |
4,125,651 | 4,125,652 | How to program a simple music player? | <p>I've just completed a tutorial on C# language syntax from <a href="http://www.csharp-station.com/Tutorial.aspx" rel="nofollow">http://www.csharp-station.com/Tutorial.aspx</a>
I'd like to get started programming a simple music player for practice. The music player should be able to index all the music files in a fold... | c# | [0] |
3,540,309 | 3,540,310 | Calling inflate() multiple times in an Android view | <p>I have a View that inherits from LinearLayout that inflates itself. After it has been created and inflated I wanted the ability to inflate a different layout. However, calling inflate() a second time seems to have no effect. Only if I close the activity and open it again is the state reflected in the UI.</p>
<p>... | android | [4] |
962,048 | 962,049 | Avoiding PopupWindow dismissal after touching outside | <p>I would like to use a PopupWindow with following behaviours/features:</p>
<ul>
<li>It is focusable (has interactive controls inside eg. buttons)</li>
<li>The View 'under' popupwindow has to consume the touches outside the popup properly</li>
<li>.. but the popupwindow has to stay on screen even after clicking outsi... | android | [4] |
3,569,878 | 3,569,879 | c#: SetScrollPos (user32.dll) | <p>I want to have 2 (rich)texboxes (vc# 2k8) with same scrolling... so when I scroll tb1 the tb2 scrolls to the same position. I use this functions:</p>
<pre><code>[DllImport("user32.dll")]
static extern int SetScrollPos(IntPtr hWnd, int nBar, int nPos, bool bRedraw);
[DllImport("user32.dll")]
public static extern in... | c# | [0] |
3,584,180 | 3,584,181 | OpenPop.Pop3 error | <p>I'm trying to connect to a exchange server using OpenPop library and when I try to connect it says "Server is not available", this is my code:</p>
<pre><code> Pop3Client Client = new Pop3Client();
Client.Connect("srv", 25, false);
Client.Authenticate("usr", "pass");
</code></pre>
<p>Can you... | c# | [0] |
1,037,350 | 1,037,351 | How to calculate dynamic size on scrollview for iphone? | <p>I have dynamic no of textviews and their size can also be dynamic, after each text view there are also dynamic no of labels, and each item is place on scroll view, so that scroll view also has dynamic size, So Someone guide me how to accomplish this task?
forgive me if this is repetitive question plz! </p>
| iphone | [8] |
5,704,335 | 5,704,336 | Embedding Gmaps in HTML | <p>I am working on embedding Google maps on HTML...</p>
<p>I want a javascript code that works same as creating one we do in Mymaps of Google maps. I want to add the function markers, polyline and polylines on a road..</p>
<p>I tried hard to do the same but did get exactly the look and the polylines doesnot work</p>
... | javascript | [3] |
4,601,693 | 4,601,694 | Selecting a specific Tab in a TabActivity from a PendingIntent sent from a Notification | <p>I've got a TabActivity with 4 tabs in it. I have a service that is running - this service runs even after my TabActivity has been destroyed.</p>
<p>When the Service receives an event, I create a notification. The TabActivity may, at this time, be destroyed, or just running in the background. </p>
<p>How can I c... | android | [4] |
5,957,222 | 5,957,223 | Plotting in java? | <p>I have an array of dimension of[20][20], filled with values of 0 & 1's. I would like to plot a graph similar to that of a weather image. Where 1's represents an activity with some colour and zero with no activity... What are essential things that I would require to begin plotting</p>
<p>Thank You
Jeet </p>
| java | [1] |
2,087,760 | 2,087,761 | What's the proper way to share an enum across multiple files? | <p>I would like to use the same enum in both the client and server parts of my current (C++) project, but am unsure of the proper way to do this. I could easily just write the enum in it's own file and include that in both files, but that feels like it's poor practice. Would putting it in a namespace and then includi... | c++ | [6] |
2,598,991 | 2,598,992 | jQuery selector not replacing text | <p>I have a table and I am trying to replace text in what should be the sibling of the filename td but it doesn't seem to be working.</p>
<p>Here's what I'm trying:</p>
<pre><code>var current = $(".filename:contains('image.jpg')").siblings();
current.find(".filesize").text('new text');
</code></pre>
<p>The HTML:</p>... | jquery | [5] |
4,931,707 | 4,931,708 | When we send messages to multiple numbers at atime, how to know for which number we are getting getResultCode()? | <p>i am developing android sms application in which i send message to multiple numbers. i want to get resultant code for all numbers.When we send messages to multiple numbers at atime, how to know for which number we are getting getResultCode()?
is there any example code for this type of coding.?</p>
| android | [4] |
3,321,170 | 3,321,171 | SESSION destroys after POST | <p>I'm developing a site for someone where users can post problems to a website and the Admin of the company can view the problems and give a solution for it. I use one page that takes care of the login handling and a mysql db. The problem is that i can log in, it shows me another panel(userpanel), but whatever other b... | php | [2] |
2,984,043 | 2,984,044 | Loading an outbuffer to a string in javascript? | <p>How to load the output buffer into a string using javascript ?</p>
<p>for example in php</p>
<pre><code><?php ob_start(); ?>
hello world !
<?php $string = ob_get_contents(); ?>
</code></pre>
| javascript | [3] |
2,748,519 | 2,748,520 | CGMakePoint(X,Y) for a image | <p>I am new to iPhone development. can any one let me know what is <code>CGMakePoint(x,y)</code> and what x, y stands for and how to get CGPoint x and y value for a image.?</p>
| iphone | [8] |
5,753,922 | 5,753,923 | Android Code - Radom number generation for calling activity | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/363681/generating-random-number-in-a-range-with-java">Generating random number in a range with Java</a><br>
<a href="http://stackoverflow.com/questions/6029495/how-can-i-generate-random-number-in-specific-range-in... | android | [4] |
3,996,336 | 3,996,337 | Cannot connect to port 8080 when using the python module for Stanford NER | <p>I am a complete rookie at this (this might be the reason why I'm stuck), but I have spent 2 days trying to find an answer for my problem with no luck whatsoever.
Here's the deal: I have downloaded the python module for Stanford NER, because I need to extract entities from text. In the readme file there was a suggest... | python | [7] |
5,154,386 | 5,154,387 | Saving the image in perticular location is not working for Second time Using SendKeys option in Python | <p>I did the code for copy and save in directory for second time in "C:/Dirs" How can I save in in this folder for multiple times</p>
<pre><code>import SendKeys
SendKeys.SendKeys("""
{LWIN}
{PAUSE .25}
mspaint.exe{ENTER}
{PAUSE 1}
^{c}
{PAUSE 1}
^{v}
{PAUSE 1}
^{s}
{PAUSE 1}
... | python | [7] |
584,591 | 584,592 | Custom Theme resets after performing search | <p>I am setting a custom theme in a "Contacts" application the following way...</p>
<pre><code>public void onCreate(Bundle savedInstanceState) {
if ("Red".equalsIgnoreCase( getIntent().getStringExtra( "Theme" )))
{
super.setTheme(R.style.red);
}
else if ("Green".equalsIgnoreCase( getIntent().getStr... | android | [4] |
4,274,555 | 4,274,556 | PHP Both kinds of quotes in variables | <p>I used to know this, but I guess it slipped my mind.
What's the code you put in the beginning and the end of a variable in php to allow both kind of quotes?</p>
| php | [2] |
3,596,425 | 3,596,426 | Close popup problem on button click | <p>I create info_popup.xml ( simple, I have textview and imagebutton on popup). I show in my main activity, but I don't know how to close that popup on click on btnExitInfo button. What to put in click listener to close pw ? I tried with GONE but it doesn't work, it is still there .</p>
<pre><code> LayoutInflater infl... | android | [4] |
168,347 | 168,348 | Jquery load more on scroll | <p>I am trying to load data from load_second.php into result div. When I scroll down on first time it loads the data from load_second.php, however, I want to keep that data and when I scroll again it should load more data. Any help would be greatly appreciated.</p>
<pre><code><script type='text/javascript'>$(win... | jquery | [5] |
2,231,416 | 2,231,417 | MultiPart Data in Javascript | <p>Can anyone help me to know:
How to send text and image type data through multipart data form in javascript to my api. Please help me in getting the solution of my question.</p>
<pre><code>function apiCall(url){
var myJsonObj ;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, O... | javascript | [3] |
1,230,539 | 1,230,540 | How to call a method on specific time in java? | <p>Is it possible to call a method in java at specific time? for example: If i have a peice of code like this:</p>
<pre><code>class Test{
....
// parameters
....
public static void main(String args[]) {
// here i want to call foo at : 2012-07-06 13:05:45 for instance
foo();
}
}
</code></pre>
<p>How this can b... | java | [1] |
3,453,157 | 3,453,158 | Functions defined in header / cpp file behaves different | <p>File: A.h</p>
<pre><code>class A
{
public:
struct x X;
int show()
{
x.member_variable ? 0: -1;
}
};
</code></pre>
<p>Now if A.cpp is complied which includes A.h (which is actually in a huge project space) we see that x.member_variable value is not as expected. But if remove the show() metho... | c++ | [6] |
2,193,499 | 2,193,500 | Find location of part of an image on screen? | <p>I have an image, 480px wide. It is mostly transparent but has a tab protruding from it. Is there a way to get the x-coordinates of the left and right edge of the protrusion? It will stretch depending on screen size, so I don't think I can hard code it.</p>
<blockquote>
<p><em><strong></em>__<em>_</em>__<em>_</em>... | android | [4] |
598,244 | 598,245 | Why does this undefined variable refer to an element's id | <pre><code><div id="myDiv"></div>
alert(myDiv); // alerts '[html HTMLDivElement]'
</code></pre>
<p>I don't understand how this seems to work. I thought you must specify the div element's id with <code>getElementById();</code></p>
| javascript | [3] |
3,694,460 | 3,694,461 | jFeed not parsing images inside RSS feed | <p>Suggestions on how to fix this? </p>
<p>It's imperative that I use javascript, sadly, or I would have been using SimplePie eons ago.</p>
| jquery | [5] |
2,302,089 | 2,302,090 | How do I complete exercise 3 from "Art & Science of Java", Chapter 4? | <p>I have to write a program that reads in a positive int, and then calculates and displays the sum of the first N odd ints. For example, if N is 4, the program should display the value 16, which is 1 + 3 + 5 + 7.</p>
<p>Here's what I have so far, but I've come up against a brick wall, and would appreciate a point in ... | java | [1] |
3,536,480 | 3,536,481 | change mode of android phone as day, night, automatic | <p>Can I change android phone mode day, night, automatic in programatically...</p>
<p>UiModeManager manager = (UiModeManager)getSystemService(Context.UI_MODE_SERVICE);
manager.setNightMode(UiModeManager.MODE_NIGHT_YES);</p>
<p>this is not working for me.... </p>
<p>shall i set any permission in andro... | android | [4] |
3,891,232 | 3,891,233 | Rotate the Simulator at launch Time | <p>i m working on a project in which i want to rotate the ipad at the launch time.i have done coded for it.But it still not working. code i have written-</p>
<p>in .m file</p>
<pre><code>-(void)viewWillAppear:(BOOL)animated
{
[[UIDevice currentDevice]setOrientation:UIInterfaceOrientationLandscapeRight];
}
- (BOOL)... | iphone | [8] |
4,789,718 | 4,789,719 | Call base class member functions from subclass members | <pre><code>public class A
{
...
public virtual void PrintMe() { /* do A */ }
}
public class B : A
{
...
public override void PrintMe() { /* do B */ }
}
public class C : B
{
...
public override void PrintMe() { /* do C */ }
private void Fun()
{
// call C::PrintMe - part one
... | c# | [0] |
3,050,081 | 3,050,082 | How is a dynamic array different from statically bound array in C++? | <p>I am learning C++ and I just read about dynamic arrays and how it lets you set the length of an array during runtime rather than during compile time. However, you don't need a dynamic array to do this. So what is the point of a dynamic array; when would you use it? I feel like I am missing something obvious so any i... | c++ | [6] |
1,130,036 | 1,130,037 | How to convert img src to $pdf->ezImage | <p>I am trying to get the code </p>
<pre><code><img src="barcodegen.php?barcode=' . $order->products[$i]['model'] . '">
</code></pre>
<p>converted to </p>
<pre><code>$pdf->ezImage
</code></pre>
<p>by ezpdf, any help will be appreciated.</p>
<p>Sam</p>
| php | [2] |
2,226,185 | 2,226,186 | retrive data as json from php to iPhone | <pre><code>-(void)viewDidLoad {
NNString *myStringJson = [[NSString alloc] initWithContentofURL:[NSURL URLwithString@" "]];
if([myStringJson length == 0]){
[myStrinJson release];
return;
}
SBJSON *parser = [[SBJSON alloc] init];
listArray = [[parser objectWithString:myStringJson] ... | iphone | [8] |
1,828,486 | 1,828,487 | I want to know how to make this .live() in jquery | <p>i was wondering how i could get this to be live? I have a text box that is fetched via ajax, and its excluding already loaded scripts i have cause of the dom I'm assuming. Any who, I've played with .live() but i usually have an element to hook it to ex/ <code>$('blah').live();</code>, but i found myself scratching ... | jquery | [5] |
672,407 | 672,408 | Adding external JavaScript file into DOM via JavaScript | <p>I need to load an external JavaScript file that is generated by a PHP script, I also want to pass any query string parameters to the script as well, I came up with the following solution: </p>
<pre>
<code>
<script><br/>var url = 'http://example.com/scripts/js.php?foo=bar';<br/>url += location.search.replace(&... | javascript | [3] |
2,966,159 | 2,966,160 | Return if a given int is an exponent of 2 C# | <p>Given a method of the bool data type that takes in an int variable, what is a <strong>single</strong> line of code that would determine if the int is an exponent of 2 or 2^n.....2,4,8,16,32 etc. I know of a way using a while loop and if statements, but I'm looking for it to be on one line.</p>
| c# | [0] |
5,308,737 | 5,308,738 | Java 1.3 library for web service | <p>I have Java 1.3 application and I need to connect them with web service. Is it possible to find some (.jar) library.</p>
| java | [1] |
5,505,069 | 5,505,070 | jquery can not trigger function from generated content | <p>I'm trying to delete one of the items which are generated by entering text and clicking the "add another" link in the linked example, but the jquery does not trigger from the generated content. If I attach the event handler to another object the function triggers but not from the generated links, any way to fix this... | jquery | [5] |
3,411,712 | 3,411,713 | trying to follow Bucky tutorials | <p>While following <a href="http://www.youtube.com/watch?v=OVfUq2DPKKg" rel="nofollow">this Youtube tutorial</a> (see the relevant code below) I get the following error:</p>
<blockquote>
<p>error line 6<br>
error: expected constructor destructor or type conversion before'('</p>
</blockquote>
<p>What might cause t... | c++ | [6] |
1,399,338 | 1,399,339 | Jquery access div in table cell | <p>I'm trying to access the first div with a class from hovering on a table row;</p>
<p>Here is my html:</p>
<pre><code><table id='search_job_results_table'>
<tbody>
<tr>
<td><div style='position:relative'><div class='search_job_tooltip'>blah blah</div></div></td>... | jquery | [5] |
5,958,118 | 5,958,119 | PHP difference between shuffle and array_rand | <p>What exactly is the difference between <code>shuffle</code> and <code>array_rand</code> functions in PHP? Which is faster if there is no difference.</p>
<p>Thanks</p>
| php | [2] |
4,797,080 | 4,797,081 | zero length arrays | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1036666/what-is-the-usage-of-array-of-zero-length">What is the usage of array of zero length?</a> </p>
</blockquote>
<p>What is the purpose of zero length arrays.Are they of any use or just like that because the... | java | [1] |
983,761 | 983,762 | Using zip file without extracting in java | <p>Iam facing a problem that, we have a .zip file that contains some text files. Now iam using java to access that files. If it is not in the zip file i can read and print on my console easily using FileInputStream. But iam unable to read a file from .zip file....</p>
<p>Please help me get rid of this.....Iam using j... | java | [1] |
1,102,352 | 1,102,353 | Only top corners rounded in <shape> | <p>I am trying to have the top corners of a shape rounded and the bottom just straight, but I'm having a problem with my shape it's saving </p>
<blockquote>
<p>error!
UnsupportedOperationException: null</p>
</blockquote>
<p>When I have </p>
<pre><code><corners android:radius="10dp" android:bottomRightRadius="... | android | [4] |
364,985 | 364,986 | Javascript new Array and join() method | <p>Inspired by <a href="https://www.destroyallsoftware.com/talks/wat" rel="nofollow">this popular speech</a> I wanted to figure out some issue related to creating arrays. Let's say I am creating new array with:</p>
<p><code>Array(3)</code></p>
<p>In console I am getting:</p>
<p><code>[undefined, undefined, undefined... | javascript | [3] |
4,573,347 | 4,573,348 | Check if a variable contains a numerical value in Javascript? | <p>In PHP, it's pretty easy:</p>
<pre><code>is_numeric(23);//true
is_numeric("23");//true
is_numeric(23.5);//true
is_numeric(true);//false
</code></pre>
<p>But how do I do this in Javascript?
I could use a regular expression, but is there a function for this?</p>
| javascript | [3] |
3,574,614 | 3,574,615 | Weird jQuery error | <p>I was going along minding my jQuery business, when all of a sudden, I tried to do this:</p>
<pre><code>var myVariable = 'some-id-here';
$('#' + myVariable).addClass('some-class');
</code></pre>
<p><strong>Everything went fine and dandy until I closed my browser</strong>. After I reopened the page, jQuery threw thi... | jquery | [5] |
3,135,010 | 3,135,011 | Remove everything but the domain with PHP | <p>My current js formula removes http://, https://, www and anything after '/'.</p>
<pre><code> function cleanUrl(url) {
return url.replace(/^(http(s)?:\/\/)?(www\.)?/gi,"");
}
</code></pre>
<p>E.G:
<a href="http://www.google.com/piza" rel="nofollow">http://www.google.com/piza</a>
returns google.com</p... | php | [2] |
2,050,051 | 2,050,052 | replace all commas | <p>I have a form where I have a couple hundred text boxes and I'd like to remove any commas when they are loaded and prevent commas from being entered. Shouldn't the follow code work assuming the selector is correct?</p>
<pre><code>$(document).ready(function () {
$("input[id*=_tb]")
.each(function () {
this.... | jquery | [5] |
6,003,215 | 6,003,216 | Android - How to show AlertDialog before finishing activity? | <p>I'm trying to implement this code</p>
<pre><code> if(someCondition){
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("message")
.setPositiveButton("Yes", this)
.setNegativeButton("No", this);
builder.show();
}
finish();
</code></pre>... | android | [4] |
2,057,858 | 2,057,859 | Need checkbox change event to respond to change of checked state done programmatically | <p>(jQuery 1.4.4) I have a checkbox that has a .change() listener that works fine for when the user clicks the checkbox, but now I also need it to fire when I programmatically change the checkbox in jQuery, using .attr('checked', 'checked'). I'm perfectly happy to use other methods to make this work. Thanks.</p>
<pr... | jquery | [5] |
2,507,745 | 2,507,746 | Print PHP string in new lines | <p>Anything wrong with this code? I want it to print the name and address - each on a separate line, but it all comes up in one line.</p>
<p>Here's the code</p>
<pre><code><?php
$myname = $_POST['myname'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$address3 = $_POST['address... | php | [2] |
2,187,683 | 2,187,684 | How to count elements inside an element specified by object? | <p>I bet this has a simple answer.</p>
<p>I want to count the number of TD elements inside a row, yet i can't seem to find the right syntax.</p>
<pre><code>var row = $('#album_cell'+currentCell).parent();
var n = $("td",row).length();
</code></pre>
<p>This returns an error obviously as i don't know how to specify th... | jquery | [5] |
4,425,624 | 4,425,625 | Hide a div to subscribers(user role) in one page (is_page) | <p>Hello have been looking at this for quite a while and cant seem to resolve it was hoping someone more familiar with the wordpress core and php could share some idea.</p>
<p>What I want to accomplish essentially is to Hide a div that permits buddypress users (the subscrivers) from adding new topics to a group forum.... | php | [2] |
4,845,396 | 4,845,397 | Value selected option dropdownbox | <p>I've got a dynamic dropdownbox:</p>
<pre><code>function chgAantal(i,artNr,lengte){
var aantal=document.getElementById("aantal_"+i).value;
if(isNaN(aantal)){
alert('Voer een geldig aantal in...');
document.all["error_"+i].src="/images/fout.gif";
ok=0;
}
else{
location.... | javascript | [3] |
5,343,445 | 5,343,446 | Android Internal Memory Issue | <p>I have a game published on Android Market. Some users reported that it cannot be purchased and downloaded.The price won't show up to buy. My game is about 70mb, is it because of sized is too big for the internal memory of those phone so Google Market disabled the purchase? </p>
<p>Any help will be appreciated. </p... | android | [4] |
356,849 | 356,850 | OutOfMemoryError behavior in Java | <p>I always thought that an <code>OutOfMemoryError</code> restarts the JVM.<br>
But I am seeing a behavior where an <code>OutOfMemoryError</code> occurs this is not caught from the code (actually I don't even know if this is possible)<br>
and the <code>JVM</code> continues (a core dump is produced though).<br>
Can anyo... | java | [1] |
4,155,206 | 4,155,207 | Declaring inherited generics with complex type constraints | <p>I have an interface with a single generic type parameter:</p>
<pre><code>public interface IDriveable<T> where T : ITransmission { ... }
</code></pre>
<p>I also have a class that has a type parameter that needs to be of that interface type:</p>
<pre><code>public class VehicleFactory<T> where T : /* ???... | c# | [0] |
1,692,317 | 1,692,318 | Where can I find documentation to support this behavior? | <p>I'm looking over some previous developers code and I come across this line:</p>
<pre><code>location.href = '#' + variable;
</code></pre>
<p>Which has the effect of updating <code>location.hash</code>. Remove the '#' and of course it redirects to the non-existent url. Playing around a bit it seems I can set the has... | javascript | [3] |
3,206,715 | 3,206,716 | android.net.wifi.WifiManager.MulticastLock lock; cant be resolved in Jmdns Demo | <p>i,m new in android.. tryining to run Jmdns demo availlable with jmdns library but problem occured is .net.wifi.WifiManager.MulticastLock lock; cant be resolved ? </p>
| android | [4] |
159,077 | 159,078 | Maximum number of local variables in a Java Method | <p>I understand the importance of <a href="http://en.wikipedia.org/wiki/Single_responsibility_principle" rel="nofollow">Single Responsibility Principle</a>, but technically speaking do we have any upper bound on the number of local variables (that which are stored in stack frames) within each java method. And is that u... | java | [1] |
4,440,375 | 4,440,376 | iPhone SearchBar with Buttons Underneath? | <p>How would one implement a search field like the one used on the iPhone Mail application. When you attempt to search it shows up 4 buttons under the search bar with the fields you can search. The search bar actually moves up to cover the navigation bar and exposes those buttons.</p>
<p>I'd like to do something simil... | iphone | [8] |
3,835,677 | 3,835,678 | Java file cannot access methods even though class file is in same directory | <p>I was given only a .class file for homework and need to write a program that accesses its methods. Well, I have the .class file in the same directory, but I cannot access its methods, so my program won't compile! I've tried on JGrasp and Eclipse. Both 'cannot find symbol' (the method name).</p>
<p>I am absolutely p... | java | [1] |
4,761,702 | 4,761,703 | Show ajax loader image until an actual image is loaded | <p>So I have a page with little picture thumbnails on it and one big area in the middle of the page for full size photo.</p>
<p>When user clicks on a thumbnail, a full size picture is shown in the middle of the page. I just change the src attribute of the image in the middle like this to achieve that:</p>
<pre><code>... | jquery | [5] |
5,585,878 | 5,585,879 | Is there a way to prevent the post viewed by the visitor? | <p>Supposed the page is <code>example.com/blog/data.php</code>. I am using <code>file_get_contents</code> to get the content in another script page. Now, i want to:</p>
<ol>
<li>Forbid google search to crawl and index the data.php page. </li>
<li>Forbid the visitor to access it</li>
</ol>
<p>Is there a way to achieve... | php | [2] |
3,507,460 | 3,507,461 | Collection in Java | <p>Quick Question...
Can collections in Java hold more than one type? Or do they all have to be the same type?</p>
<p>thanks</p>
| java | [1] |
613,099 | 613,100 | How to set timer in show progress method | <p>How do I set a timer in the <code>showprogress</code> method?</p>
<p>My code is below, which shows a progress bar when submit button is clicked and waits for an XML response from server. How do I set timer in this <code>showprogress</code> method so it stops after 15 seconds?</p>
<pre><code>private void showProgre... | android | [4] |
912,721 | 912,722 | Getting a list value from key/value pair | <p>If I have a list with key/value pair, how do I get the value of the key?</p>
<p>I'm working with this code snippet:</p>
<pre><code>>>> items = {'fees':[('status','pending'), ('timeout',60)], 'hostel':[('status',
'pending'), ('timeout','120')]}
>>> print [items[i] for i in items.keys()]
[[('statu... | python | [7] |
2,895,295 | 2,895,296 | How to get information of particular user from facebook,twitter,google? | <p>I am trying to build a web app in java like following </p>
<p>the user enters his/her mail id and password if the user mail id and password are same in </p>
<pre><code>Facebook
Twitter
Google
Buzz
LinkedIn
</code></pre>
<p>than fetch the information like post and twit etc which belong to that user. I googled... | java | [1] |
4,900,733 | 4,900,734 | How to increase rows in NSMutableArray? | <pre><code>NSString *categoryStr = categoryName.text;
NSLog(@"Category Name:--->%@",categoryStr);
appDelegate.categoryData = [[NSMutableDictionary dictionaryWithObjectsAndKeys:
categoryStr, @"name",image ,@"image", nil] mutableCopy];
[appDelegate.categories addObject:appDelegate.categoryData];
NSLog(@"Category Dat... | iphone | [8] |
1,724,544 | 1,724,545 | How to use static/helper method in a class? | <p>Below I have created a class. I am trying to use the method gcd(a,b) in the initialization of a Fraction object. However, when I was trying to do this it would not work WITHOUT the 'Fraction' part of "Fraction.gcd(a,b)". I used @staticmethod here, but it does absolutely nothing, i.e. my code works the same without i... | python | [7] |
1,870,729 | 1,870,730 | Delet hyperlink is not responding if the row as data with apostrophe in javascript | <p>I have Form, which displays 5 column data. The last colum is the delete option, which is an hyperlink.</p>
<p>when i try to delete the row, the row is successfully deleted if the column data is not containing any apostrophe.
But when i have data with apostrophe (eg : test's), the delete link is not responding.
:(<... | javascript | [3] |
3,169,140 | 3,169,141 | how to invoke a service's android method since void onclick function? | <p>hello I'm trying to invoke a service's android method since a public void onclick and i have one mistake, it tell that i need insert "AssignemetOperator Expression" to complete the expresion, but i don't see where it's the mistake.
i put de code here
the mistake is on the boolean ret=bindService(.........
it´s ins... | android | [4] |
5,587,164 | 5,587,165 | adding run time on my java program | <p>i have my Java program and i would like to add code that show the run time for calculating, but i have no idea how can i do that?</p>
| java | [1] |
3,098,788 | 3,098,789 | jquery doesn't remove div always on mouseleave | <p>This is very annoying. After you rollover on image, if you rollout from left, top or right edges red box disappears. But if you rollout from bottom edge red box sometimes disappears sometimes not. Why is that?</p>
<p><a href="http://jsfiddle.net/f98r3/2/" rel="nofollow">http://jsfiddle.net/f98r3/2/</a></p>
<p><em>... | jquery | [5] |
4,307,672 | 4,307,673 | How to get a session value from a second table? | <p>I have two tables for the users; a login table and the user profile table.</p>
<p>I want to compare a value from 'userprofiletable' to another value from another table called posts. If the value is equal, it shows a list.</p>
<p>I have the following code. The problem is that it is not comparing the value in the po... | php | [2] |
3,247,048 | 3,247,049 | on click of any of the 3 "chkmain" radio buttons the "child" and "child1" should be enabled | <pre><code><input type="radio" id="chkMain" name="chkMain"/>
<input type="radio" id="chkMain1" name="chkMain" />
<input type="radio" id="chkMain2" name="chkMain" />
<input class="child" type="checkbox" id="chk1" disabled="true" />
<input class="child" type="checkbox" id="chk2" disabled="true... | jquery | [5] |
3,524,435 | 3,524,436 | Android: NullpointerException at vibrate | <p>I am using the following code , but its giving the nullpointer exception at vibrate.</p>
<pre><code>public Server(DroidGap gap, WebView view) //constructor
{
mAppView = view;
mGap = gap;
}
public Server(Context context) //constructor
{
... | android | [4] |
752,448 | 752,449 | What's the best way to return the name of the current property? | <p>This code shows a property that calls out to a method to get that property's name:</p>
<pre><code>public string Foo { get { return MyName(); } }
string MyName([System.Runtime.CompilerServices.CallerMemberName]
string propertyName = null)
{
return propertyName;
}
</code></pre>
<p>Is there a better way?</p... | c# | [0] |
2,733,138 | 2,733,139 | if statement executing when condition is false | <p>I'm tinkering with a projecteuler problem and I encountered the following really odd behaviour. And I can't for the life of me figure out whats going on. </p>
<p><img src="http://i.imgur.com/0Ds4I.png" alt="Screenshot"></p>
<p>As the screenshot shows. The condition evaluates to false, and the if-statment executed ... | c++ | [6] |
4,621,240 | 4,621,241 | Function (callable) objects with inherited properties | <p>Is there any way to create a function/callable object that inherits properties from another object? This is possible with <code>__proto__</code> but that property is deprecated/non-standard. Is there a standards compliant way to do this?</p>
<pre><code>/* A constructor for the object that will host the inheritable ... | javascript | [3] |
4,989,492 | 4,989,493 | How to strtotime date format like this | <p>I would like to strtotime dateformat like this - Fri Jun 15 05:38:11 +1000 2012 How could I do that? Basically I need to strtotime it, then do the following - <code>$ago = time()-strtotime(Fri Jun 15 05:38:11 +1000 2012);</code> and then do this - </p>
<pre><code>$ago = $ago / (60*60*24);
echo $ago.' days ago';
</c... | php | [2] |
4,040,026 | 4,040,027 | I have an int value; now how do I present it in a TextView to the user? Android | <p>Beginning I should say that I am very new to programming. </p>
<p>I am building an android application which includes a calculator function. What I want to do is on button click to get the user input from two EditTexts, add them together and then display the result in a TextView. Similar questions have been covered... | android | [4] |
3,238,559 | 3,238,560 | Sharing Android NDK Lib | <p>The Native Code of the Android application is going alone with application as lib file in the APK file. Suppose if I want to share a native code between two different applications, Is there any trick avail apart from the below:</p>
<ol>
<li>Adding the lib with every application</li>
<li>Copy the lib in to system/li... | android | [4] |
1,720,039 | 1,720,040 | ASP.NET validators validate on mouse up | <p>I have a compare validator on a Password field compared it to a password repeat field. If there is a validation error the error doesn't disappear until the lost focus event is fired. The client wants this changed to be the key up event.</p>
<p>What is the best way of going about this?</p>
| asp.net | [9] |
4,899,136 | 4,899,137 | Whiteboard Making | <p>Hy!!
I want to make a Whiteboard app, but i don't know how to make only some pixels black and let the others white.</p>
| android | [4] |
5,717,199 | 5,717,200 | Calling a local drive from javascript | <p>I have a folder in D:\testDownload .I want to open the folder on click of a button.
How to place the code inside the javascript function.</p>
<p>function open(){</p>
<p>}</p>
| javascript | [3] |
4,650,176 | 4,650,177 | Displaying images | <p>My instructor gave us example code that is very similiar to the code below. I haven't heard back from him yet and wanted to find out why my code won't work properly. Could someone give me some advice on what I'm doing wrong or an easier method to display images. Thanks for your time.</p>
<pre><code><%@ WebHandle... | asp.net | [9] |
2,919,842 | 2,919,843 | Correct pattern for registering a receiver? | <p>I need to register a receiver. I have been using the following pattern:</p>
<pre><code>@Override
protected void onResume() {
super.onResume();
registerReceiver(myReceiver, new IntentFilter(...));
}
@Override
protected void onPause() {
super.onPause();
unregisterReceiver(myReceiver);
}
private Bro... | android | [4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.